CN113074672A - Method for calculating eccentric position of grating disc in encoder eccentric adjustment system - Google Patents

Method for calculating eccentric position of grating disc in encoder eccentric adjustment system Download PDF

Info

Publication number
CN113074672A
CN113074672A CN202110380804.9A CN202110380804A CN113074672A CN 113074672 A CN113074672 A CN 113074672A CN 202110380804 A CN202110380804 A CN 202110380804A CN 113074672 A CN113074672 A CN 113074672A
Authority
CN
China
Prior art keywords
image
eccentric
edge
calculating
encoder
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.)
Granted
Application number
CN202110380804.9A
Other languages
Chinese (zh)
Other versions
CN113074672B (en
Inventor
周丽杰
张广钿
付鹏强
王昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin University of Science and Technology
Original Assignee
Harbin University of Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Harbin University of Science and Technology filed Critical Harbin University of Science and Technology
Priority to CN202110380804.9A priority Critical patent/CN113074672B/en
Publication of CN113074672A publication Critical patent/CN113074672A/en
Application granted granted Critical
Publication of CN113074672B publication Critical patent/CN113074672B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/26Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes
    • G01B11/27Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes for testing the alignment of axes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes

Abstract

The invention discloses a method for detecting the eccentric position between a main shaft and a code wheel in the assembling process of a grating encoder, which is characterized in that a motor drives the main shaft of the encoder to uniformly collect complete pictures at twelve positions and records the angle of each picture as the accumulated rotation angle of the motor; determining the position of the leftmost edge in the image by using a vertical projection method, extracting points on the leftmost edge after performing edge detection on the image, performing straight line fitting on the extracted edge points, and calculating the distance between the midpoint of the straight line and the rightmost edge of the image; the invention uses the polar coordinate equation of the circle to express the change of the edge position in 12 images, and the angles of twelve images and the distance between the middle point of the straight line and the rightmost side of the image are substituted into the polar coordinate equation of the circle, and then the position of the eccentricity is solved by using the least square method.

Description

Method for calculating eccentric position of grating disc in encoder eccentric adjustment system
Technical Field
The invention relates to the technical field of assembling of grating encoders, in particular to a method for calculating the eccentric position of a grating encoder in an eccentric adjustment system of the encoder.
Background
The coaxiality between the grating disc and the main shaft of the encoder affects the accuracy and performance of the photoelectric encoder, therefore, the adjustment of the coaxiality between the encoder main shaft and the grating disc is an important step in the assembly process of the photoelectric encoder, the traditional eccentric adjustment method is to place the encoder under a microscope and finish the adjustment by manually knocking the edge of the grating disc by workers, the traditional eccentric adjustment method has higher requirements on the proficiency of the workers, therefore, an automatic adjusting device is needed to replace workers to complete the eccentric adjustment of the grating encoder, the grating eccentric adjusting system calculates the eccentric position by extracting the characteristics of the grating image in the lens and then rotates the main shaft to enable the maximum eccentric position to face the push rod, then the push rod is driven to complete adjustment, and in order to improve the eccentricity detection precision, the invention provides a method for acquiring a plurality of pictures and calculating the eccentricity position based on machine vision.
Disclosure of Invention
The invention aims to provide a method for calculating the eccentric position of a grating disk in an encoder eccentric adjustment system, which can solve the problems of low calculation precision, low efficiency and the like caused by incomplete images acquired by a high-magnification telecentric lens.
In order to achieve the purpose, the technical scheme of the invention is as follows: a method for calculating the eccentric position of a grating disk in an encoder eccentric adjustment system is characterized by comprising the following steps:
s1, driving a servo motor to drive a coder main shaft to rotate, triggering the industrial CCD camera to collect a complete image at intervals of 30 degrees, and collecting 12 images in total;
s2: carrying out binarization with gray values of 0 and 1 on the acquired gray level image, traversing an array after carrying out vertical projection on the binarized image, and finding out an area where the leftmost edge of the image is located;
s3: carrying out canny edge detection after Gaussian filtering of the collected image, and extracting edge points of an area where the leftmost edge is located after edge detection;
s4: fitting the extracted edge points on the circular arc by using a least square straight line fitting method, and calculating the distance l between the middle point of the fitted straight line segment and the rightmost side of the imagei
S5: setting the accumulated rotation angle of the main shaft as theta during each image acquisitioniThen the angle theta of the first image1At 0 °, angle θ of the last image12At 330 °, 12 images of |iAnd thetaiSolving the equation set after the polar coordinate equation of the circle is brought intoGiving values of a, b and r;
s6: calculating the eccentric size l according to the calculated a, b and reAnd an eccentric angle thetae
In one embodiment of the present invention, in the step S4, the height h of the image is divided by two and then substituted into a linear equation obtained by fitting the edges
Figure 101360DEST_PATH_IMAGE001
Finding the coordinate point (x)iH/2), then the distance l between the midpoint of the fitted straight line segment and the rightmost side of the imageiEqual to the length of the image minus xi
In an embodiment of the present invention, in the step S6, the eccentric magnitude leIs calculated by
Figure 18501DEST_PATH_IMAGE002
Eccentric angle
Figure 798238DEST_PATH_IMAGE003
Then determining theta according to the positive and negative of a and beTheta can be determined after the quadranteThe size of (2).
Compared with the prior art, the invention has the following beneficial effects: the invention provides a method for calculating the eccentric position between a code wheel and a grating main shaft by collecting 12 sections of circular arcs on the same circle on a grating disc; the method finds the area where the leftmost edge is located from three adjacent edges by a vertical projection method so as to reduce the calculation amount and the interference; the invention provides a method for processing a small segment of circular arc by using linear fitting so as to reduce the influence of noise; the invention uses the polar coordinate equation of the circle to express the change of the edge position in a plurality of pictures and solves the eccentric position by the least square method, thereby improving the accuracy of eccentric detection.
Drawings
FIG. 1 is a flow chart of a method for calculating the eccentric position of a raster encoder in an encoder eccentricity adjustment system.
Fig. 2 is a schematic diagram of the eccentric position between the grating disk and the main axis of the encoder, where 12 rectangles are the positions of image acquisition.
Fig. 3 shows a vertical projection method used to divide the area where the leftmost edge is located.
FIG. 4 is a graph of the distance l between the straight line fitted using the leftmost edge and the midpoint of the straight line from the rightmost side of the imagei
Fig. 5 shows the calculation results.
Detailed Description
The technical scheme of the invention is specifically explained below with reference to the accompanying drawings.
The invention provides a method for calculating the eccentric position of a grating encoder in an encoder eccentric adjustment system, which is characterized by comprising the following steps of:
s1, driving a servo motor to drive a coder main shaft to rotate, triggering the industrial CCD camera to collect a complete image at intervals of 30 degrees, and collecting 12 images in total;
s2: carrying out binarization with gray values of 0 and 1 on the acquired gray level image, traversing an array after carrying out vertical projection on the binarized image, and finding out an area where the leftmost edge of the image is located;
s3: carrying out canny edge detection after Gaussian filtering on the collected image, and extracting edge points of an area where the leftmost edge is located after edge detection;
s4: fitting the extracted edge points by using a least square straight line fitting method, and calculating the distance li between the midpoint of the fitted straight line segment and the rightmost side of the image;
s5: setting the accumulated rotation angle of the main shaft as theta during each image acquisitioniThen the angle theta of the first image1At 0 °, angle θ of the last image12At 330 °, 12 images of |iAnd thetaiAfter a polar coordinate equation of a circle is substituted, solving an equation set to obtain values of a, b and r;
s6: calculating the eccentric size l according to the calculated a, b and reAnd an eccentric angle thetae
Further, in step S2, a one-dimensional array having the same length and the same image width is created, the array records the number of points with a gray scale value of 0 in each column of the image, the array is traversed from zero, if the array is not zero, the array is stopped being traversed, the current position of the array is the position of the leftmost edge, as shown in fig. 3, the black rectangular region in fig. 3 is the region of the rightmost edge, and the position of the rightmost edge is shifted by 200 pixels to the left and right, so that the black rectangular region in fig. 3 is obtained.
Further, in step S4, as shown in fig. 4, the straight line fitted by the edge point is extracted as a black line segment in the graph, and the height h of the image is divided by two and then is substituted into the straight line equation obtained by fitting the edge
Figure 36190DEST_PATH_IMAGE004
Finding the coordinate point (x)iH/2), then the distance l between the midpoint of the fitted straight line segment and the rightmost side of the imageiEqual to the length of the image minus xiAs shown in FIG. 4, |iIs equal to the white line segment in the figure.
Further, in the step S5, as shown in fig. 2, the 12 black boxes around the principal axis in the second drawing represent the capturing positions of the picture, and the distance from the rotation center of the camera is constant, so that the polar coordinate equation with the principal axis as the origin can be used to represent li(ii) pre-processing the acquired picture to obtain (l)ii) The polar equation of the circle is introduced
Figure 850563DEST_PATH_IMAGE005
, (lii) The difference between the square of the distance to the spindle rotation center and the square of the radius is:
Figure 673025DEST_PATH_IMAGE006
in the formula (I), the compound is shown in the specification,
Figure 408900DEST_PATH_IMAGE007
Figure 607800DEST_PATH_IMAGE008
Figure 276679DEST_PATH_IMAGE009
by
Figure 863518DEST_PATH_IMAGE010
Separately, the derivation of A, B, C yields the following equation set:
Figure 617847DEST_PATH_IMAGE011
Figure 354859DEST_PATH_IMAGE012
Figure 347086DEST_PATH_IMAGE013
solving the equation set to obtain:
Figure 776930DEST_PATH_IMAGE014
Figure 362763DEST_PATH_IMAGE015
Figure 637887DEST_PATH_IMAGE016
wherein:
Figure 281358DEST_PATH_IMAGE017
Figure 85366DEST_PATH_IMAGE018
Figure 814287DEST_PATH_IMAGE019
Figure 486577DEST_PATH_IMAGE020
Figure 984555DEST_PATH_IMAGE021
by passing
Figure 756202DEST_PATH_IMAGE022
Figure 706840DEST_PATH_IMAGE023
Figure 58187DEST_PATH_IMAGE024
The values of a and b can be found.
Further, in the step S6, the eccentricity is calculated by
Figure 410671DEST_PATH_IMAGE002
Eccentric angle
Figure 207681DEST_PATH_IMAGE003
Then based on the determined thetaeThe position quadrant can determine thetaeThe size of (2).

