Setting method and setting apparatus for operation path for articulated robot

A temporary operation path is set by connecting a plurality of welding points in a virtual space generated by a computer to investigate whether an end effector can be operated along the temporary operation path. If the operation cannot be operated, a path to avoid interference with a workpiece is set automatically while extracting a portion in which the workpiece exists in the internal space surrounded by the end effector in order to set a narrow-area operation path for withdrawing the end effector from a welding point. Next, in order to set a wide-area operation path for making movement between withdrawing points, a template operation is applied, in which the end effector is moved by a prescribed distance in a prescribed direction.

This application is the national phase under 35 U.S.C. § 371 of PCT International Application No. PCT/JP01/10202 which has an International filing date of Nov. 22, 2001, which designated the United States of America.

1. Technical Field

The present invention relates to a setting method and a setting apparatus for an operation path for an articulated robot. Specifically, the present invention relates to a setting method and a setting apparatus for an operation path for an articulated robot, for setting the path for operating an end effector provided at a forward end of the articulated robot, between predetermined operation points.

2. Background Art

Conventionally, if an articulated robot installed for a production line is directly operated to perform the teaching of the operation posture, an operator skilled in the operation of the articulated robot should perform the operation at the working site of the production line. Accordingly, the operation becomes inefficient. The above operation should also be performed with the production line being stopped. Therefore, the operation rate of the production line is decreased.

Recently, the teaching (off-line teaching) is performed based upon an off-line procedure to efficiently perform the teaching operation or to maintain the operation rate of the production line. In the off-line teaching, a model, which includes an articulated robot, a workpiece as an operation objective, and peripheral structures, is constructed on a computer. Teaching data is prepared by using the model, and then the teaching data is supplied to the articulated robot installed at the working site. Therefore, it is unnecessary to stop the production line during the preparation of the teaching data.

The conventional off-line teaching is not necessarily used widely for the following reason.

Naturally, the articulated robot should not interfere with (for example, contact) various peripheral structures, workpieces or the like. When various peripheral structures exist or when the workpiece is of a complicated shape, it is difficult to set an operation path to avoid such obstacles.

More specifically, the round-robin method, in which the interference is investigated as to all postures of the articulated robot, is not practical, because the amount of calculation is enormous. No solution exists in some cases in the optimizing method such as the so-called mathematical programming. Further, according to the stochastic technique using random numbers, the convergence of solution is not assured and the calculation has no reproducibility.

Several techniques have been suggested to solve the above problems.

For example, a technique is known, which utilizes a flat plane including a start point and an arrival point (see Japanese Patent Publication No. 2875498). In this technique, an off-limit area, in which a cross section of an obstacle is appropriately enlarged, is defined on a prescribed plane. An operation path, which passes through the apex of the off-limit area, is set to avoid the interference. However, in this technique, the operation path is set by verifying the interference with the off-limit area at every time. For this reason, the verifying operation is complex, and the operation path is complicated. Even if the operation path is proper, it is also impossible to verify whether the articulated robot can actually operate on the operation path from a viewpoint of operation ranges of respective axes.

Another technique is also known, for example, in which the position and the shape of an obstacle are inputted and instructed with an exclusively used controller in a production site to set an operation path (see Japanese Laid-Open Patent Publication No. 9-81228). However, in this technique, the operation path cannot be set automatically, because the teaching is performed while operating the actual machine at the production site.

Accordingly, the above off-line teaching relies on the manual operation to set the operation path for avoiding the obstacles at present.

However, the manual operation needs a long period of time to extract a non-interference area in which the robot does not interfere with the workpiece and other equipments. The judgment also differs depending on individual persons. It is inevitable to cause any oversight and/or any omission for the extraction point.

As described above, when the posture of the robot is determined by means of the off-line teaching, the operation required therefor is not necessarily easy. Especially, it is difficult to retrieve a path for retracting a gun unit from a welding point so that it may not interfere with a workpiece, on a monitor screen, when the workpiece is of a complicated three-dimensional shape. It takes a long period of time to perform the teaching.

DISCLOSURE OF INVENTION

In consideration of the above problems, it is an object of the present invention to provide a setting method and a setting apparatus for an operation path for an articulated robot, in which steps for determining the path are automatically performed, and teaching data can be prepared in a short period of time without requiring any skill, when off-line teaching is performed for a withdrawing path to make no interference with a workpiece, in a narrow-area operation path for withdrawing an end effector from an operation point on the workpiece, of operation paths for an articulated robot.

Another object of the present invention is to provide a setting method and a setting apparatus for an operation path for an articulated robot, in which a wide-area operation path for making movement between operation points or between withdrawing positions can be set automatically and efficiently without performing any complicated calculation which may be affected by the shape of a workpiece and/or an obstacle.

Still another object of the present invention is to provide a setting method and a setting apparatus for an operation path for an articulated robot, in which a narrow-area operation path and a wide-area operation path can be set automatically and efficiently.

According to the present invention, there is provided a method for setting an operation path for an articulated robot including an end effector, the method comprising an internal space-defining step of defining an internal space which is partially surrounded by an arm or electrodes of the end effector; an extracting step of extracting an objective workpiece portion which exists in the internal space, of a workpiece to be welded; and an interference-investigating step of investigating whether interference occurs between the end effector and the objective workpiece portion when the articulated robot is operated.

Accordingly, the steps for determining the path are automatically performed, and teaching data can be prepared in a short period of time without requiring any skill, when off-line teaching is performed for a withdrawing path to make no interference with a workpiece, in a narrow-area operation path for withdrawing an end effector from an operation point on the workpiece.

In this case, the articulated robot, the end effector, the workpiece, and peripheral structures are virtual ones constructed as a model in accordance with a program processing effected by a computer.

The workpiece may be a model which is approximated with a plurality of blocks.

The internal space may be a model which is approximated with a plurality of blocks.

Further, the interference-investigating step may comprise a reference line-defining step of defining a reference line passing through a substantially central portion of the objective workpiece portion; an investigation end position-defining step of setting an investigation end position for the end effector on the reference line; and a first detailed interference-investigating step of investigating whether interference occurs between the end effector and the objective workpiece portion by operating the end effector from an investigation start position to the investigation end position.

The interference-investigating step may comprise a reference line-defining step of defining a reference line passing through a substantially central portion of the objective workpiece portion; a center of gravity position-defining step of defining a center of gravity position of the objective workpiece portion based upon the reference line; and a second detailed interference-investigating step of investigating whether interference occurs between the end effector and the objective workpiece portion by operating the end effector from an investigation start position to the center of gravity position.

A portion of the objective workpiece portion, which is located closely to an opening as compared with the center of gravity position of the objective workpiece portion, may be extracted as a new objective workpiece portion with which the objective workpiece portion is replaced to perform the center of gravity position-defining step and the second detailed interference-investigating step.

