Next Article in Journal
YOLOv5-FF: Detecting Floating Objects on the Surface of Fresh Water Environments
Next Article in Special Issue
Multi-View Masked Autoencoder for General Image Representation
Previous Article in Journal
Microbial Dynamics in Sour–Sweet Wine Vinegar: Impacts on Chemical and Sensory Composition
Previous Article in Special Issue
Modeling of Walking-Gait Parameters and Walking Strategy for Quadruped Robots
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Machine Vision Dial Automatic Drawing System—Based on CAXA Secondary Development

School of Mechanical Engineering, Xijing University, Xi’an 710123, China
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2023, 13(13), 7365; https://doi.org/10.3390/app13137365
Submission received: 18 May 2023 / Revised: 13 June 2023 / Accepted: 16 June 2023 / Published: 21 June 2023
(This article belongs to the Special Issue Advanced Pattern Recognition & Computer Vision)

Abstract

:
Whether the pointer recognition of an SF6 (sulfur hexafluoride) density controller is correct or not is directly related to enterprise security. Therefore, a pointer recognition system that is highly efficient, precise, and secure is required. In this paper, we set up a detection platform for efficient detection of pointer readings. To detect the pointer with high accuracy, we propose a dial pointer angle detection method based on OpenCV that obtains high-precision dial pointer angle information. We then use Socket communication to transmit the dial pointer information to the secondary development program. Finally, we use the ObjectCRX development software package based on Visual Studio 2015 to quickly access the CAXA electronic drawing board graphics database, carry out secondary development of the CAXA electronic drawing board 2021, and comprehensively apply various functions to draw the overall outline of the dial. Finally, we read the dial pointer angle in order to draw the current test product dial CAD drawing. After verification, the average error rate of pointer angle recognition is 0.69°, which is much lower than the enterprise standard of 2.7°. Based on machine vision technology, we researched and designed an SF6 density controller dial automatic drawing system, and after many tests, the system runs stably and the accuracy meets the needs of enterprises.

1. Introduction

1.1. Research Background and Significance

High-voltage appliances often use sulfur hexafluoride (SF6), a synthetic gas with excellent arc-stopping capabilities and chemical stability [1]. SF6 gas density is monitored using an SF6 density controller in the gas chamber of SF6 high-voltage electrical equipment. The accuracy of the meter is crucial for the safety of high-voltage electrical equipment. During the manufacturing process of SF6 density controllers, the current index value of the dial pointer may not match the current pressure due to material differences in the internal structure of the product, friction between the gears, errors during the assembly process, and other factors. To correct this deviation, a dial that matches the current product must be reprinted using the standard dial as a base. The current manufacturing process uses manual visual inspection to check the pointer value of the dial, and the CAD drawing of the standard dial is adjusted based on the deviation value is recorded. However, this process has low efficiency and a high error rate due to the inherent limitations of the human eye. Therefore, a high-performance, high-accuracy SF6 density controller dial automatic rendering system is urgently needed.
Based on actual production conditions, enterprises have proposed the following requirements for the device:
(1)
The device should be designed with the MKZB-IP SF6 density controller product and should be easy to install, have a small equipment volume, be easy to operate, have a high degree of automation, and have high safety performance.
(2)
The device should be easily adaptable to detect different types of products.
(3)
The accuracy of the dial should reach 1.0.
(4)
The final output should be a CRX file for technical personnel to modify.
(5)
Please refer to Table 1 for product parameters.
Machine vision technology has become an essential tool for product detection and has been widely applied in various fields through years of development. In this paper, we have designed and built a set of SF6 density controller dial automatic drawing systems based on the requirements of enterprises. Through a thorough understanding of the product’s performance and usage, we have utilized machine vision technology to construct an equipment work platform and design a dial pointer recognition algorithm and automatic drawing system. This has significantly improved the efficiency and accuracy of product testing, solving the current issue of not being able to inspect products in large quantities.

1.2. Research Status at Home and Abroad

Machine vision, an essential branch of artificial intelligence, is rapidly developing and is primarily used to replace human labor in completing high-precision and high-efficiency production tasks [2]. It has been widely applied in various fields of manufacturing [3]. The machine vision system mainly consists of a camera, lens, light source, image grabber, image processing software, signal reception and processing system, and output system, among others [4].

1.2.1. Research Status of Instrument Representation Number Recognition