Claims (4)

1. A method for calculating the eccentric position of a grating disk in an encoder eccentric adjustment system is characterized by comprising the following steps:
s1: the servo motor is driven to drive the encoder spindle to rotate, the industrial CCD camera is triggered to collect one complete image every 30 degrees, and 12 images are collected in total;
s2: carrying out binarization with gray values of 0 and 1 on the acquired gray level image, traversing an array after carrying out vertical projection on the binarized image, and finding out an area where the leftmost edge of the image is located;
s3: carrying out canny edge detection after Gaussian filtering on the collected image, and extracting edge points of an area where the leftmost edge is located after edge detection;
s4: fitting using least squares linear fitTaking the edge points on the arc, and calculating the distance l between the midpoint of the straight line segment and the rightmost side of the imagei
S5: setting the accumulated rotation angle of the main shaft as theta during each image acquisitioniThen the angle theta of the first image1At 0 °, angle θ of the last image12At 330 °, 12 images of |iAnd thetaiAfter a polar coordinate equation of a circle is substituted, solving an equation set to obtain values of a, b and r;
s6: calculating the eccentric size l according to the calculated a, b and reAnd an eccentric angle thetae
2. The method for calculating the eccentric position of the grating disk in the eccentric adjustment system of the encoder according to claim 1, wherein: in step S2, a one-dimensional array having the same length as the image width is created, the array records the number of points with a gray scale value of 0 in each column of the image, the array is traversed from zero, if the array is not zero, the array is stopped, and the array stop position is the position of the leftmost edge.
3. The method for calculating the eccentric position of the grating disk in the eccentric adjustment system of the encoder according to claim 1, wherein: in step S4, the height h of the image is divided by two and then substituted into a linear equation obtained by fitting the edges to obtain a coordinate point (x)iH/2), then the distance l between the midpoint of the fitted straight line segment and the rightmost side of the imageiEqual to the length of the image minus xi
4. The method for calculating the eccentric position of the grating disk in the eccentric adjustment system of the encoder according to claim 1, wherein: in step S5, the polar equation of the circle is used to represent the l extracted from the 12 picturesiChange of (a)ii) And after the polar coordinate equation of the circle is substituted, solving the equation set by using a least square method to obtain the values of a, b and r.
CN202110380804.9A 2021-04-09 2021-04-09 Method for calculating eccentric position of grating disc in encoder eccentric adjustment system Expired - Fee Related CN113074672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110380804.9A CN113074672B (en) 2021-04-09 2021-04-09 Method for calculating eccentric position of grating disc in encoder eccentric adjustment system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110380804.9A CN113074672B (en) 2021-04-09 2021-04-09 Method for calculating eccentric position of grating disc in encoder eccentric adjustment system