According to another aspect of the present invention, there is provided an apparatus for setting an operation path for an articulated robot provided with an end effector, the apparatus comprising an internal space-defining section for defining an internal space which is partially surrounded by an arm or electrodes of the end effector; a workpiece-extracting section for extracting an objective workpiece portion which exists in the internal space, of a workpiece to be welded; and an interference-investigating section for investigating whether interference occurs between the end effector and the objective workpiece portion when the end effector is operated.

According to still another aspect of the present invention, there is provided a method for setting an operation path for an articulated robot for operating an end effector from a start point to an arrival point, the method comprising an operation-investigating step of setting a path for connecting the start point and the arrival point to investigate whether the end effector can be operated along the path; and a retracting path-setting step of setting a retracting path for operating the end effector by a prescribed distance in a prescribed direction from the start point or the arrival point if the end effector cannot be operated along the path in the operation-investigating step.

Accordingly, a wide-area operation path for making movement between operation points or between withdrawing positions can be set automatically and efficiently without performing any complicated calculation which may be affected by the shape of a workpiece or an obstacle.

The prescribed direction may be a predetermined direction based on a posture of the end effector at the start point or the arrival point.

The prescribed direction may be a direction to connect the start point or the arrival point and an established point in space.

The established point may be a central point of an original axis of the articulated robot.

An end point of the retracting path may be defined as a new start point or a new arrival point to execute the operation-investigating step or the retracting path-setting step again.

The retracting path, in which the prescribed distance is corrected, may be set again if an end point of the retracting path is a point at which the articulated robot cannot arrive or a point at which interference occurs.

According to still another aspect of the present invention, there is provided an apparatus for setting an operation path for an articulated robot for operating an end effector from a start point to an arrival point, the apparatus comprising a path-investigating section for setting a path for connecting the start point and the arrival point to investigate whether the end effector can be operated along the path; and a wide-area operation path-setting section for setting a retracting path for operating the end effector by a prescribed distance in a prescribed direction from the start point or the arrival point if the path-investigating section judges that the end effector cannot be operated along the path.

According to still another aspect of the present invention, there is provided a method for setting an operation path for an articulated robot for operating an end effector between operation points for a workpiece, the method comprising a narrow-area operation path-setting step of setting a narrow-area operation path along which the end effector arranged at the operation point for the workpiece is retracted from the operation point to a point located near an end of the workpiece while maintaining a non-interference state with respect to the workpiece and another obstacle, based upon shapes of the obstacle and the workpiece near the operation point; and a wide-area operation path-setting step of setting a wide-area operation path for effecting operation from a start point to an arrival point by combining predetermined prescribed operations provided that the start point and the arrival point reside in predetermined points of points located near the end.

Accordingly, it is possible to set the narrow-area operation path and the wide-area operation path automatically and efficiently.

The narrow-area operation path-setting step may comprise an internal space-defining step of defining an internal space which is partially surrounded by an arm or electrodes of the end effector; an extracting step of extracting an objective workpiece portion which exists in the internal space, of the workpiece; and an interference-investigating step of investigating whether interference occurs between the end effector and the objective workpiece portion when the articulated robot is operated.

The wide-area operation path-setting step may comprise an operation-investigating step of setting a path for connecting the start point and the arrival point to investigate whether the end effector can be operated along the path; and a retracting path-setting step of setting a retracting path for operating the end effector by a prescribed distance in a prescribed direction from the start point or the arrival point if the end effector cannot be operated along the path in the operation-investigating step.

The prescribed direction may be a predetermined direction based on a posture of the end effector at the start point or the arrival point.

The prescribed direction may be a direction to connect the start point or the arrival point and an established point in space.

According to still another aspect of the present invention, there is provided an apparatus for setting an operation path for an articulated robot for operating an end effector between operation points for a workpiece, the apparatus comprising a narrow-area operation path-setting section for setting a narrow-area operation path along which the end effector arranged at the operation point for the workpiece is retracted from the operation point to a point located near an end of the workpiece while maintaining a non-interference state with respect to the workpiece and another obstacle, based upon shapes of the obstacle and the workpiece near the operation point; and a wide-area operation path-setting section for setting a wide-area operation path for effecting operation from a start point to an arrival point by combining predetermined prescribed operations provided that the start point and the arrival point reside in predetermined points of points located near the end.

BEST MODE FOR CARRYING OUT THE INVENTION

Illustrative embodiments of the setting method and the setting apparatus for the operation path for the articulated robot according to the present invention will be explained below with reference toFIGS. 1 to 21.

Basically, in the setting method and the setting apparatus for the operation path for the articulated robot according to the embodiment of the present invention, the operation path is set while extracting the portion in which the workpiece exists to investigate the interference in the internal space surrounded by the gun unit during the narrow-area operation in which the end effector provided at the forward end of the articulated robot is withdrawn from the operation point on the workpiece. During the wide-area operation for making movement between the withdrawing positions, the operation path is set to move to the arrival point while avoiding the obstacle by operating while combining the template operations for making movement from the start point by the prescribed distance in the prescribed direction.

As shown inFIG. 1, an off-line teaching apparatus (operation path-setting apparatus)10, which is used in the embodiment of the present invention, performs teaching of the operation of an articulated robot50. The apparatus10is linked to a robot apparatus12for performing desired operation for an operation objective based upon prepared teaching data.

The robot apparatus12comprises the articulated robot50, and a robot control unit22for controlling the operation of the articulated robot50based upon the teaching data.

As shown inFIG. 2, a control unit14, which constitutes the off-line teaching apparatus10, includes CPU (computer)26as a control means for controlling the entire off-line teaching apparatus10, ROM28and RAM29as storage sections, a hard disk drive (HDD)39for effecting access of data with respect to the hard disk34, a drawing control circuit30for effecting drawing control on a screen of a monitor16, an interface circuit32to which a keyboard18and a mouse20as input apparatuses are connected, a recording medium drive36for controlling an external recording medium36a(for example, a flexible disk or a compact disk), a data-preparing circuit38for preparing teaching data, and a simulation circuit40for effecting simulation on the screen of the monitor16based upon the teaching data. The simulation circuit40is based on three-dimensional CAD, and it has, for example, the function to prepare the model and investigate the mutual interference of the model (interference-investigating section40a).

The hard disk34stores, for example, an operation path-setting program35having the function to set the operation path for an articulated robot50, condition data37as the condition for setting the operation path, and unillustrated OS.

