Robot device with three-dimensional sensor and control method of the robot device

DE112022005336T5Pending Publication Date: 2024-08-29FANUC LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE112022005336
Authority / Receiving Office
DE · DE
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

Existing robot devices equipped with three-dimensional sensors face inaccuracies in measuring and synthesizing three-dimensional point clouds due to errors in the position and orientation of the robot, particularly caused by backlash in the speed reducer, leading to incorrect positioning and control issues when handling large or glossy workpieces.

Method used

A robot device and control method that utilize a three-dimensional sensor to generate and estimate surface information, and set correction amounts for the robot's position and orientation to align planes detected at different relative positions, ensuring accurate three-dimensional point cloud synthesis and surface matching.

Benefits of technology

The solution reduces errors in three-dimensional position information acquired from the sensor output, enabling high-accuracy detection and handling of workpieces by aligning planes and correcting for positional and orientational errors, thus improving the robot's ability to grip and transport workpieces accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure DE112022005336T5_0000_ABST
    Figure DE112022005336T5_0000_ABST
Patent Text Reader

Abstract

This robot device comprises: a position information generation unit that generates three-dimensional position information of a workpiece surface based on output from a visual sensor; and a surface derivation unit that derives surface information with respect to a surface, including the workpiece surface, based on the three-dimensional position information. The robot moves the visual sensor from a first position to a second position. A correction amount setting unit sets a correction amount for controlling the robot at the second position such that a first surface, encompassing the workpiece surface detected at the first position, aligns with a second surface, encompassing the workpiece surface detected at the second position.
Need to check novelty before this filing date? Find Prior Art

Description

ROBOT DEVICE WITH THREE-DIMENSIONAL SENSOR AND METHOD FOR CONTROLLING ROBOT DEVICE

[0001] The present invention relates to a robot device equipped with a three-dimensional sensor and a method for controlling the robot device.

[0002] A robotic device equipped with a robot and a work tool can perform various tasks by changing the position and orientation of the robot. It is known that a three-dimensional sensor detects the position of a workpiece so that the robot can perform the task at a position and orientation that correspond to the position and orientation of the workpiece (see, for example, Japanese Patent Application Laid-Open No. 2004-144557). Driving the robot based on the position and orientation of the workpiece detected by the three-dimensional sensor allows the robotic device to perform the task with high precision.

[0003] By using a 3D sensor, multiple 3D points can be set on the surface of the workpiece included in the measurement area, and the positions of each 3D point can be detected. Furthermore, based on the positions of the multiple 3D points, a distance image with different intensities depending on the distance can be generated.

[0004] When a workpiece is too large for the measurement area of ​​the 3D sensor, the robot device can measure it at multiple positions while moving the 3D sensor. The 3D point clouds acquired by placing the 3D sensor at multiple positions can be combined. For example, a 3D camera can be fixed to the hand of the robot device. The robot's position and orientation can be changed to capture images at multiple positions. The 3D point clouds measured at each position can then be combined to generate a single large 3D point cloud.

[0005] Alternatively, if the surface of the workpiece is glossy, the position of a portion of the workpiece may not be measurable due to halation of light (for example, Japanese Patent Application Laid-Open No. 2019-113895). When such halation occurs, the 3D sensor can be moved to capture images at multiple positions to compensate for the 3D points of the portion whose position could not be measured.

[0006] JP 2004-144557 A JP 2019-113895 A

[0007] When calculating the positions of three-dimensional points set on the surface of a workpiece, the control device of a robot device converts positions in a sensor coordinate system set in a three-dimensional sensor into positions in a robot coordinate system. At this time, the positions of the three-dimensional points are converted based on the position and orientation of the robot. However, if there is an error in the position and orientation of the robot, this error may affect the accuracy of the positions of the three-dimensional points. For example, there is a problem in that errors in the positions of the three-dimensional points in the robot coordinate system occur due to errors in the position and orientation of the robot caused by backlash in the reducer. In particular, when three-dimensional points are measured from multiple positions and a three-dimensional point cloud is synthesized, there is a problem in that controlling the robot device based on the synthesized three-dimensional point cloud results in inaccurate control.

[0008] A robotic device according to an aspect of the present disclosure includes a three-dimensional sensor for detecting the position of a workpiece surface, and a robot that changes the relative position of the workpiece and the three-dimensional sensor. The robotic device includes a position information generation unit that generates three-dimensional position information of the workpiece surface based on the output of the three-dimensional sensor, and a surface estimation unit that estimates surface information related to a surface including the workpiece surface based on the three-dimensional position information. The robotic device also includes a correction amount setting unit that sets a correction amount for driving the robot. The robot is configured to change the relative position between the workpiece and the three-dimensional sensor from a first relative position to a second relative position different from the first relative position. The correction amount setting unit sets a correction amount for driving the robot at the second relative position based on the surface information so that a first surface including the workpiece surface detected at the first relative position coincides with a second surface including the workpiece surface detected at the second relative position.

[0009] A control method for a robot device according to an aspect of the present disclosure includes the steps of: (a) positioning the relative position of a workpiece and a three-dimensional sensor at a first relative position; and (b) generating three-dimensional position information of the surface of the workpiece at the first relative position based on output from the three-dimensional sensor; (c) positioning the relative position of the workpiece and the three-dimensional sensor at a second relative position different from the first relative position; and (d) generating three-dimensional position information of the surface of the workpiece at the second relative position based on output from the three-dimensional sensor; (e) estimating surface information related to a surface including the surface of the workpiece based on the three-dimensional position information at each relative position; and (f) setting a correction amount for driving the robot at the second relative position based on the surface information so that a first surface including the surface of the workpiece detected at the first relative position coincides with a second surface including the surface of the workpiece detected at the second relative position.

[0010] The robot device and the method for controlling the robot device according to the aspects of the present disclosure can set a correction amount for the robot that reduces an error in the three-dimensional position information acquired from the output of the three-dimensional sensor.

[0011] 1 is a perspective view of a workpiece and a first robot device according to an embodiment. FIG. 2 is a block diagram of the first robot device according to an embodiment. FIG. 3 is a schematic diagram of a visual sensor according to an embodiment. FIG. 4 is a perspective view of a visual sensor and a workpiece for explaining a three-dimensional point cloud and a distance image. FIG. 5 is a perspective view explaining a three-dimensional point cloud set on the surface of a workpiece. FIG. 6 is an example of a distance image generated based on the output of the visual sensor. FIG. 7 is a perspective view of a workpiece and the first robot device when the visual sensor is moved to a second position. FIG. 8 is a schematic cross-sectional view when no error in the second position occurs when the visual sensor is moved to the second position. FIG. 9 is a schematic cross-sectional view when an error occurs in the second position when the visual sensor is moved to the second position. FIG. 10 is a schematic cross-sectional view explaining the position of a three-dimensional point cloud in a robot coordinate system when an error occurs in the second position of the visual sensor. FIG. 11 is a schematic cross-sectional view of a visual sensor and a workpiece explaining the amount of correction for the position of the visual sensor. FIG. 12 is a flowchart of control performed during a teaching operation of a robot device according to an embodiment. FIG. 13 is a flowchart of control for an operation of transporting a workpiece according to an embodiment. FIG. 14 is a perspective view of a second workpiece and a visual sensor according to an embodiment. FIG. 15 is a block diagram of a surface estimation unit in a modified example of the first robot device. FIG. 16 is a perspective view of a third workpiece and a visual sensor according to an embodiment. 10 is a schematic cross-sectional view of a fourth workpiece and a visual sensor according to an embodiment. FIG. 11 is a schematic view of a second robot device according to an embodiment.

[0012] A robot device and a control method for the robot device according to the embodiment will be described with reference to Figures 1 to 18. The robot device according to the embodiment is equipped with a three-dimensional sensor for detecting the position of the surface of a workpiece as an object to be worked on. Three-dimensional position information such as the position of a three-dimensional point is obtained by processing the output of the three-dimensional sensor. First, a first robot device equipped with a robot that changes the position and orientation of the three-dimensional sensor will be described.

