Abstract:
There are provided method and apparatus for controlling a robot, in which when the robot is continuously controlled in different directions such that from the movement in the horizontal direction to the movement in the vertical direction, the movements in the horizontal and vertical directions from a predetermined position are executed in parallel during the movement in the horizontal direction. In the method, target movement positions in the horizontal and vertical directions are input, a first distance which is necessary to move the robot in only the vertical direction is input, and the predetermined position is determined on the basis of the target movement positions in the horizontal and vertical directions and the first distance. The movements in the horizontal and vertical directions include the equal acceleration motion and the equal deceleration motion. With this method, the operator can easily perform the programming and teaching of the robot such that the robot can reach a desired final target position while avoiding obstacles without colliding therewith in the shortest time.

Description:
This application is a continuation of application Ser. No. 07/457,303 filed Dec. 26, 1989, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a method and apparatus for controlling a robot in which, for instance, the orbit of a robot arm or the like is controlled in accordance with a program which has previously been written and, more particularly, to realize both of the high robot controlling speed and the safe orbit in the case of continuously executing the moving operations in different directions. 
     2. Related Background Art 
     As conventional techniques regarding the realization of a high speed in the continuous operation control of a robot, the techniques shown in, for instance, JP-A-58-177289, JP-A-60-132207, JP-A-61-146487, etc. are known. 
     The apparatus of JP-A-58-177289 comprises means for detecting the arm position and means for comparing the detected arm position with a predetermined position which has previously been stored, wherein when the arm has passed the predetermined position, the program steps progress even during the arm operation, thereby realizing the high control speed. In more detail, according to JP-A-58-177289, the movement in the horizontal direction is executed by a DC servo motor and the movement in the vertical direction is performed by an air cylinder. A chuck or the like is connected to the tip of the air cylinder. Assuming that a target position in the horizontal direction is point D, the air cylinder is driven at the time point when the arm passes a point D&#39; before the point D, thereby starting the downward motion. The point D&#39; is determined by presuming from the time required until the air cylinder arrives at the lowest position. 
     On the other hand, the control apparatus of JP-A-60-132207 uses DC servo motors for three axes and comprises: means for detecting the arm position; means for inputting an overlap area where the next operation can be started during the present arm operation; and means for discriminating whether the arm exists in the overlap area or not, wherein when the arm is located in the overlap area, the present movement command and the next movement command overlap to realize, the high control speed. The overlap area is input by the operation of an operator. The overlap area is defined as an area near a change point of the moving direction. 
     On the other hand, the apparatus of JP-A-61-146487 has a vertical movement control circuit and a horizontal movement control circuit which are independent of each other, wherein the horizontal movement is started by a timing signal from the vertical movement control circuit and the vertical movement is started by a timing signal from the horizontal movement control circuit. The timing signals are output by detecting the horizontal moving velocity so that the downward movement is finished after completion of the horizontal movement. In other words, when the horizontal movement and the downward movement overlap, the horizontal movement finishes early. At the time near the end of the downward movement, only the downward movement is executed, to realize high control speed and to prevent damage, accident, or the like, to the arm. 
     However, in the robot control, it is not always necessary to move the robot from the present position to a target position at high speed when the robot must clear an obstacle to arrive at the target position. In other words, if the robot cannot avoid an obstacle, high control speed may not be realized. The operations of the ascent→horizontal movement→descent per se must be executed because an obstacle exists between the present position and the target position although the robot inherently can reach the target position by only the horizontal movement. Such a situation will be appreciated, in the case of assembling a completed product from a plurality of parts where the robot must be controlled in a manner such that the robot finger gripping the part avoids an enclosure encasing the part and, further, both the finger and the part grasped by the finger do not collide with the semicomplete article during the assembly. 
     The above three conventional examples have a feature that the horizontal movement and the vertical movement are executed together in parallel for a certain period of time. The orbit which is obtained by the parallel motions in those two directions is specified by the synthesis of the moving velocities in those directions. 
     For instance, FIG. 14 shows orbits of the motions in the two directions which have been described in JP-A-61-146487. It is assumed that the time required from the start of the movement in the vertical (Z axis) direction to the arrival at the target position is set to a and the time required from the movement at a velocity v 0  in the horizontal (X axis) direction to the stopping of the motion is set to b and is set to a predetermined offset value so as to obtain a certain downward movement after completion of the horizontal movement. The start time of the downward movement is set to the time when the velocity in the horizontal direction becomes v. ##EQU1## The above equation is satisfied only when it is assumed that the decelerating motion in the horizontal direction can be approximated by linear motion and the value of c is set to a small value. However, as shown in FIG. 14, if an obstacle 100 exists in the orbit of the parallel motions, the robot arm will be broken. Therefore, hitherto, a temporary target position in the vertical direction is set by repeating trials and errors by the operator so that the orbit of the parallel motions is set to enable an obstacle to be avoided and, thereafter, (only) the vertical movement is executed until the final target position in the vertical direction. However, in the process of the trials and errors, a serious accident may occur such that the robot collides with a tool or a workpiece or the like because the straight line portion upon descending cannot be specified. As the easiest method for avoiding such an accident, it is sufficient to merely reduce the parallel motion time period. However, such a method is contrary to the realization of high speed. This is because according to JP-A-61-146487, it is the primary object to define the period of time for the parallel motions on the basis of the decelerating velocity in the horizontal direction and the time which is required for the motion in the vertical direction and a viewpoint such that the highspeed control is realized without the safety feature of obstacle avoidance. 
     In the conventional example of JP-A-58-177289, as mentioned above, since the movement in the vertical direction is executed by the air cylinder, the position control is not executed, so that the safety is further unstable as compared with JP-A-61-146487. 
     On the other hand, according to JP-A-60-132207, since the overlap area must be input on the basis of the perception of the operator, safety and speed may not be adequate. 
     SUMMARY OF THE INVENTION 
     It is an object of the invention to provide method and apparatus for controlling a robot in which the foregoing drawbacks are eliminated. 
     It is another object of the invention to provide a method and apparatus for controlling a robot in which when the continuous operation of the robot is controlled in different directions, the robot is enabled to reach a target position in a short time and the latent possibility of the breakage of the robot is eliminated. 
     It is still another object of the invention to provide a method and apparatus for controlling a robot in which the operator can easily execute programming to teach the obstacle avoidance of an obstacle while maintaining high speed robot movement. 
     It is yet another object of the invention to provide a method and apparatus for controlling a robot in which before completion of the movement by a movement command of the robot, another command can be interpreted and executed. 
     The above and other objects and features of the present invention will become apparent from the following detailed description and the appended claims with reference to the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a side elevational view of an orbit by a robot control apparatus according to an embodiment of the invention; 
     FIG. 2 is a block diagram showing an arm portion of the control apparatus; 
     FIG. 3 is a diagram showing a program which is used in the apparatus of the embodiment; 
     FIG. 4 is a timing chart showing a change in orbit in the embodiment of FIG. 1; 
     FIGS. 5 and 6 are diagrams for explaining constructions of the apparatus of the embodiment; 
     FIG. 7 is a flowchart showing a procedure of an interpreter in the apparatus of the embodiment; 
     FIG. 8 is a diagram showing an example of a format of an I/O command which is used in a position determination control unit; 
     FIGS. 9A, 9B and 9C are diagrams showing examples of orbits which are used for the orbit plan in the embodiment, respectively; 
     FIGS. 10A, 10B and 10C are flowcharts showing control procedures in the position determination control unit; 
     FIGS. 11A and 11B are flowcharts for calculating a point P G  ; 
     FIGS. 12A, 12B, 12C, 12D and 12E are diagrams for explaining methods of calculating the point P G  ; 
     FIG. 13 is a diagram for explaining a modification; and 
     FIG. 14 is a diagram for explaining a conventional example. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     An embodiment in the case where the present invention is applied to a robot control apparatus of the XYZθ axes will be described hereinbelow with reference to the drawings. 
     OUTLINE OF THE EMBODIMENT 
     FIG. 1 is a diagram for explaining the circumstances in which the robot in the embodiment is used and the operation of an arm of the robot. FIG. 2 shows a construction of the arm. In FIG. 1, reference numeral 4 denotes a magazine in which a plurality of parts 2 are enclosed. Reference numeral 3 indicates a workpiece held in a tool 5. The robot takes out one of the parts 2 from the magazine 4 and attaches it to the workpiece 3. A cavity 6 is formed in the workpiece 3. The part 2 is inserted into an inner concave portion 7 of the cavity 6. 
     In FIG. 1, for simplicity of explanation, it is assumed that the horizontal movement is executed in the X direction and the vertical movement is performed in the direction of a Z axis. To execute the assembling operations as mentioned above, it is necessary that the arm starts ascending from point P 0  and passes through points P 4  →P G  →P 5  and stops at point P 3 . FIG. 3 shows a program to realize the above operations. In FIG. 3, a PICK command instructs a finder 13 to grasp the part 2. SPEED denotes a command to define a moving velocity of the arm; OUT indicates a command to turn on/off a special solenoid (not shown in FIG. 1) or the like; INP a command to input a status of a sensor (not shown in FIG. 1) or the like; ARCHUP an upward command; ARCH a horizontal movement command; and ARCHDOWN a downward command. 
     In the program of FIG. 3, the movement commands have the following formats. 
     ARCHUP P 1  ; H 1   
     ARCH P 2  ; P 3  ; V 3  ; H 2   
     ARCHDOWN P 3  ; V 3   
     Those commands are the peculiar commands in the embodiment and are set such as to define an object and to allow the arm to execute a motion of an orbit so as to avoid the obstacle. 
     To understand the commands, explanation will be continued by returning to FIG. 1. 
     As shown in the diagram, since the magazine 4 has a flange 8, when the vertical movement is started from point P 0 , the arm must not collide with the flange. Therefore, only the vertical movement is executed for the interval from P 0  to P 4  and it is necessary to inhibit the horizontal movement during this period of time. 
     The command 
     ARCHUP P 1  ; H 1   
     denotes that the upward motion is executed toward point P1 and only the upward motion is performed for the interval of the distance H 1  and after the upward motion of the distance H 1  is executed, the next commands can also be executed in parallel. In the example of the program of FIG. 3, the next commands denote the commands of the line 4 and the subsequent lines and are substantially the ARCH command. Point P 4  is defined as a point which is higher than point P 0  by the distance H 1 . 
     On the other hand, since the workpiece 3 has the shape mentioned above, as shown in FIG. 1, if at least only the vertical movement is not executed for the interval of the distance H 2  in the upper direction from the final target position P 3 , the arm will collide with the flange of the workpiece. 
     The command 
     ARCH P 2  ; P 3  ; V 3  ; H 2   
     instructs horizontal movement toward point P 2  and denotes that the next program commands can be also executed in parallel at the time when the arm has passed through point P G  which is specified by the final target position P 3 , a descending speed V 3 , and the distance H 2 . In the example of FIG. 3, the next program commands denote the commands of line 8 and the subsequent lines and are substantially the command of 
     ARCHDOWN P 3  ; V 3   
     Point P 5  is defined as a point which is higher than point P 3  by the distance H 2 . 
     FIG. 4 is a diagram showing the motion of the arm in the case where the robot in the embodiment of FIG. 1 operated in accordance with the program of FIG. 3. 
     Point P G  must be determined from the following viewpoints. 
     1 Both the horizontal movement and the downward movement are executed in parallel after point P G . 
     2 Even the downward motion is started from P G  the horizontal movement is continued and is finished at point P 2 . 
     3 The horizontal movement is finished at the time when the downward motion has passed point P 5 . 
     4 The downward motion is finished at point P 3 . 
     Point P G  determined from the above viewpoints is located in front of point P 2  by only a distance Δx in the X direction. Ax denotes the distance at which the arm moves in the horizontal direction for a time T 25  which is required when the motion in the Z direction is shifted from point P 2  to point P 5 . The motions in the X and Z directions are not the simple equal velocity motions in general. In the embodiment as well, 
     
         equal acceleration motion→equal velocity motion→equal deceleration motion 
    
     are executed. The value of the time T 25  differs depending on whether point P 5  exists in the equal acceleration motion interval, the equal velocity motion interval or the equal deceleration motion interval, that is, it differs depending on the values of the distance P 2  P 3  and the distance H 2 . A method of determining Δx will be described hereinafter. 
     CONSTRUCTION OF THE CONTROL APPARATUS 
     FIG. 5 shows a construction of the robot control apparatus of the embodiment. In the diagram, reference numeral 20 denotes an input/output apparatus to input the program as shown in FIG. 3; 21 indicates a portion having a microcomputer to interpret the input program; and 22 represents a position determination control unit to independently control XYZ axes and the θ axis. Practically speaking, the control unit 22 servo controls a servo motor (M in FIG. 6) by an output (position data) of an encoder (E in FIG. 6) directly coupled with the servo motor. Reference numeral 23 denotes an I/O control unit for driving a solenoid (25 in FIG. 6) of the finger 13 and for inputting an output of a sensor (26 in FIG. 6) to check whether the finger has grasped the part or not. 
     FIG. 6 shows the relations among the program interpretation portion 21, the position determination control unit 22, and the I/O control unit 23 in FIG. 5. The program of the interpretation portion 21 comprises: the application program as shown in FIG. 3; an OS (operating system); and an interpreter to interpret the application program. FIG. 7 shows a part of a procedure of the interpreter. The program interpretation portion 21, position determination control unit 22, and I/O control unit 23 are connected by a system bus 24. The interpreter sends I/O commands as shown in FIG. 8 to the position determination control unit 22. The I/O commands comprise command codes and parameters in correspondence to the above three commands ARCHUP, ARCH, and ARCHDOWN. When the position determination control unit 22 receives the I/O commands, it executes the processes corresponding thereto. As shown in FIG. 9, the moving operation is performed on the basis of the well-known trapezoidal control. That is, 
     
         equal acceleration motion→equal velocity motion→equal deceleration motion 
    
     are executed. In the trapezoidal control which is used in the embodiment, the acceleration upon acceleration/ deceleration is given by ##EQU2## assuming that a velocity in the equal velocity motion is set to V, an acceleration time period which is required until the velocity reaches V is set to T AC , and a deceleration time period which is required from the velocity V to the stop is set to T AC . On the other hand, the distance of the movement which is executed from the velocity &#34;0&#34; to the time point when the velocity is accelerated to V or the distance of the movement which is executed from the velocity V to the time when the velocity is decelerated to &#34;0&#34; is given by ##EQU3## FIG. 9B shows a state in which after the velocity had been accelerated to V, it was soon immediately to &#34;0&#34;. The total movement distance in the case of FIG. 9B is 
     
         VT.sub.AC 
    
     from equation (2). FIG. 9C shows a state in which after the velocity had been accelerated at the acceleration α for only a period of time T (&lt;T AC ), it was decelerated to &#34;0&#34;. At this time, the movement distance is ##EQU4## The equation (1) to (3) are often referred to when obtaining point P G . 
     SEQUENCE TO EXECUTE THE FETCHING OF COMMANDS 
     A situation such that before the commands of ARCH and the like are completely executed, the next commands can be executed (what is called a pipeline execution control) will be explained by using a control procedure of an interpreter program shown in FIG. 7 and control procedures of the I/O command execution program in the position determination control unit shown in FIGS. 10A to 10C. With such a pipeline execution control, the programmer can write the program in a manner such that during the execution of the ARCH command or the like, not only the other ARCH commands but also an OUT command, an INP command, and the like can be executed in parallel. 
     The operations based on the interpreter program and the servo control program in the I/O control unit will now be described with reference to FIGS. 7 to 10. The coordinates of each point in FIG. 1 are defined. As mentioned above, since the movement of the arm is considered by only the XZ system, 
     
         P.sub.0 =(x.sub.1,z.sub.0) 
    
     
         P.sub.1 =(x.sub.1,z.sub.1) 
    
     
         P.sub.4 =(x.sub.1,z.sub.0 +H.sub.1) 
    
     
         P.sub.G =(x.sub.G,z.sub.1) 
    
     
         P.sub.2 =(x.sub.2,z.sub.1) 
    
     
         P.sub.5 =(x.sub.2,z.sub.3 +H.sub.2) 
    
     
         P.sub.3 =(x.sub.2,z.sub.3) 
    
     In step S1 in FIG. 7, the count value of a program counter PC is increased by &#34;1&#34;. In step S2, the command pointed by the PC is fetched. In step S4, a check is made to see if the fetched command is a command regarding the ARCH (jump to step S8) or a command regarding the I/O (jump to step S30) or other commands. If it is the command about the ARCH, command codes (ARCH=0, ARCHUP=1, ARCHDOWN=2) are set in steps S8 to S14. In step S16, an I/O command is made by adding a parameter as shown in FIG. 8 for every command. The I/O command is sent to the position determination control unit 22. In step S20, the apparatus waits for the input of an ACK signal from the control unit 22. As will be understood from FIG. 4 and the description of the servo control procedure, which will be explained hereinafter the ACK signal is returned from the position determination control unit 22 when the robot has passed through the intermediate point such as P 4 , P 5 , etc. Upon reception of the ACK signal, the control routine is returned to the main routine (not shown) and the above-mentioned procedure is again executed from step S1. That is, in the case of the command regarding ARCH, if the ACK signal is returned from the position determination control unit 22, the interpretation portion 21 fetches the next command in the program and executes it. Therefore, the parallel processes of the commands related to ARCH or the parallel processes of both of the commands related to ARCH and the other commands can be executed. In the embodiment, particularly, the parallel processes of the commands at the level of the advanced language as shown in FIG. 3 can be performed. Before progressing from the command regarding ARCH to another command regarding ARCH, for instance, as shown in FIG. 3, the programmer inserts the INP command or the like, thereby making it possible to progress to the subsequent ARCH command after confirming that the finger 13 normally operates. 
     On the other hand, if the command is the check command (INP) of the I/O device, in step S30, status data is required for the I/O control unit 23. In step S32, the content of the input status is checked. If the status data is correct, the processing is returned to the main routine and the next command is fetched. 
     If the command is, for instance, the command (e.g., command OUT) to drive a solenoid or the like, step S6 follows and such a command is executed. That is, the I/O command to drive a predetermined solenoid is sent to the I/O control unit 23. 
     In the position determination control unit 22, on the basis of the code of the I/O command sent from the interpretation portion 21, a check is made to see if the command is the ARCHUP command, ARCH command, or ARCHDOWN command. 
     DETAILS OF THE EXECUTION OF THE ARCHUP COMMAND 
     The operation when 
     ARCHUP P 1  ; H 1   
     was programmed with now be described. The ARCHUP command is shown in FIG. 10A. In step S50, an orbit plan is made. The orbit plan is formed to determine the position at which the equal acceleration motion is executed, the position at which the equal velocity motion is performed, and the position from which the deceleration motion is started in the case where the velocity is controlled by the trapezoidal control shown in FIG. 9 when the robot moves from point P 0  to point P 1 . The loop in steps S52 to S56 and the loop in steps S58 to S60 are executed in parallel. 
     In the loop in steps S52 to S56, the servo motor in the Z direction is driven (step S52), an encoder output (z i ) is read (step S54), and a check is made to see if the position of the arm in the Z direction has exceeded point P 1  (z i  &gt;z 1 ) or not (step S56). In the loop in steps S58 to S60, the encoder output (z i ) is read (step S58) and a check is made to see if the position of the arm in the Z direction has exceeded point P 4  (z i  &gt;z 0  +H 1 ) or not (step S60). When the Z axis is set in the upward direction in FIG. 1, the timing when the answer in step S60 is discriminated to be YES is earlier than the timing when the answer in step S56 is determined to be YES. Therefore, the process in step S62 is executed and the ACK signal is returned to the interpretation portion 21. As mentioned above, the interpretation portion 21 can fetch the next command by the ACK signal. 
     DETAILS OF THE EXECUTION OF THE ARCH COMMAND 
     The ARCH command is shown in FIG. 10B. 
     When the interpreter fetches the ARCH command, the I/O command of code &#34;0&#34; is sent to the control unit 22. The position determination control unit 22 calculates point P G  in step S72. After point P G  is calculated, the loop in steps S74 to S78 and the loop in steps S80 to S82 are executed in parallel. 
     In the loop in steps S74 to S78, the servo motor in the X direction is driven (step S74), an encoder output (x i ) is read (step S76), and a check is made to see if the position of the arm in the X direction has exceeded x i  &gt;x 2 ) point P 2  or not (step S78). In the loop in steps S80 to S82, the encoder output (x i ) is read (step S80) and a check is made to see if the position of the arm in the X direction has exceeded point P G  (x i  &gt;x G ) or not (step S82). Assuming that the X axis is set in the leftward direction in FIG. 1, since x G  &lt;x 2 , the timing when the answer in step S82 is determined to be YES is earlier than the timing when the answer in step S78 is decided to be YES. Thus, the process in step S84 is executed. The ACK signal is returned to the interpretation portion 21. The interpretation portion 21 fetches the next command by the ACK signal. 
     The details of the calculation control of point P G  in step S72 will now be described with reference to a flowchart of FIG. 11. The control of FIG. 11 is equivalent to a process such that the distance Δx of the movement which is executed in the horizontal direction is obtained in the time T 25  which is required when the movement in the Z direction is shifted from point P 2  to point P 5  as mentioned above. In step S100, the following values are defined on the basis of the orbit plan, parameters of the I/O commands, and the like. That is, 
     T AZ  : accelerating time upon descent (=decelerating time) 
     V 3  : maximum descending speed (speed in the equal velocity motion) 
     z: movement distance in the vertical direction (=|P 3  -P 2  |) 
     In step S102, the magnitudes of z and V 3  T AZ  are checked, thereby discriminating whether the equal velocity motion exists during the descent from P 2  to P 3  or not in the orbit plan which was made in step S70. 
     In the case where the equal velocity downward motion exists 
     As described in conjunction with FIG. 9, if 
     
         z &gt;V.sub.3 ·T.sub.AZ 
    
     the equal velocity downward motion exists. In this case, in steps S110 and S112, a check is made to see if point P 5  lies within the equal acceleration motion interval or the equal velocity motion interval or the equal deceleration motion interval. ##EQU5## denotes the distance when the robot moves in the Z direction for the decelerating time period T AZ , ##EQU6## (NO in step S110) denotes that the deceleration is started at a position which is upper than P 5 . ##EQU7## (YES in step S110) means that the deceleration is started at a position which is lower than P 5 . If NO in step S110, the motion of the robot is executed in a manner such that the acceleration for the period of time T AZ  →equal velocity motion at V 3  →start of the deceleration→passage at P 5  →arrival at P 3 . The time which is required when the robot arrives at P 3  from P 2  (P 2  →P 3 ) is ##EQU8## On the other hand, the time which is required for (P 5  →P 3 ) is ##EQU9## Thus, as shown in step S114, T 25  is ##EQU10## 
     If the deceleration is executed at a position lower than P 5  (YES in step S110), a check is made to see if P 5  lies within the acceleration motion interval or the equal velocity motion interval by discriminating the magnitudes between H 2  and ##EQU11## (NO in step S112), the motion is executed at the equal acceleration V 3  /T AZ  for the period of time T 25 . Therefore, T 25  is ##EQU12## as shown in step S118. On the contrary, if P 5  lies within the equal velocity motion interval, the accelerating time is T AZ  and the equal velocity motion period of time until P 5  is ##EQU13## Therefore, as shown in step S116, ##EQU14## In the case where the equal velocity downward motion does not exist 
     If the equal velocity downward motion does not exist, z&lt;V 3  ·T AZ  and step S104 follows. In this case, there are two cases where the deceleration is executed before P 5  (H 2  ≦1/2z) and where the deceleration is performed after P 5  (H 2  &gt;1/2z). In the former case, the time which is required for the movement of P 2  →P 3  is ##EQU15## from ##EQU16## and the time which is required for the movement of P 5  →P 3  is ##EQU17## 
     As mentioned above, the value of T 25  is obtained in each case. Then, the distance Δx of the movement which is executed in the X direction for the time period T 25  is calculated in accordance with a flowchart of FIG. 11B. In step S120, the following values are defined. That is, 
     T AX  : accelerating time in the X direction (=decelerating time) 
     V 2  : maximum speed (speed in the equal velocity motion) 
     x: movement distance in the horizontal direction (=|P 2  -P 1  |) 
     In step S122, the values of x and V 2  ·T AX  are compared, thereby checking whether the equal velocity motion interval exists in the horizontal movement or not. 
     In the case where the equal velocity horizontal movement exists 
     In this case, the answer in step S122 is NO and step S140 follows. The period of time which is required for the acceleration and deceleration is set to 2T AX  and the period of time of the equal velocity motion is (x-V 2  ·T AX )/V 2 , so that a time T T  which is required for the horizontal movement from P 1  to P 2  is ##EQU18## In step S141, the magnitudes of T 25  and T T  are compared. If T 25  &gt;T T , this means that the downward motion is started at a position left of P 1  and such a situation is impossible, so that it is regarded as a program error. 
     In step S142, the magnitudes of T 25  and T AX  are compared. If the downward start point P G  is located before the start position of the deceleration of the horizontal movement, 
     
         T.sub.25 &gt;T.sub.AX 
    
     If the downward start point P G  is located after the start of the deceleration of the horizontal movement, 
     
         T.sub.25 ≦T.sub.AX 
    
     As shown in FIG. 12A, if the downward motion is started in the equal velocity motion interval, 
     
         T.sub.25 ≦T.sub.t -T.sub.AX 
    
     (YES in step S144). Therefore, the distance αx of the movement of (P 1  →P G ) is obtained by ##EQU19## as shown in step S148. 
     As shown in FIG. 12B, if the downward motion is executed for the accelerating period of time, 
     
         T.sub.25 &gt;T.sub.T -T.sub.AX 
    
     (NO in step S144), so that step S150 follows. In this case, since ##EQU20## 
     On the other hand, if it is determined that T 25  ≦T AX  in step S142, step S146 follows. At this time, since the downward motion is started for the decelerating period of time as shown in FIG. 12C, ##EQU21## Thus, 
     
         Δx=x-(1/2)(V.sub.2 T.sub.25 /T.sub.AX.sup.2) 
    
     In the case where the equal velocity horizontal movement does not exist 
     In this case, since x≦V 2  ·T AX , step S124 follows. As will be obvious from FIG. 12D, since the value of T T  is twice as long as the period of time which is required from the start of the acceleration to the completion of the movement of the distance of 1/2x, as shown in step S124, ##EQU22## The process in step S125 has the same meaning as that in step S141. Since 1/2T T  is the time which is required for the deceleration, ##EQU23## means that the downward motion is executed before the start of the deceleration as shown in FIG. 12D. At this time, since Δx is the distance between P 1  and P G , that is, the distance of the movement which was executed by the acceleration for the period of time (T T  -T 25 ), ##EQU24## On the other hand, in the case where the downward motion is started after the start of the deceleration in the horizontal direction, 
     
         Δx=x-|P.sub.G -P.sub.2 | 
    
     as shown in FIG. 12E, so that ##EQU25## as shown in step S128. In this manner, the value of Δx can be obtained in each case. In the next step S152, the X coordinate position x G  of P G  is calculated. That is, ##EQU26## In the above equation, (x 2  -x 1 )/x is set in consideration of the horizontal moving direction. 
     If the downward motion is started at P G  obtained as mentioned above, the conditions of the above items e,crc/1/  to e,crc/4/  are satisfied. 
     That is, point P G  is a passing point at which in the case where the downward motion was started toward point P 3 , the robot can arrive at point P 3 , in the shortest time by avoiding an obstacle. Therefore, at the time point when the robot has passed point P G  the position determination control unit 22 returns the ACK signal to the interpretation portion 21. The interpretation portion interprets the next ARCHDOWN command and sends the I/O command to the position determination control unit 22. Thus, the robot arm avoids the obstacle and reaches point P 3  in the shortest time. 
     DETAILS OF THE EXECUTION OF THE ARCHDOWN COMMAND 
     According to the program of FIG. 3, when the ACK signal is returned to the interpretation portion at the time when the robot has passed point P G  by the ARCH command, the OUT command, IF INP command, and ARCHDOWN command are executed. A control procedure of the position determination control unit 22 for the ARCHDOWN command is shown in FIG. 10C. 
     According to the embodiment described above, 
     I: By using the advanced robot language, it is possible to describe the robot control program to execute the operations in different directions in parallel while avoiding an obstacle. Therefore, the programmer can easily execute the program and the teaching and the optimum parallel movement can be executed so that the robot can be moved at a high speed. 
     II: Particularly, in the ARCH command, the height H 2  of obstacle, the maximum descending speed V 3 , the target downward position P 3 , etc. can be described. Therefore, not only can an obstacle be avoided but also the passing point P G  to reach the target point P 3   in the shortest time is calculated by the control apparatus itself rather than the operator. Thus, the passing point P G  which can be obtained only by repeating the trials and errors as in the conventional technique can be easily derived. 
     III: In the commands of the ARCHUP and ARCH systems, the previous movement command is incorrectly finished at the start time point of the movement in the different direction. Therefore, the programmer can insert a desired program procedure during the subsequent movement command. A degree of freedom in making of the control program increases. 
     The present invention can be variably modified within the spirit and scope of the appended claims of the invention. 
     For instance, in the embodiment of FIG. 1, two directions of X and Z have been set. However, other directions can be also set. 
     On the other hand, the embodiment of FIG. 1 has been described with respect to the industrial robot as an example. In the industrial robot, in many cases, an obstacle appears in the height direction. However, as shown in FIG. 13, there is a case where two points S 1  and S 2  exist as points which the arm must avoid. Even in such a case, the ARCH command to which the invention is applied becomes 
     ARCH P 2 , P 3 , V 3  ; H 2  ; H 3  ; H 4   
     In the above command, point S 2  which is specified by P 3  and H 2  is the avoiding point as described in FIG. 1. Point S 1  exists at the position of the height H 3  from point P 3  and is the point existing at the position corresponding to the distance H 4  in the horizontal direction from S 2 . In such a command, the orbit is controlled in the following manner. First, with respect to point S 1 , an orbit is made and passing point P G  &#39; is calculated in the same manner as the foregoing embodiment. In addition, with respect to point S 2  as well, an orbit is made and passing point P G  &#39; is calculated. If two orbits which were independently calculated with respect to one of S 1  and S 2  do not interfere with those of the other point, P G  &#39; or P G  &#34; which is nearer to point P 1  is used as P G . If one of the two orbits which were independently calculated with respect to one of S 1  and S 2  interferes with that of the other point, the orbit on the side which does not interfere is used. The present invention can be expanded and applied even to a model such that two interference points exist as mentioned above. 
     In the above embodiment of FIG. 1, H 1  and H 2  have been used as height information of the straight line portion which are added to the ARCHUP and ARCH commands. However, they can be also described by points P 4  and P 5  in place of them. 
     In the embodiment of FIG. 1, the interpretation portion is of the interpreter type. However, as the program interpretation portion, in the case of using a compiler type program system which all of the commands have previously been set into the execution form, the target value and velocity of the descending command added to the horizontal movement command are preliminarily read and compiled and, thereafter, they can be added. Therefore, even if they do not exist in the horizontal movement command, the similar advantages are obtained. 
     If the movement amount is not 0 on the horizontal movement axis, even when the horizontal position at which the downward motion can be started is calculated with respect to any axis, the similar advantages can be derived. 
     In case position determination control unit 22 for calculating the position every servo cycle is used in place of the calculation of the horizontal position at which the downward motion can be started, even if the timing calculation is used, the similar advantages can be derived. 
     On the other hand, the orbit plan is not limited to the trapezoidal control but can be also made by other control. 
     Even when the horizontal position at which the downward motion can be started is calculated by the program interpretation portion instead of the position determination control unit 22, the similar advantages can be obtained.