The operation path-setting program35includes a narrow-area operation path-setting section35afor setting, for example, based upon the shape of a workpiece80, the narrow-area operation path along which a gun unit (end effector)68, which is arranged on a point on the workpiece80(seeFIG. 5), for example, on a welding point T0, is retracted to a point located near the end of the workpiece80while maintaining the non-interference state with the workpiece80and other components, and a wide-area operation path-setting section35bfor setting the wide-area operation path along which the operation is effected from a start point P1to an arrival point P2by combining predetermined prescribed operations provided that the start point P1(seeFIG. 17) and the arrival point P2reside in arbitrary two points in the space.

The operation path-setting program35has a path-investigating section35cfor investigating wither or not the gun unit68can be operated on the path obtained by connecting two arbitrary points.

The operation path-setting program35further includes an internal space-defining section35dfor defining a predetermined internal space in the virtual space, and a workpiece-extracting section35efor extracting a portion of the workpiece80to be welded existing in a predetermined space.

As shown inFIG. 3, a second base56, a first link58, a second link60, a third link62, a fourth link64, and a gun attachment section66are connected to a first base54as an attachment stand of the articulated robot50in this order toward the forward end. The gun unit68is connected to the gun attachment section66disposed at the forward end.

The second base56is rotatable supported with respect to the first base54about the center of the axis J1as the vertical axis. The proximal end of the first link58is supported tiltably with respect to the second base56with the axis J2as the horizontal axis. The proximal end of the second link60is supported swingably with respect to the forward end of the first link58with the axis J3as the horizontal axis. The third link62is connected on the forward end side of the second link60with the axis J4as the common central axis for rotation. Further, the proximal end of the fourth link64is supported swingably with respect to the forward end of the second link62with the axis J5located in the right-angled direction with respect to the axis J4. The gun attachment section66is connected on the forward end side of the fourth link64with the axis J6as the common central axis for rotation.

The gun unit68, which is connected to the gun attachment section66, is a so-called C-type welding gun, and it has, at both ends of an arch-shaped arm74, a pair of electrodes70,72which are openable/closable along the axis J6. In the closed state, the electrodes70,72make contact with the workpiece80at the welding operation point (hereinafter referred to as “TCP (Tool Center Point)”) for the axis J6.

The direction, which is directed from TCP and which is coincident with the axial center of the electrode72of the main body, is designated as “vector Zr”. The direction, which is perpendicular to the vector Zr and which is directed outside of the gun unit68, is designated as “vector Xr”. The direction, which is mutually perpendicular to the vector Xr and the vector Zr, is designated as “vector Yr”.

The driving mechanism for the axes J1to J6and the opening/closing mechanism for the electrodes70,72are driven by unillustrated actuators respectively. TCP is determined by the values of respective angles of rotation θ1to θ6of the axes J1to J6and the sizes of the respective sections of the articulated robot50.

The gun unit68is not limited to the C-type welding gun. For example, an X-type welding gun shown inFIG. 4(welding gun provided with a pair of opening/closing gun arms rotatably supported by a common support shaft)68amay be used for the gun unit68.

The point of intersection between the axis J1and the axis J2is defined as the origin (central point of the original axis) O as the reference point for the coordinate calculation and the control in relation to the articulated robot50. With the reference of the origin O, the vertically upward direction is represented by the height Z, the direction of the axis J2obtained when the angle of rotation θ1satisfies θ1=0 is represented by the depth Y, and the direction perpendicular to the height Z and the depth Y is represented by the width X. The three-dimensional orthogonal coordinate is expressed with the height Z, the width X, and the depth Y.

Next, explanation will be made with reference toFIGS. 5 and 6for the procedure for setting the operation path for the articulated robot50by using the off-line teaching apparatus10and the operation path-setting program35constructed as described above.

In the following description, an example will be explained as shown inFIG. 5in which the gun unit68is successively moved between a plurality of welding points (operation points) Tn (n=0, 1, 2, . . . ) for performing the welding for the workpiece80which is a thin plate.

The welding point Tn is represented by six values in total including three-dimensional orthogonal coordinate values (X, Y, Z) in the space in which the welding is performed and three parameters of TCP for indicating the posture of the gun unit68.

Further, it has been already verified that the gun unit68of the articulated robot50is capable of arriving at the welding point Tn, and the posture of the gun unit68when the welding point Tn is welded, i.e., the values of the vector Xr, the vector Yr, and the vector Zr are determined as well.

According to the embodiment of the present invention, further, the articulated robot50, the workpiece80, and the peripheral structures are dealt with as virtual models in the off-line teaching apparatus10. However, in the following description, these components will be represented-by the same reference numerals as those of the actual apparatus.

The workpiece80is dealt with as the model composed of a plurality of blocks in order to obtain a high speed of the processing.

In step S1shown inFIG. 6, an operator for the off-line teaching apparatus10starts up the operation path-setting program35by a predetermined operation method. OS, which is incorporated in the off-line teaching apparatus10, loads the operation path-setting program35stored on the hard disk34onto RAM29to execute the operation path-setting program35. The processing of the next step S2and the followings are executed by the operation path-setting program35.

Subsequently, in step S2, a temporary operation path90(seeFIG. 5), which is obtained by connecting the welding points Tn, is set. The operation path90may be linear as shown inFIG. 5, or it may be an arbitrary curve along which the articulated robot50is operated with ease. Operation paths100,102,104,110,112described later on may be set in the same manner as described above.

Subsequently, in step S3, it is investigated whether the articulated robot50is capable of setting the posture when the gun unit68is operated along the temporary operation path90. Further, it is investigated whether the gun unit68interferes with other structures or components in the operation path90.

Specifically, dividing points, which are obtained by dividing the operation path90into those having minute lengths, are set. The postures of the articulated robot50, i.e., the angles of rotation θ1to θ6, which are provided when the gun unit68is arranged at the respective dividing points, are determined. As for the calculation method for the angles of rotation θ1to θ6, a well-known matrix calculation method (hereinafter referred to as “inverse operation”) may be applied, for example, for the sizes of the respective sections of the articulated robot50and the six values in total defined by the vector Xr, the vector Yr, and the vector Zr for representing the posture of the gun unit68and the spatial position coordinates (X, Y, Z) of the dividing points.

When the posture of the gun unit68differs between the welding points T0and T1, the vector Xr, the vector Yr, and the vector Zr may be defined at the respective dividing points in a manner of linear interpolation. In this investigation, it is assumed that the electrodes70,72are opened so that they may not interfere with the workpiece80.

If the posture of the articulated robot50holds at each of the dividing points, the operation from the welding point T0to the welding point T1is actually assured.

Subsequently, in step S4, it is judged whether the solution of the inverse operation is normally determined at each of the dividing points. That is, it is judged whether TCP is capable of arriving at the dividing point. If the solution is not determined, if the value of the angle is without the rotatable range of the axis J1to J6even if the solution is determined, or if the articulated robot50interferes in the determined posture (for example, interferes with the obstacle82, other workpieces, and pillars in the factory), then the routine proceeds to step S5. If the solution is normally determined, the solution is within the rotatable range, and no interference occurs, then the routine proceeds to step S7.