[0013] Fig. 1 is a perspective view of a first robot device according to this embodiment. Fig. 2 is a block diagram of the first robot device according to this embodiment. Referring to Figs. 1 and 2, the first robot device 3 transports a workpiece 65. The first robot device 3 includes a hand 5 as a work tool for gripping the first workpiece 65, and a robot 1 as a movement mechanism for moving the hand 5. The robot device 3 includes a control device 2 that controls the robot 1 and the hand 5. The robot device 3 includes a visual sensor 30 as a three-dimensional sensor that outputs a signal for detecting the position of the surface of the workpiece 65.

[0014] The first workpiece 65 is a plate-like member having a flat surface 65a. The workpiece 65 is placed on a surface 69a of a stand 69, which serves as a mounting member. In the first robot device 3, the position and orientation of the workpiece 65 are fixed. The hand 5 of this embodiment grasps the workpiece 65 by suction. The work tool is not limited to this form, and any work tool can be used depending on the work to be performed by the robot device 3. For example, a work tool for welding or a work tool for applying a sealant can be used.

[0015] The robot 1 is a vertical articulated robot including multiple joints 18. The robot 1 includes an upper arm 11 and a lower arm 12. The lower arm 12 is supported by a swivel base 13. The swivel base 13 is supported by a base 14. The base 14 is fixed to an installation surface. The robot 1 includes a wrist 15 connected to the end of the upper arm 11. The wrist 15 includes a flange 16 to which the hand 5 is fixed. The robot 1 in this embodiment has six drive axes, but is not limited to this form. Any robot capable of moving a work tool can be used.

[0016] The visual sensor 30 is attached to the flange 16 via a support member 36. In the first robot device 3, the visual sensor 30 is supported by the robot 1 so that the position and orientation of the visual sensor 30 changes together with the hand 5.

[0017] The robot 1 of this embodiment includes a robot driving device 21 that drives components of the robot 1, such as the upper arm 11. The robot driving device 21 includes a plurality of driving motors for driving the upper arm 11, the lower arm 12, the rotating base 13, and the wrist 15. The hand 5 includes a hand driving device 22 that drives the hand 5. The hand driving device 22 of this embodiment drives the hand 5 using air pressure. The hand driving device 22 includes a vacuum pump, a solenoid valve, and the like that supply reduced-pressure air to the hand 5.

[0018] The control device 2 includes an arithmetic processing device 24 (computer) including a CPU (Central Processing Unit) as a processor. The arithmetic processing device 24 has a RAM (Random Access Memory) and a ROM (Read Only Memory), which are connected to the CPU via a bus. The robot device 3 drives the robot 1 and the hand 5 based on an operation program 41. The robot device 3 has a function of automatically transporting a workpiece 65.

[0019] The arithmetic processing unit 24 of the control device 2 includes a storage unit 42 that stores information related to the control of the robot device 3. The storage unit 42 can be configured with a non-transitory storage medium capable of storing information. For example, the storage unit 42 can be configured with a storage medium such as a volatile memory, a non-volatile memory, a magnetic storage medium, or an optical storage medium. An operation program 41 created in advance to perform an operation of the robot 1 is stored in the storage unit 42.

[0020] The arithmetic processing device 24 includes an operation control unit 43 that outputs operation commands. The operation control unit 43 outputs operation commands to the robot driving unit 44 to drive the robot 1 based on the operation program 41. The robot driving unit 44 includes an electrical circuit that drives the drive motor. The robot driving unit 44 supplies electricity to the robot driving device 21 based on the operation commands. The operation control unit 43 also outputs operation commands to the hand driving unit 45 to drive the hand driving device 22. The hand driving unit 45 includes an electrical circuit that drives a pump or the like. The hand driving unit 45 supplies electricity to the hand driving device 22 based on the operation commands.

[0021] The operation control unit 43 corresponds to a processor that operates in accordance with the operation program 41. The processor reads the operation program 41 and performs the control defined in the operation program 41, thereby functioning as the operation control unit 43.

[0022] The robot 1 includes a state detector for detecting the position and posture of the robot 1. In this embodiment, the state detector includes a position detector 23 attached to the drive motor of each drive axis of the robot drive device 21. The position detector 23 is configured by, for example, an encoder. The position and posture of the robot 1 are detected based on the output of the position detector 23.

[0023] The control device 2 includes a teaching operation panel 49 as an operation panel with which an operator manually operates the robot device 3. The teaching operation panel 49 includes an input unit 49a for inputting information related to the robot device 3. The input unit 49a is composed of operating members such as a keyboard and a dial. The teaching operation panel 49 includes a display unit 49b for displaying information related to the control of the robot device 3. The display unit 49b is composed of a display panel such as a liquid crystal display panel.

[0024] In the robot device 3 of this embodiment, a robot coordinate system 71 is set that remains unchanged even if the position and posture of the robot 1 change. In the example shown in FIG. 1 , the origin of the robot coordinate system 71 is located on the base 14 of the robot 1. The robot coordinate system 71 is also referred to as a world coordinate system. The robot coordinate system 71 has a fixed origin and fixed coordinate axes. In this embodiment, the robot coordinate system 71 is set so that the Z axis is parallel to the vertical direction.

[0025] A tool coordinate system 73 having an origin set at an arbitrary position on the work tool is set for the robot device 3. The position and orientation of the tool coordinate system 73 change together with the hand 5. In this embodiment, the origin of the tool coordinate system 73 is set at the tool tip point. The position of the robot 1 corresponds to the position of the tool tip point (the position of the origin of the tool coordinate system 73). The orientation of the robot 1 corresponds to the orientation of the tool coordinate system 73 with respect to the robot coordinate system 71.

[0026] Furthermore, a sensor coordinate system 72 is set in the robot device 3 relative to the visual sensor 30. The sensor coordinate system 72 is a coordinate system whose origin is fixed at an arbitrary position, such as the center point of the lens of the visual sensor 30. The position and orientation of the sensor coordinate system 72 change together with the visual sensor 30. In this embodiment, the sensor coordinate system 72 is set so that its Z axis is parallel to the optical axis of the camera included in the visual sensor 30.

[0027] The sensor coordinate system 72 has a predetermined relative position and orientation with respect to a flange coordinate system or a tool coordinate system 73 set on the surface of the flange 16. The sensor coordinate system 72 is calibrated based on the position and orientation of the robot 1 so that the coordinate values ​​of the robot coordinate system 71 can be calculated from the coordinate values ​​of the sensor coordinate system 72.

[0028] Each coordinate system defines an X-axis, a Y-axis, and a Z-axis, as well as a W-axis around the X-axis, a P-axis around the Y-axis, and an R-axis around the Z-axis.

[0029] FIG. 3 shows a schematic diagram of the visual sensor of this embodiment. The visual sensor of this embodiment is a three-dimensional camera capable of acquiring three-dimensional position information of the surface of an object. With reference to FIGS. 2 and 3, the visual sensor 30 of this embodiment is a stereo camera including a first camera 31 and a second camera 32. Each of the cameras 31 and 32 is a two-dimensional camera capable of capturing two-dimensional images. The visual sensor 30 of this embodiment includes a projector 33 that projects a pattern of light, such as a striped pattern, toward the workpiece 65. The cameras 31 and 32 and the projector 33 are disposed inside a housing 34.

[0030] Referring to FIG. 2 , the control device 2 of the robot device 3 includes a visual sensor 30. The robot 1 changes the relative position of the workpiece 65 and the visual sensor 30. The control device 2 includes a processing unit 51 that processes the output of the visual sensor 30. The processing unit 51 includes a position information generation unit 52 that generates three-dimensional position information of the surface of the workpiece 65 based on the output of the visual sensor 30. The processing unit 51 includes a surface estimation unit 53 that estimates surface information related to a surface including the surface of the workpiece based on the three-dimensional position information. The surface information is information that identifies the surface of the workpiece. For example, if the surface of the workpiece is flat, the surface information includes an equation of the surface in the robot coordinate system.

