| Grating encoder is a kind of sensor widely used in high-precision angular displacement detection.The traditional production method of manually adjusting the edge of the code disk to make the center of the code disk approach the axis of the rotation axis has great defects,which cannot meet the industrial technical requirements at this stage.It is urgent to develop an automatic installation equipment to improve the assembly accuracy and efficiency of the encoder code disk.In this paper,the eccentricity detection and adjustment technology in the encoder eccentricity adjustment system is studied based on machine vision.The main research contents are as follows:Firstly,the task requirements and technical difficulties of eccentric adjustment are analyzed,and then the encoder eccentric adjustment system is built and the overall control scheme is designed.The characteristics of the code disk image are analyzed,and the most suitable detection features are selected according to the system hardware structure and detection algorithm;The reasons that affect the accuracy and efficiency of eccentricity detection and adjustment in the encoder encoder eccentric adjustment system are analyzed and studied,and the hardware is improved and adjusted accordingly.Secondly,aiming at the problem of image out of focus caused by installation error when replacing the encoder,the focus evaluation function is studied in depth,an adaptive focus evaluation function is proposed,and the search strategy of auto focus system combining rough and fine is formulated.To solve the problem of feature images moving out of the field of view caused by replacing different types of encoders,the homography recursive algorithm is used to splice the complete code disk images,and the SIFT algorithm is used to complete the fast matching of field of view images,feature images and complete images.Thirdly,the image processing algorithm is studied,including image enhancement,threshold segmentation,edge detection and contour extraction.The least square method is used to develop the code trace outer circle fitting algorithm,the initial eccentricity detection algorithm is developed based on the position change of eight code trace outer circles with an interval of 45 °,the average value method is used to complete the calculation of the axis coordinate of the rotation axis,and the secondary eccentricity detection algorithm based on a single sampled image is developed.Finally,the optical flow method is used to track the displacement of the corners of the code path image,and the data of code path displacement and optical flow tracking are fused through Kalman filtering to complete the precision compensation of the push rod displacement and improve the system adjustment accuracy.Through experiments,it is verified that the efficiency and accuracy of the code disk adjustment of the eccentric adjustment system meet the design requirements. |