The investigation for the interference is automatically performed by the function of the simulation circuit40. When the simulation circuit40is used, it is possible to reliably perform the three-dimensional investigation which is not clear from the screen of the monitor16as the two-dimensional expression.

In step S5, the narrow-area operation path, which is used to withdraw the gun unit68from the welding points T0and T1, is set by the function of the narrow-area operation path-setting section35a. A detailed method therefor will be described later on.

Subsequently, in step S6, the two withdrawing positions Ue (seeFIG. 14), which are obtained by the narrow-area operation path, are set as the start point P1and the arrival point P2respectively to set the wide-area operation path for moving the gun unit68from the start point P1to the arrival point P2. The setting is performed by the function of the wide-area operation path-setting section35b. A detailed method therefor will be described later on.

After setting the narrow-area operation path and the wide-area operation path, the routine proceeds to step S7.

In step S7, it is confirmed whether the investigation is performed for all of the operation paths90set in step S1to complete the process. If there is any operation path90which is not investigated, the routine returns to step S3to continue the investigation.

As described above, in the embodiment of the present invention, the welding points Tn are firstly connected to one another by the operation path90. If the operation path90is not applied as it is, the narrow-area operation path for avoiding, for example, any projection of the workpiece80and the obstacle82is set. Further, the wide-area operation path is set in order to make movement between the withdrawing positions Ue obtained by setting the narrow-area operation path.

When the narrow-area operation path is set, the portion, in which the workpiece exists, is extracted to investigate the interference in the internal space which is partially surrounded by the gun unit68. Therefore, it is possible to automatically set the path for avoiding any interference with the workpiece.

When the wide-area operation path is set, the template operation is applied, in which the gun unit68is moved by a prescribed distance in a prescribed direction. Therefore, it is possible to automatically set the wide-area operation path without performing, any complicated calculation which may be affected by the shapes of the workpiece80and the obstacle82.

Further, the setting of the narrow-area operation path for withdrawing the gun unit68of the articulated robot50from the welding point Tn on the workpiece80and the setting of the wide-area operation path for making movement from the start point P1to the arrival point P2are performed by the different processes adapted to the respective processes. Therefore, it is possible to efficiently set the operation path between the welding points Tn.

Next, explanation will be made with reference toFIGS. 7 to 16for the method for setting the narrow-area operation path in step S5shown inFIG. 6.

When the narrow-area operation path is set, three methods are principally used in order to determine the path for withdrawing the gun unit68from the welding portion of the workpiece80.

Firstly, a method is used to directly make movement from the welding portion to the withdrawing point. Secondly, a method is used to make movement from the welding point to the center of gravity on the cross section of the workpiece80. Thirdly, a method is used to extract only a portion of the workpiece80disposed closely to the opening of the gun unit68so that the withdrawing path is determined by preferentially using the extracted portion.

In step S101shown inFIG. 7, the gun unit68of the articulated robot50is set at the position at which the welding point T0of the workpiece80is welded.

The welding point T0gives the adjustment start position (Ts), and hence it is recorded on the temporary path table12for the operation data to perform the initialization (see Order1shown inFIG. 10).

As shown inFIG. 10, the path table120comprises the column120aof “Direction of gun unit”, the column120bof “Position of TCP”, and the column120cof “Angle of each axis”. The column120cof “Angle of each axis” includes the angles of rotation θ1to θ6.

Subsequently, in step S102shown inFIG. 7, TCP of the gun unit68located at the welding point To is set as the investigation start position Ts.

Subsequently, in step S103, the central point C (seeFIG. 11A) is defined at the substantial center of the gun unit68where the arm74and the electrodes70,72are overviewed. Radial straight lines1090are set from the central point C at predetermined angle widths to determine points of intersection1092on the inner circumferential side of the arm74and the electrodes70,72.

For the simplified explanation, the points of intersection1092are determined on the plane. However, actually, the points of intersection are determined in the three-dimensional shape by utilizing the data in the depth direction as well. Accordingly, the workpiece model (objective workpiece portion)1096described later on and the solids (or blocks)1094described below are dealt with as three-dimensional shapes not as planar shapes.

Subsequently, in step S104, as shown inFIG. 11B, the plurality of points of intersection1092are connected with a line segment to set an annular line1092bfor forming a closed interval1092a. Lattice-shaped lines, which have predetermined spacing distances, are set in the closed interval1092ato extract points of intersection1092cexisting in the closed interval1092a, of points of intersection of the lattice-shaped lines.

Subsequently, in step S105, as shown inFIG. 12A, square solids1094are embedded about the centers of the extracted points of intersection1092cso that no gap is formed to set the internal space of the gun.

The processes of steps S103to S105are executed by the function of the internal space-defining section35d.

Subsequently, in step S106, as shown inFIG. 12B, the workpiece80is arranged so that the workpiece80is matched for relative positions with respect to the gun unit68and the gun internal space. A portion, in which the workpiece80and the solids1094are overlapped with each other, is extracted as a workpiece model1096(seeFIG. 12C). Then, a portion80aof the workpiece80, which is not overlapped with the solids1094, is excluded, because the portion is irrelevant to the investigation of the interference. The respective solids1094, which constitute the workpiece model1096, are distinguished as workpiece solids1098. Even if the gun unit68is moved, the initial positions are fixed for the workpiece model1096and the respective workpiece solids1098.

The process in step S106is executed by the function of the workpiece-extracting section35e.

As described above, the process is easily performed, because the workpiece80is dealt with as the model with the plurality of blocks. Further, no useless processing is performed, because any unnecessary portion of the workpiece80(for example, non-overlapped portion80a) is automatically excluded.

Subsequently, in step S107, the principal component line (or the reference line) M1of the workpiece model1096is calculated by the technique of principal component analysis.

The method for calculating the principal component line M1will be explained in detail. As shown inFIG. 13A, central point coordinates (Xs, Ys, Zs) of the respective workpiece solids1098are defined.

Subsequently, as shown inFIG. 13B, the square sum of the distance s between each of the central point coordinates1098aand the principal component line M1is made minimum. The principal component line M1is defined to satisfy the following expression.
Σ|s|2=min

Specifically, the respective central point coordinates1098aare used to calculate the eigen value and the eigen vector of the variance and covariance matrixes, and Xs, Ys, Zs are used to determine the position of the center of gravity G1as an average value of the respective coordinates of X, Y, Z. The eigen vector, which passes through the center of gravity position G1, is the principal component line M1.

In the following steps S108to S112, as shown inFIG. 14, it is investigated whether any interference is caused when the operation is performed linearly from the investigation start point Ts to the withdrawing position Ue.