Currently, research on dial pointer recognition has been extensively conducted by scholars both domestically and abroad, and image processing is the most commonly used method [5]. For circular instrument recognition, the Hough circle transform is mainly utilized to extract the outline of the dial, followed by the Hough line transformation to extract the pointer and corresponding reference line, enabling the current pointer indicator to be determined according to the straight line angle [6].
Han J et al. [7] proposed a reading recognition method based on an improved Hough transform and adopted an improved adaptive median filtering method to obtain better image filtering results. The linear relationship between the scale of the instrument panel and the angle was used to determine the reading of the pointer. Jia Qianghan [8] extracted the dial image and eliminated background interference through OTSU threshold segmentation. The position of the dial circle was located through Hough circle detection, and the image was expanded to extract the pointer. Cao Sijia et al. [9] from Hunan University proposed an automatic mechanical watch measurement method based on machine vision technology to address the issues of low efficiency and poor accuracy in reading mechanical watches. The mask-icon network was utilized to extract the pointer area, and methods such as the Canny operator and RANSAC least square distance were used to calculate the angle relationship between the pointer and center line, significantly enhancing mechanical watch precision measurement efficiency. Shen Yunqing et al. [10] proposed an instrument recognition method based on template matching and Hough circle detection. First, the position and center coordinates of the circular dial were obtained through the Hough circle detection method, followed by binarization of the image through the K-means method, and finally, the pointer was fitted and recognized through the rotating virtual line method. The reading was calculated based on the correspondence between the angle and the scale.
Although the above-mentioned methods can realize the angle recognition of instrument pointers, the detection accuracy of the instrument described in this paper cannot meet actual production requirements. With the development of deep learning technology, scholars have utilized this method to achieve recognition of meter pointer reading and angle.
Bu Lingzheng et al. [11] used the convolutional neural network method to automatically extract character image features by designing network parameters, training the classification model, and finally utilizing the trained classification model to complete instrument character recognition. Zhang Sen [12] proposed a convolutional neural network pointer meter image readout recognition method based on an attention mechanism, which constructs a two-way heterogeneous convolutional neural network that integrates convolutional attention modules and adopts a soft interval hierarchical regression to simplify the model volume. Hu Xin [13] improved the recognition method of pointer representation using the Hough transform and proposed a new pointer meter reading method. The deep learning yolov5 model was introduced to achieve direct positioning of the pointer. Li Huihui [14] designed an intelligent detection and recognition system for circular pointer meters based on the improved MobileNetV2 network model combined with the Hough transform. First, the circular area of the dial is extracted using the Hough transform to construct a dataset, and then the circular pointer gauges are identified by utilizing the improved pre-trained MobileNetV2 network model.

1.2.2. Research Status of Secondary Development of Computer-Aided Design Software

Computer-aided design software (CAD) is a technology that utilizes computers and graphics equipment to assist designers in their work. Designers can use the software to edit, zoom in on, zoom out on, translate, and rotate graphics and perform other related data processing tasks. However, in complex CAD problems or when there are numerous design modifications, it can be challenging to solve the problem using the original software’s functions alone. In such cases, it is necessary to perform secondary development on CAD software to simplify the design work [15].
The secondary development of AutoCAD can be divided into two types: function expansion of application software such as AutoCAD and reading and writing DWG documents, and embedding them in application software outside the AutoCAD environment. Accurate and convenient identification of product information is crucial for the integration of CAD and PDM information [16]. Qiu Shengfeng [17] developed a plug-in harmonic reducer simulation platform based on the ANSYSACT platform and used the Iron Python language to complete the parametric creation process of a three-dimensional model of a material and harmonic reducer. Cai Hanming et al. [18] used Visual Studio 2015 development tools to develop AutoCAD software twice using Visual C# language to achieve the parametric drawing of disc slot cams. Gao Lihua [19] used AutoCAD VBA technology for secondary development, which can automatically generate the corresponding gear shape according to the user’s input parameters for different types of gears. Zhu Zongxi et al. [20] created parametric drawing and symbol annotation sub-modules of various members using VC++ and Object ARX development technologies, allowing the parametric drawing of steel truss members.
In recent years, machine vision research has been applied in various industries. The research and promotion of meter dial display recognition have become important topics for scholars to study. Based on existing research methods, this paper proposes a dial pointer angle detection method for SF6 density controller products which can accurately measure the dial pointer angle. Compared with traditional methods, this method has higher accuracy and more stable detection. This paper designs and implements a visual dial automatic system based on CAXA secondary development. At present, research on the integration of machine vision systems and CAD secondary development systems has not made significant progress. Therefore, the research content of this paper hopes to contribute to the application of this direction.

2. Dial Pointer Angle Recognition System

An automatic detection equipment for the SF6 density controller dial face was constructed, and the image of the pointer position of the SF6 density controller dial face was taken at a specific point required by the enterprise. Based on the OpenCV open-source vision library, the scale line ROI area was extracted through contour data extraction, coordinate transformation, pre-processing, and other operations. Finally, the coordinate value of each position in the image was used to characterize the angle of the dial pointer by traversing the image threshold, and an angle recognition algorithm suitable for this system was proposed for recognizing the angle of the dial pointer. Lastly, the angle recognition system was integrated with the secondary development system of the electronic drawing board through communication.

2.1. Construction of Visual Detection Platform

This paper describes the design and construction of a detection platform, as shown in Figure 1, to meet the detection requirements of various enterprises. The visual detection system mainly consists of industrial cameras, lenses, and light sources.
By considering the characteristic information of the watch face, various detection hardware models in Table 2 have been obtained through strict selection.

2.2. Watch Face Image Recognition

2.2.1. Image Acquisition

Using the constructed detection system, the SF6 density controller is fixed for dial image acquisition. Figure 2 displays an image of the qualified product dial collected under Figure 2a 0 (MPa), Figure 2b low pressure closing pressure pa (MPa), Figure 2c low pressure alarm pressure Pv (MPa), and Figure 2d rated pressure Pn (MPa).

2.2.2. Outline Data Extraction from within Tick Marks

