Calibration method, device, robot and storage medium for robot tool coordinate system
By setting a feature strip on the fixture at the end of the robot's lead screw and using the vision module to automatically calibrate the tool coordinate system, the problem of large errors in manual calibration is solved, and a calibration process with higher accuracy and efficiency is achieved.
Patent Information
- Application Number
- CN202311622571.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-11-29
AI Technical Summary
In the prior art, manual calibration of the tool coordinate system of an industrial robot is prone to large errors, resulting in reduced production accuracy.
By setting a feature strip on the fixture at the end of the robot's screw as a calibration reference, using the vision module to acquire images, controlling the movement and rotation of the robot's screw end, and automatically determining the three points of the tool coordinate system, the robot's tool coordinate system is determined using a four-point calibration algorithm.
The calibration accuracy is improved, the calibration time is shortened, and the robot's working efficiency and production accuracy are improved.
Smart Images

Figure CN117484505B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robots, and in particular relates to a method, a device, a robot and a storage medium for automatically calibrating a robot tool coordinate system. Background Art
[0002] With the continuous improvement of industrial automation, more and more production workshops are using industrial robots. When used on the production line, industrial robots are usually equipped with visual cameras for production applications, and fixtures are also installed at the end of the industrial robot for production. This model is widely used.
[0003] After the fixture is installed at the end of an industrial robot, the tool coordinate system is typically calibrated. After prolonged operation on the production line, the fixture can experience certain positional deviations, leading to errors from the initially calibrated tool coordinate system. This can directly impact the stability and accuracy of the fixture's operation, necessitating recalibration of the tool coordinate system. However, current calibrations are mostly manual, and their accuracy depends on the operator's steps, proficiency, and precision. This can easily lead to significant errors, reducing the production accuracy of the industrial robot.
[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, device, robot and storage medium for automatic calibration of a robot tool coordinate system, so as to solve the problem that large errors are prone to occur when manually calibrating the tool coordinate system in related solutions, thereby reducing the production accuracy of industrial robots. By setting a feature bar at the clamp position at the end of the robot's screw as a calibration reference, the robot can realize automatic calibration of the tool coordinate system, thereby solving the problem that large errors are prone to occur in manual calibration, improving the accuracy of calibration, and making the robot's operation more stable.
[0006] The present invention provides an automatic calibration method for a robot tool coordinate system, wherein the robot has a screw and a vision module; the vision module is used to obtain an image at the end of the screw of the robot; a tool fixture can be installed at the end of the screw of the robot; a feature strip is provided on the side of the tool fixture facing the vision module; the feature strip is used to mark the position of the tool fixture so that the tool fixture can be recognized by the vision module; the method comprises: obtaining a photo taken by the vision module; controlling the end of the screw of the robot to move to a position corresponding to the center point of the photo, and determining the point position of the end of the screw of the robot as the first point position in the tool coordinate system; using the feature strip as a reference object, controlling the movement and rotation of the end of the screw of the robot, and determining three points in the tool coordinate system; determining the tool coordinate system of the robot according to the first point position in the tool coordinate system and the three points in the tool coordinate system.
[0007] In some embodiments, the feature strip is used as a reference to control the movement and rotation of the robot's lead screw end, and determine three points in the tool coordinate system, including: establishing a square template of the feature strip, the square template being a virtual template established in the robot's control software, the square template having four corners and a center point, and the center point being the intersection of the diagonals of the four corners; and using any corner of the square template of the feature strip as a rotation origin, controlling the square template of the feature strip to rotate according to a preset angle, obtaining the pixel coordinates of the four corners of the square template of the feature strip after rotation, recorded as theoretical pixel coordinates; determining the robot coordinates of the robot's lead screw end according to the theoretical pixel coordinates; controlling the robot's lead screw end to move and rotate according to the coordinates of the robot's lead screw end and the preset angle, and determining any point in the tool coordinate system; thereafter, re-controlling the square template of the feature strip to rotate with the rotation origin and the preset angle, and determining the other two points in the tool coordinate system.
[0008] In some embodiments, the robot coordinates of the lead screw end of the robot are determined according to the theoretical pixel coordinates, including: calculating the pixel coordinates of the center point of the square template of the feature bar according to the theoretical pixel coordinates; determining the pixel coordinates of the lead screw end of the robot according to the preset correspondence between the pixel coordinates of the center point of the square template of the feature bar and the pixel coordinates of the lead screw end of the robot, and the pixel coordinates of the center point of the square template of the feature bar; and converting the pixel coordinates of the lead screw end of the robot into the robot coordinates of the lead screw end of the robot.
[0009] In some embodiments, the robot's screw end is controlled to move and rotate according to the coordinates of the robot's screw end and the preset angle, and any point in the tool coordinate system is determined, including: controlling the robot's screw end to move and rotate according to the coordinates of the robot's screw end and the preset angle, then controlling the vision module to retake a photo, and identifying the position of the feature strip from the retaken photo, obtaining the pixel coordinates of the four corners of the new square template of the feature strip, recorded as actual pixel coordinates; judging whether the actual pixel coordinates are completely consistent with the theoretical pixel coordinates; if the actual pixel coordinates are completely consistent with the theoretical pixel coordinates, then taking the current point of the robot's screw end as a point in the tool coordinate system.
[0010] Matching the above method, another aspect of the present invention provides an automatic calibration device for a robot tool coordinate system, wherein the robot has a screw and a vision module; the vision module is used to obtain an image at the end of the screw of the robot; a tool fixture can be installed at the end of the screw of the robot; a feature strip is provided on the side of the tool fixture facing the vision module; the feature strip is used to mark the position of the tool fixture so that the tool fixture can be recognized by the vision module; the device includes: an acquisition unit, configured to obtain a photo taken by the vision module; a control unit, configured to control the end of the screw of the robot to move to a position corresponding to the center point of the photo, and determine the point of the end of the screw of the robot as the first point in the tool coordinate system; the control unit is further configured to control the movement and rotation of the end of the screw of the robot using the feature strip as a reference object, and determine three points in the tool coordinate system; the control unit is further configured to determine the tool coordinate system of the robot based on the first point in the tool coordinate system and the three points in the tool coordinate system.
[0011] In some embodiments, the control unit uses the feature strip as a reference to control the movement and rotation of the robot's lead screw end and determine three points in the tool coordinate system, including: establishing a square template of the feature strip, the square template being a virtual template established in the control software of the robot, the square template having four corners and a center point, and the center point being the intersection of the diagonals of the four corners; and using any corner of the square template of the feature strip as a rotation origin, controlling the square template of the feature strip to rotate according to a preset angle, obtaining the pixel coordinates of the four corners of the square template of the feature strip after rotation, recorded as theoretical pixel coordinates; determining the robot coordinates of the lead screw end of the robot based on the theoretical pixel coordinates; controlling the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and the preset angle, and determining any point in the tool coordinate system; thereafter, re-controlling the square template of the feature strip to rotate according to the rotation origin and the preset angle, and determining the other two points in the tool coordinate system.
[0012] In some embodiments, the control unit determines the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates, including: calculating the pixel coordinates of the center point of the square template of the feature strip according to the theoretical pixel coordinates; determining the pixel coordinates of the lead screw end of the robot according to a preset correspondence between the pixel coordinates of the center point of the square template of the feature strip and the pixel coordinates of the lead screw end of the robot, and the pixel coordinates of the center point of the square template of the feature strip;
[0013] The pixel coordinates of the lead screw end of the robot are converted into robot coordinates of the lead screw end of the robot.
[0014] In some embodiments, the control unit controls the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and the preset angle, and determines any point in the tool coordinate system, including: controlling the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and the preset angle, and then controlling the visual module to retake a photo, and identify the position of the feature strip from the retaken photo, and obtain the pixel coordinates of the four corners of the new square template of the feature strip, which are recorded as actual pixel coordinates; judging whether the actual pixel coordinates are completely consistent with the theoretical pixel coordinates; if the actual pixel coordinates are completely consistent with the theoretical pixel coordinates, then taking the current point of the lead screw end of the robot as a point in the tool coordinate system.
[0015] Matching the above-mentioned device, the present invention further provides a robot, comprising: the automatic calibration device for the robot tool coordinate system described above.
[0016] In accordance with the above method, the present invention further provides a storage medium comprising a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned method for automatic calibration of the robot tool coordinate system.
[0017] The solution of the present invention comprises a robot with a vision module and a feature bar disposed at the location where the robot is mounted on a fixture. When the robot begins to automatically calibrate a tool coordinate system, it obtains an image captured by the vision module, controls the robot's lead screw end to move to a position corresponding to the center point of the image, and uses the position of the lead screw end as the first point in the tool coordinate system. Using the feature bar as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined. The robot's tool coordinate system is determined based on the first point in the tool coordinate system and the three points in the tool coordinate system. By setting the feature bar as a calibration reference and controlling the movement and rotation of the robot's lead screw end, the tool coordinate system is automatically determined. This not only shortens the calibration time but also improves the calibration accuracy, thereby increasing the robot's operating efficiency.
[0018] Other features and advantages of the present invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the present invention.
[0019] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 1 is a flow chart of an embodiment of a method for automatically calibrating a robot tool coordinate system according to the present invention;
[0021] Figure 2 1. A schematic diagram of a flow chart of an embodiment of the method of the present invention for determining three points in a tool coordinate system;
[0022] Figure 3 1. A schematic flow chart of an embodiment of the method for determining the robot coordinates of the end of the robot lead screw in the present invention;
[0023] Figure 4 Schematic diagram of the structure of an embodiment of an automatic calibration device for a robot tool coordinate system of the present invention;
[0024] Figure 5 A schematic structural diagram of an embodiment of the overall structure of a robot of the present invention;
[0025] Figure 6 Schematic diagram of the structure of an embodiment of the robot of the present invention in a shooting state;
[0026] Figure 7 A schematic diagram of an embodiment of establishing a virtual rectangular coordinate system in the method of the present invention;
[0027] Figure 8 A schematic diagram of an embodiment of establishing four feature bar frame templates in the method of the present invention;
[0028] Figure 9 FIG. 4 is a flow chart of an embodiment of the method of the present invention for automatically calibrating a tool coordinate system.
[0029] In conjunction with the accompanying drawings, the reference numerals in the embodiments of the present invention are as follows:
[0030] 1-Industrial robot; 2-Fixture; 3-Camera; 4-Camera base; 5-Center point of the screw end;
[0031] 6-feature bar; 102-acquisition unit; 104-control unit. DETAILED DESCRIPTION
[0032] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present invention and corresponding drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0033] According to an embodiment of the present invention, a method for automatically calibrating a robot tool coordinate system is provided, wherein the robot has a screw and a vision module; the vision module is used to obtain an image at the end of the robot's screw; a fixture can be installed at the end of the robot's screw; a feature strip is provided on the side of the fixture facing the vision module; the feature strip is used to mark the position of the fixture so that the fixture can be recognized by the vision module. Figure 5 and Figure 6 The structure of the robot shown in the figure includes an industrial robot 1, a fixture 2, a camera 3, and a camera base 4. The fixture 2 is set at the end of the screw of the industrial robot 1, and the screw end has a center point 5. A feature bar 6 is set at the bottom of the fixture 2. The shooting direction of the camera 3 is the direction of the fixture 2, that is, the camera 3 can capture the feature bar 6. Figure 1 FIG2 is a flow chart of an embodiment of the method of the present invention. The method for automatically calibrating a robot tool coordinate system may include steps S110 to S140.
[0034] In step S110 , the photos taken by the visual module are obtained.
[0035] Specifically, before acquiring images taken by the vision module, the robot and vision module are calibrated, establishing a correspondence between the robot's coordinate system and the camera's visual coordinate system. This allows for conversion between robot coordinates and pixel coordinates. A fixture is then installed at the end of the robot's lead screw, and a feature strip is attached to the fixture.
[0036] In step S120, the end of the lead screw of the robot is controlled to move to a position corresponding to the center point of the photo, and the position of the end of the lead screw of the robot is determined as the first point in the tool coordinate system.
[0037] Specifically, after acquiring a photo taken by the vision module, the vision software determines the visual pixel coordinates P1 of the center point of the photo in the visual coordinate system and converts the visual pixel coordinates P1 into robot coordinates in the robot coordinate system. After sending these robot coordinates to the robot, the robot moves the end of the screw rod to the robot coordinates, so that the end of the screw rod is at the position corresponding to the center point of the photo, and determines the current position of the end of the screw rod as the first point in the tool coordinate system.
[0038] In step S130 , the characteristic strip is used as a reference to control the movement and rotation of the lead screw end of the robot, and determine the three points in the tool coordinate system.
[0039] In some embodiments, in step S130, the characteristic strip is used as a reference to control the movement and rotation of the lead screw end of the robot and determine the specific process of the three points in the tool coordinate system, such as Figure 2 As shown, it includes: step S210 to step S230.
[0040] Step S210, establish a square template of the feature strip, wherein the square template is a virtual template established in the control software of the robot, and the square template has four corners and a center point, and the center point is the intersection of the diagonals of the four corners; and use any corner of the square template of the feature strip as the rotation origin, control the square template of the feature strip to rotate according to a preset angle, and obtain the pixel coordinates of the four corners of the square template of the feature strip after rotation, which are recorded as theoretical pixel coordinates.
[0041] Specifically, after the robot's lead screw reaches the position corresponding to the center point of the photo, it sends information to the vision software, which then controls the camera to take a photo and search for the characteristic strip in the photo. Once found, the vision software creates a standard line along the two borders of the characteristic strip and then connects the two ends of the standard line with a straight line. This creates a square box in the visual image, which is identified as the square template of the characteristic strip.
[0042] Then, any corner of the square template is used as the coordinate origin, and the two sides with the coordinate origin as the endpoints are used as the X axis and Y axis to establish a virtual rectangular coordinate system. Figure 7 As shown, the square template has four corners. A coordinate system is established with (X0, Y0) as the origin, so that the two sides of the template fall on the X and Y axes. Therefore, the virtual coordinates of the other three corners of the square template are (X1, Y0), (X0, Y1), and (X1, Y1). The intersection of the two diagonals within the template is then determined as the center point of the template. The X coordinate of this center point is X = (X1-X0) / 2, and the Y coordinate is Y = (Y1-Y0) / 2, resulting in the center point coordinates (X, Y).
[0043] In the current state, the end of the robot's screw is still at the center of the photo. Therefore, after converting the template center coordinates (X, Y) into visual pixel coordinates P2, there is a corresponding relationship between visual pixel coordinates P2 and visual pixel coordinates P1. This correspondence is P1 = k * P2, where k is a coefficient. Based on this correspondence, after clarifying the visual pixel coordinates P2 of the template center, the corresponding visual pixel coordinates P1 of the photo center can be obtained. In other words, only when the end of the screw is at the position of visual pixel coordinates P1, that is, the end of the screw is at the center of the photo, can the visual pixel coordinates of the feature strip template center be P2.
[0044] After that, the template is controlled to rotate in the virtual rectangular coordinate system. Since the basis of this solution is the four-point calibration method, three more points need to be determined, so it needs to be rotated three times, and after each rotation, a point position in the calibration tool coordinate system is determined. Figure 8 As shown in the figure, with the origin as the rotation center, the square template is rotated three times by 90°, 180°, and 270° respectively, resulting in templates in three different positions. Since the process of determining the position of a point in the calibration tool coordinate system after each rotation is the same, only the process of determining the position of one point is described here.
[0045] After the template is rotated, since the virtual coordinates of the four corners of the template before rotation are already clear, the virtual coordinates of the four corners of the rotated template can be calculated. The calculation formula is: X'=X*cosθ-Y*sinθ, Y'=X*sinθ+Y*cosθ. Among them, X and Y are the virtual coordinates of the template points before rotation, X' and Y' are the virtual coordinates of the template points after rotation, and θ is the rotation angle. Through this formula, the virtual coordinates of the four corners of the rotated template can be obtained and converted into pixel coordinates to obtain the pixel coordinates of the four corners of the rotated feature strip template.
[0046] Step S220 : determining the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates.
[0047] In some embodiments, in step S220, the specific process of determining the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates is as follows: Figure 3 As shown, it includes: step S310 to step S330.
[0048] Step S310: Calculate the pixel coordinates of the center point of the square template of the feature strip according to the theoretical pixel coordinates.
[0049] Step S320, determining the pixel coordinates of the robot's lead screw end according to the preset correspondence between the pixel coordinates of the center point of the square template of the feature strip and the pixel coordinates of the lead screw end of the robot, and the pixel coordinates of the center point of the square template of the feature strip.
[0050] Step S330 : converting the pixel coordinates of the lead screw end of the robot into the robot coordinates of the lead screw end of the robot.
[0051] Specifically, the pixel coordinates of the four corners of the rotated template can be used to calculate the pixel coordinates of the template's center. The X coordinate of the center pixel coordinates is X = (X1 - X0) / 2, and the Y coordinate is Y = (Y1 - Y0) / 2. Based on the corresponding relationship P1 = k * P2, the pixel coordinates of the robot's lead screw end can be obtained and converted into robot coordinates to obtain the robot coordinates of the robot's lead screw end.
[0052] Step S230, control the robot's screw end to move and rotate according to the coordinates of the robot's screw end and the preset angle, and determine any point in the tool coordinate system; then, re-control the square template of the feature bar to rotate with the rotation origin and the preset angle, and determine the other two points in the tool coordinate system.
[0053] In some embodiments, in step S230, the specific process of controlling the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and the preset angle, and determining any point in the tool coordinate system includes: steps S410 to S430.
[0054] Step S410, control the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and the preset angle, then control the visual module to retake the photo, and identify the position of the feature strip from the retaken photo, and obtain the pixel coordinates of the four corners of the new square template of the feature strip, which are recorded as actual pixel coordinates.
[0055] The robot's lead screw is controlled to move to the robot coordinates obtained in the previous step and rotate according to the angle and direction of the template. The vision module is then controlled to retake a photo. The vision software obtains the position of the feature strip from the photo and the pixel coordinates of the four corners of the feature strip.
[0056] Step S420 , determining whether the actual pixel coordinates completely coincide with the theoretical pixel coordinates.
[0057] Step S430: If the actual pixel coordinates completely coincide with the theoretical pixel coordinates, the current position of the lead screw end of the robot is used as a point in the tool coordinate system.
[0058] If the actual pixel coordinates do not completely coincide with the theoretical pixel coordinates, the points in the currently determined tool coordinate system are cleared and the tool coordinate system is recalibrated.
[0059] In step S140 , the tool coordinate system of the robot is determined according to the first point in the tool coordinate system and the three points in the tool coordinate system.
[0060] According to the four points obtained, the tool coordinate system of the robot can be obtained using the four-point calibration algorithm.
[0061] This solution uses a feature bar as a reference at the fixture position, controls the movement and rotation of the feature bar and the robot's lead screw end, and compares the theoretically rotated coordinates with the actual ones. This determines the four points in the tool coordinate system and calibrates them using the four-point method to obtain the robot's tool coordinate system. This process requires no manual operation, which not only improves calibration accuracy, stabilizes the robot's operation, and enhances the accuracy of the automated production line, but also reduces calibration time and improves production efficiency.
[0062] Figure 9 FIG. 1 is a flow chart of an embodiment of the method of the present invention for automatically calibrating a tool coordinate system. Figure 9 As shown, the method includes:
[0063] Step 1: After the robot turns on the automatic calibration tool coordinate system function, it controls the camera to take a photo and determine the center point of the photo. After converting the pixel coordinates of the center point into robot coordinates, it sends them to the robot, causing the end of the robot screw to move to the robot coordinates, which corresponds to the center point position of the photo.
[0064] Step 2: Control the camera to take another photo, identify the feature strip in the photo, and create a box template and a virtual rectangular coordinate system based on the feature strip's border. Then, control the template to rotate three times about a fixed point, creating three box templates.
[0065] Step 3: Calculate the pixel coordinates of the center point of each of the three established square templates, and obtain the robot coordinates of the end of the robot screw according to the corresponding relationship, so that the robot moves and rotates according to the coordinates and the corresponding rotation angle.
[0066] Step 4: After each movement and rotation of the robot, control the camera to take another photo, determine the pixel coordinates of the feature strip from the photo, and judge whether the pixel coordinates match the pixel coordinates calculated in step 3. If they match, send a qualified message to confirm that the point is the point in the calibration tool coordinate system. Then start from step 3 and continue to match the next point until four points are matched. If the match fails, clear all previous records and start matching again.
[0067] The technical solution of this embodiment comprises a robot with a vision module and a feature bar located at the location where the robot is mounted on a fixture. When the robot begins to automatically calibrate the tool coordinate system, it obtains an image captured by the vision module, controls the robot's lead screw end to move to the position corresponding to the center point of the image, and uses the point at the lead screw end of the robot as the first point in the tool coordinate system. Using the feature bar as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined. The robot's tool coordinate system is determined based on the first point in the tool coordinate system and the three points in the tool coordinate system. By setting the feature bar as a calibration reference and controlling the movement and rotation of the robot's lead screw end, the tool coordinate system is automatically determined. This not only shortens the calibration time but also improves the calibration accuracy, making the robot more efficient.
[0068] According to an embodiment of the present invention, there is also provided an automatic calibration device for a robot tool coordinate system corresponding to the automatic calibration method for a robot tool coordinate system. The robot has a screw and a vision module; the vision module is used to obtain an image at the end of the screw of the robot; a fixture can be installed at the end of the screw of the robot; a feature strip is provided on the side of the fixture facing the vision module; the feature strip is used to mark the position of the fixture so that the fixture can be recognized by the vision module. Figure 5 and Figure 6 The robot structure shown in the figure includes an industrial robot 1, a fixture 2, a camera 3, and a camera base 4. The fixture 2 is located at the end of a screw rod of the industrial robot 1, and the screw rod end has a center point 5. A feature bar 6 is located at the bottom of the fixture 2. The shooting direction of the camera 3 is the direction of the fixture 2, that is, the camera 3 can capture the feature bar 6. Figure 4 FIG2 is a schematic structural diagram of an embodiment of the device of the present invention. The automatic calibration device for a robot tool coordinate system may include: an acquisition unit 102 and a control unit 104 .
[0069] The acquisition unit 102 is configured to acquire the photos taken by the visual module. The specific functions and processing of the acquisition unit 102 are shown in step S110.
[0070] Specifically, before acquiring images taken by the vision module, the robot and vision module are calibrated, establishing a correspondence between the robot's coordinate system and the camera's visual coordinate system. This allows for conversion between robot coordinates and pixel coordinates. A fixture is then installed at the end of the robot's lead screw, and a feature strip is attached to the fixture.
[0071] The control unit 104 is configured to control the end of the robot's screw to move to a position corresponding to the center point of the photo, and determine the position of the end of the robot's screw as the first point in the tool coordinate system. The specific functions and processing of the control unit 104 are described in step S120.
[0072] Specifically, after acquiring a photo taken by the vision module, the vision software determines the visual pixel coordinates P1 of the center point of the photo in the visual coordinate system and converts the visual pixel coordinates P1 into robot coordinates in the robot coordinate system. After sending these robot coordinates to the robot, the robot moves the end of the screw rod to the robot coordinates, so that the end of the screw rod is at the position corresponding to the center point of the photo, and determines the current position of the end of the screw rod as the first point in the tool coordinate system.
[0073] The control unit 104 is further configured to control the movement and rotation of the lead screw end of the robot using the feature strip as a reference, and determine the three points in the tool coordinate system. The specific functions and processing of the control unit 104 are shown in step S130.
[0074] In some embodiments, the control unit 104 controls the movement and rotation of the lead screw end of the robot using the feature strip as a reference, and determines three points in the tool coordinate system, including:
[0075] The control unit 104 is further configured to establish a square template for the feature strip, the square template being a virtual template created in the robot's control software, the square template having four corners and a center point, the center point being the intersection of the diagonals of the four corners; and to control the rotation of the square template according to a preset angle, using any corner of the square template as a rotation origin, to obtain pixel coordinates of the four corners of the rotated square template, which are recorded as theoretical pixel coordinates. The specific functions and processing of the control unit 104 are described in step S210.
[0076] Specifically, after the robot's lead screw reaches the position corresponding to the center point of the photo, it sends information to the vision software, which then controls the camera to take a photo and search for the characteristic strip in the photo. Once found, the vision software creates a standard line along the two borders of the characteristic strip and then connects the two ends of the standard line with a straight line. This creates a square box in the visual image, which is identified as the square template of the characteristic strip.
[0077] Then, any corner of the square template is used as the coordinate origin, and the two sides with the coordinate origin as the endpoints are used as the X axis and Y axis to establish a virtual rectangular coordinate system. Figure 7 As shown, the square template has four corners. A coordinate system is established with (X0, Y0) as the origin, so that the two sides of the template fall on the X and Y axes. Therefore, the virtual coordinates of the other three corners of the square template are (X1, Y0), (X0, Y1), and (X1, Y1). The intersection of the two diagonals within the template is then determined as the center point of the template. The X coordinate of this center point is X = (X1-X0) / 2, and the Y coordinate is Y = (Y1-Y0) / 2, resulting in the center point coordinates (X, Y).
[0078] In the current state, the end of the robot's screw is still at the center of the photo. Therefore, after converting the template center coordinates (X, Y) into visual pixel coordinates P2, there is a corresponding relationship between visual pixel coordinates P2 and visual pixel coordinates P1. This correspondence is P1 = k * P2, where k is a coefficient. Based on this correspondence, after clarifying the visual pixel coordinates P2 of the template center, the corresponding visual pixel coordinates P1 of the photo center can be obtained. In other words, only when the end of the screw is at the position of visual pixel coordinates P1, that is, the end of the screw is at the center of the photo, can the visual pixel coordinates of the feature strip template center be P2.
[0079] After that, the template is controlled to rotate in the virtual rectangular coordinate system. Since the basis of this solution is the four-point calibration method, three more points need to be determined, so it needs to be rotated three times, and after each rotation, a point position in the calibration tool coordinate system is determined. Figure 8 As shown in the figure, with the origin as the rotation center, the square template is rotated three times by 90°, 180°, and 270° respectively, resulting in templates in three different positions. Since the process of determining the position of a point in the calibration tool coordinate system after each rotation is the same, only the process of determining the position of one point is described here.
[0080] After the template is rotated, since the virtual coordinates of the four corners of the template before rotation are already clear, the virtual coordinates of the four corners of the rotated template can be calculated. The calculation formula is: X'=X*cosθ-Y*sinθ, Y'=X*sinθ+Y*cosθ. Among them, X and Y are the virtual coordinates of the template points before rotation, X' and Y' are the virtual coordinates of the template points after rotation, and θ is the rotation angle. Through this formula, the virtual coordinates of the four corners of the rotated template can be obtained and converted into pixel coordinates to obtain the pixel coordinates of the four corners of the rotated feature strip template.
[0081] The control unit 104 is further configured to determine the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates. The specific functions and processing of the control unit 104 are shown in step S220.
[0082] In some embodiments, the control unit 104 determines the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates, including:
[0083] The control unit 104 is further configured to calculate the pixel coordinates of the center point of the square template of the feature strip according to the theoretical pixel coordinates. The specific functions and processing of the control unit 104 are shown in step S310.
[0084] The control unit 104 is further configured to determine the pixel coordinates of the robot's lead screw end based on the preset correspondence between the pixel coordinates of the center point of the square template of the feature strip and the pixel coordinates of the lead screw end of the robot, and the pixel coordinates of the center point of the square template of the feature strip. The specific functions and processing of the control unit 104 are described in step S320.
[0085] The control unit 104 is further configured to convert the pixel coordinates of the lead screw end of the robot into the robot coordinates of the lead screw end of the robot. The specific functions and processing of the control unit 104 are shown in step S330.
[0086] Specifically, the pixel coordinates of the four corners of the rotated template can be used to calculate the pixel coordinates of the template's center. The X coordinate of the center pixel coordinates is X = (X1 - X0) / 2, and the Y coordinate is Y = (Y1 - Y0) / 2. Based on the corresponding relationship P1 = k * P2, the pixel coordinates of the robot's lead screw end can be obtained and converted into robot coordinates to obtain the robot coordinates of the robot's lead screw end.
[0087] The control unit 104 is further configured to control the robot's lead screw end to move and rotate according to the robot's lead screw end coordinates and the preset angle, and determine a point in the tool coordinate system; thereafter, control the square template of the feature strip to rotate about the rotation origin and the preset angle, and determine two other points in the tool coordinate system. The specific functions and processing of the control unit 104 are described in step S230.
[0088] In some embodiments, the control unit 104 controls the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and the preset angle, and determines any point in the tool coordinate system, including:
[0089] The control unit 104 is further configured to control the robot's lead screw end to move and rotate according to the robot's lead screw end coordinates and the preset angle, then control the vision module to retake a photo, identify the position of the feature strip from the retaken photo, and obtain pixel coordinates of the four corners of the square template of the new feature strip, which are recorded as actual pixel coordinates. The specific functions and processing of the control unit 104 are described in step S410.
[0090] The robot's lead screw is controlled to move to the robot coordinates obtained in the previous step and rotate according to the angle and direction of the template. The vision module is then controlled to retake a photo. The vision software obtains the position of the feature strip from the photo and the pixel coordinates of the four corners of the feature strip.
[0091] The control unit 104 is further configured to determine whether the actual pixel coordinates completely coincide with the theoretical pixel coordinates. The specific functions and processing of the control unit 104 are shown in step S420.
[0092] The control unit 104 is further configured to use the current position of the lead screw end of the robot as a point in the tool coordinate system if the actual pixel coordinates completely coincide with the theoretical pixel coordinates. The specific functions and processing of the control unit 104 are described in step S430.
[0093] The control unit 104 is further configured to clear the point position in the currently determined tool coordinate system and recalibrate the tool coordinate system if the actual pixel coordinates do not completely coincide with the theoretical pixel coordinates.
[0094] The control unit 104 is further configured to determine the tool coordinate system of the robot based on the first point in the tool coordinate system and the three points in the tool coordinate system. Specific functions and processing of the control unit 104 are shown in step S140.
[0095] According to the four points obtained, the tool coordinate system of the robot can be obtained using the four-point calibration algorithm.
[0096] This solution uses a feature bar as a reference at the fixture position, controls the movement and rotation of the feature bar and the robot's lead screw end, and compares the theoretically rotated coordinates with the actual ones. This determines the four points in the tool coordinate system and calibrates them using the four-point method to obtain the robot's tool coordinate system. This process requires no manual operation, which not only improves calibration accuracy, stabilizes the robot's operation, and enhances the accuracy of the automated production line, but also reduces calibration time and improves production efficiency.
[0097] Figure 9 FIG. 1 is a flow chart of an embodiment of the method of the present invention for automatically calibrating a tool coordinate system. Figure 9 As shown, the method includes:
[0098] Step 1: After the robot turns on the automatic calibration tool coordinate system function, it controls the camera to take a photo and determine the center point of the photo. After converting the pixel coordinates of the center point into robot coordinates, it sends them to the robot, causing the end of the robot screw to move to the robot coordinates, which corresponds to the center point position of the photo.
[0099] Step 2: Control the camera to take another photo, identify the feature strip in the photo, and create a box template and a virtual rectangular coordinate system based on the feature strip's border. Then, control the template to rotate three times about a fixed point, creating three box templates.
[0100] Step 3: Calculate the pixel coordinates of the center point of each of the three established square templates, and obtain the robot coordinates of the end of the robot screw according to the corresponding relationship, so that the robot moves and rotates according to the coordinates and the corresponding rotation angle.
[0101] Step 4: After each movement and rotation of the robot, control the camera to take another photo, determine the pixel coordinates of the feature strip from the photo, and judge whether the pixel coordinates match the pixel coordinates calculated in step 3. If they match, send a qualified message to confirm that the point is the point in the calibration tool coordinate system. Then start from step 3 and continue to match the next point until four points are matched. If the match fails, clear all previous records and start matching again.
[0102] Since the processing and functions implemented by the device of this embodiment basically correspond to the embodiments, principles and examples of the aforementioned method, for any details not fully described in this embodiment, please refer to the relevant descriptions in the aforementioned embodiments and will not be repeated here.
[0103] The technical solution of the present invention comprises a robot having a vision module and a feature bar disposed at the location where the robot is mounted on a fixture. When the robot begins to automatically calibrate the tool coordinate system, it obtains an image captured by the vision module, controls the robot's lead screw end to move to a position corresponding to the center point of the image, and uses the lead screw end's position as the first point in the tool coordinate system. Using the feature bar as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined. The robot's tool coordinate system is determined based on the first point in the tool coordinate system and the three points in the tool coordinate system. By setting the feature bar as a calibration reference and controlling the robot's lead screw end to move and rotate, the tool coordinate system is automatically determined. This not only shortens the calibration time but also improves the calibration accuracy, making the robot more efficient.
[0104] According to an embodiment of the present invention, a robot corresponding to the automatic calibration device of the robot tool coordinate system is also provided. The robot may include: the automatic calibration device of the robot tool coordinate system described above.
[0105] Since the processing and functions implemented by the robot of this embodiment basically correspond to the embodiments, principles and examples of the aforementioned devices, for any details not fully described in this embodiment, please refer to the relevant descriptions in the aforementioned embodiments and will not be repeated here.
[0106] The technical solution of the present invention comprises a robot having a vision module and a feature bar disposed at the location where the robot is mounted on a fixture. When the robot begins to automatically calibrate the tool coordinate system, it obtains an image captured by the vision module, controls the robot's lead screw end to move to a position corresponding to the center point of the image, and uses the lead screw end's position as the first point in the tool coordinate system. Using the feature bar as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined. The robot's tool coordinate system is determined based on the first point in the tool coordinate system and the three points in the tool coordinate system. By setting the feature bar as a calibration reference and controlling the robot's lead screw end to move and rotate, the tool coordinate system is automatically determined. This not only shortens the calibration time but also improves the calibration accuracy, making the robot more efficient.
[0107] According to an embodiment of the present invention, a storage medium corresponding to an automatic calibration method of a robot tool coordinate system is also provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the automatic calibration method of the robot tool coordinate system described above.
[0108] Since the processing and functions implemented by the storage medium of this embodiment basically correspond to the embodiments, principles and examples of the aforementioned method, for any details not fully described in this embodiment, please refer to the relevant descriptions in the aforementioned embodiments and will not be repeated here.
[0109] The technical solution of the present invention comprises a robot having a vision module and a feature bar disposed at the location where the robot is mounted on a fixture. When the robot begins to automatically calibrate the tool coordinate system, it obtains an image captured by the vision module, controls the robot's lead screw end to move to a position corresponding to the center point of the image, and uses the lead screw end's position as the first point in the tool coordinate system. Using the feature bar as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined. The robot's tool coordinate system is determined based on the first point in the tool coordinate system and the three points in the tool coordinate system. By setting the feature bar as a calibration reference and controlling the robot's lead screw end to move and rotate, the tool coordinate system is automatically determined. This not only shortens the calibration time but also improves the calibration accuracy, making the robot more efficient.
[0110] In summary, it is easy for those skilled in the art to understand that, under the premise of no conflict, the above-mentioned advantageous methods can be freely combined and superimposed.
[0111] The foregoing description is merely an embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of the claims.
Claims
1. A method for automatic calibration of a robot tool coordinate system, characterized in that: The robot comprises a lead screw and a vision module; the vision module is used to obtain an image at the end of the lead screw of the robot; a fixture can be installed at the end of the lead screw of the robot; a feature strip is provided on a side of the fixture facing the vision module; the feature strip is used to mark the position of the fixture so that the fixture can be recognized by the vision module; the method comprises: Obtaining photos taken by the visual module; Controlling the end of the lead screw of the robot to move to a position corresponding to the center point of the photo, and determining the position of the end of the lead screw of the robot as the first point in the tool coordinate system; Using the feature strip as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined. The three points are determined by controlling the robot's lead screw end to move and rotate according to the coordinates of the robot's lead screw end and a preset angle, and determining any one point in the tool coordinate system. Thereafter, the square template of the feature strip is re-controlled to rotate at a rotation origin and a preset angle, and another two points in the tool coordinate system are determined. The rotation origin is any corner of the square template of the feature strip. The tool coordinate system of the robot is determined according to the first point in the tool coordinate system and the three points in the tool coordinate system.
2. The automatic calibration method of the robot tool coordinate system according to claim 1, characterized in that: Using the characteristic strip as a reference, the robot's lead screw end is controlled to move and rotate, and three points in the tool coordinate system are determined, including: Establishing a square template for the feature strip, where the square template is a virtual template established in the control software of the robot, and the square template has four corners and a center point, where the center point is the intersection of the diagonals of the four corners; using any corner of the square template for the feature strip as a rotation origin, controlling the square template for the feature strip to rotate according to a preset angle, and obtaining pixel coordinates of the four corners of the square template for the feature strip after rotation, which are recorded as theoretical pixel coordinates; Determining the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates; The robot's screw end is controlled to move and rotate according to the coordinates of the robot's screw end and the preset angle, and any point position in the tool coordinate system is determined; then, the square template of the feature strip is re-controlled to rotate with the rotation origin and the preset angle, and the other two points in the tool coordinate system are determined.
3. The automatic calibration method of the robot tool coordinate system according to claim 2, characterized in that: Determining the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates includes: Calculating the pixel coordinates of the center point of the square template of the feature strip according to the theoretical pixel coordinates; Determining the pixel coordinates of the end of the lead screw of the robot based on the preset correspondence between the pixel coordinates of the center point of the square template of the feature strip and the pixel coordinates of the end of the lead screw of the robot, and the pixel coordinates of the center point of the square template of the feature strip; The pixel coordinates of the lead screw end of the robot are converted into robot coordinates of the lead screw end of the robot.
4. The automatic calibration method of the robot tool coordinate system according to claim 2, characterized in that: Controlling the end of the lead screw of the robot to move and rotate according to the coordinates of the end of the lead screw of the robot and the preset angle, and determining any point position in the tool coordinate system, including: Controlling the end of the lead screw of the robot to move and rotate according to the coordinates of the end of the lead screw of the robot and the preset angle, then controlling the vision module to retake a photo, and identifying the position of the feature strip from the retaken photo, obtaining the pixel coordinates of the four corners of the square template of the new feature strip, and recording them as actual pixel coordinates; Determining whether the actual pixel coordinates completely coincide with the theoretical pixel coordinates; If the actual pixel coordinates completely coincide with the theoretical pixel coordinates, the current position of the lead screw end of the robot is used as a point in the tool coordinate system.
5. An automatic calibration device for a robot tool coordinate system, characterized in that: The robot comprises a lead screw and a vision module; the vision module is used to obtain an image at the end of the lead screw of the robot; a fixture can be installed at the end of the lead screw of the robot; a feature strip is provided on a side of the fixture facing the vision module; The feature strip is used to mark the position of the fixture so that the fixture can be identified by the visual module; the device includes: an acquisition unit, configured to acquire photos taken by the visual module; a control unit configured to control the end of the lead screw of the robot to move to a position corresponding to the center point of the photo, and determine the position of the end of the lead screw of the robot as the first point in the tool coordinate system; The control unit is further configured to control the movement and rotation of the lead screw end of the robot using the feature strip as a reference, and determine three points in the tool coordinate system; the three points are determined by controlling the lead screw end of the robot to move and rotate according to the coordinates of the lead screw end of the robot and a preset angle, and determining any one point in the tool coordinate system; thereafter, re-controlling the square template of the feature strip to rotate around a rotation origin and a preset angle, and determining another two points in the tool coordinate system; the rotation origin is any corner of the square template of the feature strip; The control unit is further configured to determine the tool coordinate system of the robot according to the first point in the tool coordinate system and the three points in the tool coordinate system.
6. The automatic calibration device for the robot tool coordinate system according to claim 5, characterized in that: The control unit controls the movement and rotation of the lead screw end of the robot using the feature strip as a reference, and determines three points in the tool coordinate system, including: Establishing a square template for the feature strip, where the square template is a virtual template established in the control software of the robot, and the square template has four corners and a center point, where the center point is the intersection of the diagonals of the four corners; using any corner of the square template for the feature strip as a rotation origin, controlling the square template for the feature strip to rotate according to a preset angle, and obtaining pixel coordinates of the four corners of the square template for the feature strip after rotation, which are recorded as theoretical pixel coordinates; Determining the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates; The robot's screw end is controlled to move and rotate according to the coordinates of the robot's screw end and the preset angle, and any point position in the tool coordinate system is determined; then, the square template of the feature strip is re-controlled to rotate with the rotation origin and the preset angle, and the other two points in the tool coordinate system are determined.
7. The automatic calibration device for the robot tool coordinate system according to claim 6, characterized in that: The control unit determines the robot coordinates of the lead screw end of the robot according to the theoretical pixel coordinates, including: Calculating the pixel coordinates of the center point of the square template of the feature strip according to the theoretical pixel coordinates; Determining the pixel coordinates of the end of the lead screw of the robot based on the preset correspondence between the pixel coordinates of the center point of the square template of the feature strip and the pixel coordinates of the end of the lead screw of the robot, and the pixel coordinates of the center point of the square template of the feature strip; The pixel coordinates of the lead screw end of the robot are converted into robot coordinates of the lead screw end of the robot.
8. The automatic calibration device for the robot tool coordinate system according to claim 6, characterized in that: The control unit controls the end of the lead screw of the robot to move and rotate according to the coordinates of the end of the lead screw of the robot and the preset angle, and determines any point position in the tool coordinate system, including: Controlling the end of the lead screw of the robot to move and rotate according to the coordinates of the end of the lead screw of the robot and the preset angle, then controlling the vision module to retake a photo, and identifying the position of the feature strip from the retaken photo, obtaining the pixel coordinates of the four corners of the square template of the new feature strip, and recording them as actual pixel coordinates; Determining whether the actual pixel coordinates completely coincide with the theoretical pixel coordinates; If the actual pixel coordinates completely coincide with the theoretical pixel coordinates, the current position of the lead screw end of the robot is used as a point in the tool coordinate system.
9. A robot, characterized in that: include: The automatic calibration device for a robot tool coordinate system according to any one of claims 5 to 8.
10. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the device where the storage medium is located is controlled to execute the automatic calibration method of the robot tool coordinate system according to any one of claims 1 to 4.
Citation Information
Patent Citations
SCARA robot body calibration and parameter identification method
CN114012730A
Tool calibration method, system and device, electronic equipment and readable storage medium
CN114794667A