Specifically, in step S108, the withdrawing position Ue is determined. As shown inFIG. 14, the withdrawing position Ue resides in the position on the principal component line M1. The vector Xr, which is based on TCP of the gun unit68, is moved while making coincidence with the principal component line M1. The place, at which the gun unit68and the electrodes70,72do not interfere, is set as the withdrawing position Ue.

Subsequently, in step S109, the posture of the articulated robot50, i.e., the angles of rotation θ1to θ6are determined based upon the position and the posture of the gun unit68prescribed by the withdrawing position Ue. In this calculation method, the determination may be made by the inverse operation from the six values in total prescribed by the position coordinates (X, Y, Z) in the space of the withdrawing position Ue and the vector Xr, the vector Yr, and the vector Zr for representing the posture of the gun unit68.

Subsequently, in step S110for the branching judgment, it is judged whether the solution is normally determined in the inverse operation in step S109. That is, it is judged whether TCP is capable of arriving at the withdrawing position Ue. If the solution is not determined, if the value of the angle is without the rotatable range of the axis J1to J6even if the solution is determined, or if the articulated robot50interferes with other structures in the determined posture, then the routine proceeds to step S111. If the solution is normally determined, the routine proceeds to step S112.

In the investigation for the interference, especially when the X-type welding gun68ais adopted for the gun unit, the investigation is made for both of the open state and the closed state of the gun unit.

If the solution is not determined normally, the rotation operation is performed in step S111to make rotation by α° about the center of the vector Yr. The rotation operation means the fact that the gun unit68is rotated about the center of the withdrawing position Ue within a range to cause no interference with the workpiece model1096as indicated by two-dot chain lines shown inFIG. 14. After the vector Xr, the vector Yr, and the vector Zr are determined in this state, the routine returns to step S109. The investigation may be performed assuming that the angle α° has angle values in both of plus and minus directions.

If the loop, which is formed by steps S109to S111, is continuously executed predetermined number of times, the withdrawing position Ue is set again at an appropriate position which is farther on the principal component line M1and at which the posture of the articulated robot50holds. Next, the routine proceeds to the next step S112.

The process for making the rotation by α° is not limited to the process based on the center of the vector Yr. The process may reside in rotation about the axis, for example, the vector Xr or the vector Zr. Such a process may be adopted in the following process for rotation in the same manner as described above.

Next, the routine proceeds to the process shown inFIG. 8. In step S112, as indicated by the path V1shown inFIG. 14, the gun unit68is operated linearly from the investigation start position Ts to the withdrawing position Ue to investigate whether any interference occurs between the arm74and the electrodes70,72and the workpiece model1096.

In step S113for the branching judgment, if it is judged that any interference occurs according to the investigation in step S112, the routine proceeds to step S114. If it is judged that no interference occurs, the routine proceeds to step S131as the termination process, because the withdrawing operation can be performed by one time of the operation.

As described above, if the shape of the workpiece80is simple, it is possible to shorten the process time, because the withdrawing path can be determined by one time of the operation.

In the example shown inFIG. 14, the electrode70clearly interferes with the projection1096aof the workpiece model1096during the movement along the path V1. In this case, the routine proceeds to step S114.

In the following steps S114to S118, it is investigated whether any interference occurs when the operation is performed linearly from the investigation start position Ts to the center of gravity position G1of the workpiece model1096.

Specifically, in step S114, as shown inFIG. 15, the path V2, which connects the investigation start position Ts and the center of gravity position G1, is defined. The posture of the gun unit68is assumed, in which the vector Xr coincides with the path V2based upon the center of gravity position G1.

In step S115, the posture of the articulated robot50is determined with the assumed posture by the inverse operation described above.

Subsequently, in step S116for the branching judgment, it is investigated whether the solution in the inverse operation is normally determined in the same manner as in step S110. Then, in addition to the inverse operation process, it is also preferable to investigate whether the gun unit68interferes with the workpiece model1096.

If the solution is not determined normally, the rotation operation is performed to rotate by α° about the center of the vector Yr (step S117) in the same manner as in step S111. After the vector Xr, the vector Yr, and the vector Zr are determined in this state, the routine returns to step S115.

If the solution is determined, the interference is investigated by linearly operating the gun unit68along the path V2from the investigation start position Ts to the center of gravity position G1in step S118in the same manner as in step S112.

If the loop, which is formed by steps S115to S117, is continuously executed predetermined number of times, it is judged that the gun unit68cannot be arranged at the center of gravity position G1. After this processing is finished, the routine proceeds to step S124as the mask process.

If it is judged that any interference occurs by the investigation performed in step S118described above and step S130described later on, the routine proceeds to step S124via step S119for the branching judgment. If it is judged that no interference occurs, the routine proceeds to the next step S120, assuming that the operation is successfully performed up to the center of gravity position.

In step S120, the posture of the articulated robot50at that point of time is additionally recorded on the path table120.

Subsequently, in step S121, the operation is made linearly from the position of the gun unit68at that point of time to the withdrawing position Ue in the same manner as in step S112to investigate whether interference occurs. In the example shown inFIG. 15, the investigation is made along the principal component line M1.

In step S122for the branching judgment, if it is judged that any interference occurs by the investigation in step S121, the routine proceeds to step S123. If it is judged that no interference occurs, the routine proceeds to step S131as the termination process, because the withdrawing operation can be performed by this operation.

If there is any interference, the position of the gun unit68at that point of time is used as a new investigation start position in step S123to perform the updating process to make exchange for the previous investigation start position Ts. That is, in the example shown inFIG. 15, it is judged that the portion outside the gun internal space needs not to be considered any more, because the gun unit68is successively withdrawn up to the center of gravity position G1. Therefore, the investigation start position Ts is also updated in order to set the workpiece model1096again at that point of time.

The workpiece solids1096are extracted and updated in the same manner as in step S106described above. A new principal component line M1and a new center of gravity position G1are determined in the same manner as in step S107described above to update them respectively, and then the routine returns to step S114. After the routine returns to step S114, the processing is continued for the new workpiece solids1096, the principal component line M1, and the center of gravity position G1determined in step S123.

As described above, the portion, which is not included in the gun internal space, is successively excluded from the processing objective. Therefore, it is possible to determine the path for withdrawing the gun unit68for the workpiece80having any complicated shape as well.

However, if the loop, which is formed by steps S114to S123, is executed not less than predetermined number of times, it is judged that it is extremely difficult to withdraw the gun unit68for the workpiece80. Therefore, the processing is finished to make the plan again.

Next, explanation will be made for steps S124to S130as the processing to be performed if it is judged in step S119that any interference occurs due the operation along the path Vn (n=1, 2, 3, . . . ). In this case, only a portion of the workpiece model1096, which is located near the opening of the gun unit68, is extracted (or subjected to the mask process) to preferentially use the extracted portion so that the withdrawing path is determined.

