Abstract:
A method for controlling a multi-joint robot having redundant operating joints, wherein joint velocities are calculated for non-redundant joints with redundant joints being fixed for each of at least a portion of the combinations of the non-redundant joints excluding redundant joints capable of attaining the movement of the robot end at a command velocity specified to the robot, by inverse-coordinate-transformation from the spatial coordinate to a joint coordinate inherent to the robot, on the basis of joint angles detected by an encoder mounted on the joints of the robot and the joint velocities are averaged or nearly averaged to obtain the average value or nearly average value as a desired joint velocity for the joints. The desired joint velocity is supplied to a velocity control unit of the robot as a controlled variable.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to method and apparatus for controlling a robot arm with multi-degrees of freedom (hereinafter simply referred to as a robot), and more particularly to method and apparatus for controlling the robot to precisely and smoothly move an end of a robot arm with redundant degrees of freedom (hereinafter simply referred to as a redundant arm) along a desired trajectory. 
     In a trajectory control method to control the robot, a trajectory to which the end of the robot is to follow is appropriately interpolated and respective points on the trajectory defined by the interpolation are used as desired points, which are sequentially selected at a predetermined time interval to sequentially control the end of the robot along the desired trajectory. In order to position the end of the robot at the selected desired point, it is necessary to synergistically actuate joints of the robot. As the synergistic control method for the joints of the robot, the following method has been well known. 
     Let us consider a robot with 3-degrees of freedom which is commonly used to position the end of the robot at any position in a given space. 
     A position   of the end of the robot in the working space represented by an orthogonal coordinate and at joint angle   of the robot represented by a coordinate inherent to the robot are expressed by: 
     
          =(x y z).sup.T                                            ( 1) 
    
     
          =(θ.sub.1 θ.sub.2 θ.sub.3).sup.T        ( 2) 
    
     where the superscript T indicates the transpose of the row vector into a column vector. 
     From a geometrical structure of the robot, the robot end position   is expressed by the joint angle   as 
     
          =F( )                                                     (3) 
    
     Namely, the following relations exist. ##EQU1## where 
     
          =(f.sub.1 f.sub.2 f.sub.3)                                (5) 
    
     The transformation   from the joint angle   represented by the coordinate inherent to the robot to the end position   in the spatial coordinate is called a coordinate transformation. 
     By solving the simultaneous equations (4) for θ 1 , θ 2  and θ 3 , the joint angle   for attaining the robot end position  is determined. 
     That is, by solving the equations (4) for  , we get 
     
          =G( )                                                     (6) 
    
     that is, ##EQU2## where 
     
         G=(g.sub.1 g.sub.2 g.sub.3)                                (8) 
    
     The transformation G from the robot end position   represented by the spatial coordinate to the joint angle   in the coordinate inherent to the robot is called an inverse coordinate transformation. 
     The method for positioning the robot end position   to the desired position by determining the joint angles   by the inverse coordinate transform equation (6) and controlling the joints of the robot to follow the angle is a most commonly known method. 
     In this control method, however, when the number of joints of the robot is larger than three, that is, when redudant joints are included, the coordinate transform function   is represented as 
     
         x=f.sub.1 (θ.sub.1, θ.sub.2, θ.sub.3, θ.sub.4, . . . , θ.sub.n) 
    
     
         y=f.sub.2 (θ.sub.1, θ.sub.2, θ.sub.3, θ.sub.4, . . . , θ.sub.n) 
    
     
         z=f.sub.3 (θ.sub.1, θ.sub.2, θ.sub.3, θ.sub.4, . . . , θ.sub.n)                                        (9) 
    
     where n is the number of joints. Since the number of unknown quantities is n (n≧4) while the number of equations is three, the joint angle is not uniquely defined for the robot end position  . In order to resolve the above problem, n-3 of the n joints may be fixed and the simultaneous equations (9) may be solved for the three joints to determine the joint angles of the robot. In this method, in order to determine which joints should be fixed and which joints should be operated to position the robot end to the desired position, an operation time required for positioning and a power consumed etc., are used as an evaluation function, and a combination of joints which minimizes the evaluation function is determined. This evaluation function is usually complex, and non-linear simultaneous equations including trigonometrical functions must be solved to determine the inverse coordinate transform function for each set of joints to be fixed. Accordingly, the calculation is very complex. 
     Further, it is a common method in prior art to obtain a specified robot end velocity from joint velocities of the robot by inverse-coordinate transforming the relation between the velocity of the robot end and the joint velocities, which relation is obtained by differentiating the equation (3) with respect to time, when there are no redundant joints in the robot. The equation which represents the robot end velocity by the joint velocity is locally a linear equation without regard to a mechanical structure of the robot. However, when the redundant joints are included, a matrix of equations representing the robot end velocity by the joint velocity is non-square. Although an inverse matrix of the non-square matrix can be obtained by an approximation function, the calculation of the approximation function is complex and time-consuming. Therefore, when a simple controller having a microcomputer as a data processing unit is used, it is practically difficult to real-time control the robot. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a method and apparatus for controlling redundant robot arms, which enable smooth and precise continuous trajectory control with a relatively simple calculation process without being affected by a mechanical structure of a robot and without using a complex evaluation function. 
     In the control of the redundant robot arm in accordance with the present invention, a relation between an arm end position   (x y z) T  represented by a spatial coordinate determined by a geometrical structure of the robot arm and n joint angles   (θ 1  θ 2  . . . θ n ) T  represented by a coordinate, inherent to the robot, that is, 
     
          = (θ)                                               (10) 
    
     is differentiated with time t to derive a velocity relation ##EQU3## and the matrix   is squared by fixing n-3 redundant joints of the n joints so that the joint velocity   is determined from the end velocity  , that is, an inverse matrix   -1  of the coordinate transform matrix   is obtained, and a velocity   k  of a combination of the remaining three non-redundant joints is determined by ##EQU4## where   k   -1  is an inverse matrix of Jacobian   k  which relationalize the velocity   k  of the combination of the operating joints with the end velocity  . From the above relation a joint velocity  rk  which attains an instructed velocity   r  is determined, and joint velocities   rk  of the operating joints determined for respective combinations of the redundant joints which can be fixed are summed and averaged as follows. ##EQU5## It is used as desired velocity   r  of the joints to control the redundant robot arm. 
     In the equation (16), the joint velocities   rk  for all combinations of the redundant joints to be fixed, that is, all combinations of the operating joints excluding the redundant joints are evenly averaged. Alternatively, a portion of all combinations of the operating joints may be used or the joint velocities   rk  may be unevenly averaged with different weightings. 
     When the robot arm is moved in a two dimensional plane, n-2 redundant joints of n joints are fixed to square the matrix   in the velocity relation to obtain the inverse matrix   k   -1  so that the velocities   rk  of the remaining two operating joints are determined, and the joint velocity   rk  and the desired velocity   r  are determined in the same manner as that for the three-dimensional movement. 
     The inverse coordinate transform matrix   k   -1  is the inverse matrix of the coordinate transform matrix   k  and it can be relatively simply obtained by a routinelike calculation process. On the other hand, the coordinate transform matrix   k  is uniquely determined from the geometrical structure of the robot arm by determining the joint angles at the start of the operation. Accordingly, the inverse coordinate-transform matrix   k   -1  is routinely obtained and hence the present control method is applicable to a general purpose method being affected by the mechanical structure of the robot. 
     In the present invention, the average of the summation of the joint velocities   k  obtained for the combinations of the redundant robot arm joints which attain the directed end velocity   m  is used as the desired joint velocity   of the redundant robot arms. Accordingly, the robot end can be smoothly controlled along the desired trajectory while all joints are synergistically moved. In the present invention, a complex algorithm to determine the angles of the redundant joints is not necessary in calculating the desired joint velocity  , and the inverse coordinate transformation from the instructed velocity   m  to the joint velocity  k  is a relatively simple conventional technique which is not affected by the mechanical structure of the robot. Accordingly, the present invention can be readily applied to the real-time control using a microcomputer. 
     In the present invention, when the robot end is controlled to be moved by sampling control, the desired velocity is corrected to reduce an error between an actual position of the robot end and the desired position at each sampling time. Thus, an error caused in the velocity control servo mechanism for driving the robot joints due to various losses is corrected and compensated so that a high precision trajectory tracking control is attained. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     These and other objects and advantages of the invention will become apparent by reference to the following description taken in conjunction with the accompanying drawings, in which: 
     FIG. 1 is a schematic diagram of a mechanical structure of a redundant robot arm in accordance with one embodiment of the present invention, 
     FIG. 2 is a configuration of one embodiment of an apparatus used to control a robot, 
     FIG. 3 is a flow chart showing a control procedure of the robot control effected by the apparatus of FIG. 2, 
     FIG. 4 is a detailed flow chart of a step for calculating a robot end command velocity in the flow chart of FIG. 3, and 
     FIG. 5 is a detailed flow chart of a step for calculating a desired joint velocity of the robot in the flow chart of FIG. 3. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENTS 
     One embodiment of the present invention is now explained. FIG. 1 is a diagram for explaining a mechanical structure of a redundant robot arm which is to be controlled in the embodiment of the present invention. The redundant robot arm comprises three rotary joints R 1 , R 2  and R 3  for positioning in an x-y plane and three links L 1 , L 2  and L 3  connected thereto. A base of the link L 1 , that is, the joint R 1  is located at an origin of the orthogonal coordinate xy. The links L 1 , L 2  and L 3  have lengths l 1 , l 2  and l 3 , respectively, and rotation angles of the joints R 1 , R 2  and R 3  are θ 1  with respect to the x-axis, θ 2  with respect to the link L 1  and θ 3  with respect to the link L 2 , respectively. 
     An end position x (x, y) of the robot is expressed by the joint angles θ 1 , θ 2  and θ 3  of the robot as follows. ##EQU6## Let us assume that ##EQU7## 
     The equations (17) are differented with a time t to obtain a velocity relation between the end position   and the joint angle  , ##EQU8## Let us assume that ##EQU9## Then, the equations (19) are represented as ##EQU10## 
     That is, 
     
          =                                                         (23) 
    
     where ##STR1## 
     From the equation (23), the desired joint velocities   r  of the joints to attain the command velocity   m  to the robot end are determined. In order to compensate for various losses in a servo mechanism for controlling the velocities of the joint angles of the robot, the desired velocity   r  is corrected by a velocity error   e  of the robot end as follows: ##EQU11## where the superscript T indicates the transpose of the row vector into a column vector. 
     Let us assume that the end of the redundant robot arm is linearly moved at a velocity v from a start position   s  (x s , y s ) to a desired position   f  (x f , y f ) under sampling control at T periods. Assume that the start position   s  is a robot end position   o  (x o , y o ) at time t=0. A desired velocity vector   r  (x r  y r ) is given by ##EQU12## An error correction velocity   e  (x e  y e ) at an n-th sampling time is given by ##EQU13##   (x, y) is the actual position of the robot end at the n-th sampling time and it is calculated from the joint angles of the robot using the equations (17), and   i  (x i , y i ) is a desired position at the n-th sampling time and x i  and y i  are given by ##EQU14## 
     Accordingly, by controlling the robot end position   in accordance with the command velocity   m  represented by the following equations at the n-th sampling time, ##EQU15## the error between the desired position and the actual position of the robot end caused by the various losses in the servo mechanism is corrected and the losses are compensated so that the robot end can precisely follow the desired trajectory. 
     From the equation (23), the following relation is held between the command velocity   m  of the robot end and the desired joint velocity   r  for attaining the command velocity   m . ##EQU16## Because three unknown quantities θ 1 , θ 2  and θ 3  to determine the desired joint velocity θ r  for the desired command velocity   m  are included while the number of equations (19) is two, the solution is not uniquely determined. 
     Thus, one of the three joints R 1 , R 2  and R 3  is fixed as a redundant joint to reduce the number of unknown quantities to two, and the joint velocities to attain the command velocity   m  by the remaining two joints are determined. The above operation is repeated for each of all possible cases of the fixed redundant joints, that is, all combinations of the operating joints excluding the fixed redundant joints (one joint in the present embodiment), and the resulting joint velocities are added and averaged to produce the desired joint velocity   r . The Jacobian  k  for the joint velocities   k  of the non-fixed operating joints when the joint R k  is fixed and the desired velocities   rk  for the operating joints are represented as follows: ##EQU17## where the superscript T indicates the transpose of the row vector into a column vector and ##EQU18## where   1  is a matrix when the joint R 1  is fixed and the joints R 1  and R 2  are used as the operating joints   2  is a matrix when the joint R 2  is fixed and the joints R 1  and R 3  are used as the operating joints, and   3  is a matrix when the joint R 3  is fixed and the joints R 1  and R 2  are used as the operating joints. 
     By putting   k  and   rk  in the equation (33), the following relation between the command velocities   m  of the robot end and the velocities   rk  of the non-fixed joints is derived. ##EQU19## 
     Since   k  is squared in the equations (34), the inverse matrix  k   -1  can be obtained. Thus, the desired joint velocities   rk  of the two operating joints when the joint R k  is fixed are determined by ##EQU20## The desired joint velocities   rk  for combination of the two joints determined by the equation (37) are calculated for each of the possible combinations of two joints and they are summed for the respective joint velocities θ 1 , θ 2  and θ 3 , and they are averaged to obtain the desired joint velocities   r , as shown below. ##EQU21## From the equations (34), (37) and (38), the desired joint velocities  r  is given by ##EQU22## and they are used as input values to the velocity control servo mechanism. 
     In the above, the joint velocities for all of the possible combinations of the operating joints excluding the redundant joints are averaged to determine the desired joint velocity   r  as shown in the equation (39). Alternatively, not all of the possible combinations of the operating joints need to be considered but a portion of the combinations may be selected in the following manner. When the total number of the joints of the robot is an even number, each joint is included once in the selected combinations, and when the total number of the joints of the robot is an odd number, each of the joints except one is included once in the selected combinations and the above one joint is included twice in the combinations. 
     In a redundant manipulator with 4 degrees of freedom, the desired joint velocities can be determined from ##EQU23## and   12  is a matrix when joints R 1  and R 2  of four joints R 1 , R 2 , R 3  and R 4  of the redundancy manipulator with 4 degrees of freedom are fixed,   23  is a matrix when the joints R 2  and R 3  are fixed,   34  is a matrix when the joints R 3  and R 4  are fixed,   13  is a matrix when the joints R 1  and R 3  are fixed,   14  is a matrix when the joints R 1  and R 4  are fixed, and   24  is a matrix when the joints R 2  and R 4  are fixed. Thus, the equation (40) is for two combinations of the operating joints R 3 , R 4  and R 1 , R 2 , the equation (41) is for two combinations of R 1 , R 4  and R 2 , R 3 , and the equations (43) is for two combinations of R 1 , R 3  and R 2 , R 4 . 
     In a redundant manipulator, with 5 degrees of freedom the desired joint velocity   r  can be determined from ##EQU24## and   345  is a matrix when joints R 3 , R 4  and R 5  of five joints R 1 , R 2 , R 3 , R 4  and R 5  of the manipulator are fixed,   125  is a matrix when the joints R 1 , R 2  and R 5  are fixed, and   123  is a matrix when the joints R 1 , R 2  and R 3  are fixed, and the equation (44) is for three combintions of the operating joints R 1 , R 2  ; R 3 , R 4  and R 4 , R 5 . 
     By selecting the portion of the all possible combinations of the operating joints, although the operation precision is lowered the operation time can be reduced. 
     On the other hand, in the equation (39), when the matrix |   1  |=0, |   2  |=0 or |   3  |=0 and so [   1  ] -1 , [   2  ] -1  or [   3  ] -1  cannot be determined, the desired joint velocity   r  can be determined from ##EQU25## The same is applied to a redundant manipulator having a freedom of larger than three. 
     In the equation (39), the desired joint velocity   r  is determined by evenly averaging the solutions of the operation joints excluding the redundant joints. Alternatively, the desired joint velocity   r  can be determined by weighted-averaging the solutions as shown below. ##EQU26## In the equation (39), the weightings in the equation (49) are equal, but the weightings may be different. 
     By unevenly weighting, it is possible to heavily weight combinations of the operating joints in which combinations specific joints are included so that the specific joints are operated at a high priority, or lightly weighting combinations of operating joints in which combinations specific joints are included so that the operation of the specific joints is suppressed. This is effective particularly when an operation range of the specific joints of the robot is limited. 
     In the present embodiment where the manipulator has the three joints R 1 , R 2  and R 3 , by setting a weight W 1  for the combination having the joints R 1  fixed to 0.8, and the weights W 2  and W 3  for the combinations having the joints R 2  and R 3  fixed, respectively, to 0.1 so that the weight for the combination which includes the operating joint R 1  is lowered, it is possible to suppress the operation of the joint R 1 . 
     In the equations (39) and (49), the operating joint velocities   rk  are weighted such that a total of the weights is unity in order to determine the desired joint velocity   r . However, as described above, since the error correction control for the servo control mechanism as shown is the equation (25) is effected in this invention, it is not necessary to weight the operating joint velocities such that the total of the weights is exactly unity. 
     FIG. 2 shows a configuration of an apparatus for carrying out the robot control of the present invention. Numeral 203 denotes a coordinate transformer for calculating a current robot end position   in accordance with the equation (17) from the robot joint angle   detected by encoders 322 mounted on the joints of the robot. Numeral 201 denotes a command velocity generator for calculating a command velocity   m  of the robot end in accordance with the equations (27), (28), (29), (30), (31) and (32) from the current end position   calculated by the coordinate transformer 203. Numeral 202 denotes a redundant inverse coordinate transformer for calculating a desired joint velocity   r  in accordance with the equations (24) and (29) from the command velocity   m  from the command velocity generator 201. The element f ij  of the matrix   in the equation (24) is a function of the joint angle  , and so the desired joint velocity   is calculated on the basis of the current joint angles detected by the encoders 322. 
     In the present embodiment, the command velocity generator 201, the coordinate transformer 203 and the redundant inverse coordinate transformer 202 are sampled at a sampling period T repeatedly and the sampled signals are processed by a microcomputer. A velocity control servo mechanism 3 comprises servo amplifiers 310, motors 320 and tachogenerators 321 for detecting a rotating speed   of the motors 320, and functions to drive the motors 320 which rotate the joints respectively in accordance with the input desired joint velocity   r . Thus, the robot end position   is smoothly and precisely moved toward the desired position  f at a specified velocity v while all joints are synergistically moved along the desired trajectory   r . 
     FIG. 3 shows a flow chart of a control procedure for the robot control in the arrangement of FIG. 2. 
     In a first step of the control procedure, the output signal from the encoder 322 is read in to read the current joint angle   (step 101). 
     In a second step, the robot end position   is calculated in accordance with the equation (3) on the basis of the joint angle   (step 102). 
     In a third step, the command velocity   m  of the robot end is calculated in accordance with the equations (25), (27), (29) and (30) on the basis of the specified desired position  f and velocity v and the end position   calculated in the second step (step 103). 
     In a fourth step, the desired joint velocity   r  of the robot is calculated in accordance with the equations (24), (35) and (39) on the basis of the joint angle   calculated in the first step and the command velocity   m  calculated in the third step (step 104). 
     Finally, in a fifth step, the desired joint velocity   r  calculated in the fourth step is supplied to the servo mechanism 3 (step 105). 
     The above sequence of operations are repeated N times at an interval of the period T so that the robot end is smoothly and precisely moved along the desired trajectory. 
     The third and fourth steps of the control procedure will now be explained in further detail. 
     The detail of the third step is shown in FIG. 4. 
     In a first sub-step, the desired velocity   r  is calculated in accordance with the equation (27) on the basis of the command velocity v and the desired position   f  (step 1031), and in a second sub-step, the desired position   i  is calculated in accordance with the equation (30) on the basis of the desired velocity   r  (step 1032). In a third sub-step, the error correcting velocity   e  is calculated in accordance with the equation (29) on the basis of the desired position  i  calculated in the second sub-step (step 1033). Finally, the desired velocity   r  is corrected by the error correcting velocity   e  in accordance with the equation (25) to calculate the command velocity  m  (step 1034). 
     The detail of the fourth step is shown in FIG. 5. 
     In a first sub-step, the Jacobian   is calculated in accordance with the equations (18), (20) and (24) on the basis of the joint angle   read in the first main step (step 1041). In a second sub-step, a degenerated inverse matrix [   k  ] -1  is calculated in accordance with the equation (35) (step 1042). Finally, in a third sub-step, the desired joint velocity   r  is calculated in accordance with the equation (29) (step 1043). 
     The calculations in the first and second sub-steps (steps 1041 and 1042) of the fourth main step can be carried out by developing the degenerated inverse matrix [   k  ] -1  with the joint angle   being a variable and putting the joint angle   therein so that the operation time can be further reduced. 
     The specific control procedure for the robot control method of the present invention has thus far described. 
     While the robot arm is moved in the two-dimensional plane in the present embodiment, the present invention can be applied to the robot arm moving in a three-dimensional space by expanding the control technique for the two-dimensional robot to the three-dimensional robot control. 
     While the final position of the robot end and the velocity are specified for the command velocity generator in the present embodiment, it is possible to make such that only the velocity is specified from the external and the robot desired joint velocity   r  is calculated on the basis of the specified velocity and the current robot joint angle.