Publications (2)

Publication Number Publication Date
CN113074672A true CN113074672A (en) 2021-07-06
CN113074672B CN113074672B (en) 2022-08-30

Family

ID=76615675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110380804.9A Expired - Fee Related CN113074672B (en) 2021-04-09 2021-04-09 Method for calculating eccentric position of grating disc in encoder eccentric adjustment system

Country Status (1)

Country Link
CN (1) CN113074672B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114839736A (en) * 2021-07-30 2022-08-02 深圳市中图仪器股份有限公司 Composite mechanism and method for reducing eccentricity errors

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101081481A (en) * 2007-06-29 2007-12-05 成都工具研究所 Method of quick measuring positioning accuracy of Numerically controlled revolving dial measuring mechanism
CN102322796A (en) * 2011-07-20 2012-01-18 唐大春 Laser detection device and method for gear parameters
CN102564308A (en) * 2011-12-29 2012-07-11 中国科学院长春光学精密机械与物理研究所 Device for detecting eccentricity of interference type high-density round grating
CN102564355A (en) * 2011-12-29 2012-07-11 中国科学院长春光学精密机械与物理研究所 Interference method for detecting eccentricity of high density radial grating
CN104655167A (en) * 2013-11-20 2015-05-27 北京信息科技大学 Calibration method of angle encoder eccentricity and structure parameters of joint coordinate measuring machine
JP2015158401A (en) * 2014-02-24 2015-09-03 三菱電機株式会社 Eccentricity adjustment apparatus
CN205630419U (en) * 2016-05-19 2016-10-12 哈尔滨理工大学 Encoder main shaft is special from line -up clamp with adjustment of circle grating axiality

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101081481A (en) * 2007-06-29 2007-12-05 成都工具研究所 Method of quick measuring positioning accuracy of Numerically controlled revolving dial measuring mechanism
CN102322796A (en) * 2011-07-20 2012-01-18 唐大春 Laser detection device and method for gear parameters
CN102564308A (en) * 2011-12-29 2012-07-11 中国科学院长春光学精密机械与物理研究所 Device for detecting eccentricity of interference type high-density round grating
CN102564355A (en) * 2011-12-29 2012-07-11 中国科学院长春光学精密机械与物理研究所 Interference method for detecting eccentricity of high density radial grating
CN104655167A (en) * 2013-11-20 2015-05-27 北京信息科技大学 Calibration method of angle encoder eccentricity and structure parameters of joint coordinate measuring machine
JP2015158401A (en) * 2014-02-24 2015-09-03 三菱電機株式会社 Eccentricity adjustment apparatus
CN205630419U (en) * 2016-05-19 2016-10-12 哈尔滨理工大学 Encoder main shaft is special from line -up clamp with adjustment of circle grating axiality

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
WANG YI-WEN: "Based on machine vision encoder grating assembled eccentric adjustment system design", 《APPLICATION RESEARCH OF COMPUTERS》 *
王义文: "编码器用圆光栅调整系统偏心位置计算方法", 《哈尔滨理工大学学报》 *
王园: "圆光栅安装偏心误差测量与补偿技术", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114839736A (en) * 2021-07-30 2022-08-02 深圳市中图仪器股份有限公司 Composite mechanism and method for reducing eccentricity errors
CN114839736B (en) * 2021-07-30 2024-01-02 深圳市中图仪器股份有限公司 Composite mechanism and method for reducing eccentricity errors