In step S124shown inFIG. 9, as shown inFIG. 16, a portion of the workpiece model1096, which is located on the side of the opening of the gun unit68, is designated as a new objective workpiece portion1096cbased upon the center of gravity position G1, and the portion is distinguished from a portion1096cwhich is located on the side opposite to the opening. In the distinguishing process, the process is conceived so that the gun unit68is withdrawn for only the portion disposed closely to the opening. The processing is reserved for the portion1096clocated on the side opposite to the opening to extract the new objective workpiece portion1096bof the opening. The workpiece model1096is replaced with the new objective workpiece portion1096bto be dealt with up to steps S125to S130as the downstream processes.

Subsequently, in step S125, the principal component line M2and the center of gravity position G2are determined in relation to the new objective workpiece portion1096bin the same manner as in the process in step S107described above.

In step S126, the path V3for connecting the investigation start position Ts and the center of gravity position G2is defined in the same manner as in step S114described above to assume the posture of the gun unit68in which the vector Xr is allowed to coincide with the path V3based upon the center of gravity position G2.

Subsequently, in step S127, the posture of the articulated robot50is determined with the assumed posture by the inverse operation in the same manner as in step S115described above.

Subsequently, in step S128for the branching judgment, it is investigated whether the solution in the inverse operation is determined normally in the same manner as in step S116described above.

If the solution is not determined normally, the rotation operation is performed to make rotation by α° about the center of the vector Yr (step S129) in the same manner as in step S117described above. The routine returns to step S127.

If the solution is determined, in step S130, the gun unit68is linearly operated along the path V3from the investigation start position Ts to the center of gravity position G2to investigate the interference in the same manner as in step S118described above. The routine returns to step S119to judge the interference investigation.

As described above, even if no appropriate path is found when the path is retrieved for the object of the entire workpiece model1096, then only the new objective workpiece portion1096b, which is located closely to the opening of the gun unit68, can be preferentially used to determine the withdrawing path by applying the mask process to the workpiece model1096. Further, in the downstream processing, the workpiece model1096is successively converted into one having the simple shape by combining the updating process for the workpiece model1096in step S123described above, making it easy to determine the withdrawing path.

If the loop, which is formed by steps S127to S129, is continuously executed predetermined number of times, it is judged that the gun unit68cannot be arranged at the center of gravity position G2. The routine returns to step S124in order to perform the further mask process. However, if the mask process is executed not less than predetermined number of times, it is judged that the mask process is not effective for the shape of the workpiece80. The routine returns to step S120which is the withdrawing process applied with no mask process to calculate the withdrawing path again.

In step S131as the termination process, for example, the coordinate of the withdrawing position Ue as the investigation end position and the vector data are added as the operation data to the path table120(seeFIG. 10). Among them, Un as the operation data is inserted between the respective welding points Tn in the path table120. Next, the routine returns to the process shown inFIG. 6.

As described above, even if no appropriate path is found when the path is retrieved for the object of the entire workpiece model1096, then only the portion, which is located closely to the opening of the gun unit68, can be preferentially used to determine the withdrawing path by applying the mask process to the workpiece model1096. Further, in the downstream processing, the workpiece model1096is successively converted into one having the simple shape by combining the updating process for the workpiece model1096in step S123described above, making it easy to determine the withdrawing path.

In the above explanation, the technique for determining the path to withdraw the gun unit68from the welding point of the workpiece80has been described. As for the path for advancing the gun unit68into the welding point, the advancing path may be obtained by inverting the order in the path table120.

The principal component line has been used as the reference line for the workpiece model1096. Another reference line such as a straight line based on the least square method or a curve having an arbitrary order may be used if the shape of the workpiece model1096is represented by the line or the curve.

Next, explanation will be made with reference toFIGS. 17 to 21for the method for setting the wide-area operation path in step S6shown inFIG. 6.

In the following description, as shown inFIG. 17, explanation will be made for an example in which the gun unit68is operated from the start point P1at which the workpiece80as the thin plate is disposed to the arrival point P2. It is assumed that the obstacle82exists between the start point P1and the arrival point P2. The withdrawing positions Ue, which are determined in the setting of the narrow-area operation path described above, are dealt with as the start point P1and the arrival point P2.

In step S201shown inFIG. 18, the wide-area operation path-setting section35bof the operation path-setting program35is executed by a predetermined operation method by an operator for the off-line teaching apparatus10. This process may be continuously performed after the setting of the narrow-area operation path.

In step S202, the wide-area operation path-setting section35breads, from the hard disk34, the condition data37as the condition for setting the operation path, and the data is stored in RAM29. Further, the start point P1and the arrival point P2for setting the operation path as well as the shape of the workpiece80and the position of the obstacle82or the like are recognized from the condition data37.

Subsequently, in step S203, the operation path (path)100to connect the start point P1and the arrival point P2is set to investigate the acceptance or rejection of establishment of the posture and the occurrence of any interference when the gun unit68is operated along the operation path100.

Specifically, dividing points, which are obtained by dividing the operation path100into those having minute lengths, are set by the function of the path-investigating section35c. The postures of the articulated robot50, i.e., the angles of rotation θ1to θ6, which are obtained when the gun unit68is arranged at the respective dividing points, are determined by means of the inverse operation.

When the posture of the gun unit68differs between the start point P1and the arrival point P2, the vector Xr, the vector Yr, and the vector Zr for indicating the posture of the gun unit68may be defined at the respective dividing points in a manner of linear interpolation. In this investigation, it is assumed that the electrodes70,72are opened so that they may not interfere with the workpiece80.

If the posture of the articulated robot50holds at each of the dividing points, the operation from the start point P1to the arrival point P2is actually assured.

Steps S206, S212, S215, S218, S224, and S227described later on are also executed by the function of the path-investigating section35c.

In step S204, it is judged whether the solution of the inverse operation is normally determined at each of the dividing points. Specifically, it is judged whether TCP is capable of arriving at the dividing point. If the solution is not determined, if the value of the angle is without the rotatable range of the axis J1to J6even if the solution is determined, or if the articulated robot50interferes with the obstacle82or the like in the determined posture, then the routine proceeds to step S205. If the solution is normally determined, the termination process is performed for the setting of the wide-area operation path in step S229.

The function of the interference of the simulation circuit40may be used for the occurrence of interference.

In step S205shown inFIG. 19, in order to avoid the obstacle82or establish the posture, the template operation is applied from the start point P1for the gun unit68to set a first junction point Q1. In this case, the template represents the prescribed operation to be executed by the articulated robot50.

It is assumed that the first template is applied to the start point P1and the arrival point P2.