To accurately calculate the angle between the dial pointer and the −0.1 tick mark, the center and radius of the contour circle in the dial are first extracted. In this paper, the pointer position map at 0 MPa is taken as an example, and the Hough gradient method is used to extract the contour data from the dial. The implementation steps are as follows:
To speed up the edge detection process and improve its accuracy, the image is first filtered. Gaussian filtering is used for image noise suppression, as shown in Figure 3a.
The Canny operator is then used to detect the edge of the filtered image, as shown in Figure 3b.
The Sobel operator is used to calculate the first derivative in the x and y directions of each non-zero pixel point in the image to obtain the gradient and calculate the perpendicular line passing through the tangent of the point along the gradient direction.
The pixel values in the perpendicular direction are accumulated, and the position where the largest value is obtained is the center point (a, b).
By calculating the distance from the center of the circle to all edge points (x, y) using the distance Formula (1), the possible radius value r can be obtained, and the maximum r-value is selected by accumulating this value, which is the radius of the detected circle.
r = ( x a ) 2 + ( y b ) 2 2
Multiple circles are detected in Figure 2b, and the radius value data is also complex. However, the circle required for the item described in this article is the inner contour circle of the dial. To obtain this circle, the maximum circle radius and the minimum circle radius are adjusted by setting appropriate radius filter conditions. This is shown in Figure 3c.

2.2.3. Dial Image Coordinate Transformation

