Abstract:
An apparatus for controlling a robot having multi-articulation-type arms with a high accuracy. Work point data and work point instructions for the robot are stored in a main storage section, while data representing the present position of an operating end of the arm of the robot is stored in a present point storage section. Reference position data is stored in a reference point storage section. A central processing unit produces a signal for instructing the robot to effect predetermined operations on the basis of the work point data, the work procedure instructions, the present position data, and the reference point data. A correction section determines a deviation of the operating end of the robot from positional data corresponding to the present position and corrects the stored positional data on the basis of the determined deviation.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a robot control apparatus, and more particularly to a robot control apparatus in which the actual spatial position of an operating member is made to be completely coincident with the stored data representing the position. 
     FIGS. 1A and 1B are schematic diagrams showing a robot of the two-arm horizontal articulation type, viewed from above, as an example to which the present invention is applied. In FIGS. 1A and 1B, reference numeral 1 designates a first arm which rotates about a first shaft (or pin) 3 provided at one end of the first arm 1, and 2 designates a second arm which rotates about a second shaft 4 rotatably provided at the other end of the first arm 1. By rotating the first and second arms 1 and 2 through predetermined angles, the other end of the second arm 2 can be brought into a predetermined desired operating position. Further, reference numeral 5 designates a position confirmation switch mechanically fixed to the first shaft 3 and used for establishing a reference point of the first arm 1, 6 designates a dog attached to the first arm 1 on the side of the first shaft 3 and on the center line of the first arm 1 corresponding to the position confirmation switch 5, 7 designates a position confirmation switch mechanically fixed to the first arm 1 at its end on the side of the second arm 2 for establishing a reference point of the second arm 2, and 8 designates a dog attached to the second arm 2 on the side of the first arm 1 and on the center line of the second arm 2 corresponding to the position confirmation switch 7. Thus, the pair of the position confirmation switch 5 and the dog 6 are disposed opposite one another on the center line of the first arm 1, and the pair of the position confirmation switch 7 and the dog 8 are disposed opposite one another on the center line of the first arm 2. FIG. 1B shows the state of the robot in which the respective arms 1 and 2 are returned to their reference points. 
     The operation of a robot 9 having such an arrangement as described above is controlled by a control device 10 as shown in FIG. 2. In FIG. 2, reference numeral 11 designates a main storage section for storing the data of work points, the work procedure, etc., of the robot, 13 designates a reference point storage section for storing the positional data of the respective arms 1 and 2 when they are returned to their reference points, 14 is a central processing unit (CPU) for effecting various control routines such as positional control for the robot 9 and control of external apparatuses, and 15 designates an instruction output section for providing an output to a servomotor of the robot 9. On the basis of the work point data and the work procedure stored in the main storage section 11, the present position data stored in the present point storage section 12, and the reference position data stored in the reference point storage section 13, the CPU 14 computes and sends instructions to the robot 9 through the instruction output section 15 so as to cause the robot 9 to perform predetermined desired movements. The positional data stored in the present point storage section 12 and the reference point storage section 13 includes, for example, as shown in FIG. 3, data representing the angle θ 1  between the X axis of a reference orthogonal coordinate system and the first arm 1 (more specifically, the center line of the first arm 1) and the angle θ 2  between an extension line (broken line) of the first arm 1 and the second arm 2. 
     In the thus arranged conventional robot control device, when the operational control is initiated (power-on time), it is necessary to confirm the positions of the arms 1 and 2 and store them in the present point storage section 12 because the content of the present point storage section 12 is then in a blank state. For this, in starting, reference point return is effected whereby the actual spatial positions of the respective arms 1 and 2 are caused to agree with the stored data of the respective arms 1 and 2. For example, if the arms 1 and 2 are in the position shown in FIG. 1A, the arm 1 is rotated about the shaft 3 until the position confirmation switch 5 aligns with the dog 6, and at the same time the arm 2 is rotated about the shaft 4 until the position confirmation switch 7 aligns with the dog 8, thereby bringing the arms 1 and 2 to their reference points as shown in FIG. 1B. 
     Upon the confirmation of alignment between the pair of the position confirmation switch 5 and the dog 6 and between the pair of the position confirmation switch 7 and the dog 8, the respective arms 1 and 2 are in their reference point returned states as shown in FIG. 1B. Upon the detection of alignment between the pair of the position confirmation switch 5 and the dog 6 and between the pair of the position confirmation switch 7 and the dog 8, the CPU 14 transfers the positional data θ 10  and θ 20  stored in the reference point storage section 13 to the present point storage section 12, and the actual spatial positions of the respective arms 1 and 2 are then made coincident with the stored positional data. Since the position confirmation switches 5 and 7 and the dogs 6 and 8 are mechanically fixed, the positions of the respective arms 1 and 2 do not vary when they are returned to their reference points. Thereafter, positional control of the robot is performed on the basis of the positional data stored in the present point storage section 12 and in accordance with the work procedure stored in the main storage section 11. That is, when the tip (free) end of the composite robot arm is to be moved to a predetermined work point according to the procedure stored in the main storage section 11, the amount of movement of each of the arms 1 and 2 is computed by the CPU 14 such that the present position data, which is stored in the present point storage section 12 and which is successively updated in accordance with the movement, agrees with the positional data of the predetermined work point. 
     For positional control of robot to be performed in the manner as described above, initial agreement between the actual spatial positions of the reference points of the arms 1 and 2 and the stored positional data of the reference points is a prerequisite. It is difficult, however, to attach the position confirmation switches and the dogs at the positions of their reference points with a high accuracy, even if the positions of their reference points are accurately determined in the design stage, because of errors in assembly and/or manufacturing tolerances. In the case where disagreement between such positions exists, that is when the actual spatial positions θ 11  and θ 21  (FIG. 4, solid line) do not agree with the positional data θ 12  and θ 22  (FIG. 4, broken line) stored in the reference point storage section 13, in order to move the tip end of the robot in the positive direction of the Y axis and parallel to the Y axis, the CPU 14 carries out its computations on the basis of the stored date θ 12  and θ 22 , thereby causing the instruction output section 15 to produce an instruction which causes the tip end of the robot arm to pass through the linear path between the points a and b as shown by the double-dot chain line in FIG. 4. Practically, however, there is a problem in that the tip end of the robot arm passes along a locus from the point A to the point B as shown by single-dot chain line in FIG. 4 because the actual operational start point A is at the position determined by the data values θ 11  and θ 21 , and thus it is impossible to carry out the desired work accurately. 
     The reason why the locus becomes a curve will now be described. When a certain point P (X,Y) in a plane is instructed as a position of the tip end of the robot arm as shown in FIG. 5, there exists the following relations among the values X, Y, θ 1  and θ 2  : ##EQU1## The values θ 1  and θ 2  can be obtained from the equation (1) as follows: ##EQU2## Although there are two solutions for the value of θ 2 , that is, one for both the right-and left-hand systems, the following description relates only to the right-hand system (+θ 2 ). The case of the left-hand system is similar to the right-hand one. 
     Assume now that the value of point (X 0 ,Y 0 ) is instructed, and the angles of the respective articulations are expressed from equations (2) and (3) as follows: ##EQU3## Similarly to this, the angles of the respective articulations when a point (X 0  +ΔX, Y 0  +ΔY), shifted by (ΔX, ΔY) from the point (X 0 ,Y 0 ), is instructed are obtained as follows: ##EQU4## Similarly, when a point (X 0  +2·ΔX,Y 0  +2·ΔY) is instructed, ##EQU5## The tip end of the robot arm will pass through these three points if the robot is an ideal one. Practically, however, as explained above, a real robot will have some deviation between the actual position and the stored point. This deviation is a difference between the position of the reference point of each articulation and the value of the coordinates of the reference point of the robot arm expressed by Δθ 1 , and Δθ 2 . Accordingly, for desired values (positions) (θ 10 , θ 2 .sbsb.0), (θ 1 .sbsb.1, θ 2 .sbsb.1) and (θ 2 .sbsb.1, θ 2 .sbsb.2), obtained as results of computing, the actual position is found from equation (1) to be: ##EQU6## If Δθ 1  =0 and Δθ 2  =0, the robot is ideal and the robot arm will pass through the three points (X 0 ,Y 0 ), (X 0  +ΔX, Y 0  +ΔY) and (X 0  +2ΔX,Y 0  +2ΔY). However, when Δθ 1  ≠0 and Δθ 2  ≠0, components due to the values Δθ 1  and Δθ 2  are added, and therefore the three points are shifted from the desired locus. Thus, the locus becomes the curve AB. In order to eliminate this error, it has been the practice to make the data points coincident by actually measuring the distance of actual movement of the robot by using an expensive jig, for example, such as a digitizer, for focusing agreement between the spatial position of the reference point and the stored positional data of the reference point. 
     SUMMARY OF THE INVENTION 
     The present invention has been attained to eliminate the disadvantages of the prior art. 
     One object of the inventin is to provide a robot control apparatus in which the position control can be accurately performed. 
     Another object of the present invention is to provide a robot control apparatus in which work can be achieved accurately. 
     According to one aspect of the present invention, an apparatus for controlling a robot is provided having a main storage section for storing the work point and work procedure of the robot arm, a present point storage section for storing the data corresponding to the present position of the end of the robot arm, a reference point storage section for storing data indicative of the position of the end of the robot arm when the robot is actuated, and a central processing unit for causing the robot to achieve predetermined operations on the basis of the work point, the work procedure, the data indicative of the present position, and the reference position data, wherein the improvement relates to the provision of a correction section in which the deviation of the actual spatial position of the end of the robot arm from the stored data corresponding to the position in question is detected, and the stored data is corrected on the basis of the deviation. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1A is a diagram showing the outline of one position of a robot arm to which the present invention can be applied; 
     FIG. 1B is a diagram showing the outline of a reference position of a robot arm; 
     FIG. 2 is a block diagram showing the arrangement of a conventional robot control apparatus; 
     FIG. 3 is an explanatory diagram showing the position of the end of the robot arm; 
     FIG. 4 is a diagram used for explaining deviations in position control in the conventional robot; 
     FIG. 5 is a diagram used for explaining the reason why a locus becomes the curve AB due to a defect indicated in FIG. 4; 
     FIG. 6 is a block diagram showing the arrangement of a robot control apparatus constructed according to a preferred embodiment of the present invention; 
     FIG. 7 is an explanatory diagram showing the attitude of a plurality of robot arms in which the position of the end of the robot arm is made to agree with a predetermined position; and 
     FIG. 8 is a diagram used for explaining the principles of deviation computing. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     A preferred embodiment of the present invention will be described hereunder with reference to FIG. 6, in which like reference numerals indicate the same or equivalent parts in FIG. 2. In FIG. 6, reference numeral 16 designates a correction instruction section for correcting, for example, the contents of a reference point storage section 13 on the basis of the deviation of the actual spatial position of the reference point from the positional data stored in a reference point storage section 13. Reference numeral 17 designates a correction teaching box constituted by various switches 17a through 17e which are operated to instruct a correction procedure. A CPU 14 in FIG. 6 computes the above-mentioned deviation in response to the positional data of the two kinds of attitudes of arms 1 and 2 as shown in FIG. 7, that is an attitude I(hereinafter referred to as the attitude in the right-hand system) of the arms 1a and 2a, and an attitude II(hereinafter referred to as the attitude in the left-hand system) of the arms 1b and 2b. The switches 17a through 17e on the teaching box 17 are turned on in a predetermined order to cause the CPU 14 to start the correction operation to detect the above-mentioned deviation, whereupon the correction instruction section 16 corrects the contents of the present point storage section 12 and/or the reference point storage section 13 on the basis of the detected deviation. That is, the CPU 14, the correction instruction section 16 and the teaching box 17 constitute a position data correction section. 
     A correction operation will now be described in detail. Upon the energization of the control device 10, it is necessary to perform a return-to-reference-point movement to bring the robot 9 into the state from which positional control can be commenced. However, there may occur a case where the actual spatial position of each of the arms 1 and 2 does not agree with the stored present positional data, even if the return-to-reference-point movement has been performed. In such a case, the operator pushes the correction start switch 17a to first bring the CPU 14 into the stand-by state, and then pushes the JOG switch 17b to supply a JOG instruction to the CPU 14 to cause the CPU 14 to supply a signal to the robot 9 through an output section 15 to move the arms 1 and 2 to bring the tip of the robot arm into alignment with a desired position P in accordance with the right-hand system attitude I. The term &#34;JOG&#34; corresponds to manual operation of the robot in which an open/close operation or an up/down movement of the hand attached at the end of the arm of the robot is achieved and the respective positional information is stored in the main storage section in the control device by manually operated switches. 
     Next, the record addition switch 17c is turned on to cause the CPU 14 to input the positional data θ 1a  and θ 2a  stored in the present point storage section 12. Following this, the JOG switch 17b is turned on again to move the arms 1 and 2 of the robot 9 so as to bring the tip end of the robot arm into alignment with the position P in accordance with the left-hand attitude II. Upon the completion of this operation, the record correction switch 17d is turned on to cause the CPU 14 to input the stored position data θ 1b  and θ 2b  with respect to the attitude II from the present point storage section 12. Finally, the record end switch 17e is turned on to cause the CPU 14 to compute the deviation of the actual spatial position from the stored position data on the basis of the values θ 1a , θ 2a , θ 1b  and θ 2b , whereupon the CPU 14 corrects the contents of the present point storage section 12 and/or the reference point storage section 13. 
     The correction is performed upon the completion of assembly of the robot. Thereafter, the work point is taught. Thus, the positional data has been completely corrected, and positional control can be accurately performed thereafter so that the robot 9 can carry out its movements along the designated path. 
     Referring to FIG. 8, a description will now be given regarding θ 1a  and θ 2a  corresponding to the present point in the right-hand system attitude I and the stored positional data on the basis of the stored positional data values θ 1b  and θ 2b  corresponding to the present point in the left-hand system attitude II. 
     In FIG. 8, P designates the above-mentioned desired position, and P I  and P II  designate points indicated by positional data stored when the point P is assumed as a fixed point in accordance with the right-hand system attitude I and the left-hand system attitude II respectively. The point P I  is specified by the stored positional data values θ 1a  and θ 2a , and the point P II  is specified by the stored positional data values θ 1b  and θ 2b , each of these positional data values differing from the absolute positional data of the fixed point P by Δθ 1  with respect to the first arm 1 and by Δθ 2  with respect to the second arm 2. That is, as indicated in FIG. 8, the values of the positions of the first and second shafts stored in the present point storage section when a given point P(P x ,P y ) is indicated by the right- and left-hand systems are θ 1a , θ 2a  and θ 1b , θ 2b , respectively. The attitude of the robot arm, as shown by the broken line in FIG. 8, is obtained by the above-mentioned values. (In FIG. 8, the X-and Y-axis origins are assumed to be true references.) The attitude shown by the solid line in FIG. 8 can be obtained by converging the two points P I  and P II  into the single point P by adding the correction values Δθ 1  and Δθ 2  to the positional data values of the first and second shafts, respectively. 
     Viewed from the reference coordinates, the data values of the respective shafts stored in the present point storage section when the point P (P x ,P y ) is indicated by the two attitudes are incorrect, and the values obtained by adding suitable correction values to such incorrect data values are the true data values representing the actual attitudes of the arms (arm angles). That is, the absolute values of the position data values of the point P are θ 1a  +Δθ 1 , θ 2a  +Δθ 2  when expressed using the positional data θ 1a , θ 2a  with respect to the right-hand system attitude I, and therefore the absolute position of the position P can be expressed in orthogonal coordinates as follows: ##EQU7## where P X  and P Y  represent the X and Y coordinates of the absolute positions respectively, and l 1  and l 2  represent the lengths of the first and second arms 1 and 2, respectively. 
     Similar to this case, the absolute values of the positional data values of the fixed point P can be expressed as θ 1b  +Δθ 1 , θ 2b  +Δθ 2  using the positional data values θ 1b , θ 2b  with respect to the left-hand system attitude II, and therefore the absolute position of the position P can be expressed in orthogonal coordinates as follows: ##EQU8## 
     The respective values of P X  in equations (4) and (5) are equal, and the respective values of P Y  in equations (4) and (5) are also equal. This is due to the fact that the point P is expressed in equations (4) and (5) in accordance with the right- and left-hand system attitudes I and II, and therefore the deviations Δθ 1  and Δθ 2  can be obtained from equations (4) and (5) because the positional data values θ 1a , θ 2a  and θ 1b , θ 2b  and the respective arm lengths l 1  and l 2  are known values. 
     That is, equations (4) and (5) can be rewritten as follows: 
     
         P=l.sub.1 e.sup.j(θ.sbsp.1a.sup.+Δθ.sbsp.1.sup.) +l.sub.2 e.sup.j(θ.sbsp.1a.sup.+Δθ.sbsp.1.sup.+θ.sbsp.2a.sup.+Δθ.sbsp.2.sup.), and                        (4&#39;) 
    
     
         P=l.sub.1 e.sup.j(θ.sbsp.1b.sup.+Δθ.sbsp.1.sup.) l.sub.2 e.sup.j(θ.sbsp.1b.sup.+Δθ.sbsp.1.sup.+θ.sbsp.2b.sup.+Δθ.sbsp.2.sup.).                            (5&#39;) 
    
     Since equations (4&#39;) and (5&#39;) are identical, ##EQU9## Setting the expression inside of the brackets in equation (6) equal to 0, ##EQU10## Setting θ A  =θ 1a  +θ 2a , θ B  =θ 1b  +θ 2b , from equation (7), ##EQU11## Setting α=cos θ A  -cosθ B  β=sin θ A  -sinθ B  γ=cos θ 1a  -cosθ 1b  δ=sin θ 1a  -sinθ 1b , 
     from equation (9): ##EQU12## from equations (10): ##EQU13## from equations (11) and (12): ##EQU14## Assuming P falls on the Y axis of the robot, in order to determine the value of θ 1 , from equation (4&#39;): 
     
         l.sub.2 sin (θ.sub.1a +θ.sub.2a +Δθ.sub.2 +Δθ.sub.1)+l.sub.1 sin (θ.sub.1a +Δθ.sub.1)=0                                  (13) 
    
     From equation (13): ##EQU15## Assuming the values θ 1a , θ 2a , θ 1b , θ 2b , l 1 , and l 2  are known, the CPU 14 evaluates the following equations to thereby obtain the deviations: 
     θ A  =θ 1a  +θ 2a   
     θ B  =θ 1b  +θ 2b   
     α=cos θ A  -cos θ B   
     β=sin θ A  -sin θ B   
     γ=cos θ 1a  -cos θ 1b   
     δ=sin θ 1a  -sin θ 1b , ##EQU16## 
     Although the embodiment described above is arranged such that the inputting of positional data for the correcting operation is achieved using the record addition switch 17c, the record correction switch 17d, etc., the present invention is not limited to this arrangement, and an input device including, for instance a CRT, a keyboard and the like may be used instead of the teaching box. The order of the steps used for inputting the position data can be exchanged. Further, although the above description relates to an embodiment of a robot of the horizontal articulation type having two arms, the present invention is not limited to this type of robot, and it is a matter of course that the invention can be applied to a robot of the multi-articulation type having three or more arms. 
     As described above, according to the present invention, a robot control apparatus is additionally provided with a correction section in which the deviation of an actual position of an operational end of the robot from the stored position data therefor is computed and the stored position data is computed using the thus computed deviation, resulting in an effect that reference point adjustment for each arm upon the completion of assembly of the robot can be easily and accurately achieved without the use of an expensive jig. In any case, since the stored reference positional data is accurate, movement along a predetermined desired path is achived.