As shown inFIG. 21, the first template resides in the operation in which the first junction point Q1obtained by operating in the prescribed direction by the prescribed distance is set based upon TCP of the gun unit68, and the gun unit68is moved along the operation path (retracting path)102(seeFIG. 17) for connecting the start point P1and the first junction point Q1. The first junction point Q1is obtained by moving the position of the start point P1. It is assumed that the direction of the gun unit68possessed by the start point P1, i.e., the direction of TCP is unchanged.

In general, in order to properly perform the welding operation, the vector Zr is set to be perpendicular to the workpiece80. Therefore, it is preferable that the prescribed direction is the withdrawing direction for the gun unit68, i.e., the direction opposite to the vector Xr. A distance, with which the gun unit68can be sufficiently disengaged from the workpiece80, may be previously prescribed for the prescribed distance depending on the size of the gun unit68. In the gun unit of a general size, it is preferable that the prescribed distance is 100 mm.

The first template provides an effective retracting method for the thin plate which is a general workpiece. It is possible to set the operation path in accordance with the predetermined convenient retracting method without being affected by the shape of the workpiece.

Subsequently, in step S206, the acceptance or rejection of the posture establishment of the articulated robot50at the first junction point Q1and the occurrence of interference with the peripheral obstacle are investigated in the same manner as in step S203.

Subsequently, in step S207, if it is judged that the posture of the articulated robot50holds at the first junction point Q1and there is no interference as a result of the investigation in step S206, the routine proceeds to step S212. Otherwise, the routine proceeds to step S208.

In step S208, in order to obtain the appropriate posture at the first junction point Q1, the posture is set, in which the gun unit68is rotated by a predetermined angle about the center of the vector Xr, Yr or Zr. The rotating process is performed together with step S209as the next judgment process to make successive rotation for all of the vectors Yr, Zr, and Xr.

Subsequently, in step S209, it is confirmed whether the added up angle of the rotation by the predetermined angle one by one arrives at 360°. If the added up angle is less than 360°, the routine proceeds to step S206to judge the posture of the articulated robot50.

If no proper posture is obtained at the first junction point Q1even if the rotation is performed by 360° for each of the vector Xr, the vector Yr, and the vector Zr, then the first junction point Q1is set again in step S210at a position returned by a predetermined distance in the direction toward the start point P1. That is, if the first junction point Q1is set at the distance of 100 mm from the start point P1, the point is returned by 10 mm in the direction toward the start point P1to set the point again at the position of 90 mm.

Subsequently, in step S211, the added up value of the distance of the return of the first junction point Q1is confirmed. If the point is returned to the start point P1as the original point, then the process is stopped, and the plan is made again. If the point is not returned to the start point P1, i.e., if the range of 10 to 90 mm is given, then the routine proceeds to step S206to judge the posture of the articulated robot50.

In step S212(if it is judged that the posture of the articulated robot50holds and no interference is caused in the judgment in step S207described above), the investigation is performed by the same process as in step S203for the acceptance or rejection of the posture establishment and the occurrence of the interference when the gun unit68is operated along the operation path102.

Subsequently, in step S213, the judgment is made in the same manner as in step S204. If it is judged that the posture of the articulated robot50holds at the dividing point on the operation path102and the operation can be performed along the operation path102, then the routine proceed to the next step S214. If it is judged that the operation cannot be performed, the routine is returned to step S210to further change the position of the first junction point Q1.

In step S214, it is confirmed that two of the first junction point Q1and the first junction point Q2are set for the start point P1and the arrival point P2. The routine proceeds to the next step S215. If the first junction point Q2corresponding to the arrival point P2is not set, the routine is returned to step S205shown inFIG. 19.

Subsequently, in step S215, the operation path104for connecting the two first junction points Q1and Q2is set to investigate the acceptance or rejection of the posture establishment and the occurrence of the interference when the gun unit68is operated along the operation path104.

Specifically, the processing is performed while prescribing that the first junction point Q1is the new start point and the first junction point Q2is the new arrival point. The investigation is made for the operation path104in the same manner as in the investigation for the path between the start point P1and the arrival point P2in step S203described above.

Subsequently, in step S216, the judgment is made in the same manner as in step S204. If it is judged that the posture of the articulated robot50holds at the dividing point on the operation path104and the operation can be performed along the operation path104, then the termination process is performed for the setting of the wide-area operation path in step S229shown inFIG. 18. If it is judged that the operation cannot be performed, the routine proceeds to the next step S217.

In step S217shown inFIG. 20, in order to avoid the obstacle82, the template operation is applied from the first junction point Q1for the gun unit68to set a second junction point R1.

It is assumed that the second template is applied to the first junction point Q1(and Q2).

As shown inFIG. 21, the second template is used such that the line108for connecting the first junction point Q1and the predetermined established point106is set, and the second junction point R1is defined as the point obtained by moving by a prescribed distance from the first junction point Q1on the line108.

The second junction point R1is obtained by moving only the spatial position for the first junction point Q1. It is assumed that the direction of the gun unit68possessed by the first junction point Q1, i.e., the direction of TCP is unchanged.

The second template is provided for the gun unit68having been disengaged from the workpiece80in order to operate in the direction in which the interfering obstacle82does not exist. The movement is made in the direction toward the origin O with the free space in which the possibility of existence of the obstacle82is low. That is, in general, the obstacle82tends to be absent near the origin O such that the operation of the articulated robot50is not inhibited. When the operation is made in this direction, the possibility of avoiding the obstacle82is preferably increased. Further, as for the articulated robot of a general size, the prescribed distance is preferably 100 mm.

Those other than the origin O may be used as the established point106. If there is any place at which the obstacle82does not exist or if there is any place at which the operation is easily performed, such a place may be used for the established point106. For example, when the operation range of the articulated robot50is expressed in the space, it is conceived that the degree of freedom of the operation is largest at the central position. Therefore, such a position may be used for the established point106.

Subsequently, in step S218, the acceptance or rejection of the posture establishment of the articulated robot50at the second junction point R1and the occurrence of any interference with the peripheral obstacle are investigated in the same manner as in step S203.

Subsequently, in step S219, if it is judged that the posture of the articulated robot50holds at the second junction point R1and there is no interference as a result of the investigation in step S218, the routine proceeds to step S224. Other than the above, the routine proceeds to step S220.

In step S220, in order to obtain the appropriate posture at the second junction point R1, the posture is set, in which the gun unit68is rotated by a predetermined angle about the center of the vector Xr, Yr, or Zr in the same manner as in step S208.

Subsequently, in step S221, it is confirmed whether the added up angle of the rotation by the predetermined angle one by one arrives at 360°. If the added up angle is less than 360°, the routine proceeds to step S218to judge the posture of the articulated robot50.