Also Published As

Publication number Publication date
CN113074672B (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN108921865B (en) Anti-interference sub-pixel straight line fitting method
CN109489566B (en) Lithium battery diaphragm material slitting width detection method, detection system and device
CN106824806B (en) The detection method of low module plastic gear based on machine vision
CN103323229B (en) Based on the five-axle number control machine tool turning axle error detection method of machine vision
CN107525467B (en) Method and device for detecting mounting defect combination of magnetic steel sheets of motor rotor
CN107392849B (en) Target identification and positioning method based on image subdivision
CN107358628B (en) Linear array image processing method based on target
CN113074672B (en) Method for calculating eccentric position of grating disc in encoder eccentric adjustment system
JP7042366B2 (en) Methods and equipment for absolute and relative measurements using camera focal length
CN112686920A (en) Visual measurement method and system for geometric dimension parameters of circular part
CN105301007A (en) Linear array CCD-based ABS gear ring defect online detection device and method
GB2430095A (en) Image data processing method for determining a focus position
CN105592308A (en) Test drawing, and method and system for detecting camera module by adopting test drawing
CN103837097A (en) Workpiece angle automatic measurement device based on image processing and measurement method thereof
CN111640154A (en) Vertical needle micro-plane sub-pixel level positioning method based on micro-vision
TW201915443A (en) Positioning and measuring system based on image scale
CN111276412A (en) Center detection method
CN110956624B (en) Image definition evaluation method for three-dimensional object
CN107563371B (en) Method for dynamically searching interesting region based on line laser light strip
CN106951814B (en) Circular grating eccentricity calculation method of encoder eccentricity adjustment system
CN116596987A (en) Workpiece three-dimensional size high-precision measurement method based on binocular vision
CN1308652C (en) Method for three-dimensional measurement of sheet metal part using single non-measuring digital camera
CN108106549B (en) A kind of motor rotor magnetic steel piece assembles the structure light detection method of radial defect
CN113805304B (en) Automatic focusing system and method for linear array camera
CN115660995A (en) Camera orthodontic method and system using linear patterns

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220830