[0031] The processing unit 51 includes a correction amount setting unit 55 that sets a correction amount for driving the robot 1. The robot 1 changes the relative position between the workpiece 65 and the visual sensor 30 from a first relative position to a second relative position different from the first relative position. The processing unit 51 includes a determination unit 54 that determines whether a first surface including the surface of the workpiece 65 detected at the first relative position and a second surface including the surface of the workpiece 65 detected at the second relative position coincide within a predetermined determination range. The correction amount setting unit 55 sets a correction amount for driving the robot at the second relative position based on the surface information so that the first surface and the second surface coincide with each other. For example, the correction amount setting unit 55 sets a correction amount for driving the robot at the second relative position based on the surface information so that the first surface and the second surface coincide with each other within a predetermined range.

[0032] The processing unit 51 includes a combining unit 56 that combines three-dimensional position information of the surfaces of multiple workpieces acquired at multiple relative positions. In this example, the combining unit 56 combines three-dimensional position information detected at a first relative position with three-dimensional position information detected at a second relative position. In particular, the combining unit 56 uses three-dimensional position information generated at the second relative position that has been corrected based on the correction amount set by the correction amount setting unit 55.

[0033] The processing unit 51 includes an imaging control unit 57 that controls imaging by the visual sensor 30. The processing unit 51 also includes a command unit 58 that sends commands regarding the operation of the robot 1. The command unit 58 in this embodiment sends a command to the operation control unit 43 to correct the position and posture of the robot 1 based on the amount of correction for the operation of the robot 1 set by the correction amount setting unit 55.

[0034] The processing unit 51 described above corresponds to a processor that operates in accordance with the operation program 41. The processor functions as the processing unit 51 by carrying out the control defined in the operation program 41. The position information generating unit 52, the surface estimating unit 53, the determining unit 54, the correction amount setting unit 55, and the combining unit 56 included in the processing unit 51 correspond to the processor that operates in accordance with the operation program 41. The imaging control unit 57 and the command unit 58 correspond to the processor that operates in accordance with the operation program 41. The processor functions as each unit by carrying out the control defined in the operation program 41.

[0035] The position information generator 52 of this embodiment calculates the distance from the visual sensor 30 to a three-dimensional point set on the surface of the object based on the parallax between the image captured by the first camera 31 and the image captured by the second camera 32. The three-dimensional point can be set for each pixel of the imaging element, for example. The position information generator 52 calculates the distance from the visual sensor 30 for each three-dimensional point. Furthermore, the position information generator 52 calculates the coordinate values ​​of the position of the three-dimensional point in the sensor coordinate system 72 based on the distance from the visual sensor 30.

[0036] 4 shows a perspective view of a visual sensor and a workpiece to illustrate an example of a three-dimensional point cloud and a distance image. In this example, a workpiece 65 is placed at an angle on a surface 69a of a stand 69. The surface 69a of the stand 69 extends perpendicular to the optical axes of the cameras 31 and 32 of the visual sensor 30. By processing the images captured by the cameras 31 and 32 of the visual sensor 30, the distance from the visual sensor 30 to a three-dimensional point set on the surface of the workpiece 65 can be detected, as indicated by arrows 102 and 103.

[0037] Fig. 5 shows a perspective view of a point cloud of three-dimensional points generated by the position information generator. In Fig. 5, the outline of the workpiece 65 and the outline of the measurement area 91 are indicated by dashed lines. Three-dimensional points 85 are arranged on the surface of the object facing the visual sensor 30. The position information generator 52 sets three-dimensional points 85 on the surface of the object included within the measurement area 91. Here, a large number of three-dimensional points 85 are arranged on the surface 65a of the workpiece 65. In addition, a large number of three-dimensional points 85 are arranged on the surface 69a of the stand 69 within the measurement area 91.

[0038] In this way, the position information generation unit 52 can display the surface of the workpiece 65 as a three-dimensional point cloud. The position information generation unit 52 can generate three-dimensional position information of the surface of the object in the form of a distance image or three-dimensional point position information (three-dimensional map). A distance image is a two-dimensional image that represents the position information of the surface of the object. In a distance image, the darkness or color of each pixel represents the distance from the visual sensor 30 to a three-dimensional point. On the other hand, a three-dimensional map represents the position information of the surface of the object as a set of coordinate values ​​(x, y, z) of three-dimensional points on the surface of the object. Such coordinate values ​​can be expressed in the robot coordinate system 71 or the sensor coordinate system 72.

[0039] 6 shows an example of a distance image obtained by output from the visual sensor. The position information generating unit 52 can generate a distance image 81 in which the color intensity varies depending on the distance from the visual sensor 30 to a three-dimensional point 85. In this example, the distance image 81 is generated so that the color becomes darker as the distance from the visual sensor 30 increases. On the surface 65a of the workpiece 65, the color becomes lighter as the workpiece 65 approaches the visual sensor 30. In this embodiment, the three-dimensional position information of the surface of the object is described using the positions of three-dimensional points, but similar control can also be performed using a distance image.

[0040] In this embodiment, the position information generator 52 is disposed in the processing unit 51 of the arithmetic processing device 24, but this is not limiting. The position information generator may be disposed inside the three-dimensional sensor. That is, the three-dimensional sensor may include an arithmetic processing device including a processor such as a CPU, and the processor of the arithmetic processing device of the three-dimensional sensor may function as the position information generator. In this case, the visual sensor outputs three-dimensional position information such as a three-dimensional map or a range image.

[0041] 7 shows a perspective view of the robot device and the workpiece when the visual sensor of the first robot device is moved to a second position. Referring to FIGS. 1 and 7, the robot device 3 grasps the surface 65a of the workpiece 65 with the hand 5. The robot device 3 controls the transfer of the workpiece 65 from the surface 69a of the stand 69 to a predetermined position. For example, the robot device 3 controls the transfer of the workpiece 65 to a nearby conveyor, shelf, or the like.

[0042] In this embodiment, when the robot 1 is positioned and oriented in a predetermined position, a workpiece 65 having a surface 65a larger than the measurement area 91 of the visual sensor 30 is measured. That is, the workpiece 65 is large enough that the entire surface 65a cannot be captured in a single image. The surface 65a is larger than the measurement area 91 and has a portion that extends beyond the measurement area 91. Alternatively, the length of the surface 65a in one predetermined direction is greater than the length of the measurement area 91 in that predetermined direction. For this reason, in this embodiment, the position (viewpoint) of the visual sensor 30 is changed and multiple images are captured. The robot device 3 changes the relative position between the workpiece 65 and the visual sensor from a first relative position to a second relative position different from the first relative position. By capturing images at each position, three-dimensional position information is generated for the entire surface 65a of the workpiece 65. Here, three-dimensional points are set on the entire surface 65a of the workpiece 65. Then, based on the three-dimensional position information, the position and orientation of the robot 1 when the hand 5 grasps the workpiece 65 is calculated.

[0043] In FIG. 1 , the visual sensor 30 is disposed at a first position and orientation (first viewpoint). The position information generator 52 sets a three-dimensional point on the surface 65 a, which is disposed within the measurement region 91. The position information generator 52 sets a three-dimensional point at one end of the surface 65 a. Next, the robot 1 changes its position and orientation so that the visual sensor 30 moves as indicated by the arrow 101. Here, the visual sensor 30 is translated in the horizontal direction. In FIG. 7 , the visual sensor 30 is disposed at a second position and orientation (second viewpoint). The position information generator 52 sets a three-dimensional point at the other end of the surface 65 a.

[0044] The measurement area 91 of the visual sensor 30 at the first position shown in Fig. 1 partially overlaps with the measurement area 91 of the visual sensor 30 at the second position shown in Fig. 7. The synthesis unit 56 sets three-dimensional points over the entire surface 65a by synthesizing the three-dimensional point cloud acquired at the first position and the three-dimensional point cloud acquired at the second position. In this example, three-dimensional points can be set over the entire surface 65a by capturing images of the visual sensor 30 twice.

[0045] The command unit 58 can then calculate the position and orientation of the surface 65a of the workpiece 65 based on the three-dimensional point cloud set on the surface 65a. The command unit 58 can calculate the position and orientation of the robot 1 for gripping the workpiece 65 based on the position and orientation of the workpiece 65.

[0046] The first position and orientation of the visual sensor 30 for measuring the surface of the workpiece 65 and the second position and orientation of the visual sensor 30 can be set by any control. For example, the operator can display an image captured by one of the two-dimensional cameras of the visual sensor 30 on the display unit 49b of the teaching pendant 49. Then, the operator can adjust the position and orientation of the robot 1 by operating the input unit 49a while looking at the image displayed on the display unit 49b.

[0047] As shown in Fig. 1, the operator can adjust the position and orientation of the robot so that one side of the workpiece 65 is located within the measurement area 91. Alternatively, as shown in Fig. 7, the operator can manually adjust the position and orientation of the robot so that the other side of the workpiece 65 is located within the measurement area 91. The operator can store in the memory unit 42 the position and orientation of the robot when the visual sensor 30 is located at a desired position and orientation. Alternatively, the position and orientation of the visual sensor may be set in advance using a simulation device or the like.

[0048] 8 shows a schematic cross-sectional view of the visual sensor and workpiece when the robot is ideally driven. In this embodiment, the surface 69a of the base 69 is planar and extends horizontally. Alternatively, the surface 65a of the workpiece 65 is planar and extends horizontally. The visual sensor 30 moves from a first position P30a to a second position P30b, as indicated by arrow 105. In this example, the position of the visual sensor 30 changes without changing its posture. The visual sensor 30 moves horizontally, parallel to the Y-axis of the robot coordinate system 71.

[0049] 8 shows a case where there is no error in the actual position and orientation of the robot 1 relative to the command values ​​of the robot 1. Three-dimensional points 85a and 85b are shown as positions represented by coordinate values ​​in the sensor coordinate system 72. Furthermore, when there is no error in the actual position and orientation of the robot, the three-dimensional points 85a and 85b are located at the same positions even when the coordinate values ​​in the sensor coordinate system 72 are converted into coordinate values ​​in the robot coordinate system 71.

[0050] Based on the output of the visual sensor 30 positioned at the first position P30a, a three-dimensional point 85a is set on the surface 65a of the workpiece 65 and the surface 69a of the platform 69. Based on the output of the visual sensor 30 positioned at the second position P30b, a three-dimensional point 85b is set on the surface 65a and the surface 69a. A portion of the measurement area 91a at the first position P30a and a portion of the measurement area 91b at the second position P30b overlap with each other. The three-dimensional point 85a and the three-dimensional point 85b are set in the overlapping area. However, because there is no error in the position and orientation of the robot, the three-dimensional points 85a and 85b set on the surface 65a are on the same plane. Therefore, the processing unit 51 can accurately estimate the position and orientation of the workpiece 65 by combining the point cloud of the three-dimensional points 85a and the point cloud of the three-dimensional points 85b.

[0051] 9 shows a schematic cross-sectional view of the visual sensor and the workpiece when an error occurs in the position and orientation of the robot when the visual sensor is moved to the second position. When the robot is driven, an error in the actual position and orientation may occur relative to the command values ​​defined in the operation program. For example, a movement error occurring in the drive mechanism, such as backlash in the transmission, may cause the actual position and orientation of the robot to deviate from the command values. In this case, the movement error of the robot corresponds to an error in the position of a three-dimensional point.

[0052] In the example shown in Fig. 9, similar to Fig. 8, a command value is generated to move the visual sensor 30 in the horizontal direction. However, as indicated by arrow 106, the visual sensor 30 moves from a first position P30a to a second position P30c, which is shifted upward. The position information generator 52 detects three-dimensional points 85a and 85c in the sensor coordinate system 72. The Z-axis coordinate value of the three-dimensional point 85a in the sensor coordinate system 72 is different from the Z-axis coordinate value of the three-dimensional point 85c in the sensor coordinate system 72.

[0053] 10 shows the position of a three-dimensional point expressed in coordinate values ​​in the robot coordinate system when the three-dimensional point is detected at the second position including an error. The processing unit 51 converts the coordinate values ​​in the sensor coordinate system 72 into coordinate values ​​in the robot coordinate system 71, assuming that the visual sensor 30 is located at the second position P30b. The coordinate values ​​in the robot coordinate system for the second position P30b are used to convert the coordinate values ​​in the sensor coordinate system 72 into coordinate values ​​in the robot coordinate system 71. For this reason, the position of the three-dimensional point 85c in the robot coordinate system 71 is calculated under the condition that the visual sensor 30 is located at the second position P30b.

[0054] The Z-axis coordinate value of the three-dimensional point 85c in the sensor coordinate system 72 becomes larger, and the three-dimensional point 85c is disposed at a position shifted from the surface 65a of the workpiece 65. In this example, the position of the three-dimensional point 85c is calculated to be below the surface 65a.

[0055] For the three-dimensional points 85a and 85c in the area where the measurement areas 91a and 91b overlap, for example, the three-dimensional point 85a closest to the visual sensor 30 can be used. In this case, it will be determined that there is a step on the surface of the workpiece 65, as shown in surface 99. As such, there is a problem in that if there is an error in the robot's driving, it will not be possible to accurately detect the positions of the three-dimensional points over the entire surface 65a of the workpiece 65.

[0056] Therefore, in this embodiment, when the visual sensor 30 is placed at the second position, the processing unit 51 sets a correction amount for driving the robot 1 so that the visual sensor 30 is placed at the second position P30b corresponding to the command values ​​for the position and posture of the robot 1.

[0057] FIG. 11 shows a schematic diagram of the visual sensor and workpiece when the correction value is calculated and the robot is driven. In this embodiment, the processing unit 51 sets a correction amount, indicated by arrow 107, so that the visual sensor 30, which is located at the second position P30c, is positioned at the second position P30b. The correction amount can be a correction amount for the command values ​​of the robot's position and orientation. In particular, the correction amount setting unit 55 searches for a second position such that, when the visual sensor 30 is located at the second position, the plane defined by the first three-dimensional points 85a acquired at the first position and the plane defined by the second three-dimensional points 85c acquired at the second position are coplanar. In other words, surface alignment control is performed to match the two surfaces. The correction amount for the robot's drive is set based on the corrected second position of the visual sensor 30.

[0058] Fig. 12 shows a flowchart of the control of the first robot device in this embodiment. The control shown in Fig. 12 includes surface matching control for matching the first surface and the second surface. The first surface is a surface that includes the surface of the workpiece 65 detected at the first relative position and serves as a reference surface for the surface matching control. The second surface is a surface that includes the surface of the workpiece 65 detected at the second relative position. The control shown in Fig. 12 can be performed during teaching work before actual work is performed.

[0059] 9 and 12, in step 111, a first position P30a and a second position P30c of the visual sensor 30 for capturing an image of the workpiece are set. In this embodiment, the operator sets the first position P30a and the second position P30c by operating the teaching pendant 49. The memory unit 42 stores command values ​​for the robot 1 at each position.

[0060] Here, the position of the visual sensor 30 is translated so that the orientation of the visual sensor 30 at the first position P30a is the same as the orientation of the visual sensor 30 at the second position P30b. For example, the visual sensor is moved in the negative direction of the Y axis of the robot coordinate system 71. However, due to errors in the drive mechanism of the robot 1, etc., the visual sensor 30 also moves in the direction of the Z axis.

[0061] Next, in step 112, the command unit 58 drives the robot 1 to move the visual sensor 30 to the first position P30a. In this example, when the visual sensor 30 is placed at the first position P30a, the robot 1 is driven without any error in the actual position and posture of the robot 1 relative to the command values ​​for the robot 1.

[0062] In step 113, the imaging control unit 57 sends a command to the visual sensor 30 to capture an image. The visual sensor 30 captures an image. The position information generation unit 52 generates first three-dimensional position information in the measurement area 91a based on the image from the first camera 31 and the image from the second camera 32. Here, a first three-dimensional point 85a is set on the surface 65a of the workpiece 65 and the surface 69a of the mount 69. The position information generation unit 52 is calibrated so that coordinate values ​​in the sensor coordinate system 72 can be converted to coordinate values ​​in the robot coordinate system 71. The position information generation unit 52 calculates the position of the three-dimensional point 85a in the sensor coordinate system 72. The position information generation unit 52 converts the coordinate values ​​in the sensor coordinate system 72 into coordinate values ​​in the robot coordinate system 71. The position of the first three-dimensional point 85a, as first three-dimensional position information, is calculated using coordinate values ​​in the robot coordinate system 71.

[0063] In step 114, the surface estimation unit 53 calculates surface information for the first surface, which includes the surface 65a of the workpiece 65. The surface estimation unit 53 calculates the equation of a plane including three-dimensional points 85a in the robot coordinate system 71 as the surface information of the first surface. The surface estimation unit 53 excludes three-dimensional points 85a whose coordinate values ​​differ significantly from a predetermined threshold value from the acquired three-dimensional points 85a. Here, the three-dimensional points 85a located on the surface 69a of the platform 69 are excluded. Alternatively, the range within which the plane is estimated in the image may be predetermined. For example, when manually setting the first position and orientation of the visual sensor 30, the operator may specify the range within which the plane is estimated on the image while viewing the image captured by the two-dimensional camera. The surface estimation unit 53 extracts three-dimensional points 85a within the range within which the plane is estimated. Next, the surface estimation unit 53 calculates the equation of a plane in the robot coordinate system 71 so as to align with the point cloud of the three-dimensional points 85a. For example, the equation of the plane of the first surface in the robot coordinate system 71 is calculated by the least squares method so that the error in the coordinate values ​​of the three-dimensional point is reduced.

[0064] Next, in step 115, the command unit 58 moves the visual sensor 30 from the first position P30a to the second position P30c as indicated by the arrow 106. By driving the robot 1, the visual sensor 30 moves.

[0065] In step 116, the imaging control unit 57 sends a command to the visual sensor 30 to capture an image. The visual sensor 30 captures the image. The position information generation unit 52 sets a second three-dimensional point 85c corresponding to the surface 65a of the workpiece 65. The position information generation unit 52 calculates the position of the three-dimensional point 85c as second three-dimensional position information. The position information generation unit 52 calculates the position of the second three-dimensional point 85c using coordinate values ​​in the robot coordinate system 71.

[0066] Next, in step 117, the surface estimation unit 53 calculates surface information of a second surface including the surface 65a of the workpiece 65. The surface estimation unit 53 can exclude the second three-dimensional point 85c located on the surface 69a of the platform 69. Alternatively, the range within which the plane is estimated in the image may be determined in advance. For example, when manually setting the second position and orientation of the visual sensor 30, the operator may specify the range within which the plane is estimated on the screen while viewing the image captured by the two-dimensional camera. The surface estimation unit 53 extracts the three-dimensional points 85c within the range within which the plane is estimated. Next, the surface estimation unit 53 calculates surface information of the second surface based on the positions of the multiple second three-dimensional points 85c. The surface estimation unit 53 calculates, in the robot coordinate system 71, an equation of the second surface including the three-dimensional point 85c using the least squares method.

[0067] Next, in step 118, the determination unit 54 determines whether the first surface and the second surface coincide within a predetermined determination range. Specifically, the determination unit 54 calculates whether the difference between the position and orientation of the first surface and the position and orientation of the second surface is within the determination range. In this example, the determination unit 54 calculates a normal vector from the origin of the robot coordinate system 71 toward the first surface based on the equation of the first surface defined by the first three-dimensional point 85a. Similarly, the determination unit 54 calculates a normal vector from the origin of the robot coordinate system 71 toward the second surface based on the equation of the second surface defined by the second three-dimensional point 85c.

[0068] The determination unit 54 compares the lengths and orientations of the normal vectors of the first and second surfaces. If the difference in the lengths of the normal vectors is within a predetermined determination range, and if the difference in the orientations of the normal vectors is also within a predetermined determination range, it can be determined that the difference in the position and orientation between the first and second surfaces is within the determination range. The determination unit 54 determines that the degree of match between the first and second surfaces is high. If, in step 118, the difference between the position and orientation of the first surface and the position and orientation of the second surface falls outside the determination range, control proceeds to step 119. Note that when the relative position between the visual sensor and the workpiece is changed, the relative orientation between the visual sensor and the workpiece may not change. For example, as shown in FIG. 9 , it may be known in advance that the orientation of the visual sensor will hardly change when the visual sensor is moved relative to the workpiece. If no error occurs in the relative orientation between the workpiece and the visual sensor, evaluation of the relative orientation based on the first and second surfaces of the workpiece may not be performed in step 118. For example, the direction of the normal vector does not need to be evaluated.

[0069] In step 119, the command unit 58 issues a command to change the position and attitude of the robot 1. In this example, the command unit 58 changes the position and attitude of the robot 1 by a small amount. The command unit 58 can execute control to slightly move the position and attitude of the robot 1 in a predetermined direction. For example, the command unit 58 executes control to slightly move the visual sensor 30 vertically upward or downward. Alternatively, the command unit 58 may execute control to drive the drive motor for each drive axis so as to rotate the component member in a predetermined direction by a predetermined angle. Note that if the relative attitude between the visual sensor and the workpiece does not change when the relative position between the visual sensor and the workpiece is changed, the robot attitude does not need to be changed in step 119.

[0070] After changing the position and orientation of the robot 1, control returns to step 116. The processing unit 51 repeats the control of steps 116 to 118. As described above, the control of FIG. 12 executes control to search for the position of the visual sensor 30 where the first surface and the second surface coincide while changing the position of the visual sensor 30. If, in step 118, the difference in position and orientation between the first surface and the second surface is within the determination range, control proceeds to step 120. In this case, referring to FIG. 11, it can be determined that the visual sensor 30 has moved from the second position P30c to the second position P30b.

[0071] Referring to FIG. 12 , in step 120, the correction amount setting unit 55 sets a correction amount for moving the visual sensor 30 from the second position P30c to the second position P30b. The arrow 107 in FIG. 11 corresponds to the correction amount. The memory unit 42 stores the correction amount for driving the robot to place the visual sensor 30 at the second position. In this embodiment, the correction amount setting unit 55 sets a correction amount for the command values ​​for the position and posture of the robot 1. The correction amount is not limited to this example and may be determined by the rotation angle of the drive motor for each drive axis. Furthermore, if the relative posture based on the first and second faces is not evaluated in step 118, it is not necessary to calculate a correction amount for the command value for the posture of the robot.

[0072] In the above embodiment, the degree of match between the first and second faces is determined to be high when the difference between the position and orientation of the first face and the position and orientation of the second face is within the determination range, but this is not limiting. It is also possible to adopt the position and orientation of the robot that has the highest degree of face match after changing the position of the robot a predetermined number of times. The correction amount for the second position may be set based on the position and orientation of the robot 1 at this time.

[0073] Alternatively, referring to FIG. 9 , the correction amount setting unit 55 may set the correction amount based on the coordinate value of a three-dimensional point 85a in the sensor coordinate system 72 at the first position P30a and the coordinate value of a three-dimensional point 85c in the sensor coordinate system 72 at the second position P30c. In this example, the equation of a first plane is calculated in the sensor coordinate system 72 based on the first three-dimensional point 85a, and the equation of a second plane is calculated in the sensor coordinate system 72 based on the second three-dimensional point 85c. The correction amount may then be calculated based on the difference in position and the difference in orientation between the first and second planes. In this example, the correction amount in the Z-axis direction of the sensor coordinate system 72 is calculated. The correction amount in the sensor coordinate system 72 can then be converted into the correction amount in the robot coordinate system 71.

[0074] In the examples shown in FIGS. 8 to 11 , the second position is determined so as to maintain a constant orientation of the visual sensor 30. That is, the second position is determined so as to translate the visual sensor 30 without changing its orientation. However, this is not limiting. The robot 1 in this embodiment is an articulated robot. The robot 1 can change the relative orientation between the workpiece 65 and the visual sensor 30 from a first relative orientation to a second relative orientation. To achieve this, the position and orientation of the visual sensor may be changed from the first position and orientation to a second position and orientation. The processing unit can control the orientation of the visual sensor in the same way as controlling the position of the visual sensor. The correction amount setting unit can set a second position correction amount and a second orientation correction amount of the visual sensor. That is, the correction amount setting unit may set an orientation correction amount in addition to a position correction amount.

[0075] 13 shows a control flowchart for carrying out an actual workpiece transport operation. In the actual operation, the visual sensor is moved to the second position using the correction amount set by the correction amount setting unit 55. In step 131, an operator or other device places the workpiece 65 at a predetermined position on the surface 69a of the platform 69. The workpiece is placed within a measurement area that is the sum of the measurement area of ​​the visual sensor 30 at the first position and the measurement area at the second position.

[0076] In step 132, the operation control unit 43 drives the robot 1 to move the visual sensor 30 to a first position. In step 133, the imaging control unit 57 captures an image with the visual sensor 30. The position information generation unit 52 generates first three-dimensional position information.

[0077] Next, in step 134, the operation control unit 43 drives the robot 1 to move the visual sensor 30 to a corrected second position using the correction amounts for the position and posture of the robot 1 set by the correction amount setting unit 55 during the teaching operation. The operation control unit 43 places the visual sensor at a position that reflects the correction amounts relative to the command values. That is, the operation control unit 43 drives the robot using command values ​​obtained by correcting the position and posture command values ​​(coordinate values) using the correction amounts. Referring to FIG. 11 , the correction amounts are applied as indicated by arrow 107, and the visual sensor 30 is placed at the second position P30b. Note that, in some cases, it is known in advance that no error will occur in the relative posture between the workpiece and the visual sensor, and the correction amount setting unit 55 calculates the correction amount for the robot position, but does not calculate the correction amount for the robot posture. In such cases, the visual sensor 30 may be moved using only the correction amount for the robot position.

[0078] Next, in step 135, the imaging control unit 57 captures an image using the visual sensor 30. The position information generation unit 52 acquires the image from the visual sensor 30 and generates second three-dimensional position information. Because the position of the robot 1 at the second position has been corrected, three-dimensional points located on the surface 65a of the workpiece 65 can be calculated with high accuracy in the robot coordinate system 71. Here, when the robot command values ​​for the second position have been corrected, the position information generation unit 52 converts the positions (coordinate values) of the three-dimensional points expressed in the sensor coordinate system 72 into positions (coordinate values) of the three-dimensional points expressed in the robot coordinate system 71 using the robot command values ​​before correction.

[0079] Next, in step 136, the combining unit 56 combines the first three-dimensional position information acquired at the first position and the second three-dimensional position information acquired at the second position. The three-dimensional position information is the position of a three-dimensional point. In this embodiment, for an area where the measurement area of ​​the visual sensor at the first position overlaps with the measurement area of ​​the visual sensor at the second position, the position of the three-dimensional point that is closer to the visual sensor 30 is used. Alternatively, within the overlapping area, the average position of the position of the three-dimensional point acquired at the first position and the position of the three-dimensional point acquired at the second position may be calculated. Alternatively, both three-dimensional points may be used.

[0080] Next, in step 137, the command unit 58 calculates the position and orientation of the workpiece 65. The command unit 58 excludes, from the acquired three-dimensional points, three-dimensional points whose coordinate values ​​deviate from a predetermined range. That is, the command unit 58 excludes three-dimensional point 85a located on the surface 69a of the base 69. The command unit 58 estimates the contour of the surface 65a of the workpiece 65 using multiple three-dimensional points. The command unit 58 calculates a gripping position on the surface 65a where the hand 5 is located approximately in the center of the surface 65a of the workpiece 65. Furthermore, the command unit 58 calculates the orientation of the workpiece at the gripping position.

[0081] In step 138, the command unit 58 calculates the position and orientation of the robot 1 so that the hand 5 is placed at a gripping position where the workpiece 65 is gripped. In step 139, the command unit 58 sends the position and orientation of the robot 1 to the operation control unit 43. The operation control unit 43 drives the robot 1 to grip the workpiece 65 with the hand 5. Thereafter, the operation control unit 43 drives the robot 1 based on the operation program 41 so as to transport the workpiece 65 to a predetermined position.

[0082] Thus, the control method for the robot device of this embodiment includes the steps of: positioning the relative position between the workpiece and the visual sensor at a first relative position; and generating three-dimensional position information of the surface of the workpiece at the first relative position by a position information generating unit based on output from the visual sensor. The control method also includes the steps of positioning the relative position between the workpiece and the visual sensor at a second relative position different from the first relative position by a robot; and generating three-dimensional position information of the workpiece at the second relative position by a position information generating unit based on output from the visual sensor. The control method also includes the steps of estimating surface information related to a surface including the surface of the workpiece based on the three-dimensional position information by a surface estimating unit. The control method also includes the step of setting a correction amount for driving the robot at the second relative position based on the surface information. The correction amount setting unit sets the correction amount so that a first surface including the surface of the workpiece detected at the first relative position coincides with a second surface including the surface of the workpiece detected at the second relative position.

[0083] In this embodiment, when a single workpiece is measured multiple times using a visual sensor, a correction amount for the robot's drive is set so that the surfaces generated from the respective 3D position information are aligned. Therefore, a robot correction amount can be set that reduces the error in the 3D position information acquired from the output of the 3D sensor. In actual work, by correcting the position and posture of the robot using the set correction amount, 3D points can be set accurately on the surface of the workpiece even when multiple measurements are performed. The surface of the workpiece can be detected accurately, allowing the robot device to perform its work accurately. For example, in this embodiment, the position and posture of the workpiece can be detected accurately, preventing the robot device from failing to grasp the workpiece or from grasping the workpiece unstably. Alternatively, 3D points can be set accurately even when 3D points are supplemented when halation occurs.

[0084] The position and orientation of the robot when the visual sensor is placed at the first position may be adjusted in advance so that they closely match the command values ​​for the position and orientation in the robot coordinate system. In the above embodiment, the robot 1 moves the visual sensor 30 to two positions, thereby placing the workpiece 65 and the visual sensor 30 at two relative positions, but this is not limiting. The robot may change the relative position between the workpiece and the visual sensor to three or more different relative positions. For example, the visual sensor may be moved to three or more positions to perform measurements using the visual sensor.

[0085] At this time, the position information generating unit can generate three-dimensional position information of the workpiece surface at each relative position. The surface estimating unit can estimate surface information at each relative position. Furthermore, the correction amount setting unit can set a correction amount for driving the robot at at least one relative position so that a surface including the workpiece surface detected at the multiple relative positions coincides within a predetermined judgment range.

[0086] For example, the correction amount setting unit may create a reference surface based on three-dimensional position information acquired at one relative position, and correct other relative positions so that surfaces generated from three-dimensional position information acquired at other relative positions coincide with the reference surface.

[0087] When the above-described flat first workpiece 65 is used, the first and second planes are calculated from three-dimensional points set on the surface 65a. Then, the position of the visual sensor is corrected so that the first and second planes coincide. Alternatively, the orientation of the visual sensor may be corrected so that the first and second planes coincide. However, the relative position of the second plane with respect to the first plane in the direction in which the first and second planes extend is not specified. Furthermore, the rotation angles around the normal direction of the first and second planes are not specified.

[0088] 11, for example, it is possible to correct the position of the workpiece 65 in the Z-axis direction of the robot coordinate system 71 and the orientation of the workpiece 65 around the W-axis and P-axis. However, positional errors in the X-axis and Y-axis directions of the robot coordinate system 71 and orientation errors around the R-axis remain. Therefore, it is also possible to use a workpiece having a characteristic portion of a distinctive shape formed on its surface and to correct the positions and orientations of the visual sensor and robot.

[0089] 14 shows a perspective view of a second workpiece 66 and a visual sensor according to this embodiment. The second workpiece 66 is formed in a plate shape. The workpiece 66 has a hole 66b that is circular in plan view. The visual sensor 30 is positioned at a first position P30a and a second position P30c for measurement, thereby detecting the position and orientation of a surface 66a of the workpiece 66.

[0090] Fig. 15 shows a block diagram of a modified example of the surface estimation unit of the first robot apparatus of this embodiment. Referring to Figs. 14 and 15, in this modified example of the first robot apparatus, the surface estimation unit 53 has a feature detection unit 59. The feature detection unit 59 is configured to be able to detect the position of a feature portion of a workpiece. For example, the feature detection unit 59 is configured to perform pattern matching using three-dimensional position information. Alternatively, the feature detection unit 59 is configured to perform pattern matching using two-dimensional images.

[0091] When setting the amount of correction for driving the robot 1 in a teaching operation, the feature detection unit 59 detects the position of the hole 66b of the workpiece 66 in the measurement area 91a based on the first three-dimensional position information acquired at the first position P30a. The feature detection unit 59 also detects the position of the hole 66b of the workpiece 66 in the measurement area 91c based on the second three-dimensional position information acquired at the second position P30c. The surface estimation unit 53 estimates surface information of the first surface and surface information of the second surface.

[0092] The determination unit 54 compares the lengths and directions of the normal vectors of the first and second surfaces, as well as the position of the hole 66b, and can change the position and orientation of the robot in the second position until the difference between the position of the hole in the first three-dimensional position information and the position of the hole in the second three-dimensional position information falls within a determination range.

[0093] The correction amount setting unit 55 sets a correction amount so that the first surface and the second surface coincide within the determination range. Furthermore, the correction amount setting unit 55 can set a correction amount so that the position of the hole 66b in the first three-dimensional position information acquired at the first position coincides within the determination range with the position of the hole 66b in the second three-dimensional position information acquired at the second position. By driving the robot with this correction amount, it is possible to align three-dimensional points in a direction parallel to the direction in which the first surface and the second surface extend. It is possible to align three-dimensional points in the X-axis direction and the Y-axis direction in addition to the W-axis direction, P-axis direction, and Z-axis direction of the robot coordinate system 71. The correction amount for the position and orientation of the robot can be set so that the position of the hole 66b in the second workpiece 66 coincides.

[0094] 16 shows a perspective view of a third workpiece and a visual sensor according to this embodiment. A hole 66b serving as a feature portion of a second workpiece 66 has a circular planar shape. The hole 66b has a point-symmetric planar shape. In contrast, a feature portion having an asymmetric planar shape is formed in a third workpiece 67. The third workpiece 67 is formed in a flat plate shape. The third workpiece 67 has a hole 67b having a triangular planar shape. The feature detection unit 59 can detect the position of the hole 67b in the measurement region.

[0095] The determination unit 54 compares the position of the hole 67b in the first three-dimensional position information with the position of the hole 67b in the second three-dimensional position information. Then, the position and posture of the robot at the second position can be changed until the difference in the position of the hole 67b falls within the determination range. The correction amount setting unit 55 can set the correction amount so that the position of the hole 67b in the three-dimensional position information acquired at the first position coincides with the position of the hole 67b in the three-dimensional position information acquired at the second position.

[0096] The third workpiece 67 has a feature portion with an asymmetric planar shape. Therefore, alignment can be performed around the normal directions of the first and second surfaces. Referring to FIG. 16 , the positions of three-dimensional points in the X, Y, and R axes of the robot coordinate system 71 can be aligned in addition to the W, P, and Z axes. The amount of correction for the position and orientation of the robot 1 can be set so that the position and orientation of the hole 67b in the third workpiece 67 match.

[0097] The third workpiece is an example in which the planar shape of the feature is neither point symmetric nor line symmetric. Asymmetric features may be formed at multiple asymmetric positions on the workpiece. For example, a feature such as a protrusion may be formed at the vertex of the triangle of the hole in the third workpiece.

[0098] In the above embodiment, the case where the workpiece has a flat surface is described, but the present invention is not limited to this. The control in this embodiment can also be applied to a case where the workpiece has a curved surface.

[0099] 17 is a schematic diagram of a fourth workpiece 68 and a visual sensor according to this embodiment. The surface 68a of the fourth workpiece 68 is curved. A first three-dimensional point 85a is set based on the output of the visual sensor 30 located at a first position P30a, and a second three-dimensional point 85c is set based on the output of the visual sensor 30 located at a second position P30c.

[0100] Even in the case of such a curved surface, by controlling the surface alignment in the teaching work similar to that described above, the correction amount setting unit 55 can set a correction amount for driving the robot 1 at the second position P30c so that the first surface including the surface of the workpiece 68 detected at the first position P30a and the second surface including the surface of the workpiece 68 detected at the second position P30c coincide within a predetermined judgment range. In actual work by the robot device, the position and posture of the robot can be corrected based on the correction amount, and three-dimensional position information can be detected.

[0101] Alternatively, if the surface of the workpiece is curved, a reference plane serving as a reference for the surface 68a of the workpiece 68 can be set in advance in three-dimensional space. The shape of the surface 68a can be generated, for example, based on three-dimensional shape data output from a CAD (Computer Aided Design) device. To determine the position of the surface 68a of the workpiece 68 in the robot coordinate system 71, the workpiece 68 is first placed on a stand. Next, a touch-up pen is attached to the robot 1, and the touch-up pen is brought into contact with contact points set at multiple positions on the surface 68a of the workpiece 68. The positions of the multiple contact points are detected in the robot coordinate system 71. Based on the positions of the multiple contact points, the position of the workpiece 68 in the robot coordinate system 71 can be determined, and a reference plane in the robot coordinate system 71 can be generated. The memory unit stores the generated reference plane of the workpiece 68.

[0102] The processing unit can adjust the first position and the second position of the visual sensor 30 so that they match the shape and position of the reference surface of the workpiece 68. The correction amount setting unit 55 can calculate the position and orientation of the robot 1 so that the first surface matches the reference surface. The correction amount setting unit 55 can also calculate the position and orientation of the robot 1 so that the second surface matches the reference surface. The correction amount setting unit 55 can then calculate the correction amount for driving the robot 1 at each position.

[0103] When a reference plane corresponding to the surface of the workpiece is generated in advance using the output of a CAD device or the like, it is preferable that the measurement area at the first position and the measurement area at the second position substantially overlap, which is suitable for control to interpolate missing three-dimensional points due to halation.

[0104] In the above embodiment, the position and orientation of the visual sensor are changed by the robot, while the position and orientation of the workpiece are fixed, but this is not limiting and the robot device can adopt any form that changes the relative position between the workpiece and the visual sensor.

[0105] 18 shows a side view of a second robot apparatus according to this embodiment. In the second robot apparatus 7, the position and orientation of the visual sensor 30 are fixed, and the robot 4 changes the position and orientation of the workpiece 64. The second robot apparatus 7 includes a robot 4 and a hand 6 attached to the robot 4 as a work tool. The robot 4 is a six-axis vertical articulated robot, similar to the robot 1 of the first robot apparatus 3. The hand 6 has two fingers facing each other. The hand 6 is configured to grip the workpiece 64 by pinching it between the fingers.

[0106] Like the first robot device 3, the second robot device 7 includes a control device 2 that controls the robot 4 and the hand 6. The second robot device 7 also includes a visual sensor 30 as a three-dimensional sensor. The position and orientation of the visual sensor 30 are fixed by a mount 35 as a fixing member.

[0107] The second robot device 7 of this embodiment inspects the surface 64a of the workpiece 64. For example, the processing unit can inspect the shape of the contour of the surface of the workpiece 64 and the shape of the characteristic portions formed on the surface of the workpiece 64 based on the synthesized three-dimensional position information of the workpiece 64. The processing unit can determine whether each variable is within a predetermined determination range.

[0108] The second robot device 7 generates three-dimensional position information of the surface 64a of the workpiece 64 based on the output of the visual sensor 30. The surface 64a of the workpiece 64 is larger than the measurement area 91 of the visual sensor 30. Therefore, the robot device 7 places the workpiece 64 at a first position P70a and generates first three-dimensional position information. The robot device 7 also places the workpiece 64 at a second position P70c and generates second three-dimensional position information. In this manner, the robot 4 moves the workpiece 64 from the first position P70a to the second position P70c, thereby changing the relative position between the workpiece 64 and the visual sensor 30 from the first relative position to the second relative position. In this example, the robot 4 moves the workpiece 64 horizontally, as indicated by arrow 108. At the second position P70c, the second position P70c may deviate from the desired position due to a driving error in the robot's driving mechanism.

[0109] The position information generating unit 52 of the second robot device generates first three-dimensional position information based on the output of the visual sensor 30 that captured an image of the surface 64a of the workpiece 64 placed at the first position P70a. The position information generating unit 52 also generates second three-dimensional position information based on the output of the visual sensor 30 that captured an image of the surface 64a of the workpiece 64 placed at the second position P70c.

[0110] The surface estimation unit 53 generates surface information for the first and second surfaces, including the surface 64a, based on the respective three-dimensional position information. The correction amount setting unit 55 can set a correction amount for driving the robot 4 at the second position P70c so that the first surface estimated from the first three-dimensional position information and the second surface estimated from the second three-dimensional position information coincide within a predetermined determination range. During actual inspection work, the position and orientation of the robot at the second position can be corrected based on the correction amount set by the correction amount setting unit 55.

[0111] The second robot device 7 can also suppress errors in the three-dimensional position information caused by driving errors of the robot 4. By driving the robot 4 based on the correction amount for driving the robot 4 at the second position, the robot device 7 can perform accurate inspection.

[0112] The other configurations, actions, and effects of the second robotic device are similar to those of the first robotic device, and therefore will not be described again here.

[0113] The three-dimensional sensor of this embodiment is a visual sensor including two two-dimensional cameras, but is not limited to this configuration. The three-dimensional sensor can be any sensor capable of generating three-dimensional position information of the surface of a workpiece. For example, a time-of-flight (TOF) camera that acquires three-dimensional position information based on the time of flight of light can be used as the three-dimensional sensor. Furthermore, the stereo camera serving as the visual sensor of this embodiment includes a projector, but is not limited to this configuration. The stereo camera does not necessarily need to include a projector.

[0114] In this embodiment, the control device that controls the robot functions as a processing unit that processes the output of the 3D sensor, but this is not a limitation. The processing unit may be configured as a processing device (computer) different from the control device that controls the robot. For example, a tablet terminal that functions as a processing unit may be connected to the control device that controls the robot.

[0115] The robot device of this embodiment performs the work of transporting or inspecting a workpiece, but is not limited to this form. The robot device can perform any work. Furthermore, the robot of this embodiment is a vertical articulated robot, but is not limited to this form. Any robot that moves a workpiece can be used. For example, a horizontal articulated robot can be used.

[0116] The above-described embodiments can be combined as appropriate. In each of the above-described controls, the order of steps can be changed as appropriate within the scope that does not change the functions and actions.

[0117] In the above-mentioned drawings, the same or equivalent parts are denoted by the same reference numerals. Note that the above-mentioned embodiments are merely examples and do not limit the invention. Furthermore, the embodiments include modifications of the embodiments as set forth in the claims.

[0118] 1, 4 Robot 2 Control device 3, 7 Robot device 5, 6 Hand 24 Processing device 30 Visual sensor P30a, P30b, P30c Position 51 Processing unit 52 Position information generation unit 53 Surface estimation unit 55 Correction amount setting unit 56 Synthesis unit 64, 65, 66, 67, 68 Workpiece 64a, 65a, 66a, 67a, 68a Surface 66b, 67b Hole P70a, P70c Position 81 Range image 85, 85a, 85b, 85c 3D point

Claims

1. A robot device comprising: a three-dimensional sensor for detecting the position of a workpiece surface; a robot that changes the relative position between the workpiece and the three-dimensional sensor; a position information generation unit that generates three-dimensional position information of the workpiece surface based on the output of the three-dimensional sensor; a surface estimation unit that estimates surface information regarding a surface including the workpiece surface based on the three-dimensional position information; and a correction amount setting unit that sets a correction amount for driving the robot, wherein the robot is configured to change the relative position between the workpiece and the three-dimensional sensor from a first relative position to a second relative position different from the first relative position, and the correction amount setting unit sets a correction amount for driving the robot at the second relative position based on the surface information so that a first surface including the workpiece surface detected at the first relative position coincides with a second surface including the workpiece surface detected at the second relative position.

2. A robot device according to claim 1, wherein the robot is configured to change the relative posture between the workpiece and the three-dimensional sensor from a first relative posture to a second relative posture.

3. A robot device according to claim 1 or 2, wherein the three-dimensional sensor is attached to the robot, the workpiece is positioned so that its position and posture are fixed, and the robot changes the relative position between the workpiece and the three-dimensional sensor from a first relative position to a second relative position by moving the three-dimensional sensor from a first position to a second position.

4. A robot device according to claim 1 or 2, comprising a work tool attached to the robot and configured to grip the workpiece, wherein the position and orientation of the three-dimensional sensor are fixed by a fixing member, and the robot changes the relative position between the workpiece and the three-dimensional sensor from a first relative position to a second relative position by moving the workpiece from a first position to a second position.

5. A robot device according to any one of claims 1 to 4, wherein the robot changes the relative position between the workpiece and the three-dimensional sensor to three or more different relative positions, the position information generation unit generates three-dimensional position information of the surface of the workpiece at each relative position, the surface estimation unit estimates the surface information at each relative position, and the correction amount setting unit sets a correction amount for driving the robot at at least one relative position so that a surface including the surface of the workpiece detected at multiple relative positions coincides within a predetermined judgment range.

6. A robot device as described in claim 1, comprising a synthesis unit that synthesizes multiple pieces of three-dimensional position information of the surface of the workpiece obtained at multiple relative positions, wherein the synthesis unit synthesizes three-dimensional position information generated at a first relative position and three-dimensional position information generated at a second relative position corrected based on the correction amount set by the correction amount setting unit.

7. A method for controlling a robot device, comprising the steps of: a robot positioning the relative position between a workpiece and a three-dimensional sensor at a first relative position; a position information generating unit generating three-dimensional position information of the surface of the workpiece at the first relative position based on the output of the three-dimensional sensor; a robot positioning the relative position between the workpiece and the three-dimensional sensor at a second relative position different from the first relative position; a position information generating unit generating three-dimensional position information of the surface of the workpiece at the second relative position based on the output of the three-dimensional sensor; a surface estimating unit estimating surface information regarding a surface including the surface of the workpiece based on the three-dimensional position information at each relative position; and a correction amount setting unit setting a correction amount for driving the robot at the second relative position based on the surface information so that a first surface including the surface of the workpiece detected at the first relative position coincides with a second surface including the surface of the workpiece detected at the second relative position.