If no proper posture is obtained at the second junction point R1even if the rotation is performed by 360° for each of the vector Xr, the vector Yr, and the vector Zr, then the second junction point R1is set again in step S222at a position obtained by movement by a predetermined distance in the direction toward the established point106. That is, if the second junction point R1is set at the distance of 100 mm from the first junction point Q1, the point is further moved by 100 mm in the direction toward the established point106to set the point again at the position of 200 mm.

Subsequently, in step S223, the added up value of the distance of the movement of the second junction point R1is confirmed. If the point arrives at the established point106, then the process is stopped, and the plan is made again. If the point does not arrive at the established point106, the routine proceeds to step S218to judge the posture of the articulated robot50.

In step S224(if it is judged that the posture of the articulated robot50holds and no interference is caused in the judgment in step S219described above), the operation path (retracting path)110for connecting the first junction point Q1and the second junction point R1is set. The investigation is performed by the same process as in step S203for the acceptance or rejection of the posture establishment and the occurrence of the interference when the gun unit68is operated along the operation path110.

Subsequently, in step S225, the judgment is made in the same manner as in step S204. If it is judged that the posture of the articulated robot50holds at the dividing point on the operation path110and the operation can be performed along the operation path110, then the routine proceed to the next step S226. If it is judged that the operation cannot be performed, the routine is returned to step S222to further change the position of the first junction point Q1.

In step S226, it is confirmed that two of the second junction points R1and R2are set for the first junction points Q1and Q2. The routine proceeds to the next step S227. If the second junction point R2corresponding to the first junction point Q2is not set, the routine is returned to step S217.

Subsequently, in step S227, the operation path112for connecting the two second junction points R1and R2is set to perform the investigation for the operation on the operation path112in the same manner as in step S203.

Subsequently, in step S228, the judgment is made in the same manner as in step S204. If it is judged that the posture of the articulated robot50holds at the dividing point on the operation path112and the operation can be performed along the operation path112, then the termination process is performed for the setting of the wide-area operation path. If it is judged that the operation cannot be performed due to the interference with the obstacle or the like, then the routine is returned to step S222, and the two second junction points R1, R2are further moved to repeat the process until the operation path holds.

After completing the setting of the operation path from the start point P1to the arrival point P2, the termination process is performed for the setting of the wide-area operation path in step S229shown inFIG. 18. The termination process includes, for example, the recording of the set wide-area operation path on the path table120(seeFIG. 10). The start point P1, the first junction point Q1, the second Junction point R1, the second junction point R2, the first junction point Q2, and the arrival point P2, which are included in the set operation path, are recorded in an order of operation on the path table120. Specifically, the values of the angles of rotation θ1to θ6about the respective axes of the articulated robot50and the values of the vectors Xr, the vector Yr, and the vector Zr indicating TCP and the position coordinates (X, Y, Z) at the respective points are recorded.

The operation path recorded on the path table120is converted by the data-preparing circuit38into the program data for operating the actual articulated robot50, and the data is transmitted to the robot control unit22.

The path table120is recorded in RAM29and the hard disk34. However, if necessary, the path table120may be printed or displayed on the screen of the monitor16.

In the foregoing description, the operation path104is the path for connecting the first junction points Q1and Q1. Alternatively, the first template may be applied to only the side of the start point P1to determine the first junction point Q1, and the application may be made as it is for the arrival point P2to set the path for connecting the first junction point Q1and the arrival point P2.

As for the operation path112, for example, the path for connecting the second junction point R1and the first junction point Q2may be set in the same manner as described above.

The operation paths102,110as the retracting path for making the retraction from the start point P1may be also used when the operation is made to another point other than the arrival point P2.

The prescribed distance, which is firstly applied for the first template, is 100 mm. Alternatively, starting from 10 mm, the distance may be elongated to 20 mm and 30 mm.

The order of application of the first and second templates may be inverted depending on the situation concerning, for example, the workpiece80and the obstacle82.

The set path table120indicates the wide-area operation path from the start point P1to the arrival point P2or the narrow-area operation path for representing the withdrawing operation from the welding point Tn. However, the operation paths are reversible, and they may be used upon the operation from the arrival point P2to the start point P1. Further, the path may be utilized up to an intermediate position without using the entire operation path.

Further, the embodiment of the present invention is applicable, for example, to an assembling robot and an applying robot other than the welding robot. The articulated robot50may have a seven-axis structure or a structure having, for example, a link mechanism or an expansion/contraction mechanism.

As described above, according to the embodiment of the present invention, the operation path100for connecting the start point P1and the arrival point P1is firstly set to investigate whether the gun unit68can be operated along the operation path100. Therefore, if the gun unit68can be operated along the operation path100, the operation path can be set extremely conveniently without providing any junction point or the like for the operation. Even if the operation on the operation path100cannot be performed, the first template is applied to operate by the prescribed distance in the direction opposite to the vector Xr as the prescribed direction from the start point P1or the arrival point P2. Therefore, the first junction points Q1and Q2can be set automatically and efficiently without performing any complicated calculation and without being affected by the shape of the workpiece80.

The first template is used to operate by the prescribed distance with which the gun unit68can be sufficiently retracted from the workpiece80depending on the size of the gun unit68in the prescribed direction set in the direction in which it is conceived to retract the gun unit68most easily with respect to the workpiece80. Therefore, although the method is convenient, the possibility of the successful and safe retraction from the workpiece80is high. Further, for example, in step206, the safety is verified. Therefore, there is no fear of interference or the like when the articulated robot50is actually operated.

According to the embodiment of the present invention, if the first junction points Q1, Q2or the second junction points R1, R2, which are set on the retracting path, are the points at which the articulated robot50cannot arrive or at which any interference occurs, the prescribed distances of the first and second templates are corrected to set the positions of the first junction points Q1, Q2or the second junction points R1, R2again. Therefore, it is possible to set the preferable retracting position.

As for the second template, the prescribed direction is the direction toward the origin O for the coordinate calculation for the articulated robot50. Therefore, the possibility of interfering with the obstacle82is low.

Further, according to the embodiment of the present invention, the first template and the second template are applied in combination. The gun unit68is firstly retracted from the workpiece80with the first template, and then the gun unit68is retracted from another obstacle82or the like with the second template to thereby verify the safety. Therefore, it is possible to set the retracting path and the wide-area operation path automatically and efficiently without performing any complicated calculation. Thus, it is of course possible to improve the operation efficiency. Further, it is also possible to improve the quality of the off-line teaching data without relying on the skill of the operator.

It is a matter of course that the setting method and the setting apparatus for the operation path for the articulated robot according to the present invention are not limited to the illustrative embodiments described above, which may be embodied in other various forms without deviating from the gist or essential characteristics of the present invention.