1. Field of the Invention
The present invention relates to a teaching position correcting device for a robot. Particularly, the invention relates to a teaching position correcting device that is used to correct a teaching position of a motion program for a robot when at least one of the robot and an object to be worked is moved.
2. Description of the Related Art
When a production line using a robot is moved, one of or both the robot and an object to be worked, i.e., a workpiece, are often moved as in the following cases.
When the line facility is moved, there occurs a difference in the positions of the robot and the workpiece after the move. Therefore, a motion program for the robot that is taught before the line is moved cannot be used as it is, and the teaching position needs to be corrected. An operator corrects the motion program while confirming each teaching position by matching it with the workpiece. This teaching correction work is very troublesome. Particularly, when the line that uses many robots in a spot welding of an automobile is to be moved, the number of steps of this teaching correction work is enormous.
In order to shorten the time required for the teaching correction work after the line move, the following methods are so far used, either independently or in combination.
Mark-off lines, markings, and a fixture are used to install robots and peripheral machines such that their relative positions before and after the line move are as identical as possible.
A tool center point (hereinafter abbreviated as TCP) of the robot is touched up to three or more reference points on the workpiece or on a holder that holds the robot (i.e., the TCP is exactly matched with the reference points). A three-dimensional position of each reference point, Pi(Xi, Yi, Zi) [i=1, . . . , n; n≧3], is measured. Three or more reference points of the workpiece or the holder before and after the movement are measured, respectively. A positional change of the workpiece or the holder between the positions before and after the move is obtained from the measured reference points. The teaching position of the robot program is shifted corresponding to this positional change.
Concerning calibration to be described later, the following documents are available: Roger Y. Tsai and Reimar K. Lenz, “A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/Eye Calibration”, IEEE Trans. on Robotics and Automation, Vol. 5, No. 3, 1989, pp. 345-358, and Japanese Patent Application Unexamined Publication No. 10-63317.
According to the above methods using mechanical means, positional precision after the re-setting is usually about a few centimeters, and it is practically difficult to secure higher precision. Therefore, teaching correction work to solve the remaining error is unavoidable. It is difficult to match a three-dimensional orientation change due to falling or inclining, for example. The precision of a fall or a decline depends on a visual observation by a setting operator.
The above method of changing the robot program according touchup is based on positional data of the workpiece or the holder obtained by measuring their positions before and after the move using the touchup of the robot. However, in actual practice, the finally obtained program cannot easily achieve high-precision work because of presence of both or one of a setting error of the TCP of the robot and a positioning error of the touchup to the reference points. According to the TCP setting or the touchup, the robot is manually operated by jog feed or the like, and the TCP of the robot is matched with a target point. In this case, the TCP setting and the positioning have different precision levels depending on the orientation of the robot when TCP setting and positioning are carried out or depending on operator's skill. Particularly, because positioning is carried out based on visual measurement, even a skilled operator cannot achieve high-precision work. Therefore, it becomes essential to correct each teaching position after the shifting.
It takes time to correctly carry out TCP setting and touchup. In many cases, the total time required to correct teaching positions hardly differs from the time required to correct teaching positions without shifting by touchup. Therefore, the shifting by touchup is not often used.
As described above, despite users' request for carrying out an accurate correction of teaching positions associated with the shifting of the robot and the workpiece in a short time, there is no practical method to achieve this.
The present invention has been made to solve the above problems, and has an object of providing a device that can easily correct in high precision teaching positions after a shifting and can reduce load on an operator who corrects the teaching associated with the shifting.
According to one aspect of the present invention, there is provided a teaching position correcting device that corrects a teaching position of a motion program for a robot equipped with a robot mechanical unit. The teaching position correcting device includes: a storage that stores the teaching position of the motion program; a vision sensor that is provided at a predetermined part of the robot mechanical unit, and measures a position and orientation of the vision sensor relative to the predetermined part and a three-dimensional position of each of at least three sites not aligned in a straight line on an object to be worked by the robot; a position calculator that obtains a three-dimensional position of each of the at least three sites before and after a change respectively of a position of the robot mechanical unit relative to the object to be worked, based on measured data obtained by the vision sensor; and a robot control device that corrects the teaching position of the motion program stored in the storage, based on a change in the relative position obtained by the position calculator.
In this case, the robot mechanical unit has an end effector that works the object, and the vision sensor can be attached to the end effector.
According to another aspect of the present invention, there is provided another teaching position correcting device that corrects a teaching position of a motion program for a robot equipped with a robot mechanical unit. The teaching position correcting device includes: a storage that stores the teaching position of the motion program; a vision sensor that is provided at a predetermined part of other than the robot mechanical unit, and measures a three-dimensional position of each of at least three sites not aligned in a straight line on an object to be worked by the robot and a three-dimensional position of each of at least three sites not aligned in a straight line on the robot mechanical unit; a position calculator that obtains a three-dimensional position of each of the at least three sites of the object to be worked and a three-dimensional position of each of the at least three sites of the robot mechanical unit before and after a change respectively of a position of the robot mechanical unit relative to the object to be worked, based on measured data obtained by the vision sensor; and a robot control device that corrects the teaching position of the motion program stored in the storage, based on a change in the relative position obtained by the position calculator.
In this case, the vision sensor is attached to another robot mechanical unit of a second robot different from the above robot.
The vision sensor is detachably attached to the robot mechanical unit, and can be detached from the robot mechanical unit when the vision sensor stops measuring of the three-dimensional positions of the at least three sites of the object.
A position and orientation of the vision sensor relative to the robot mechanical unit can be obtained by measuring a reference object at a predetermined position from plural different points, each time when the vision sensor is attached to the robot mechanical unit.
The at least three sites of the object can be shape characteristics that the object has.
Alternatively, the at least three sites of the object can be reference marks formed on the object.
The vision sensor can have a camera that carries out an image processing, and the camera can obtain a three-dimensional position of a measured site by imaging the measured part at plural different positions. This camera can be an industrial television camera, for example.
The vision sensor can be a three-dimensional vision sensor. The three-dimensional vision sensor can be a combination of an industrial television camera and a projector.
According to any one of the above aspects of the invention, the vision sensor mounted on the robot mechanical unit measures three-dimensional positions of plural specific sites on the object to be worked. Based on three-dimensional positions measured before and after the shifting respectively, a coordinate conversion necessary to correct the teaching position is obtained. By working the coordinate conversion on the teaching position data of the motion program, the teaching position of the program is corrected.
The above and other objects, features and advantages of the present invention will be made more apparent by the following description of the preferred embodiments thereof, with reference to the accompanying drawings wherein:
A teaching position correcting device according to embodiments of the present invention is explained below with reference to the drawings. As shown in
A teaching board 18 that is connected to the teaching board interface 13 can have a usual display function. An operator prepares, corrects, and registers a motion program for a robot by manually operating the teaching board 18. The operator also sets various parameters, operates the robot based on the taught motion program, jog feeds, in the manual mode. A system program that supports the basic function of the robot and the robot control device is stored in the ROM of the memory 12. The motion program (in this case, a spot welding) of the robot taught according to the application and relevant set data are stored in the non-volatile memory of the memory 12. A program and parameters used to carry out the processing relevant to the correction of the teaching position data to be described later are also stored in the non-volatile memory of the memory 12. The RAM of the memory 12 is used for a storage area to temporarily store various data processed by the CPU 11.
The servo control 15 has servo controllers #1 to #n, where n is a total number of axes of the robot, and n is assumed to be equal to 6 in this case. The servo control 15 receives a shift command prepared through operations (such as a path plan preparation, and interpolation and an inverse transformation based on the plan) to control the robot. The servo control 15 outputs torque commands to servo amplifiers A1 to An based on the shift command and feedback signals received from pulse coders not shown belonging to the axes. The servo amplifiers A1 to An supply currents to servomotors of the respective axes based on the torque commands, thereby driving the servomotors. The communication interface 14 is connected to the position calculator, that is, an image processing unit 2 shown in
The image processing unit 2 has a block configuration as shown in
A camera as an imaging unit of a vision sensor 3, that is, a CCD (charge-coupled device) camera in this case, is connected to the camera interface 23. When the camera receives an imaging command via the camera interface 23, the camera picks up an image using an electronic shutter function incorporated in the camera. The camera sends a picked-up video signal to the frame memory 26 via the camera interface 23, and the frame memory 26 stores the video signal in the form of a grayscale signal. A display such as a CRT (cathode ray tube) or an LCD (liquid crystal display) is connected to the monitor interface 24, as a monitor 2a (refer to
The image processor 22 analyses the video signal of the workpiece stored in the frame memory 26. The image processor 22 recognizes selected reference marks 6a, 6b, and 6c, not aligned in a straight line, that indicate positions of three sites on a holder 5. Based on this recognition, a three-dimensional position of each of the marks 6a, 6b, and 6c is obtained, as described later in detail. A program and parameters for this purpose are stored in the non-volatile memory 27. The RAM 28 temporarily stores data that the CPU 20 uses to execute various processing. The communication interface 29 is connected to the robot control device via the communication interface 14 at the robot control device side.
Referring back to
The motion program for the robot that carries out a welding is taught in advance, and is stored in the robot control device 1a. The vision sensor (i.e., a sensor head) 3 is connected to the image processing unit 2. The image processing unit 2 processes an image input from the vision sensor 3, and detects a specific point or a position of a shape characteristic within the sensor image.
According to the present embodiment, the vision sensor 3 is the CCD camera that picks up a two-dimensional image. The vision sensor 3 is detachably attached to a predetermined part such as the work tool 1d of the robot, with suitable fitting means, such as absorption utilizing a permanent magnet or clamping using a vise function, for example. The vision sensor 3 can be once detached from the work tool 1d after a measuring before the shifting described later, and mounted again after the shifting. Otherwise, the work tool 1d can be shifted in a state of being mounted with the vision sensor 3, when this has no problem. In the former case, one vision sensor can be used to correct teaching positions of plural robots. A relative relationship between a coordinate system Σf of a mechanical interface on a final link of the robot 1 and a reference coordinate system Σc of the vision sensor can be set in advance, or can be set by calibration when the vision sensor 3 is fitted to the work tool 1d. When the vision sensor 3 is once detached after the measuring before the shifting, calibration is also carried out after the shifting. The vision sensor is calibrated according to a known technique, which is briefly explained later.
As described above, according to the present invention, when a position of the robot 1 changes relative to the object after at least one of the robot 1 and the holder 5 is shifted, the teaching position of the motion program for the welding robot can be completely corrected easily and accurately. For this purpose, in this embodiment, a processing procedure described in a flowchart shown in
In the flowchart shown in
Step 100: The vision sensor (i.e., CCD camera) 3 is fitted to the work tool 1d. When the vision sensor 3 has a sensor head equipped with a camera and a projector, this sensor head is fitted to the work tool 1d. The vision sensor 3 is detachably fitted, and is once detached later (refer to step 150).
Step 101: A sensor fitting position and orientation is calibrated to obtain a relative position and orientation relationship between the coordinate system Σf of a final link of the robot and the reference coordinate system Σc of the fitted vision sensor (i.e., camera). A known calibration method can be suitably used.
The operator shifts, in a manual mode like jog feed, the robot to a first position A1 where the reference object R is within the field of vision of the vision sensor. The operator operates the keyboard of the image processing unit, to instruct the input of an image for a first calibration. The image processing unit 2 picks up an image from the vision sensor. The image processing unit analyzes the reference object R for calibration, and obtains data of a position and orientation [D1] of the reference object R viewed from the sensor coordinate system Σc, from the positions of the dots on the image, dot intervals, and a dot layout. At the same time, the image processing unit fetches a position and orientation [A1] of the coordinate system Σf of the final link at the imaging time, from the robot control device via the communication interface, and stores [D1] and [A1] into the memory of the image processing unit.
Similarly, the robot is moved to a separate position A2, and [D2] and [A2] are stored. Further, the robot is moved to a position A3 that is not aligned in a straight line connecting between A1 and A2, and [D3] and [A3] are stored. In general, [Di] and [Ai] are obtained at three or more different positions not aligned in a straight line. The image processing unit calculates a position and orientation [S] of the sensor coordinate system Σc relative to the final link Σf, from plural pairs of [Di] and [Ai] obtained in this way, and stores the calculates result [S]. Several methods of calculating [S] are known and, therefore, a detailed explanation is omitted (refer to “A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/Eye Calibration”, IEEE Trans. on Robotics and Automation, Vol. 5, No. 3, 1989, pp. 345-358).
Several methods of calibrating a three-dimensional vision sensor having a camera and a projector combined together are also known and, therefore, a detailed explanation is omitted (for example, refer to Japanese Patent Application Unexamined Publication No. 10-63317).
In the above example, the relationship between the coordinate system Σf of a final link and the reference coordinate system Σc of the vision sensor is set by calibration. When a camera fitting fixture is designed to be able to fit the vision sensor to the final link of the robot in the same position and orientation each time, calibration can be omitted and a relationship between Σc and Σf known in advance can be set to the image processing unit from the input unit like the keyboard.
When calibration is carried out each time when the vision sensor is fitted like in the present embodiment, it is not necessary to take into account the precision of fitting the vision sensor to the work tool. In other words, even when the fitting of the vision sensor to the work tool has an error, calibration can absorb this error, and therefore, there is an advantage that the fitting error does not affect the precision of measurement. When high repeatability of position and orientation is not required at each fitting time, this also has an advantage of being able to use a simple fitting mechanism such as a magnet or a vise mechanism.
Steps 102, 103, 104 and 105: After ending the calibration, three-dimensional positions of the first to the third reference marks (refer to 6a to 6c in
Instead of artificially providing the reference marks, ready-made parts having a shape characteristic, when present, can be used. Holes and corners of which positions can be accurately obtained by image processing are preferable for these parts. There is no particular limit to the parts so long as they have a feature of which position the vision sensor can detect. A part of or the whole reference marks, or alternative shape characteristics or characteristic parts, may be provided on the workpiece 4.
Specifically, as shown in
Next, the operator shifts the robot from B1 to a position B1′a certain distance from B1. The image processing unit picks up the image of the sensor based on the instruction from the operator, detects the position of the first reference mark 6a on the image, and fetches a robot position [B1′], in a similar manner to that of fetching the position at B1.
The position of the sensor coordinate system Σc at [B1] and [B1′] in the robot coordinate system is obtained from [B1], [B1′], and the position and orientation [S] of the sensor coordinate system Σc relative to the final link Σf obtained by the calibration. Using this position and the position of the mark 6a on the image detected at [B1] and [B1′], a three-dimensional position P1(x1, y1, z1) of the mark 6a in the robot coordinate system can be obtained, based on a known stereo view principle. When the vision sensor is a three-dimensional vision sensor using a projector, the position P1(x1, y1, z1) of each reference mark can be measured by imaging at one robot position.
The obtained position P1(x1, y1, z1) is sent to the robot control device via the communication interface, and is stored in the memory within the robot control device. The resolution of a general vision sensor is from 1/500 to 1/1000 or above of the range of the field of vision. Therefore, the vision sensor can measure positions of the reference marks in substantially higher precision than that achieved by visual observation.
Similarly, the operator shifts the robot to positions where the second and third reference marks 6b and 6c are within the field of vision of the sensor respectively, measures three-dimensional positions P2(x2, y2, z2) and P3(x3, y3, z3) of the second and third marks respectively, and stores these three-dimensional positions in the memory within the robot control device. To shift the robot to each measuring position, the operator can manually shift the robot by jog feed. Alternatively, a robot motion program to measure the mark measuring positions is prepared in advance, and each measuring position is taught to the motion program. The measured positions of the three reference marks can be stored in the memory of the image processing unit.
Step 150: After the reference marks are measured before the shifting, the vision sensor can be detached or does not need to be detached from the work tool. The robot 1 and the holder 5 are shifted to separate positions, and are set up again.
Steps 200 and 201: After the shifting, the vision sensor is fitted to the front end of the robot work tool again, and calibration is carried out again in the same process as that before the shifting. When the vision sensor is kept fitted to the front end of the robot work tool, these steps can be omitted.
Steps 202, 203, 204 and 205: In the layout after the shifting, positions of the reference marks 6a, 6b and 6c on the holder are measured again in the same process as that before the shifting. Obtained mark positions after the shifting, P1′(x1′, y1′, z1′), P2′(x2′, y2′, z2′) and P3′(x3′, y3′, z3′) are stored. At this stage, the reference mark positions before the shifting, P1(x1, y1, z1), P2(x2, y2, z2) and P3(x3, y3, z3), and the reference mark positions after the shifting, P1′(x1′, y1′, z1′), P2′(x2′, y2′, z2′) and P3′(x3′, y3′, z3′), for the three reference marks on the holder 5 are stored in the memory of the robot control device.
The operator operates the robot teaching board 18 to instruct the motion program of which teaching positions should be corrected. Next, the operator instructs the memory area in which the positions of the three reference marks before and after the shifting respectively are stored, and instructs to correct the teaching positions of the motion program.
Step 300: The robot control device calculates a matrix [W1] that expresses the position and orientation of the holder before the shifting, from the reference mark positions P1, P2 and P3 before the shifting.
Step 301: The robot control device calculates a matrix [W2] that expresses the position and orientation of the holder after the shifting, from the reference mark positions P1′, P2′ and P3′ after the shifting.
These matrices before and after the shifting have the following relationship, where P denotes the teaching position before the shifting and P′ denotes the teaching position after the shifting.
inv[W1]P=inv[W2]P′ (1)
where inv[Wi] is an inverse matrix of [Wi].
From the above expression, using W1, W2 and P, the teaching position P′ to be corrected after the shifting is obtained as follows.
P′=[W2]inv[W1]P (2)
Therefore, when the matrix [W2] inv[W1]P is multiplied to the teaching position P before the shifting on the left side, the teaching position after the shifting can be obtained. Based on this, [W2] inv[W1]P is calculated within the robot control device.
Step 302: Coordinate conversion is carried to each teaching position of the assigned motion program, using the above expression (2). As a result, the teaching position after correcting the relative positional deviation between the robot and the object due to the shifting can be obtained.
The mounting of the vision sensor onto the work robot having the end effector is explained above. As another embodiment of the present invention, a second robot 1′ including another robot mechanical unit 1b′ can be provided in addition to the robot 1 that carries out the work, as shown in
For this purpose, as shown in
When the reference marks are set to the sites of which positions change according to the orientation of the robot mechanical unit 1b, preferably the robot mechanical unit 1b takes the same orientation at the measuring time before the shifting and at the measuring time after the shifting. When the robot mechanical unit 1b takes a different orientation, it is necessary to obtain a change in the position of the robot after the shifting by taking the difference of orientations into consideration. This requires a complex calculation, and can easily generate error.
To shift the program, a position of the robot mechanical unit 1b relative to the other robot mechanical unit 1b′ mounted with the vision sensor is calculated based on the three reference marks 7a to 7c of the robot mechanical unit 1b. This relative position is calculated in the same method as that used to calculate the position based on the reference marks 6a to 6c in the above embodiment, and therefore, a detailed explanation of this calculation is omitted.
A position (i.e., a matrix) of the holder 5 relative to the robot mechanical unit 1b is calculated using the obtained position of the robot mechanical unit 1b. The teaching position is shifted at step 300 and after in the same method as that used in the above embodiment (where the measuring robot and the robot of which teaching positions are corrected are the same).
According to the present invention, the number of steps of teaching correction work due to the shifting can be decreased by taking advantage of the following effects (1) and (2).
(1) The vision sensor measures positions, without using a touchup method which involves positioning based on visual recognition. Therefore, a high-precision measuring, which cannot be achieved based on visual recognition, can be achieved. Because visual confirmation is not necessary, the measurement does not depend on the skill of the operator. Because the vision sensor automatically carries out the measurement, the work is completed in a short time.
(2) The vision sensor recognizes the positions and orientations of the front end of the arm of the robot and the vision sensor, by looking at a reference object from plural points. Therefore, the vision sensor can be mounted when necessary. The position and orientation of a part where the vision sensor is mounted does not require high precision. Therefore, the work can be carried out easily.
While the invention has been described with reference to specific embodiments chosen for the purpose of illustration, it should be apparent that numerous modifications could be made thereto, by one skilled in the art, without departing from the basic concept and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2003-388160 | Nov 2003 | JP | national |
Number | Date | Country | |
---|---|---|---|
Parent | 10989432 | Nov 2004 | US |
Child | 12222002 | US |