To accurately extract the tick mark area on the disc and simplify the calculation steps, image coordinate transformation is used to transform the circular dial image into a rectangular image. This makes it possible to arrange the tick mark area vertically at the edge of the new image after transformation, which is convenient for extracting the position relationship of the pointer. The following steps are followed for image coordinate transformation:
(1)
Image Rotation:
To simplify the complexity of the later angle calculation and obtain a rectangular image from the −0.1 tick mark to the 0.9 tick mark after coordinate transformation, the image coordinates are rotated counterclockwise from the 12-point direction, and the 0.9 tick mark on the dial is rotated to the 0.3 tick mark position. In this paper, the rotation angle is selected as (162°) to obtain the rotation image, as shown in Figure 3d.
(2)
Image Coordinate Transformation:
  • The tick marks in the rectangular strip image are arranged from left to right, and the width (W) of the rectangle is the circumference (2Πr) of the outline circle inside the tick mark. The height (H) is 1/4 of the length of the pointer, as shown in Figure 4a.
  • The angle (θ) and radius (r) of each rotation are determined.
{ θ = 2 π / W ( N W + 1 ) r = r H + N H
Since the image coordinate system of OpenCV is positive from the y-axis downward, the value in the Cartesian coordinate we obtain needs to be multiplied by −1 to obtain the correct coordinate value. The converted coordinate value is:
{ x = a + r cos θ y = b r sin θ
c.
After the coordinate transformation, the resulting coordinate transformation plot is shown in Figure 4b. However, the generated image contains too much irrelevant information. Therefore, the tick mark area is obtained by extracting the region of interest of the image, as shown in Figure 4c. The image is flipped for easy observation, and the result is shown in Figure 4d.

2.2.4. Image Preprocessing

Image preprocessing is a crucial step to eliminate irrelevant information, recover useful real information, enhance the detectability of relevant information, and simplify data to the maximum extent, thereby improving the reliability of image recognition [21]. The preprocessing process is shown in Figure 5. First, the image after coordinate conversion is grayscale processed to prepare for subsequent image recognition work. (The OTSU image segmentation algorithm is used to binarize the image and obtain a binary image) replacement The OTSU image segmentation algorithm is used to perform binarization processing to obtain binary images. The image is inverted so that the binary value of the image background and the tick mark area are exchanged. This is because in the angle recognition algorithm, we are only interested in the tick mark and pointer area, and the value of the tick mark is considered an unrelated area that increases the complexity of program calculation and affects the accuracy and success rate of angle recognition. The above results are shown in Figure 6a–d.

2.3. Angle Recognition

According to the testing requirements of the enterprise, the diameter of the dial face of the product to be tested is 88 mm, the dial range is −0.1~0.9 MPa, and the measurement accuracy level is 1.0. According to the regulations of the state for general pressure gauges, according to GB/T1226-2001, the allowable error of the SF6 density controller is the dial’s full scale × (accuracy grade × 100%) = ±0.01 MPa. The angle between the initial scale line −0.1 and the end scale line 0.9 of the dial is 270°. Therefore, the allowed measurement angle error of the pointer in the dial is (±0.01/1) × 270° = ±2.7°, and the accuracy of the pointer in each division cell is 2.7/27 = 0.1.
From the ROI region extracted in Figure 6d, it can be observed that the region where the pointer is located is wider than that of the scale line. Based on this characteristic, this paper finds the −0.1 scale line, 0.9 scale line, and the coordinates of the pointer by traversing the sum of thresholds in each column of the image. The angle is characterized by length, and the angle between the center of the pointer and the reference line −0.1 scale line is obtained. According to the algorithm described in this paper, it is finally detected that the angle between the dial pointer of SF6 density controller and the −0.1 scale line under air pressure is −0.36° compared with the actual angle of 27°, which is in line with the enterprise demand error, indicating that the algorithm is effective.

2.4. Socket Communication

The implementation of the image recognition algorithm is based on the Python platform, while the secondary development program of the electronic drawing board is based on the Visual Studio (VS) platform. In this paper, the 2015 version of VS was selected. Therefore, it is necessary to establish a connection between Python and the communication program so that the data obtained after image recognition can be read by the secondary development program. The process is shown in Figure 7.
A socket is an abstraction of an endpoint for bidirectional communication between application processes on different hosts in the network. It provides a mechanism for application layer processes to exchange data using network protocols [22]. A socket connects the application process and the network protocol stack, serving as the interface for applications to communicate through network protocols and interact with the network protocol stack [23]. As shown in Figure 8, a socket hides the complex TCP/IP (Transmission Control Protocol/Internet Protocol) protocol family behind the interface.
In this paper, Python is used as the client and C++ is used as the server, while Socket is used to achieve continuous communication between the two. The communication process is shown in Figure 9.

3. Automatic Drawing System Design

The CAXA electronic drawing board is based on Visual Studio (VS) under the Windows operating system, and the software package was developed through ObjectCRX. In this paper, the parametric software design method is used to analyze the actual needs of the software to allow automatic drawing of the SF6 density controller dial. By reading the angle information collected by the dial pointer for angle recognition, the system can create CAD drawings of the dial and automatically draw features such as circles, lines, and words. The system enables the parametric design of the watch face image, greatly improving design efficiency and reducing manual labor time.

3.1. Introduction to the ObjectCRX Development Package

ObjectCRX is a development package for secondary development on the CAXA board platform, providing an object-oriented development environment and application program interface based on C++. It allows rapid access to the CAXA electronic board graphics database [24]. The full name of CRX in ObjectCRX is the CAXA Runtime Extension (CAXA Runtime eXtension). ObjectCRX enables developers to extend CAXA board features such as commands, dialogs, entities, objects, and more. A CRX application is a dynamic link library (DLL) that shares the address space of the board and can be called directly by the board. To extend the board’s functionality, the CRX library includes a number of macros that help users define new classes or add functionality to existing e-board classes. The extended programming environment of the board provides a powerful C++ library that helps users extend the board application, classes, and protocols and create new commands similar to the internal commands of the board.

3.2. Design Ideas

In this paper, the design requirements are separated into variable parameters and invariant parameters by using parametric design.

3.2.1. Parametric Design Ideas

Parametric design involves writing the project as a function and using computer calculations to obtain engineering results by modifying certain initial conditions, thus automating the design process [25]. In the process of parametric system design, design requirements are often established based on engineering and geometric relationships. To meet these design requirements, initial values of product dimensions or engineering parameters must be considered, and the basic relationships must be maintained each time these design parameters are changed. These parameters can be divided into two categories: variable parameters, which are size values, and invariant parameters, which are the various continuous geometric relationships between geometric elements. The essence of parametric design is that, under the influence of variable parameters, the parametric system can automatically generate all invariant parameters [26]. Therefore, various constraint relationships must be established in parametric design. Parametric design can greatly improve the speed of model generation and modification and has significant application value in product series design and CAD system development [27].

3.2.2. Requirements Analysis

The enterprise provided various elements, including the CAD template for the SF6 density controller dial, as shown in Figure 10 and Table 1. The model has a diameter of 100 mm and a height of 200 mm, with a range of −0.1~0.9 MPa, a dial diameter of 88 mm, a fixed −0.1 reference tick mark, and an overall angle of 270°. The primary objective of this paper is to obtain the angle information from between the −0.1 reference tick lines of each length line distance, using the dial pointer angle recognition system to automatically draw the SF6 density controller dial. The dial information mainly comprises the inner and outer circle outline of the tick mark, the length of the −0.1 reference tick mark and its position coordinates, the text information in the dial, and the color-fill area division. The CAD template was analyzed to determine the invariant and variable parameters in the parametric system, and the results are presented in Table 3.

3.3. System Design

This paper describes the secondary development of the CAXA Electronic Diagram Board 2021 based on VS, based on the actual requirements analysis of the system. The development process is divided into two stages: invariant parameter model creation and variadic model creation. Figure 11a shows the function classes primarily used for invariant parameter model creation, while Figure 11b shows the function classes primarily used for variadic model creation.

3.3.1. Invariant Parameter Model Creation

In the system design, the invariant parameters include the inner and outer contour diameters of the scale line, the vertical angle of the −0.1 long reference line, the length of the short scale line, the rated pressure (Pn), the low pressure closing pressure (Pa), the low pressure alarm pressure (Pv), and the accuracy level. This section will clarify the implementation process of drawing such parameters.
(1)
Creating the inner and outer contours of the tick marks and the precision numeric outer contours
The center of the contour circle is located at the coordinate origin, and the coordinate values of the −0.1 reference tick mark and 0.9 tick mark, as well as the inner and outer contours, are calculated, as shown in Figure 12. The calculated coordinates of the four intersections are listed in Table 4. Since the outer contour of the accuracy class diagram does not provide the exact position, the CAD template is surveyed, and the coordinates of the center of the mark are (11, −6).
This paper describes the creation of the inner and outer contour arcs and the precision identification circle profile using the starting point, center of the circle, and end point in ObjectCRX. The CRxDbArc class is used to represent the arc, and the constructor CreateArc is used to create the arc, as shown in Figure 13a.
(2)
Creating the −0.1 long baseline
The start and end points are used to create a −0.1 long reference line, and the coordinates of the −0.1 long reference line are (−25.4558, −25.4558), (−31.1127, −31.1127), as shown previously. The CRxDbLine class represents a straight line, and CreateLine is used to create a straight line, as shown in Figure 13b.
(3)
Drawing text
This paper is only designed for the MKZB-IP SF6 density controller product. Thus, the rated pressure Pn, low pressure closing pressure Pa, low pressure alarm pressure Pv, and accuracy level are fixed values. If applied to other product models, the corresponding parameters can be changed. To create a text object, the CRxDbText class constructor CreateText can be used. The results of the implementation process are shown in Figure 13c.

3.3.2. Variadic Model Creation

In the system design, the unchanged parameters include the product number, the angle of the −0.1 reference line, and five equal angles between each 0.1 grid. This section will clarify the implementation process of drawing such parameters.
(1)
Creating customizable product numbers
The product number varies depending on the product’s serial number, and the parameter should allow the user to input a customized value. Figure 14a shows an example of entering the number 00001. This paper uses MFC (Microsoft Basic Class Library) to design this feature. MFC is a class library provided by Microsoft Corporation that encapsulates Windows API in the form of C++ classes and includes an application framework to reduce the workload of application developers. It contains a large number of Windows handle wrapper classes and many Windows built-in controls and component wrappers [28].
(2)
Creating 0~0.9 long tick marks
The extracted angle identification information is used to create 0~0.9 long tick marks. Through Socket communication, the angle recognition information of 0~0.9 long tick marks from the reference line −0.1 angle can be imported. The imported data is shown in Table 5. List A[a] represents the standard dial tick mark angle, where a = a + 1, a < 11. The 0~0.9 long tick marks can be obtained by rotating the −0.1 reference tick mark at the corresponding angle, as shown in Figure 14b.
(3)
Create 5 equal angle lines between each 0.1 tile
From the demand analysis in Table 3, it is clear that the length of the bisecting angle line needs to be created. A line S[b] with a length of 4 mm and coinciding with the −0.1 tick line is created, where b = b + 1, b < 10. Nine short tick marks are obtained according to the method of creating −0.1 long reference lines, which coincide with each long tick line of 0~0.8. The numbers are shown in Table 6 below.
Each 0.1 cell is divided into five equal parts, and the equal angles between the segments are shown in Table 7 below. The short tick marks are rotated clockwise according to the equal angle in each cell to create an equal angle line of the dial. Figure 14c shows the resulting equal angle lines.
(4)
Create a fill object
To facilitate user identification, the enterprise stipulates that the dial color-filling rule is the distribution of the ribbon according to the parameter value for automatic filling. The blocking point is red, the area between the blocking point and the alarm point is orange, the area between the alarm point and the rated point is green, and the area above the rated point is green mesh. The enterprise requires the use of the CRxDbHatch class to complete the filling in the electronic board. The results of the implementation process are shown in Figure 14d.

4. System Validation

4.1. Angle Recognition System Verification

For this verification, an SF6 density controller that has passed the manual test is selected. The equipment is installed in the SF6 density controller dial detection equipment, and the detection system is started. The image of the dial pointer at a specific pressure point is collected, and the angle detection is carried out in real-time. The test results are shown in Table 8.
Based on the experimental results, the average angle error of the 11 groups of tests is 0.69°, and the maximum error is 1.20°. These errors are less than half of the minimum tick mark of the dial, indicating that the detection system can meet the requirements of the enterprise.

4.2. Automatic Drawing System Validation

This study selected an SF6 density controller that had been manually detected as unqualified dial. The equipment was installed in the SF6 density controller dial detection equipment, and the detection system was started. The image of the dial pointer at a specific pressure point was collected, and angle detection was carried out in real time. As a result, a deviation was observed at the position of the pointer at a specific point, as shown in Figure 15a,b. The test results are shown in Table 9.
The experimental test results in Table 8 were imported into the CAXA secondary development system to obtain the actual pointer indicator dial CAD drawing of the tested product, which is shown in Figure 16.
The experimental results demonstrate that the CAXA secondary development system can automatically draw CAD drawings of SF6 density controller dials. The system is able to quickly and accurately identify angle information generated by the system based on the detected angles, and generate a CAD drawing in CAXA2021 software that can be modified and edited by users. Therefore, the CAXA secondary development system is capable of achieving the automatic drawing of SF6 density controller dials.

5. Conclusions and Prospect

5.1. Conclusions

This paper presents the design of an SF6 density controller dial automatic rendering system, based on machine vision technology. The main design content includes:
  • A visual acquisition system that meets the image feature acquisition requirements of the dial. SF6 density controller dial image acquisition equipment is built according to the design scheme.
  • An angle recognition algorithm based on the OpenCV open-source vision library and designed by using An SF6 density controller dial image acquisition device for image acquisition. This algorithm extracts the scale line ROI area through contour data extraction, coordinate transformation, preprocessing, and other operations. By traversing the image threshold method, the pointer angle is characterized by the coordinate value of each position in the image to obtain the angle value. This method has higher accuracy and adaptability than traditional angle recognition algorithms in the situation described in this paper.
  • An analysis of the requirements of the CAD automatic drawing function using parametric design. VS is used in the secondary development of the CAXA electronic drawing board 2021. Constant parameters and variable parameters are created based on the demand analysis. Finally, the angle information is obtained by communicating with the angle recognition system and is imported into the automatic drawing system for verification. The CAD drawing of the dial can be accurately drawn according to the actual deflection of the dial pointer of the tested product. This system can greatly improve the speed of the generation and modification of the product dial model and has great application value in the design of product series.
This paper conducted a large number of experiments to verify the automatic rendering system. The system was found to be able to quickly and accurately identify angle information, generate a CAD drawing that users can modify and edit in CAXA software, and realize the automatic rendering of SF6 density controller dials. The system fully meets the needs of enterprise production.

5.2. Prospect

This paper presents an automatic drawing system for SF6 density controller dials based on machine vision. The system is capable of accurately measuring the angle of the dial pointer and automatically drawing a CAD drawing of the dial based on the measurement information. The system can be further improved by adding equipment and enhancing the algorithm to achieve additional functions, such as:
  • Adding an automatic printing function and printer equipment to realize the full automation of the instrument calibration process.
  • Improving the circle detection algorithm to further enhance its accuracy.
  • Adding a manipulator device to complete the replacement of the old dashboard and the installation of the new dashboard based on the printed dashboard. This will achieve the automation of the entire process of dial checking, including detection, drawing, printing, and installation.

Author Contributions

N.Z. was responsible for the design of ideas and the provision of laboratories and equipment, during the research process, which provided important help for the research ideas and implementation of this paper. F.L. was responsible for the design and implementation of the experiment as well as the analysis and interpretation of the data during the research process, which made an important contribution to the improvement of the quality of the results of this paper. E.Z. was responsible for deducing and analyzing the theory, writing and revising the paper, and made important contributions to the successful completion of this paper. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

Data can be contacted by the first author.

Acknowledgments

Thanks to the three authors for their important contributions to the research of this article. In addition, I would like to express my thanks to the reviewers for taking time out of your busy schedule to review the paper and put forward any shortcomings. Thank you for your guidance.

Conflicts of Interest

The authors declare that they have no competing interest.

References

  1. Peng, J.; Pu, Y.; Jia, Z.; Zhu, X.; Ye, H. Analysis of a 110 kV Outdoor sulfur hexafluorated Circuit Breaker B Phase Fault. High Volt. Appar. 2023, 59, 216–220. [Google Scholar]
  2. Jing, G.; Hua, L.; Tao, Z. Machine Vision and Application. Electron. Sci. Technol. 2014, 27, 185–188. [Google Scholar]
  3. Liu, C.; Yang, T. Application and industrial development of machine vision in intelligent manufacturing. Mach. Tool Hydraul. 2021, 49, 172–178. [Google Scholar]
  4. Zhang, Y. Research on Visual Measurement System of Refractory Bricks Based on Linear Structured Ligh. Master’s Thesis, Zhejiang University, Zhejiang, China, 2018. [Google Scholar]
  5. Ling, T.; Bo, G.; Lei, L.; Lu, J.; Zheng, X. Automatic Verification System of Pointer Precision Pressure Gauge Based on Machine Vision. Ind. Metrol. 2020, 30, 28–31. [Google Scholar]
  6. Kucheruk, V.; Kurytnik, I.; Kulakov, P.; Lishchuk, R.; Moskvichova, Y.; Kulakova, A. Definition of dynamic characteristics of pointer measuring devices on the basis of automatic indications determination. Arch. Control Sci. 2018, 28, 401–418. [Google Scholar]
  7. Han, J.; Li, E.; Tao, B.; Lv, M. Reading recognition method of analog measuring instruments based on improved hough transform. In Proceedings of the International Conference on Electronic Measurement & Instruments, Chengdu, China, 16–19 August 2011. [Google Scholar]
  8. Jia, Q. Research on Detection of Industrial Pointer Pressure Instrument. Master’s Thesis, Shanghai University of Engineering Science, Shanghai, China, 2020. [Google Scholar]
  9. Cao, S.; Dai, Y.; Yu, H.; Li, F.; Sun, W. Travel Time Accuracy Measurement of Mechanical Watch Based on Machine Vision. J. Hunan Univ. Nat. Sci. Ed. 2020, 47, 9. [Google Scholar]
  10. Shen, Y.; Xiong, W.; Huang, W.; Xu, W. Instrument Recognition Based on template Matching and Hough Circle Detection. Comput. Technol. Dev. 2021, 31, 69–73. [Google Scholar]
  11. Bu, L.; Wang, H.; Zhu, M.; Dai, W. Multi-source Number Recognition Algorithm Based on Improved Convolutional Neural Network. J. Comput. Appl. 2018, 38, 3403–3408. [Google Scholar]
  12. Zhang, S.; Wan, J.; Wang, H.; Guan, M.; Yang, B.; Li, F. Convolutional neural network pointer meter image readout recognition method based on attention mechanism. Electr. Power Autom. Equip. 2022, 42, 218–224. [Google Scholar]
  13. Xin, H.; Hua, O.; Yang, Y.; Zhuocheng, H. An Improved Indicator Recognition Method for Pointer Gauge. Electron. Meas. Technol. 2021, 44, 132–137. [Google Scholar]
  14. Li, H.; Yan, K.; Zhang, L.; Liu, W.; Li, Z. Circular Pointer Instrument Recognition System Based on MobileNetV2. J. Comput. Appl. 2021, 41, 1214–1220. [Google Scholar]
  15. Xu, C.; Wu, X. AutoCAD secondary development technology in high-standard basic farmland planning and design. Hubei Agric. Sci. 2013, 52, 3412–3414. [Google Scholar]
  16. Qiu, R. Analysis of secondary development technology and related applications of Auto CAD. Heilongjiang Sci. Technol. Inf. 2011, 106. [Google Scholar]
  17. Qiu, S. Fatigue Life Analysis of Soft Wheel of Harmonic Reducer Based on CAD/CAE Technology. Master’s Thesis, Nanjing University of Information Science and Technology, Nanjing, China, 2020. [Google Scholar]
  18. Cai, H.; Li, Z.; Li, X. Application of C# Development AutoCAD in Parametric Drawing of Disc Groove Cam. Mech. Electr. Eng. 2019, 36, 40–43. [Google Scholar]
  19. Gao, L. Development of gear CAD system based on AutoCAD. Intern. Combust. Engine Accessories 2021, 198–199. [Google Scholar]
  20. Zhu, Z.X.; Cheng, Y.D.; Wang, B. Research on parametric drawing of steel truss bridge based on CAD secondary development technology. Railw. Stand. Des. 2014, 58, 78–82. [Google Scholar]
  21. You, L. Research on Pointer Instrument Image Preprocessing Technology under Visual Recognition Background. Electr. Meas. Instrum. 2013, 50, 129–131. [Google Scholar]
  22. Zhu, L.; Sun, J.; Shao, Z.; Cao, Z. Ethernet FinsTCP Communication Based on Socket Mode. Forg. Equip. Manuf. Technol. 2020, 55, 108–110. [Google Scholar]
  23. Zhang, X.; Chang, L.; Wu, W.; Liao, J.; Shen, L. Implementation of Socket Communication under Linux System. Electroacoust. Technol. 2020, 44, 87–89. [Google Scholar]
  24. Shao, K.; Gao, Z. Parametric Drawing Software Based on VBA Mode. Cem. Technol. 2021, 72–75+79. [Google Scholar]
  25. Gu, Y. Research and Application of Parametric Drawing Design Based on AutoCAD Secondary Development. Master’s Thesis, Anhui Jianzhu University, Anhui, China, 2017. [Google Scholar]
  26. Xu, S. Research on Parametric Design of Curved Curtain Wall of Special-Shaped Space Based on BIM Technology. Master’s Thesis, Wuhan Institute of Technology, Wuhan, China, 2020. [Google Scholar]
  27. Qin, B. Development of ObjectARX Based Mold Parametric Library. Mod. Manuf. Eng. 2015, 61–64. [Google Scholar]
  28. Mao, L.; Liu, G. Meteorological monitoring system based on Lora technology. Electron. Des. Eng. 2018, 26, 113–118. [Google Scholar]
Figure 1. Design drawings (a) and physical drawings of the testing platform (b).
Figure 1. Design drawings (a) and physical drawings of the testing platform (b).
Applsci 13 07365 g001
Figure 2. Dial images of SF6 density controllers qualified at 0 Mpa, 0.45 Mpa (pa), 0.4 Mpa (pv), and 0.5 Mpa (pn), respectively.
Figure 2. Dial images of SF6 density controllers qualified at 0 Mpa, 0.45 Mpa (pa), 0.4 Mpa (pv), and 0.5 Mpa (pn), respectively.
Applsci 13 07365 g002
Figure 3. (a) Gaussian filter extraction results, (b) edge detection results, (c) Hough gradient detection results, (d) image rotation.
Figure 3. (a) Gaussian filter extraction results, (b) edge detection results, (c) Hough gradient detection results, (d) image rotation.
Applsci 13 07365 g003
Figure 4. (a) Rectangular strip image, (b) Coordinate converted image, (c) Tick mark area, (d) Image flip.
Figure 4. (a) Rectangular strip image, (b) Coordinate converted image, (c) Tick mark area, (d) Image flip.
Applsci 13 07365 g004
Figure 5. Image processing flow.
Figure 5. Image processing flow.
Applsci 13 07365 g005
Figure 6. (a) Image binarization, (b) image opening operation, (c) image negation, (d) tick line ROI.
Figure 6. (a) Image binarization, (b) image opening operation, (c) image negation, (d) tick line ROI.
Applsci 13 07365 g006
Figure 7. Program import flow.
Figure 7. Program import flow.
Applsci 13 07365 g007
Figure 8. Transmission control protocol.
Figure 8. Transmission control protocol.
Applsci 13 07365 g008
Figure 9. Socket communication flow.
Figure 9. Socket communication flow.
Applsci 13 07365 g009
Figure 10. SF6 density controller dial CAD template.
Figure 10. SF6 density controller dial CAD template.
Applsci 13 07365 g010
Figure 11. (a) The main functional classes of the invariant parameter model, (b) The main functional classes of the variadic model.
Figure 11. (a) The main functional classes of the invariant parameter model, (b) The main functional classes of the variadic model.
Applsci 13 07365 g011
Figure 12. Schematic diagram of coordinate calculation.
Figure 12. Schematic diagram of coordinate calculation.
Applsci 13 07365 g012
Figure 13. (a) Arc outline, (b) reference line at 0.1, (c) rest of the text information on the dial.
Figure 13. (a) Arc outline, (b) reference line at 0.1, (c) rest of the text information on the dial.
Applsci 13 07365 g013
Figure 14. (a) Define the product number, (b) create 0~0.9 long tick marks, (c) create 5 equal angle lines between each 0.1 cell, (d) create fill objects.
Figure 14. (a) Define the product number, (b) create 0~0.9 long tick marks, (c) create 5 equal angle lines between each 0.1 cell, (d) create fill objects.
Applsci 13 07365 g014
Figure 15. Image of the dial of the unqualified SF6 density controller.
Figure 15. Image of the dial of the unqualified SF6 density controller.
Applsci 13 07365 g015
Figure 16. System test results.
Figure 16. System test results.
Applsci 13 07365 g016
Table 1. Product parameters of MKZB-IP SF6 density controller.
Table 1. Product parameters of MKZB-IP SF6 density controller.
TypeParameterRemark
Product diameter × height (mm) 100 × 200
Dial diameter (mm) 88
Range (MPa) −0.1–0.9−0.1 tick mark unchanged
Angle 270°
Output modeRS485
interfaceM20 × 1.5
Rated pressure/Pn (MPa) 0.5Tested when blood pressure reduction is required
Low pressure closing pressure/Pa (MPa) 0.45Tested when blood pressure reduction is required
Low pressure alarm pressure/Pv Tested when blood pressure reduction is required
Table 2. Hardware selection of the detection system.
Table 2. Hardware selection of the detection system.
NameModel
Industrial camerasMV-EM200M
Industrial lensesBT-118C2520MP5
Type of lightMV-RL66X41A60-V
Table 3. Results of requirements analysis.
Table 3. Results of requirements analysis.
Invariant ParametersNumeric ValueVariadic Parameters
Tick mark outer contour diameter88 mm0~0.9 Each long tick line is −0.1 reference line angle
The diameter of the outline inside the tick mark72 mm
−0.1 long reference line distance vertical direction angle45°
Short tick mark length4 mm5 equal angles between each 0.1 cell
Rated pressure Pn (MPa) 0.50
Low pressure closing pressure Pa (MPa) 0.45Product number
Low pressure alarm pressure Pv0.40
Accuracy class1.0(Circle diameter 3.6 mm)
Table 4. Profile coordinates.
Table 4. Profile coordinates.
−0.1 Tick Mark0.9 Tick Mark
The outer contour is rounded (88 mm)(−31.1127, −31.1127)(31.1127, −31.1127)
The inner contour is rounded (72 mm)(−25.4558, −25.4558)(25.4558, −25.4558)
Table 5. Long tick marks identify data.
Table 5. Long tick marks identify data.
Tick Marks00.10.20.30.60.70.80.90.50.450.4
−0.1 angle from distanceA[0]A[1]A[2]A[3]A[4]A[5]A[6]A[7]A[8]A[9]A[10]
Table 6. Short tick marks identify data.
Table 6. Short tick marks identify data.
Coincident Tick Marks−0.100.10.20.30.40.50.60.70.8
numberingS[0]S[1]S[2]S[3]S[4]S[5]S[6]S[7]S[8]S[9]
Table 7. The dial is divided into 5 equal angular lines.
Table 7. The dial is divided into 5 equal angular lines.
Tick Marks−0.1–00–0.10.1–0.20.2–0.30.3–0.4
angle A   [ 0 ] 0 / 5 A   [ 1 ] A   [ 0 ] / 5 A   [ 2 ] A   [ 1 ] / 5 A   [ 3 ] A   [ 2 ] / 5 A   [ 10 ] A   [ 3 ] / 5
Tick marks0.4–0.50.5–0.60.6–0.70.7–0.80.8–0.9
angle A   [ 8 ] A   [ 10 ] / 5 A   [ 4 ] A   [ 8 ] / 5 A   [ 5 ] A   [ 4 ] / 5 A   [ 6 ] A   [ 5 ] / 5 A   [ 7 ] A   [ 6 ] / 5
Table 8. Angle identification system test results.
Table 8. Angle identification system test results.
The Tick Mark at Which the Pointer Is LocatedCircle Center
Coordinates (x, y)
Radius (mm)The Actual Pointer AngleTest the Pointer
Angle
Absolute Error
0(672, 588)45827°26.64°0.36°
0.1(669, 586)45554°53.52°0.48°
0.2(666, 587)45881°80.79°0.21°
0.3(669, 585)455108°107.42°0.58°
0.4(671, 583)453135°134.56°0.44°
0.5(669, 586)455162°161.25°0.75°
0.6(670, 587)456189°187.80°1.20°
0.7(669, 586)455216°214.97°1.03°
0.8(671, 588)457243°241.99°1.01°
0.9(668, 585)456270°269.00°1.00°
0.45(669, 586)456148.5°147.89°0.61°
Table 9. Automatic drawing system test results.
Table 9. Automatic drawing system test results.
The Tick Mark at Which the Pointer Is LocatedTest the Pointer AngleSF6 Density Controller Potential SignalTest the Pointer Angle
027.51°Rated pressure Pn = 0.5162.45°
0.151.27°
0.280.91°
0.3108.18°Low pressure closing pressure Pa = 0.45145.62°
0.6189.59°
0.7215.97°Low pressure alarm pressure Pv = 0.4136.94°
0.8240.11°
0.9269.00°
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, N.; Li, F.; Zhang, E. The Machine Vision Dial Automatic Drawing System—Based on CAXA Secondary Development. Appl. Sci. 2023, 13, 7365. https://doi.org/10.3390/app13137365

AMA Style

Zhang N, Li F, Zhang E. The Machine Vision Dial Automatic Drawing System—Based on CAXA Secondary Development. Applied Sciences. 2023; 13(13):7365. https://doi.org/10.3390/app13137365

Chicago/Turabian Style

Zhang, Ning, Fei Li, and Enxu Zhang. 2023. "The Machine Vision Dial Automatic Drawing System—Based on CAXA Secondary Development" Applied Sciences 13, no. 13: 7365. https://doi.org/10.3390/app13137365

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop