CN109459970B - A vision-based elliptical hole potentiometer angle reset system and reset method - Google Patents
A vision-based elliptical hole potentiometer angle reset system and reset method Download PDFInfo
- Publication number
- CN109459970B CN109459970B CN201811257895.1A CN201811257895A CN109459970B CN 109459970 B CN109459970 B CN 109459970B CN 201811257895 A CN201811257895 A CN 201811257895A CN 109459970 B CN109459970 B CN 109459970B
- Authority
- CN
- China
- Prior art keywords
- angle
- reset
- potentiometer
- image
- elliptical hole
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000001514 detection method Methods 0.000 claims abstract description 54
- 230000005540 biological transmission Effects 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000003708 edge detection Methods 0.000 claims description 4
- 230000000877 morphologic effect Effects 0.000 claims description 4
- 230000003628 erosive effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 11
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/054—Input/output
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/11—Plc I-O input output
- G05B2219/1105—I-O
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Automation & Control Theory (AREA)
- Geometry (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域technical field
本发明属于椭圆孔电位器角度复位技术领域,特别是涉及一种基于视觉的椭圆孔电位器角度复位系统及复位方法。The invention belongs to the technical field of angle reset of an oval hole potentiometer, in particular to a vision-based system and method for resetting the angle of an oval hole potentiometer.
背景技术Background technique
椭圆孔电位器生产过程中需要对电位器的零阻和滑动噪声等电参数进行检测,检测步骤为:首先将椭圆孔顺时针旋转至初始位检测零阻,再将椭圆孔从初始位逆时针旋转至结束位检测滑动噪声。但由于生产工艺的问题,流水线上生产出的电位器上的椭圆孔通常为任意角度。目前,生产企业在电参数检测过程中对椭圆孔的角度复位操作主要采用人工方式,当待检测电位器进入电参数检测工位的夹具后,人工旋转至初始位再进行检测。采用人工复位方式不仅成本高、效率低,准确性也难以长时间保证。During the production process of the elliptical hole potentiometer, it is necessary to detect the electrical parameters such as zero resistance and sliding noise of the potentiometer. The detection steps are: first, rotate the elliptical hole clockwise to the initial position to detect zero resistance, and then turn the elliptical hole counterclockwise from the initial position. Rotate to end position to detect sliding noise. However, due to problems in the production process, the elliptical holes on the potentiometers produced on the assembly line are usually at any angle. At present, manufacturers mainly use manual methods to reset the angle of the elliptical hole during the electrical parameter testing process. When the potentiometer to be tested enters the fixture of the electrical parameter testing station, it is manually rotated to the initial position before testing. The manual reset method is not only costly and inefficient, but also difficult to guarantee accuracy for a long time.
发明内容Contents of the invention
本发明为了解决现有技术中的问题,提出一种基于视觉的椭圆孔电位器角度复位系统及复位方法。In order to solve the problems in the prior art, the present invention proposes a vision-based elliptical hole potentiometer angle reset system and a reset method.
为实现上述目的,本发明采用以下技术方案:一种基于视觉的椭圆孔电位器角度复位系统,它包括PLC控制系统、CAN总线、角度检测装置和角度复位装置,所述PLC控制系统与CAN总线通讯连接,所述角度检测装置包括摄像头和工控机,所述摄像头安装在待检测电位器夹具的正上方,所述摄像头通过千兆以太网与工控机通讯连接,所述工控机通过RS485模块与PLC控制系统通讯连接,所述角度复位装置包括气缸、伺服电机和批头,所述气缸的伸缩杆与伺服电机相连,所述伺服电机输出轴与批头固定相连,所述伺服电机与CAN总线通讯连接,所述气缸通过I/O模块与CAN总线通讯连接,所述角度复位装置位于待复位电位器夹具的正上方,所述角度检测装置所在的区域为角度检测工位,所述角度复位装置所在的区域为角度复位工位。To achieve the above object, the present invention adopts the following technical solutions: a vision-based elliptical hole potentiometer angle reset system, which includes a PLC control system, a CAN bus, an angle detection device and an angle reset device, the PLC control system and the CAN bus Communication connection, the angle detection device includes a camera and an industrial computer, the camera is installed directly above the potentiometer fixture to be detected, the camera is connected to the industrial computer through Gigabit Ethernet, and the industrial computer communicates with the industrial computer through the RS485 module PLC control system communication connection, the angle reset device includes a cylinder, a servo motor and a batch head, the telescopic rod of the cylinder is connected to the servo motor, the output shaft of the servo motor is fixedly connected to the batch head, and the servo motor is connected to the CAN bus Communication connection, the cylinder communicates with the CAN bus through the I/O module, the angle reset device is located directly above the potentiometer fixture to be reset, the area where the angle detection device is located is the angle detection station, and the angle reset The area where the device is located is the angle reset station.
更进一步的,所述批头为椭圆形结构。Furthermore, the bit has an elliptical structure.
本发明还提供了一种基于视觉的椭圆孔电位器角度的复位方法,它包括以下步骤:The present invention also provides a method for resetting the angle of the oval hole potentiometer based on vision, which includes the following steps:
步骤一:当电位器进入角度检测工位的夹具后,PLC控制系统通过RS485模块向工控机输送一个角度检测工位就绪信号;Step 1: When the potentiometer enters the fixture of the angle detection station, the PLC control system sends an angle detection station ready signal to the industrial computer through the RS485 module;
步骤二:工控机获得角度检测工位就绪信号后,通过千兆以太网向摄像头输送一个触发信号;Step 2: After the industrial computer obtains the ready signal of the angle detection station, it sends a trigger signal to the camera through Gigabit Ethernet;
步骤三:摄像头获得触发信号后,拍摄一幅图像,并通过千兆以太网向工控机传送拍摄的图像;Step 3: After the camera obtains the trigger signal, it takes an image, and transmits the captured image to the industrial computer through Gigabit Ethernet;
步骤四:工控机获得图像后,根据角度检测算法计算椭圆孔偏转角度,并将该偏转角度通过RS485模块输送给PLC控制系统;Step 4: After the industrial computer obtains the image, calculate the deflection angle of the elliptical hole according to the angle detection algorithm, and send the deflection angle to the PLC control system through the RS485 module;
步骤五:PLC控制系统获得椭圆孔偏转角度后,将该偏转角度通过CAN总线输送给角度复位装置中的伺服电机,同时通过CAN总线通知电位器传送机构将电位器传送到角度复位工位;Step 5: After the PLC control system obtains the deflection angle of the elliptical hole, it transmits the deflection angle to the servo motor in the angle reset device through the CAN bus, and at the same time notifies the potentiometer transmission mechanism through the CAN bus to transmit the potentiometer to the angle reset station;
步骤六:角度复位装置中的伺服电机获得偏转角度后,伺服电机从初始位逆时针旋转至该偏转角度,旋转完毕后通过CAN总线输送一个伺服电机就绪信号给PLC控制系统;Step 6: After the servo motor in the angle reset device obtains the deflection angle, the servo motor rotates counterclockwise from the initial position to the deflection angle, and after the rotation is completed, a servo motor ready signal is sent to the PLC control system through the CAN bus;
步骤七:电位器进入角度复位工位的夹具后,通过CAN总线输送一个角度复位工位就绪信号给PLC控制系统;Step 7: After the potentiometer enters the fixture of the angle reset station, an angle reset station ready signal is sent to the PLC control system through the CAN bus;
步骤八:PLC控制系统同时接收到伺服电机就绪信号和角度复位工位就绪信号后,通过CAN总线向气缸输送触发信号;Step 8: After the PLC control system receives the servo motor ready signal and the angle reset station ready signal at the same time, it transmits the trigger signal to the cylinder through the CAN bus;
步骤九:气缸接收到触发信号后,从高位向下运动至低位,使批头进入椭圆孔中,完毕后通过CAN总线向PLC控制系统输送一个气缸伸出信号;Step 9: After the cylinder receives the trigger signal, it moves downward from the high position to the low position, so that the bit enters the oval hole, and then sends a cylinder extension signal to the PLC control system through the CAN bus;
步骤十:PLC控制系统接收到气缸伸出信号后,通过CAN总线向伺服电机输送触发信号;Step 10: After the PLC control system receives the cylinder extension signal, it sends the trigger signal to the servo motor through the CAN bus;
步骤十一:伺服电机接收到触发信号后,顺时针旋转步骤六中接收到的偏转角度,使椭圆孔旋转至初始位,完毕后通过CAN总线向PLC控制系统输送一个角度复位完毕信号;Step 11: After receiving the trigger signal, the servo motor rotates the deflection angle received in step 6 clockwise to make the oval hole rotate to the initial position, and then sends an angle reset completion signal to the PLC control system through the CAN bus;
步骤十二:PLC控制系统接收到角度复位完毕信号后,通过CAN总线通知气缸从低位向上运动至高位,并通知伺服电机旋转至初始位,同时通知电位器传送机构将电位器传送到电参数检测工位。Step 12: After receiving the angle reset signal, the PLC control system notifies the cylinder to move from the low position to the high position through the CAN bus, and notifies the servo motor to rotate to the initial position, and at the same time notifies the potentiometer transmission mechanism to transmit the potentiometer to the electrical parameter detection Station.
更进一步的,所述角度检测算法包括以下步骤:Further, the angle detection algorithm includes the following steps:
步骤一:从角度检测装置摄像头拍摄的图像中心,截取700×700像素大小的正方形图像子块,作为检测算法的输入图像;Step 1: From the center of the image captured by the camera of the angle detection device, intercept a square image sub-block with a size of 700×700 pixels as the input image of the detection algorithm;
步骤二:在颜色名空间中提取输入图像的白色通道,并归一化到[0,1]区间;Step 2: Extract the white channel of the input image in the color name space, and normalize it to the [0,1] interval;
步骤三:在归一化后的图像中,采用8连通的方式清除掉比周围更亮且与图像边界相连接的前景区域;Step 3: In the normalized image, the 8-connected method is used to remove the foreground area that is brighter than the surrounding and connected to the image boundary;
步骤四:构造半径为10的圆盘型结构,并利用该结构对清除边界区域后的图像执行腐蚀操作;Step 4: Construct a disk-shaped structure with a radius of 10, and use this structure to perform an erosion operation on the image after removing the boundary area;
步骤五:将腐蚀后的图像作为标记图像,将清除边界区域后的图像作为掩模图像,执行形态学重构,去掉椭圆孔区域外的比周围更亮的前景区域;Step 5: Use the corroded image as a marked image, and use the image after clearing the boundary area as a mask image, perform morphological reconstruction, and remove the foreground area outside the elliptical hole area that is brighter than the surrounding area;
步骤六:将形态学重构后的图像归一化到[0,1]区间,并采用阈值0.5执行二值化操作,得到仅包含椭圆孔区域的二值图像;Step 6: Normalize the morphologically reconstructed image to the [0,1] interval, and perform a binarization operation with a threshold of 0.5 to obtain a binary image containing only the elliptical hole area;
步骤七:计算二值图像中椭圆孔区域的质心坐标[x0,y0]和主轴角度α∈[0°,180°]两个描述子,并利用上述两个描述子得到通过坐标点[x0,y0]、角度为α的主轴直线方程;Step 7: Calculate the centroid coordinates [x 0 ,y 0 ] and the main axis angle α∈[0°,180°] two descriptors of the elliptical hole area in the binary image, and use the above two descriptors to obtain the passing coordinate point [ x 0 ,y 0 ], the linear equation of the main axis with angle α;
步骤八:采用Sobel算子对包含椭圆孔区域的二值图像执行边缘检测,得到椭圆孔区域边缘上各像素点的坐标;Step 8: Use the Sobel operator to perform edge detection on the binary image containing the elliptical hole area, and obtain the coordinates of each pixel on the edge of the elliptical hole area;
步骤九:计算边缘上各像素点坐标到主轴直线的距离,其中距离最大的点即为缺口尖点,该点坐标记为[xp,yp];Step 9: Calculate the distance from the coordinates of each pixel point on the edge to the main axis line, and the point with the largest distance is the sharp point of the gap, and the coordinates of this point are marked as [x p , y p ];
步骤十:利用椭圆孔区域质心坐标[x0,y0]、主轴角度α、以及缺口尖点坐标[xp,yp],计算得到椭圆孔的偏转角度β,计算公式为:Step 10: Use the centroid coordinates [x 0 , y 0 ] of the elliptical hole area, the main axis angle α, and the notch cusp coordinates [x p , y p ] to calculate the deflection angle β of the elliptical hole. The calculation formula is:
其中α0为椭圆孔电位器标准元件初始位的主轴角度。Among them, α 0 is the main axis angle of the initial position of the standard component of the oval hole potentiometer.
更进一步的,所述角度检测算法中α0的计算过程包括以下步骤:Further, the calculation process of α0 in the angle detection algorithm comprises the following steps:
步骤一:将椭圆孔电位器标准元件中的椭圆孔人工旋转至初始位,放入角度检测工位的夹具中;Step 1: Manually rotate the elliptical hole in the standard component of the elliptical hole potentiometer to the initial position, and put it into the fixture of the angle detection station;
步骤二:通过角度检测装置的摄像头拍摄一幅图像;Step 2: Take an image through the camera of the angle detection device;
步骤三:采用角度检测算法步骤一至步骤七所述的方法计算椭圆孔主轴角度,得到的主轴角度即为α0。Step 3: Calculate the main axis angle of the elliptical hole by using the methods described in steps 1 to 7 of the angle detection algorithm, and the obtained main axis angle is α 0 .
与现有技术相比,本发明的有益效果是:本发明利用图像触发采集模块采集待检测椭圆孔电位器的图像信息,并通过定义的角度检测算法,利用角度复位装置实现对椭圆孔电位器的角度自动复位操作;显著减少人工复位成本,增加角度复位准确率,提高检测效率,投入小,便于操作,具有极大的市场前景。Compared with the prior art, the beneficial effect of the present invention is: the present invention uses the image trigger acquisition module to collect the image information of the elliptical hole potentiometer to be detected, and through the defined angle detection algorithm, the angle reset device is used to realize the adjustment of the elliptical hole potentiometer. Automatic angle reset operation; significantly reduce the cost of manual reset, increase the accuracy of angle reset, improve detection efficiency, small investment, easy to operate, and have great market prospects.
附图说明Description of drawings
图1为本发明所述的一种基于视觉的椭圆孔电位器角度复位系统结构示意图Fig. 1 is a kind of vision-based elliptical hole potentiometer angle reset system structure schematic diagram according to the present invention
图2为本发明所述的一种基于视觉的椭圆孔电位器角度复位方法流程框图Fig. 2 is a flow chart of a method for resetting the angle of an elliptical hole potentiometer based on vision according to the present invention
图3为本发明所述的一种基于视觉的椭圆孔电位器角度复位方法采集的椭圆孔电位器示意图Fig. 3 is a schematic diagram of the elliptical hole potentiometer collected by a vision-based elliptical hole potentiometer angle reset method according to the present invention
图4为本发明所述的一种基于视觉的椭圆孔电位器角度复位方法采集的椭圆孔角度初始位示意图Fig. 4 is a schematic diagram of the initial position of the elliptical hole angle collected by a vision-based elliptical hole potentiometer angle reset method according to the present invention
图5为本发明所述的一种基于视觉的椭圆孔电位器角度复位方法采集的椭圆孔角度结束位示意图Fig. 5 is a schematic diagram of the end position of the elliptical hole angle collected by a vision-based elliptical hole potentiometer angle reset method according to the present invention
图6为图4提取颜色名空间中的白色通道并归一化的结果示意图Figure 6 is a schematic diagram of the result of extracting and normalizing the white channel in the color name space in Figure 4
图7为图6清除边界区域的结果示意图Figure 7 is a schematic diagram of the result of clearing the boundary area in Figure 6
图8为图7形态学重构的结果示意图Figure 8 is a schematic diagram of the results of morphological reconstruction in Figure 7
图9为图8归一化并二值化的结果示意图Figure 9 is a schematic diagram of the results of normalization and binarization in Figure 8
图10为图9边缘检测的结果示意图Figure 10 is a schematic diagram of the result of edge detection in Figure 9
图11为本发明所述的角度检测算法得到的初始位主轴角度α0的示意图Fig. 11 is a schematic diagram of the initial position main axis angle α 0 obtained by the angle detection algorithm of the present invention
图12为本发明所述的角度检测算法得到图3椭圆孔偏转角度β的示意图Fig. 12 is a schematic diagram of the deflection angle β of the elliptical hole in Fig. 3 obtained by the angle detection algorithm of the present invention
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地阐述。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention.
参见图1-12说明本实施方式,一种基于视觉的椭圆孔电位器角度复位系统,它包括PLC控制系统、CAN总线、角度检测装置和角度复位装置,所述PLC控制系统与CAN总线通讯连接,所述角度检测装置包括摄像头和工控机,所述摄像头安装在待检测电位器夹具的正上方,所述摄像头通过千兆以太网与工控机通讯连接,所述工控机通过RS485模块与PLC控制系统通讯连接,所述角度复位装置包括气缸、伺服电机和批头,所述气缸的伸缩杆与伺服电机相连,所述伺服电机输出轴与批头固定相连,所述伺服电机与CAN总线通讯连接,所述气缸通过I/O模块与CAN总线通讯连接,所述角度复位装置位于待复位电位器夹具的正上方,所述角度检测装置所在的区域为角度检测工位,所述角度复位装置所在的区域为角度复位工位。Referring to Figures 1-12 to illustrate this embodiment, a vision-based elliptical hole potentiometer angle reset system includes a PLC control system, a CAN bus, an angle detection device and an angle reset device, and the PLC control system is connected to the CAN bus for communication , the angle detection device includes a camera and an industrial computer, the camera is installed directly above the potentiometer fixture to be detected, the camera is connected to the industrial computer through Gigabit Ethernet, and the industrial computer is controlled by the RS485 module and the PLC System communication connection, the angle reset device includes a cylinder, a servo motor and a bit, the telescopic rod of the cylinder is connected to the servo motor, the output shaft of the servo motor is fixedly connected to the bit, and the servo motor is connected to the CAN bus , the cylinder communicates with the CAN bus through an I/O module, the angle reset device is located directly above the potentiometer fixture to be reset, the area where the angle detection device is located is an angle detection station, and the angle reset device is located The area is the angle reset station.
所述批头为椭圆形结构,便于批头进入椭圆孔中并对椭圆孔进行复位操作。The bit has an elliptical structure, which is convenient for the bit to enter into the elliptical hole and reset the elliptical hole.
本发明同时提供了一种基于视觉的椭圆孔电位器角度复位方法,它包括以下步骤:The present invention simultaneously provides a kind of vision-based method for resetting the angle of the elliptical hole potentiometer, which includes the following steps:
步骤一:当电位器进入角度检测工位的夹具后,PLC控制系统通过RS485模块向工控机输送一个角度检测工位就绪信号;Step 1: When the potentiometer enters the fixture of the angle detection station, the PLC control system sends an angle detection station ready signal to the industrial computer through the RS485 module;
步骤二:工控机获得角度检测工位就绪信号后,通过千兆以太网向摄像头输送一个触发信号;Step 2: After the industrial computer obtains the ready signal of the angle detection station, it sends a trigger signal to the camera through Gigabit Ethernet;
步骤三:摄像头获得触发信号后,拍摄一幅图像,并通过千兆以太网向工控机传送拍摄的图像;Step 3: After the camera obtains the trigger signal, it takes an image, and transmits the captured image to the industrial computer through Gigabit Ethernet;
步骤四:工控机获得图像后,根据角度检测算法计算椭圆孔偏转角度,并将该偏转角度通过RS485模块输送给PLC控制系统;Step 4: After the industrial computer obtains the image, calculate the deflection angle of the elliptical hole according to the angle detection algorithm, and send the deflection angle to the PLC control system through the RS485 module;
步骤五:PLC控制系统获得椭圆孔偏转角度后,将该偏转角度通过CAN总线输送给角度复位装置中的伺服电机,同时通过CAN总线通知电位器传送机构将电位器传送到角度复位工位;Step 5: After the PLC control system obtains the deflection angle of the elliptical hole, it transmits the deflection angle to the servo motor in the angle reset device through the CAN bus, and at the same time notifies the potentiometer transmission mechanism through the CAN bus to transmit the potentiometer to the angle reset station;
步骤六:角度复位装置中的伺服电机获得偏转角度后,伺服电机从初始位逆时针旋转至该偏转角度,旋转完毕后通过CAN总线输送一个伺服电机就绪信号给PLC控制系统;Step 6: After the servo motor in the angle reset device obtains the deflection angle, the servo motor rotates counterclockwise from the initial position to the deflection angle, and after the rotation is completed, a servo motor ready signal is sent to the PLC control system through the CAN bus;
步骤七:电位器进入角度复位工位的夹具后,通过CAN总线输送一个角度复位工位就绪信号给PLC控制系统;Step 7: After the potentiometer enters the fixture of the angle reset station, an angle reset station ready signal is sent to the PLC control system through the CAN bus;
步骤八:PLC控制系统同时接收到伺服电机就绪信号和角度复位工位就绪信号后,通过CAN总线向气缸输送触发信号;Step 8: After the PLC control system receives the servo motor ready signal and the angle reset station ready signal at the same time, it transmits the trigger signal to the cylinder through the CAN bus;
步骤九:气缸接收到触发信号后,从高位向下运动至低位,使批头进入椭圆孔中,完毕后通过CAN总线向PLC控制系统输送一个气缸伸出信号;Step 9: After the cylinder receives the trigger signal, it moves downward from the high position to the low position, so that the bit enters the oval hole, and then sends a cylinder extension signal to the PLC control system through the CAN bus;
步骤十:PLC控制系统接收到气缸伸出信号后,通过CAN总线向伺服电机输送触发信号;Step 10: After the PLC control system receives the cylinder extension signal, it sends the trigger signal to the servo motor through the CAN bus;
步骤十一:伺服电机接收到触发信号后,顺时针旋转步骤六中接收到的偏转角度,使椭圆孔旋转至初始位,完毕后通过CAN总线向PLC控制系统输送一个角度复位完毕信号;Step 11: After receiving the trigger signal, the servo motor rotates the deflection angle received in step 6 clockwise to make the oval hole rotate to the initial position, and then sends an angle reset completion signal to the PLC control system through the CAN bus;
步骤十二:PLC控制系统接收到角度复位完毕信号后,通过CAN总线通知气缸从低位向上运动至高位,并通知伺服电机旋转至初始位,同时通知电位器传送机构将电位器传送到电参数检测工位。Step 12: After receiving the angle reset signal, the PLC control system notifies the cylinder to move from the low position to the high position through the CAN bus, and notifies the servo motor to rotate to the initial position, and at the same time notifies the potentiometer transmission mechanism to transmit the potentiometer to the electrical parameter detection Station.
角度检测算法包括以下步骤:The angle detection algorithm includes the following steps:
步骤一:从角度检测装置摄像头拍摄的图像中心,截取700×700像素大小的正方形图像子块,作为检测算法的输入图像;Step 1: From the center of the image captured by the camera of the angle detection device, intercept a square image sub-block with a size of 700×700 pixels as the input image of the detection algorithm;
步骤二:在颜色名空间中提取输入图像的白色通道,并归一化到[0,1]区间;Step 2: Extract the white channel of the input image in the color name space, and normalize it to the [0,1] interval;
步骤三:在归一化后的图像中,采用8连通的方式清除掉比周围更亮且与图像边界相连接的前景区域;Step 3: In the normalized image, the 8-connected method is used to remove the foreground area that is brighter than the surrounding and connected to the image boundary;
步骤四:构造半径为10的圆盘型结构,并利用该结构对清除边界区域后的图像执行腐蚀操作;Step 4: Construct a disk-shaped structure with a radius of 10, and use this structure to perform an erosion operation on the image after removing the boundary area;
步骤五:将腐蚀后的图像作为标记图像,将清除边界区域后的图像作为掩模图像,执行形态学重构,去掉椭圆孔区域外的比周围更亮的前景区域;Step 5: Use the corroded image as a marked image, and use the image after clearing the boundary area as a mask image, perform morphological reconstruction, and remove the foreground area outside the elliptical hole area that is brighter than the surrounding area;
步骤六:将形态学重构后的图像归一化到[0,1]区间,并采用阈值0.5执行二值化操作,得到仅包含椭圆孔区域的二值图像;Step 6: Normalize the morphologically reconstructed image to the [0,1] interval, and perform a binarization operation with a threshold of 0.5 to obtain a binary image containing only the elliptical hole area;
步骤七:计算二值图像中椭圆孔区域的质心坐标[x0,y0]和主轴角度α∈[0°,180°]两个描述子,并利用上述两个描述子得到通过坐标点[x0,y0]、角度为α的主轴直线方程;Step 7: Calculate the centroid coordinates [x 0 ,y 0 ] and the main axis angle α∈[0°,180°] two descriptors of the elliptical hole area in the binary image, and use the above two descriptors to obtain the passing coordinate point [ x 0 ,y 0 ], the linear equation of the main axis with angle α;
步骤八:采用Sobel算子对包含椭圆孔区域的二值图像执行边缘检测,得到椭圆孔区域边缘上各像素点的坐标;Step 8: Use the Sobel operator to perform edge detection on the binary image containing the elliptical hole area, and obtain the coordinates of each pixel on the edge of the elliptical hole area;
步骤九:计算边缘上各像素点坐标到主轴直线的距离,其中距离最大的点即为缺口尖点,该点坐标记为[xp,yp];Step 9: Calculate the distance from the coordinates of each pixel point on the edge to the main axis line, and the point with the largest distance is the sharp point of the gap, and the coordinates of this point are marked as [x p , y p ];
步骤十:利用椭圆孔区域质心坐标[x0,y0]、主轴角度α、以及缺口尖点坐标[xp,yp],计算得到椭圆孔的偏转角度β,计算公式为:Step 10: Use the centroid coordinates [x 0 , y 0 ] of the elliptical hole area, the main axis angle α, and the notch cusp coordinates [x p , y p ] to calculate the deflection angle β of the elliptical hole. The calculation formula is:
其中α0为椭圆孔电位器标准元件初始位的主轴角度。Among them, α 0 is the main axis angle of the initial position of the standard component of the oval hole potentiometer.
角度检测算法中α0的计算过程包括以下步骤:The calculation process of α0 in the angle detection algorithm includes the following steps:
步骤一:将椭圆孔电位器标准元件中的椭圆孔人工旋转至初始位,放入角度检测工位的夹具中;Step 1: Manually rotate the elliptical hole in the standard component of the elliptical hole potentiometer to the initial position, and put it into the fixture of the angle detection station;
步骤二:通过角度检测装置的摄像头拍摄一幅图像;Step 2: Take an image through the camera of the angle detection device;
步骤三:采用角度检测算法步骤一至步骤七所述的方法计算椭圆孔主轴角度,得到的主轴角度即为α0。Step 3: Calculate the main axis angle of the elliptical hole by using the methods described in steps 1 to 7 of the angle detection algorithm, and the obtained main axis angle is α 0 .
以上对本发明所提供的一种基于视觉的椭圆孔电位器角度复位系统及复位方法,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The vision-based elliptical hole potentiometer angle reset system and reset method provided by the present invention have been introduced in detail above. In this paper, specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments It is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, The contents of this description should not be construed as limiting the present invention.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811257895.1A CN109459970B (en) | 2018-10-26 | 2018-10-26 | A vision-based elliptical hole potentiometer angle reset system and reset method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811257895.1A CN109459970B (en) | 2018-10-26 | 2018-10-26 | A vision-based elliptical hole potentiometer angle reset system and reset method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109459970A CN109459970A (en) | 2019-03-12 |
CN109459970B true CN109459970B (en) | 2019-10-25 |
Family
ID=65608555
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811257895.1A Active CN109459970B (en) | 2018-10-26 | 2018-10-26 | A vision-based elliptical hole potentiometer angle reset system and reset method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109459970B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI736873B (en) * | 2019-04-17 | 2021-08-21 | 緯創資通股份有限公司 | Webcam, driving module of webcam, and restoration method thereof |
CN111103533B (en) * | 2019-12-12 | 2020-09-25 | 常州机电职业技术学院 | Reset method of ten-position rotary dial switch reset system based on vision |
CN112066914B (en) * | 2020-08-14 | 2021-12-21 | 常州机电职业技术学院 | 3362 potentiometer mechanical angle reset system and reset method based on machine vision |
WO2022032648A1 (en) * | 2020-08-14 | 2022-02-17 | 常州机电职业技术学院 | Machine vision-based resetting system and resetting method for resetting mechanical angle of 3362 potentiometer |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001264617A (en) * | 2000-03-21 | 2001-09-26 | Canon Inc | Zoom demand device |
CN1473360A (en) * | 2001-09-19 | 2004-02-04 | ���ְ�˹��ѧ��ҵ��ʽ���� | Semiconductor wafer inspection apparatus |
JP2004047784A (en) * | 2002-07-12 | 2004-02-12 | Microjenics Inc | Neutral position return mechanism |
CN103761534A (en) * | 2014-01-22 | 2014-04-30 | 哈尔滨工业大学 | Method for detecting vision localization of QFP element |
CN103837097A (en) * | 2012-11-23 | 2014-06-04 | 上海久点触控计算机系统股份有限公司 | Workpiece angle automatic measurement device based on image processing and measurement method thereof |
CN104229702A (en) * | 2014-06-18 | 2014-12-24 | 电子科技大学 | Round barrel center positioning device and positioning method thereof |
CN107014822A (en) * | 2017-02-28 | 2017-08-04 | 深圳市维图视技术有限公司 | A kind of non-woven fabrics gauze mask defective vision detecting system and method |
-
2018
- 2018-10-26 CN CN201811257895.1A patent/CN109459970B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001264617A (en) * | 2000-03-21 | 2001-09-26 | Canon Inc | Zoom demand device |
CN1473360A (en) * | 2001-09-19 | 2004-02-04 | ���ְ�˹��ѧ��ҵ��ʽ���� | Semiconductor wafer inspection apparatus |
JP2004047784A (en) * | 2002-07-12 | 2004-02-12 | Microjenics Inc | Neutral position return mechanism |
CN103837097A (en) * | 2012-11-23 | 2014-06-04 | 上海久点触控计算机系统股份有限公司 | Workpiece angle automatic measurement device based on image processing and measurement method thereof |
CN103761534A (en) * | 2014-01-22 | 2014-04-30 | 哈尔滨工业大学 | Method for detecting vision localization of QFP element |
CN104229702A (en) * | 2014-06-18 | 2014-12-24 | 电子科技大学 | Round barrel center positioning device and positioning method thereof |
CN107014822A (en) * | 2017-02-28 | 2017-08-04 | 深圳市维图视技术有限公司 | A kind of non-woven fabrics gauze mask defective vision detecting system and method |
Also Published As
Publication number | Publication date |
---|---|
CN109459970A (en) | 2019-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109459970B (en) | A vision-based elliptical hole potentiometer angle reset system and reset method | |
CN108921176B (en) | Pointer instrument positioning and identifying method based on machine vision | |
CN111798412B (en) | Intelligent diagnosis method and system for defects of power transformation equipment based on infrared image | |
CN108470338B (en) | A water level monitoring method | |
WO2016055031A1 (en) | Straight line detection and image processing method and relevant device | |
CN106097368B (en) | A kind of recognition methods in veneer crack | |
CN112630639B (en) | A high-voltage switchgear handcart contact meshing state online detection system and method | |
CN101919685B (en) | Tongue diagnosis intelligent control and diagnosis system | |
CN114279357A (en) | A method and system for measuring burr size of die castings based on machine vision | |
CN104197836A (en) | Vehicle lock assembly size detection method based on machine vision | |
CN109946304A (en) | On-line detection system and detection method for surface defects of parts based on feature matching | |
CN104715250B (en) | cross laser detection method and device | |
CN111598897A (en) | Infrared image segmentation method based on Otsu and improved Bernsen | |
CN103544714A (en) | Visual tracking system and method based on high-speed image sensor | |
CN111257329A (en) | A kind of smart phone camera defect detection method and detection system | |
CN110335271A (en) | Infrared detection method and device for electrical component failure | |
CN103076342A (en) | LabVIEW-based PCB (printed circuit board) plugging online detecting system and detecting method thereof | |
CN110247328A (en) | Position judging method based on image recognition in switchgear | |
CN202444572U (en) | Non-reference video monitoring image blurring quality detection device | |
CN111340833A (en) | Power transmission line extraction method based on least square interference-free random Hough transformation | |
CN115690012A (en) | Detection method for wrong connection line of electric energy meter | |
CN114266895A (en) | Fan blade image segmentation and splicing method and device | |
CN112418226B (en) | Method and device for identifying opening and closing states of fisheyes | |
CN105898242B (en) | A kind of solar tracking system and method based on Image Acquisition and processing | |
CN111103533B (en) | Reset method of ten-position rotary dial switch reset system based on vision |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |