BACKGROUND OF THE INVENTION1. Field of the Invention:- This invention relates to a control apparatus for anindustrial robot. More particularly, the present inventionrelates to a control apparatus which is advantageously used forcontrolling an articulated industrial robot of the type whichholds a workpiece for movement relative to a fixed tool. 
2. Description of the Prior Art:- Industrial robots are widely used in various applications forgreatly reducing the burden of workers in factories. The robotis also used for performing a job with extreme precision and/orin a dangerous site. 
- Conventionally, an articulated industrial robot is made tohold a tool such as a grinder, a welding torch or a cutter formovement relative to a workpiece removably held by a fixedworkpiece holder. In this case, therefore, it is necessary toprovide a separate transfer mechanism for transferring theworkpiece to and from the workpiece holder. As a result, theoverall arrangement tends to become bulky and complicated. 
- In view of the above problem, it has been proposed to causean articulated industrial robot to hold a workpiece for movementrelative to a fixed tool, as disclosed for example in JapanesePatent Applications Laid-open Nos. 64(1989)-37603, 2(1990)-82302and 3(1991)-239486. According to this proposal, the robot can bealso utilized for transferring the workpiece to and from the tool within the maximum movable space of the robot, therebystreamlining the process without requiring a separate transfermechanism. 
- According to the teaching of Japanese Patent ApplicationsLaid-open Nos. 2(1990)-82302 and 3(1991)-239486 mentioned above,the control apparatus for the robot prepares a plurality ofteaching data (constituting a task program) by memorizing, at eachteaching point, the positional and attitudinal relation of arobot mechanical interface point (tip end) relative to a robotbase reference point or the positional and attitudinal relationof the robot base reference point relative to the mechanicalinterface point. In other words, the control apparatus memorizesonly the desired robot movement as the teaching data. 
- According to the teaching of Japanese Patent ApplicationsLaid-open Nos. 64(1989)-37603, on the other hand, the robotcontrol apparatus prepares a plurality of teaching data bymemorizing the target positions of the workpiece relative to therobot mechanical interface point. 
- Further, the prior art control apparatus disclosed in thethree laid-open Japanese appplications equally controls the roboton the premise that the tool and the workpiece configuration willnot be changed. 
- The prior art control apparatus described above has beenfound to have various disadvantages. Several of thesedisadvantages are briefly enumerated below. The reasons for thedisadvantages of the prior art will be readily understood from thedetailed description of the embodiments of the present invention givenhereinafter and therefore not specifically described here. 
- (1) The task program including the teaching data as to therelation between the robot tip end and the robot base or the robottip end and the workpiece is not directly indicative of therelation between the tool and the workpiece, so that it isdifficult to realize, from the task program, how the workpiece isworked on by the tool.
- (2) It is difficult to use the CAD (computer aided design)data of a workpiece for making a task program.
- (3) It is difficult to modify the task program for adaptionto a change in the position and/or attitute of the tool, to achange in the configuration and/or dimension of the workpiece,arc to a change in the workpiece holding position provided by thetip end of robot.
- (4) The robot is capable of operating only with respect to asingle tool. Thus, it is impossible for the single robot toperform successive jobs on the workpiece by a series of tools.
- EP-A-0440816 describes a method of controlling anindustrial robot which manoeuvres a workpiece relativeto a tool. The method is concerned with the problem ofreducing the teaching time required for changing theorientation of a workpiece relative to the tool andinvolves changing the posture between a workpiece and anarbitrary work point which is defined on the referenceco-ordinates of the robot. When the workpiece issubjected to a teaching operation with respect to thework point, the work point is temporarily controlled asif it were the end effector from a robot control point. 
SUMMARY OF THE INVENTION- It is, therefore, an object of the present invention toprovide a robot control apparatus wherein the task program isdirectly indicative of the positional and attitudinal relation ofa tool relative to a workpiece. 
- An objet of an embodiment of the present invention is to provide a robotcontrol apparatus which facilitates the use of CAD workpiece datafor preparing a task program. 
- Another object of an embodiment of the present invention is to provide arobot control apparatus wherein the task program can be easilymodified to improve the robot movement. 
- A further object of an embodiment of the present invention is to provide arobot control apparatus which enables the robot to operatesuccessively relative to a series of tools. 
- Still another object of an embodiment of the present invention is to provide arobot control apparatus wherein most content of the existing taskprogram can be conveniently utilized for making a new taskprogram when there is a change in the position and attitude of thetool, the configuration of the workpiece, or the holding positionof the workpiece. 
- According to the present invention there isprovided a control apparatus for an articulatedindustrial robot which holds a workpiece (W) formovement relative to at least one fixed tool, the robothaving a base reference point (Bo) and a mechanicalinterface point (Ho), the tool having a tool tip (Eo),the workpiece having a workpiece reference point (Wo),characterized in that the control apparatus comprises:setting data input means for entering setting data whichincludes a positional and attitudinal relation Et of thetool tip (Eo) relative to the robot base reference point(Bo) as well as a positional and attitudinal relation Ew of the workpiece reference point (Wo) relative to therobot mechanical interface point (Ho); T determinationmeans connected to the robot for calculating apositional and attitudinal relation T of the robotmechanical interface point (Ho) relative to the robotbase reference point (Bo) on the basis of jointvariables (n) of the robot; wXt determination meansconnected to the setting data input means and the Tdetermination means for calculating a positional andattitudinal relation wXtj of the tool tip (Eo) relativeto the workpiece reference point (Wo) on the basis ofthe positional and attitudinal relations Et, Ew, T;speed input means for entering a translational speed vjof the workpiece (W) relative to the tool; taskprogramming means connected to the wXt determinationmeans and the speed input means for preparing andstoring a task program which includes the positional andattitudinal relations Et, Ew, wXtj and the translationalspeed vj, the task program including a plurality ofteaching data corresponding to teaching points, each ofthe teaching data containing at least the positional andattitudinal relation wXtj and the translational speed vj;teaching data extraction means connected to the taskprogramming means for successively taking out theteaching data from the task program; setting dataextraction means connected to the task programming meansfor taking out the positional and attitudinal relationsEt, Ew from the task program; trajectory, planning meansconnected to the teaching data extraction means forplanning a trajectory of the workpiece (W) relative tothe tool in accordance with the teaching data taken outby the teaching data extraction means; interpolationmeans connected to the trajectory planning means forinterpolating the trajectory between each two successiveteaching points; and instruction means connected to the interpolation means and the robot for causing the robotto move the workpiece (W) along the interpolatedtrajectory. 
- Also according to the present invention a controlapparatus for an articulated industrial robot whichholds a workpiece (W) for movement relative to at leastone fixed tool, the robot having a base reference point(Bo) and a mechanical interface point (Ho), the toolhaving a took tip (Eo), the workpiece having a workpiecereference point (Wo), characterized in that the controlapparatus comprises: setting data input means forentering a plurality of setting data each of whichincludes a positional and attitudinal relation Et of thetool tip (Eo) relative to the robot base reference point(Bo) as well as a positional and attitudinal relation Ewof the workpiece reference point (Wo) relative to therobot mechanical interface point (Ho); identifying meansconnected to the setting data input means for givingidentifiers to the respective setting data; file makingmeans connected to the identifying means for preparingand storing a file of the thus identified setting data;T determination means connected to the robot forcalculating a positional and attitudinal relation T ofthe robot mechanical interface point (Ho) relative tothe robot base reference point (Bo) on the basis ofjoint variables (n) of the robot: wXt determinationmeans connected to the T determination means and thefile making means for calculating a positional andattitudinal relation wXtj of the tool tip (Eo) relativeto the workpiece reference point (Wo) on the basis ofthe positional and attitudinal relations Et, Ew, T;speed input means for entering a translational speed vjof the workpiece (W) relative to the tool; identifierinput means for entering identifiers corresponding tothe plurality of setting data; task programming means connected to the wXt determination means, the speedinput means and the identifier input means for preparingand storing a task program which includes a plurality ofteaching data corresponding to teaching points, each ofthe teaching data containing at least the positional andattitudinal relation wXtj; and the translational speedvj together with the corresponding identifiers enteredat the identifier input means; teaching data extractionmeans connected to the task programming means forsuccessively taking out the teaching data from the taskprogram; setting data extraction means connected to thefile making means and the teaching data extraction meansfor taking out the positional and attitudinal relationsEt, Ew from the file making means according to theidentifiers which are included in the teaching datataken out by the teaching data extraction means;trajectory planning means connected to the teaching dataextraction means for planning a trajectory of theworkpiece (W) relative to the tool in accordance withthe teaching data taken out by the teaching dataextraction means; interpolation means connected to thetrajectory planning means for interpolating thetrajectory between each two successive teaching points;and instruction means connected to the interpolationmeans and the robot for causing the robot to move theworkpiece (W) along the interpolated trajectory. 
- Also according to the present invention, there isprovided a control apparatus for an articulatedindustrial robot which holds a workpiece (W) formovement relative to at least one fixed tool, the robothaving a base reference point (Bo) and a mechanicalinterface point (Ho), the tool having a tool tip (Eo),the workpiece having a workpiece reference point (Wo),characterized in that the control apparatus comprises:setting data input means for entering setting data which includes a positional and attitudinal relation Et of thetool tip (Eo) relative to the robot base reference point(Bo) as well as a positional and attitudinal relation Ewof the workpiece reference point (Wo) relative to therobot mechanical interface point (Ho) ; T determinationmeans connected to the robot for calculating apositional and attitudinal relation T of the robotmechanical interface point (Ho) relative to the robotbase reference point (Bo) on the basis of jointvariables (n) of the robot; teaching data input meansfor entering a positional and attitudinal relation wXt.of the tool tip (Eo) relative to the workpiece referencepoint (Wo) and a translational speed vj of the workpiece(W) relative to the tool; task programming meansconnected to the setting data input means and theteaching data input means for preparing and storing atask program which includes the positional andattitudinal relations Et, Ew, wXtj and the translationalspeed vj, the task program including a plurality ofteaching data corresponding to teaching points, each ofthe teaching data containing at least the positional andattitudinal relation wXtj and the translational speed vj;teaching data extraction means connected to the taskprogramming means for successively taking out theteaching data from the task program; setting dataextraction means connected to the task programming meansfor taking out the positional and attitudinal relationsEt, Ew from the task program; trajectory planning meansconnected to the T determination means and the teachingdata extraction means for planning a trajectory of theworkpiece (W) relative to the tool in accordance withthe teaching data taken out by the teaching dataextraction means; interpolation means connected to thetrajectory planning means for interpolating thetrajectory between each two successive teaching points; and instruction means connected to the interpolationmeans and the robot for causing the robot to move theworkpiece (W) along the interpolated trajectory. 
- Also according to the present invention, there isprovided a control apparatus for an articulatedindustrial robot which holds a workpiece (W) formovement relative to at least one fixed tool, the robothaving a base reference point (Bo) and a mechanicalinterface point (Ho), the tool having a tool tip (Eo),the workpiece having a workpiece reference point (Wo),characterized in that the control apparatus comprises:setting data input means for entering a plurality ofsetting data each of which includes a positional andattitudinal relation Et of the tool tip (Eo) relative tothe robot base reference point (Bo) as well as apositional and attitudinal relation Ew of the workpiecereference point (Wo) relative to the robot mechanicalinterface point (Ho); identifying means connected to thesetting data input means for giving identifiers to therespective setting data; file making means connected tothe identifying means for preparing and storing a fileof the thus identified setting data; T determinationmeans connected to the robot for calculating apositional and attitudinal relation T of the robotmechanical interface point (Ho) relative to the robotbase reference point (Bo) on the basis of jointvariables (n) of the robot; teaching data input meansfor entering a positional and attitudinal relation wXtjof the tool tip (Eo) relative to the workpiece referencepoint (Wo) and a translational speed vj of the workpiece(W) relative to the tool together with identifierscorresponding to the plurality of setting data; taskprogramming means connected to the teaching data inputmeans for preparing and storing a task program whichincludes a plurality of teaching data corresponding to teaching points, each of the teaching data containing atleast the positional and attitudinal relation wXtj andthe translational speed vj together with thecorresponding identifiers entered at the teaching datainput means; teaching data extraction means connected tothe task programming means for successively taking outthe teaching data from the task program; setting dataextraction means connected to the file making means andthe teaching data extraction means for taking out thepositional and attitudinal relations Et, Ew from thefile making means according to the identifiers which areincluded in the teaching data taken out by the teachingdata extraction means; trajectory planning meansconnected to the T determination means and the teachingdata extraction means for planning a trajectory of theworkpiece (W) relative to the tool in accordance withthe teaching data taken out by the teaching dataextraction means; interpolation means connected to thetrajectory planning means for interpolating thetrajectory between each two successive teaching points;and instruction means connected to the interpolationmeans and the robot for causing the robot to move theworkpiece (W) along the interpolated trajectory. 
- In one embodiment, there is provided a controlapparatus for an articulated industrial robot whichholds a workpiece for movement relative to at least onefixed tool, the robot having a base reference point anda mechanical interface point, the tool having a tooltip, the workpiece having a workpiece reference pointand a mechanical interface point, the tool having a tooltip, the workpiece having a workpiece reference point,the control apparatus comprising: setting data inputmeans for entering setting data which include apositional and attitudinal relation Et of the tool tiprelative to the robot base reference point as well as a positional andattitudinal relation Ew of the workpiece reference point relativeto the robot mechanical reference point; means for determining apositional and attitudinal relation T of the robot mechanicalinterface point relative to the robot base reference point; meansfor supplying a positional and attitudinal relation wXtj of thetool tip relative to the workpiece reference point and forsupplying a translational speed vj of the workpiece relative tothe tool; task programming means for preparing and storing a taskprogram which includes a plurality of teaching data correspondingto teaching points, each of the teaching data containing at leastthe relation wXtj and the translational speed vj ; teachingdata extraction means for successively taking out the teachingdata from the task program; trajectory planning means for planninga trajectory of the workpiece relative to the tool in accordancewith the teaching data taken out by the teaching data extractionmeans; interpolation means for interpolating the trajectorybetween each two successive teaching points; and instructionmeans for causing the robot to move the workpiece along theinterpolated trajectory. 
- Various features and advantages of the present invention willbecome apparent from the following description of the preferredembodiments given with reference to the accompanying drawings. 
BRIEF DESCRIPTION OF THE DRAWINGS- In the accompanying drawings: 
- Fig. 1 is a perspective view showing a robot controlled by acontrol apparatus according to an embodiment of the present invention;
- Fig. 2 is a plan view showing a teach pendant;
- Fig. 3 is a block diagram showing a general electricarrangement of the control apparatus;
- Fig. 4 is a schematic view showing the relatioship inposition and attitude between the robot, a tool and a workpiece;
- Fig. 5 is an exploded perspective view showing therelationship between various links of the robot;
- Fig. 6 is a fragmentary side view showing a first link of therobot as seen in the direction of an arrow U in Fig. 5;
- Fig. 7 is a schematic view illustrating the relationship inposition and attitude between the tool and the workpiece;
- Fig. 8 is a control block diagram according to a firstembodiment of the present invention;
- Fig. 9 is a schematic view similar to Fig. 4 but showing therelationship in position and attitude between the robot, aplurality of tools and a workpiece;
- Fig. 10 is a flow chart showing the teaching procedureperformed according to the first embodiment;
- Fig. 11 is a view showing the content of the task programprepared according to the first embodiment;
- Fig. 12 is a flow chart showing the playback procedureaccording to the first embodiment;
- Fig. 13 is a schematic view illustrating a change of the toolposition;
- Fig. 14 is a flow chart illustrating how to use an existingtask program for making a new task program adapted to the changedtool position;
- Fig. 15 is a view showing comparison between the existingtask program and the new task program;
- Fig. 16 is a schematic view illustrating a change of theworkpiece holding position provided by the robot hand;
- Fig. 17 is a view showing how to use an existing task programfor making a new task program adapted to the changed workpieceholding position;
- Fig. 18 is a view illustrating a change of the workpiececonfiguration;
- Fig. 19 is a view showing how to use an existing task programfor making a new task program adapted to the changed workpiececonfiguration;
- Fig. 20 is a control block diagram according to a secondembodiment of the present invention;
- Fig. 21 is a flow chart showing the steps of making a file ofidentified setting data as a preliminary part of the teachingprocedure performed according to the second embodiment;
- Fig. 22 is a flow chart showing a main part of the teachingprocedure performed according to the second embodiment;
- Fig. 23 is a view showing the content of the task programprepared according to the second embodiment;
- Fig. 24 is a flow chart showing the playback procedureaccording to the second embodiment;
- Fig. 25 is a control block diagram according to a thirdembodiment of the present invention;
- Fig. 26 is a flow chart showing the teaching procedureaccording to the third embodiment;
- Fig. 27 is a control block diagram according to a fourthembodiment of the present invention;
- Fig. 28 is a flow chart showing the teaching procedureaccording to the fourth embodiment;
- Fig. 29 is a perspective view showing an alternative robotwhich may be controlled by the control apparatus according to thepresent invention; and
- Fig. 30 is a schematic view showing the same robot.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS1. Description of the Overall Arrangement:
- Referring first to Fig. 1, there is illustrated an industrialrobot 2 which is controlled by a control apparatus 1 according toan embodiment of the present invention. The robot 2 has a base 9 fixed on a floorfor example. Of course, the illustrated robot is only oneexample and therefore may be replaced by a different robot. 
- The robot 2 shown in Fig. 1 has six rotary joints (points ofarticulation) 3a-3f to provide six degrees of freedom. The freeend joint 3f carries a hand 4 for holding a workpiece W which maybe an object being welded for example. The respective joints 3a-3fare rotated about respective rotary axes 6a-6f by respectivedrive devices 5a-5f. Though not shown, each of the drive devices5a-5f includes a reduction mechanism, a servomotor and a rotationdetector (rotary encoder). 
- The workpiece W held by the robot 2 may be made to undergovarious treatments provided by a plurality of tools 7. Each ofthe tools 7 is supported on a support 8 which is, in turn, fixedto the floor like the base 9 of the robot 2. The tool performs apredetermined treatment such as grinding, cutting or welding. 
- The control apparatus 1 is connected to an operating box 10and a teach pendant 11. The operating box 10 is used forswitching between a teaching mode and a playback mode and forstarting the playback mode operation. The teach pendant 11 isused for manually operating the robot 2 and for entering, either in a on-line or off-line state, various data (e.g. setting data,teaching data and identifiers) which are needed for making taskprograms. 
- As shown in Fig. 2, the teach pendant 11 includes robotoperation buttons 42 for manually operating the respective drivedevices 5a-5f, a teaching point memory button 43, and an ENDbutton 44. The teach pendant further includes input keys 45 forentering the above-mentioned data (e.g. setting data, teachingdata and identifiers), and a changeover switch 46 for selectingbetween a teaching-data input mode and a setting-data input mode. 
- As shown in Fig. 3, the control apparatus 1 comprises acentral processing unit (CPU) 12 which receives the input signalsfrom the operating box 10 and the teach pendant 11 (Fig. 1)through an interface 13. On the basis of the calcuation andcontrol programs stored in a ROM (read only memory) 14, the CPU 12generates various data and task programs for feeding to the theRAM (random access memory) 15. The CPU 12 also generates driveinstruction data for the respective drive devices 5a-5f on thebasis of the calculation programs stored in the ROM 14 and thetask programs stored in the RAM 15. The drive instruction datathus generated are fed through a dual port RAM 16 for controllingservodrivers 17a-17f associated with the respective drive devices5a-5f. 
- Reference is now made to Fig. 4 which shows the positionaland attitudinal relation between the robot 2, the workpiece W andeach tool 7. For the convenience of explanation, only one tool 7is shown in Fig. 4 relative to the robot 2 which is illustratedonly schematically. 
- In Fig. 4, two different coordinate systems are taken whichinclude a rectangular base coordinate system Bo-XYZ and arectangular mechanical interface coordinate system Ho-X'Y'Z'.The base coordinate system Bo-XYZ is fixed relative to a referencepoint Bo of the robot base 9, whereas the mechanical interfacecoordinate system Ho-X'Y'Z' is fixed relative to a mechanialinterface point Ho of the robot 2. Further, in Fig. 4, referencesign Eo represents the tip of the tool 7, whereas reference signWo designates a predetermined reference point Wo of the workpieceW. 
- Reference sign Et in Fig. 4 represents the positional andattitudinal relation of the tool tip Eo relative to the robotbase reference point Bo, whereas reference sign Ew represents thepositional and attitudinal relation of the workpiece referencepoint Wo relative to the mechanical interface point Ho.Similarly, reference sign T represents the positional andattitudinal relation of the mechanical interface point Horelative to the robot base reference point Bo, whereas referencesign wXt designates the positional and attitudinal relation of thetool tip Eo relative to the workpiece reference point Wo. Therespective relations Et, Ew, T, wXt are expressed in the followingmanner. 
2. Description of Et:- The positional and attitudinal relation Et of the tool tip Eorelative to the base reference point Bo of the robot 2 is firstdescribed. 
- The attitude of the tool tip Eo in the base coordinate system Bo-XYZ may be represented by a set of three unit vectors p1, p2,p3 fixed at the tool tip Eo. Each of the unit vectors p1-p3 aredefined by three components extending along the respective XYZ-axes.For example, the unit vector p1 may be defined by threecomponents F1x (along the X-axis of the base coordinate systemBo-XYZ), F2x (along the Y-axis), F3x (along the Z-axis). Thus,the respective unit vectors p1-p3 can be expressed by thefollowing formulas (1)-(3) when viewed in the base coordinatesystem.p1 = (F1x, F2x, F3x)p2 = (F1y, F2y, F3y)p3 = (F1z, F2z, F3z) 
- Further, the position vector BoEo of the tool tip Eo in thebase coordinate system Bo-XYZ may be defined by the followingformula (4) (see Fig. 4).BoEo = (Eox, Eoy, Eoz) 
- Therefore, the positional and attitudinal relation Et of thetool tip Eo relative to the robot base reference point Bo can beexpressed by the following matrix (5). 
- In the 4-row-4-column matrix (or 4 by 4 matrix or 4x4 matrix)of the formula (5), the upper left 3x3 partition represents theattitude of the tool tip Eo, whereas the 3-row-1-column vector(Eox, Eoy, Eoz)T at the upper right represents the position ofthe tool tip Eo relative to the robot base reference point Bo. Itshould be appreciated that the notation "( )T " means row-to-columntransposition. 
- On the other hand, the positional and attitudinal relation Etof the tool tip Eo relative to the robot base reference point Bocan be also expressed by the following formula (6).Et = Trans(Eox, Eoy, Eoz) · Rot(X, α x) · Rot(Y, α y) ·Rot(Z, α z) 
- In the formula (6), the notation "Trans(Exo, Eyo, Ezo)" is ahomogeneous transformation matrix (given in the formula (7) below)representing translational transformation of the tool tip Eo fromthe robot base reference point Bo. Each of the notations "Rot(X,α x)", "Rot(Y, α y)" and "Rot(Z, α z)" is also a homogeneoustransformation matrix (given in the formulas (8)-(10) below)representing rotation of the tool tip Eo about the X-axis (or Y-axisor Z-axis) of the base coordinate system Bo-XYZ through anangle α x (or α y or α z). 
- According to the formula (6), the position of the tool tip Sois expressed by the translation "Trans(Eox, Eoy, Eoz)", whereasthe attitude of the tool tip Eo is given by the roll-pitch-yawangle expression "Rot(X, α x) · Rot(Y, α y) · Rot(Z, α z)". Theproduct of the matrices contained the formula (6) is also a 4-row-4-columnmatrix which is equivalent to the matrix of the formula(5). 
- In the field of robotics, it is well-known to use 4-row-4-columnmatrices for transforming coordinate systems (as above),thereby describing the position and attitude of an objectrelative to a reference object. 
3. Description of Ew:- The positional and attitudinal relation Ew of the workpiecereference point Wo relative to the mechanical interface point Hoof the robot 2 is next described. 
- The attitude of the workpiece reference point Wo in themechanical interface coordinate system Ho-X'Y'Z' may berepresented by a set of three unit vectors q1, q2, q3 fixed atthe workpiece reference point Wo. Each of the unit vectors q1-q3are defined by three components along the respective X'Y'Z'-axes.For example, the unit vector q1 may be defined by threecomponents G1x (along the X'-axis of the coordinate system Ho-X'Y'Z'),G2x (along the Y'-axis), G3x (along the Z'-axis). Thus,the respective unit vectors q1-q3 can be expressed by thefollowing formulas (11)-(13) when viewed in the mechanicalinterface coordinate system.q1 = (G1x, G2x, G3x)q2 = (G1y, G2y, G3Y)q3 = (G1z, G2z, G3z) 
- Further, the position vector HoWo of the workpiece referencepoint Wo in the mechanical interface coordinate system Ho-X'Y'Z'may be defined by the following formula (14).HoWo = (Wox, Woy, Woz) 
- Therefore, the positional and attitudinal relation Ew of theworkpiece reference point Wo relative to the mechanical interface point Ho can be expressed by the following matrix (15). 
- On the other hand, the positional and attitudinal relation Ewof the workpiece reference point Wo relative to the mechanicalinterface point Ho can be also expressed by the following formula(16).Ew = Trans(Wox, Woy, Woz) · Rot(X', β x) · Rot(Y', β y) ·Rot(Z', β z) 
- The meaning of the formula (16) is similar to that of theformula (6). Again, the product of the matrices contained in theformula (16) is also a 4-row-4-column matrix which is equivalentto the matrix of the formula (15). 
4. Description of T:- Since the robot 2 has a plurality of joints, the positionaland attitudinal relation T of the mechanical interface point Hoof the robot 2 relative to the base reference point Bo can beconveniently expressed by the so-called "Denavit-Hartenbergnotation" (hereafter referred to as "DH Notation"). The DHnotation is fully described in "ROBOT MANIPULATORS" (Written byR. P. Paul: Published by MIT Press in 1981). For the convenience of explanation, the DH notation is described below with referenceto Figs. 5 and 6. 
- As shown in Figs. 5 and 6, the robot 2 is assumed to have abase link 18a and first to sixth links 18b-18g. Besides the basecoordinate system Bo-XYZ and the mechanical interface coordinatesystem Ho-X'Y'Z', different coordinate systems OT0-X0Y0Z0 to OT5-X5Y5Z5are systematically related to the respective links. 
- According to the DH notation, the relation An between eachtwo successive coordinate systems is expressed by the followingformula (17).An = Rot(Z,  n) · Trans(0, 0, dn) · Trans(an, 0, 0) ·Rot(X, α n) 
- The parameters  n, dn, an and α n contained in the formula(17) are determined for the respective links 18a-18g in thefollowing manner. 
- First, at the base link 18a, since the Z0-axis of the firstlink 18b extends in the same direction as the Z-axis of the baselink 18a, a rotational angle a n about the X-axis is 0.0.Further, the coordinate system origin OT0 of the first link 18b isspaced from the base reference point Bo of the base link 18a byan amount dn=d0 in the Z-axis direction and by an amount an=0.0in the X-axis direction. Moreover,  n at the base link 18a,namely 0 which is initial rotation of the first link 18b aboutthe Z-axis, is zero (0.0). Note that the subsequent rotation ofthe first link 18b about the Z-axis is taken into considerationin the next step, as described below. 
- At the first link 18b, the Z1-axis of the second link 18c isrotationally displaced from the Z0-axis of the first link 18b byan angle α n=+ π /2 about the X0-axis of the first link 18b.Further, the coordinate system origin OT1 of the second link 18cis spaced from the coordinate system origin OT0 of the first link18b by an amount dn=d1 in the Z0-axis direction and by an amountan=a1 in the X0-axis direction (see Fig. 6). Moreover, the firstlink 18b is rotated relative to the base link 18a by  n=1about the Z0-axis (Figs. 1 and 4). 
- At the second link 18c, the Z2-axis of the third link 18d isparallel to the Z1-axis of the second link 18c, hence α n=0.0.Further, the coordinate system origin OT2 of the third link 18d isspaced from the coordinate system origin OT1 of the second link18c by an amount dn=0.0 in the Z1-axis direction and by an amountan=a2 in the X1-axis direction. Moreover, the second link 18c isrotated relative to the first link 18b by  n=2 about the Z1-axis(see also Fig. 1). 
- The parameters  n, dn, an and α n for the third to sixthlinks 18d-18g are listed in the following table 1 together withthose already described. Of these parameters,  n alone can bechanged by means of the drive devices 5a-5f (Fig. 1) and istherefore called "joint variable". | No. | Likn | n | an | dn | αn |  | 0 | Base Link | 0.0 | 0.0 | d0 | 0.0 |  | 1 | 1st Link | 1 | a1 | d1 | +π /2 |  | 2 | 2nd Link | 2 | a2 | 0.0 | 0.0 |  | 3 | 3rd Link | 3 | a3 | 0.0 | +π /2 |  | 4 | 4th Link | 4 | 0.0 | d4 | +π /2 |  | 5 | 5th Link | 5 | 0.0 | 0.0 | -π /2 |  | 6 | 6th Link | 6 | 0.0 | d6 | 0.0 |  
 
- For the ith link, the formula (17) may be rewritten, asfollows.Ai = Rot(Z,  i)· Trans(ai, 0, dn)· Rot(X, α i) 
- The positional and attitudinal relation T (Fig. 4) of themechanical interface point Ho of the robot 2 relative to the basereference point Bo of the robot 2 is obtained by taking theproduct of Ai for the respective links 18a-18g, as indicated bythe following equation (19).T = A0 · A1 · A2 · A3 · A4 · A5 · A6 
- Since each of the elements contained in both of the formulas(18) and (19) is a 4-row-4-column matrix, the product obtained by the formula (19) is also a 4-row-4-column matrix. The resultingproduct matrix is given in the following formula (20). 
5. Description of wXt:- Then, the positional and attitudinal relation wXt of the tooltip Eo relative to the workpiece reference point Wo is describedwith reference to Fig. 7. 
- In substantially the same manner as already described withrespect to Et (Fig. 4), the positional and attitudinal relationwXt of the tool tip Eo relative to the workpiece reference pointWo is also expressed by the following formula (21) which issimilar to the formula (6) for calculating Et.wXt = Trans(Sx, Sy, Sz) · Rot(X,  x) · Rot(Y,  y) ·Rot(Z,  z) 
- The respective notations "Trans(Sx, Sy, Sz)" "Rot(X,  x)","Rot(Y, y)" and "Rot(Z,  z)" contained in the formula (21)correspond to the notations used in the formula (6), so that theyrepresent a 4-row-4-column transformation matrix, as expressed bythe formulas (22)-(25) below. Note that the parameters used inthe formula (21) are shown in Fig. 7 except for  x and  z whichcan be easily inferred from the illustrated parameter  y. 
- According to the formula (21), the position of the tool tipEo is expressed by the translation "Trans(Sx, Sy, Sz)", whereasthe attitude of the tool tip Eo is given by the roll-pitch-yawangle expression "Rot(X,  x) · Rot(Y,  y) · Rot(Z,  z)". Theproduct of the matrices contained the formula (21) is also a 4-row-4-columnmatrix which is given by the following formula (26). 
6. Correlation between Et, Ew, T and wXt:- As described above, all of Et, Ew, T and wXt are equallyrepresented by a 4-row-4-column matrix. Thus, by referring toFig. 4, it is clearly understood that the following equation (27)is applicable.Et = T· Ew· wXt 
- By using the equation (27), it is possible to determine T ifEt, Ew and wXt are known. It is also possible to determine wXt ifEt, Ew and T are known. 
7. Description of First Embodiment:- Having described the background items necessary forconveniently understanding the present invention, the firstembodiment of the present invention is now described. 
- Referring to Fig. 8, the control apparatus 1 of the firstembodiment comprises a setting data input means 19 for enteringthe positional and attitudinal relation Et of the tool tip Eorelative to the base reference point Bo of the robot 2, and thepositional and attitudinal relation Ew of the workpiece referencepoint Wo relative to the mechanical interface point Ho of therobot 2. The data entry may be performed by using the input keys 45 of the teach pendant 11 (see Figs. 1 and 2). 
- The control apparatus 1 also comprises a T determinationmeans 20 for determining the positional and attitudinal relation Tof the robot mechanical interface point Ho relative to the basereference point Bo of the robot 2. For this purpose, the Tdetermination means 20 receives information about the jointvariable  n (see Figs. 1 and 5) at each of the rotary joints 3a-3f. 
- The relation T determined at the T determination means 20together with the relations Et and Ew entered at the setting datainput means 19 is fed to a wXt determination means 21 forcalculating the positional and attitudinal relation wXtj of thetool tip Eo relative to the workpiece reference point Wo. Suchcalculation is performed on the basis of the equation (27). Thenotation "wXt" with the suffix "j" means that the "wXt" data istaken at the "jth" teaching point, and the same suffix is alsoused in the following description to specify the teaching point. 
- Reference numeral 22 in Fig. 8 designates a speed input meansfor entering the translational speed vj of the workpiece Wrelative to the tool 7. 
- A task programming means 23 generates a plurality of teachingdata which include the translational speed vj entered at thespeed input means 22 and the wXtj data calculated at the wXtdetermination means 21. The task programming means 23 alsoprepares a task program on the basis of the teaching data and theEt-Ew setting data entered at the setting data input means 19,and stores the thus prepared task program. 
- A teaching data extraction means 24 successively takes out the teaching data from the task program made at the taskprogramming means 23, whereas a setting date extraction means 25takes the setting data (Et and Ew) from the task program. 
- A trajectory planning means 26 receives the teaching datafrom the teaching data extraction means 24 for planning atrajectory for the workpiece W (namely, the mechanical interfacepoint Ho of the robot 2) relative to the tool 7. 
- An interpolation means 27 interpolates the trajectory plannedby the trajectory planning means 24 between each two adjacentteaching points. The interpolation means 27 also calculates thepositional and attitudinal relation wXtj. i of the tool tiprelative to the workpiece reference point Wo at each interpolationpoint. The notation "wXtj. i " means that the interpolation datais taken at the "ith" interpolation point following the "jth"teaching point, and the same notation is also used in thefollowing description to specify the interpolation point. 
- An instruction means 28 calculates a required value of thejoint variable  n (namely, the movement of the robot 2) on thebasis of the wXtj. i calculated by the interpolation means 27,and gives corresponding instructions to the drive devices 5a-5f(Fig. 1) of the robot 2. 
- Next, the operation of the control apparatus 1 according tothe first embodiment is described starting from the teachingprocedure. 
- In Fig. 9, the robot 2 is designed to act on a selected oneof three tools 7a, 7b, 7c. It is now assumed that two tools 7a,7c are designed to perform the same kind of task (welding forexample), whereas the other tool 7b performs a different kind of task (grinding for example). It is further assumed that thereaching procedure is first performed with respect to the tool 7a. 
- This first teaching procedure is illustrated in the flow diagramof Fig. 10. 
- As shown in Fig. 10, in S1 (S being the abbreviation of"Step"), the numeral zero (0) is entered as the serial number jof the teaching data. 
- In S2, the positional and attitudinal relation Et (Et1) ofthe tool tip Eo (Eo1) relative to the base reference point Bo aswell as the positional and attitudinal relation Ew (Ew1) of theworkpiece reference point Wo relative to the mechanical interfacepoint Ho is supplied from the setting data input means 19 (seeFig. 8) by using the teach pendant 11 (see Fig. 2). 
- In S3, j is increased by one (1) to be ready for making theteaching data. 
- In S4, the robot 2 holding the workpiece W is manuallymanipulated by using the robot operation buttons 42 (see Fig. 2)to a desired position for teaching. Then, the teaching pointmemory button 43 (Fig. 2) of the teach pendant 11 is pushed tostore the present position (teaching point). 
- In S5, the joint variables (1-6) of the robot 2 aredetected for determining the positional and attitudinal relation Tof the mechanical interface point Ho relative to the basereference point Bo. Such determination can be done at the Tdetermination means 20 (see Fig. 8) by performing calculation inaccordance with the formulas (18)-(20). 
- In S6, the wXt determination means 21 (see Fig. 8) is causedto calculate the positional and attitudinal relation wXtj of the tool tip Eo1 relative to the workpiece reference point Wo byusing the following equation (28).wXtj = (T · Ew1)-1 · Et1 
- As can be easily understood, the equation (28) corresponds toequation (27) which is a more general expression. Specifically,the Et1 and Ew1 of the equation (28) correspond to the Et and Ew,respectively, of the equation (27). The notation "(T · Ew1)-1"means the inverse matrix of (T · Ew1). 
- In S7, the translational speed v, of the workpiece Wrelative to the tool 7a is numerically entered from the speedinput means 22 (see Fig. 8) by using the teach pendant (see Fig.2). Further, the task programming means 23 (Fig. 8) is caused toprepare and store a teaching data including vj and wXtj. 
- The above steps S3-S7 are repeated successively with respectto a require number of teaching points. Thereafter, in S8, theEND button 44 (see Fig. 2) of the teach pendant 11 is pressed toterminate the teaching procedure. 
- In S9, the task programming means 23 (Fig. 8) is caused toprepare and store a task program which includes a series ofteaching data together with the setting data. 
- Fig. 11 shows the content of the task program thus prepared.It is important that the task programitself includes the setting data (Et1 and Ew1) in addition to theteaching data. It is also significantthat the teaching data include the positional and attitudinalrelation wXtj of the tool tip Eo1 relative to the workpiece reference point Wo, as opposed to the prior art wherein theteaching data only include the positional and attitudinal relationT of the tool tip relative to the base reference point. Thetechnical advantages of having such a task program will bedescribed later. 
- Next, the playback procedure for the first embodiment isdescribed with reference to the flow diagram of Fig. 12. 
- In S50, the numeral zero (0) is entered as the serial numberof the teaching data. 
- In S51, the setting data extraction means 25 (Fig. 8) iscaused to read out, from the task program, the positional andattitudinal relation Et1 of the tool tip Eo1 relative to the basereference point Bo as well as the positional and attitudinalrelation Ew1 of the workpiece reference point Wo relative to themechanical interface point Ho. 
- In S52, the present joint variables (1 -6) of the robot 2are detected for determining the positional and attitudinalrelation T of the mechanical interface point Ho relative to thebase reference point Bo according to the formulas (18)-(20).Further, the wXt determination means 21 (see Fig. 8) is caused tocalculate the positional and attitudinal relation wXtj , at thepresent instance, of the tool tip Eo1 relative to the workpiecereference point Wo according to the equation (28). The wXtj thusobtained is used as a starting point for subsequentinterpolation. 
- In S53, the wXtj+ 1 at the (j+1)th teaching point is taken outfrom the task program as a target point for the interpolation. 
- In S54, the unit displacement Δ u (including both of the moving distance and the moving direction) for each interpolationinterval or path segment, the number nj+ 1 of interpolation pointsand the time tj+ 1 required for interpolation are determined in thefollowing manner. 
- Now, the position component Lj of wXtj of the jth teachingdata is defined by the following formula (29).Lj = (Sxj , Syj , Szj)T 
- Note that (Sxj , Syj, Szj )T contained in the formula (29)corresponds to the fourth column vector of the wXt matrixcontained in the formula (26) (see also Fig. 7). Similarly to Ljthe position component Lj+ 1 of wXtj+ 1 of the (j+1)th teachingdata is defined by the following formula (30).Lj = (Sxj+1, Syj+1, Szj+1 )T 
- The difference between the formulas (29) and (30) gives avector extending from the jth teaching point to the (j+1)thteaching point. Dividing this vector by its own length gives anormalized value Δ h which is represented by the followingformula (31).Δ h = (Lj+1 - Lj )/|| Lj+1 - Lj || 
- In the formula (31), the notation "|| Lj+ 1 - Lj || " means anoperator representing the length of the vector. The Δ h obtainedby the formula (31) is a vector representing the direction of translation, and the magnitude of Δ h is unity (1). Thus, thetranslational displacement is obtained if Δ h is multiplied bythe moving distance. 
- If the interpolation pitch (namely, the time for eachinterpolation interval) is represented by t0 while thetranslational speed is represented by vj+ 1, the moving distancefor each interpolation interval is given by vj+ 1 · t0. Thus, theunit displacement Δ u for each interpolation interval iscalculated according to the following formula (32).Δ u = vj+1 · t0 · Δ h = (u1, u2, u3)T 
- The number of interpolation points is obtained if thedistance between the starting and target points is divided by theunit moving distance per each interpolation interval, asindicated by the following formula (33).nj+1 = || Lj+1 - Lj ||/ (vj+1 · t0) 
- Further, the required time tj+1 is given if the distancebetween the starting and target points is divided by the movingspeed, as indicated by the following formula (34).tj+1= || Lj+1 - Lj || /vj+1 
- Next, in S55, the attitudinal change of the tool 7a relativeto the workpiece W is determined at each of the translationalinterpolation points. For interpolation between the jth and (j+1) th Interpolation points, this attitudinal change may be calculatedas rotation through an angle β about a certain axis Kr inaccordance with the following formula (35). 
- For determining the Kr and β, the formula (35) may be alsorewritten as the following formula (36). 
- The axis Kr provisionally used as the rotational center axisis a vector having an X-component Krx, a Y-component Kry and a Z-componentKrz. Krx, Kry, Krz and β may be calculated in thefollowing way. 
- Division of β by the number of interpolation points gives arotational angle Δ β for each interpolation interval, asindicated in the following formula (38).Δ β = β /nj+1 
- In S56, the numeral zero (0) is entered as the present serialnumber i of the interpolation points. 
- In S57, i is increased by one (1). 
- In S58, the lapsed time is calculated according to thefollowing formula (39).tj = i · t0 
- In S59, the positional and attitudinal relation wXtj. i of thetool tip Eoi relative to the workpiece reference point Wo at timeti is calculated in the following way. 
- As previously described, the translational displacement foreach interpolation interval is given by Δ u=(u1, u2, u3),whereas the attitudinal change for each interpolation interval isdefined as rotation through an angle Δ β about the axis Kr. Thus, the present wXtj.i may be calculated by using the previouswXtj.i-1, as indicated by the following equation (40).wXtj.i = wXtj.j-1 · Trans(u1, u2, u3) · Rot(Kr, Δ β ) 
- Further, the following equation (41) is applicable at the ithinterpolation point.Et1 = T· Ew1· wXtj.i 
- In S60, the target positional and attitudinal relation T ofthe mechanical interface point Ho relative to the base referencepoint Bo of the robot 2 is calculated on the basis of the equation(41). Specifically, the relation T can be obtained if both sidesof the equation (41) is multiplied by the inverse matrix of Ew1.wXtj. i , as shown in the following formula (42).T = Et1· (Ew1 · wXtj.i )-1 
- In S61, the joint variables (1-6) of the robot 2 arecalculated to realize the target T. Such calculation of the jointvariables may be performed by the so-called "inverse kinematics"which is described in "ROBOTICS" (Written by John J. Craig:Published by Kyoritsushuppan Kabushiki Kaisha in 1981). 
- In S62, the joint variables (1-6) calculated in S61 areconverted to drive instruction data for the servomotors of therespective drive devices 5a-5f (see Fig. 1). Upon lapse of ti ,the drive instruction signals are sent to the servodrivers 17a-17f (Fig. 3) for rotationally moving the respective joints 3a-3f ofthe robot 2, as previously planned. 
- In S63, the steps S57-S62 are repeated until the nthinterpolation point (target teaching point) is reached. 
- In S64, if the target teaching point is reached, j isincreased by one (1). 
- In S65, if the next teaching point corresponding to j+1 isavailable, the steps S52-S64 are repeated by using the nextteaching point as a new target point. 
- In S66, if the next teaching point is no longer available,the playback procedure is terminated. 
- In this way, the robot 2 is so controlled that the tool 7aperforms its treatment relative to the workpiece W along theplanned trajectory formed by the series of teaching points. 
- According to a preferred embodiment, the task program preparedfor the tool 7a can be conveniently utilized for making taskprograms for the other tools 7b, 7c (Fig. 9) or for otherworkpieces because the task program for the tool 7a includes Et1,Ew1 as the setting data and wXtj as part of the teaching data.This point, which is one of the most important advantages of thepreferred embodiment, is now described with reference to Figs. 13 - 18. 
- In Fig. 13 (and Fig. 9 as well), the tool 7a (hereafterreferred to as "first tool") is shown with the tool 7c (hereafterreferred to as "third tool") which performs the same kind of task(welding for example). The third tool 7c has a tip Eo3 whosepositional and attitudinal relation relative to the robot basereference point Bo is denoted by Et3. 
- Since the third tool 7c performs the same task as the first tool 7c with respect to an identically configured workpiece W,the positional and attitudinal relation Ew1 (see Fig. 9) of theworkpiece reference point Wo relative to the mechanical interfacepoint Ho is applicable with respect to both of the first and thirdtools 7a, 7c. Further, for the same reason, the positional andattitudinal relation wXt (see Fig. 9) of the third tool tip Eo3relative to the workpiece reference point Wo is also the same asthat of the first tool tip Eo1. 
- Fig. 14 shows a flow diagram for preparing a task program forthe third tool 7c on the basis of the task program alreadyprepared for the first tool 7a. Fig. 15 shows a comparisonbetween the task program I for the first tool 7a and the taskprogram II for the third tool 7c. 
- As shown in Fig. 14, entry of the setting data Et3 and Ew1are performed in S501, and j is set at zero (0) in S502. Then, jis increased by one (1) in S503, whereas the wXtj data for thefirst tool 7a are simply copied for the third tool 7c in S504(see also Fig. 15). After entirely copying the wXtj data (S505),the task program II for the third tool 7c is prepared in S506 bycombining the copied wXtj data with the setting data Et3, Ew1.Thus, the task program II can be prepared very easily by copyingmost portion of the existing task program I. 
- Apparently, the playback procedure for the third tool 7c maybe performed substantially in the same manner as that for thefirst tool 7a (see Fig. 12) once the task program II is made. 
- Returning to Fig. 9, the task program I (Fig. 15) for thefirst tool 7a may be also utilized to prepare a task program forthe remaining tool 7b (hereafer referred to as "second tool") which performs a different kind of task (grinding for example).More specifically, when the second tool 7b is made to grind aweld bead of the workpiece W which has previously undergone thewelding operation at the first tool 7a, there is no need to makeany adjustment with respect to Ew1 and wXt even at the time ofgrinding by the second tool 7b. Thus, the task program I for thefirst tool 7a may be conveniently used for preparing a taskprogram for the second tool 7b substantially in the same manneras described with reference to Figs. 13-15. 
- Figs. 16 illustrates how to make an adjustment when thepresent workpiece W (original) is replaced by a modifiedworkpiece W' with respect to the first tool 7a. For simplicity,it is assumed that the modified workpiece W' is longer than theoriginal workpiece W but has a work target portion Wa' which isidentical in shape to the work target portion Wa of the originalworkpiece W. 
- Under the above assumption, the positional and attitudinalrelation Ew1' of the modified workpiece reference point Wo'relative to the mechanical interface point Ho differs from the Ew1of the original workpiece W. However, the positional andattitudinal relation wXt (see Fig. 9) of the first tool 7arelative to the original workpiece reference point Wo is alsoapplicable with respect to the modified workpiece reference pointWo' . 
- Therefore, as shown in Fig. 17, a task program III adapted tothe modified workpiece W' can be easily prepared by copying thetask program I for the original workpiece W except that Ew1 issubstituted by Ew1'. 
- Figs. 18 illustrates how to make an adjustment when thepresent workpiece W (original) is replaced by another modifiedworkpiece W'' which differs slightly only in the shape of worktarget portion from the original workpiece W. Specifically, theoriginal workpiece has a work target portion formed by points P1,P2, P3, P4, P5, P6, P7, --- Pn, whereas the modified workpiece W''has a work target portion formed by points P1, P2, P3", P4'', P5'',P6'', P7, --- Pn. The modified workpiece W'' is otherwise the sameas the original workpiece W. 
- Therefore, as shown in Fig. 19, a task program IV adapted tothe modified workpiece W'' can be easily prepared by copying thetask program I for the original workpiece W except that wXt3-wXt4corresponding to the points P3-P6 (teaching points) of theoriginal workpiece W are substituted by wXt3''-wXt4'' correspondingto the points P3''-P6''. 
8. Description of Second Embodiment:- Next, the second embodiment of the present invention isdescribed with reference to Figs. 20-24. 
- Referring to Fig. 20, the control apparatus 1 of the secondembodiment comprises a setting data input means 19, a Tdetermination means 20, a speed input means 22, a teaching dataextraction means 24, a trajectory planning means 26, aninterpolation means 27 and an instruction means 28, similarly tothe control apparatus of the first embodiment. Further, thecontrol apparatus 1 of the second embodiment comprises thefollowing elements. 
- An identifying means 29 gives identifiers to a plurality of setting data entered by the setting data input means 19. 
- A file making means 30 prepares and stores a file of thusidentified setting data. 
- An identifier input means 31 selects desired ones from theplurality of setting data and supplies the correspondingidentifiers for input to a task programming means 33. 
- A wXt determination means 32 calculates the positional andattitudinal relation wXt, of the tool tip Eo relative to theworkpiece reference point Wo. Such calculation is performed onthe basis of the setting data which are read out from the filemaking means 30 in response to the identifiers entered by theidentifier input means 31, and on the basis of the positional andattitudinal relation T of the mechanical interface point Horelative to the base reference point Bo as determined at the Tdetermination means 20. 
- The task programming means 33 generates a plurality ofteaching data which include the translational speed vj entered atthe speed input means 22, the wXtj data calculated at the wXtdetermination means 32, and the identifers entered at theidentifier input means 31. The task programming means 33 alsoprepares a task program on the basis of the teaching data, andstores the thus prepared task program. 
- A setting data extraction means 40 takes out the setting datafrom the file making means 30 according to the identifiers whichare included in the teaching data taken out by the teaching dataextraction means 24. 
- Next, the operation of the control apparatus 1 according tothe second embodiment is described starting from the teaching procedure. It should be understood that the control apparatus 1of the second embodiment is used to control the robot 2successively with respect to a plurality of tools although onlyone tool 7 is illustrated in Fig. 20. 
- Fig. 21 is a flow diagram showing the steps for making a fileof identified setting data. In S100 and S101, the changeoverswitch 46 of the teach pendant 11 (see Fig. 2) is operated toselect the setting-data input mode, and selection is made whetherto enter the positional and attitudinal relation Et of the tooltip Eo relative to the base reference point Bo or the positionaland attitudinal relation Ew of the workpiece reference point Wo(see also Fig. 4) relative to the mechanical interface point Ho. 
- If data entry of Et is selected, the teach pendant 11 isoperated to enter Et data in S102. This step is followed by S104wherein a corresponding identifier is entered for the Et dataagain by using the teach pendant 11. 
- Similarly, if data entry of Ew is selected, the teach pendant11 is operated to enter Ew data in S103. This step is followedby S105 wherein a corresponding identifier is entered for the Ewdata again by using the teach pendant 11. 
- The steps S100-S105 are repeated until all different Et andEw data corresponding to different tools (and/or differentworkpieces if applicable) are entered and identified. 
- If a terminating instruction is given by the teach pendant(Fig. 2) in S106, the filing making means 30 (Fig. 20) is causedto make and store a file of different setting data (Et and Ew)respectively having different identifiers. 
- Fig. 22 is a flow diagram showing the steps up to making a task program. 
- First, the numeral zero (0) is entered as the serial number jof the teaching data in S1, which is followed by S3 wherein j isincreased by one (1) to be ready for making the teaching data. 
- In S150, the teach pendant 11 (Fig. 2) is operated to enterthe identifiers corresponding to the tool 7 and workpiece W (Fig.20) which are undergoing teaching at the jth teaching point. 
- In S4, the robot 2 holding the workpiece W is manuallymanipulated, by using the robot operation buttons 42 (see Fig. 2)of the teach pendant 11, to assume a desired position forteaching. Then, the teaching point memory button 43 (Fig. 2) ispushed to store the present position (jth teaching point). 
- In S5, the joint variables (1-6) of the robot 2 aredetected for determining the positional and attitudinal relation Tof the mechanical interface point Ho relative to the basereference point Bo. Such determination can be done at the Tdetermination means 20 (see Fig. 20) by performing calculation inaccordance with the formulas (18)-(20). 
- In S6, the wXt determination means 32 (see Fig. 20) is causedto calculate the positional and attitudinal relation wXtj of thetool tip Eo1 relative to the workpiece reference point Wo byusing the equation (28). 
- In S151, the translational speed vj of the workpiece Wrelative to the tool is numerically entered from the speed inputmeans 22 (see Fig. 20) by using the teach pendant 11 (see Fig. 2). 
- Further, the task programming means 33 (Fig. 20) is caused toprepare and store a teaching data including vj. wXtj and theidentifiers of Et, Ew. 
- The steps S3-S151 are repeated with respect to a requirednumber of teaching points (covering the plurality of tools 7) .Thereafter, in S8, the END button 44 (see Fig. 2) of the teachpendant 11 is pressed to terminate the teaching procedure. 
- In S152, the task programming means 33 (Fig. 20) is caused toprepare and store a task program which includes a series ofteaching data which are required for operating the robot 2successively with respect to the series of tools 7. 
- Fig. 23 shows the content of the task program thus prepared.It is important to note that the single task program includes theteaching data for the plurality of tools 7, and that eachteaching data includes the identifiers for the setting data (Et1and Ew1) in addition to the information about wXtj and vj. 
- Next, the playback procedure for the second embodiment isdesribed with reference to the flow diagram of Fig. 24. 
- In S50, the numeral zero (0) is entered as the serial numberj of the teaching data. 
- In S200, the setting data extraction means 40 (Fig. 20) readsout the identifiers from the (j+1)th teaching data, causing thefile making means to supply the corresponding Et and Ew. 
- In S201, the present joint variables (1-6) of the robot2 are detected for determining the positional and attitudinalrelation T of the mechanical interface point Ho relative to thebase reference point Bo according to the formulas (18)-(20).Further, the wXt determination means 32 (see Fig. 20) is caused tocalculate the positional and attitudinal relation wXtj , at thepresent instance, of the tool tip Eo1 relative to the workpiecereference point Wo according to the equation (28). The wXtj thus obtained is used as a starting point for subsequentinterpolation. 
- In S202, the wXtj+ 1 at the (j+1)th teaching point is takenout from the task program as a target point for subsequentinterpolation. 
- The steps S54-S64 are substantially the same as those of theplayback procedure for the first embodiment (see Fig. 12). 
- In S65, if the next teaching point corresponding to j+1 isavailable, the steps S200-S64 are repeated by using the nextteaching point as a new target point. 
- In S66, if the next teaching point is no longer available,the playback procedure is terminated. 
9. Description of Third Embodiment:- Next, the third embodiment of the present invention isdescribed with reference to Figs. 25 and 26. 
- Referring to Fig. 25, the control apparatus 1 of the thirdembodiment comprises a setting data input means 19, a Tdetermination means 20, a teaching data extraction means 24, asetting data extraction means 25, a trajectory planning means 26,an interpolation means 27 and an instruction means 28, similarlyto the control apparatus of the first embodiment. Further, thecontrol apparatus 1 of the third embodiment comprises thefollowing elements. 
- A teaching data input means 34 is used to enter thepositional and attitudinal relation wXtj of the tool tip Eorelative to the workpiece reference point Wo, and thetranslational speed vj of the workpiece W relative to the tool 7. 
- Specifically, the teaching data input means 34 includes a wXtcomponent input means 36 which are used for entering thepositional components Sx, Sy, Sz and attitudinal components  x, y,  z of the tool tip Eo relative to the workpiece referencepoint Wo, and a wXt determination means 37 for calculating wXtj onthe basis of the information obtained from the wXt componentinput means 36. 
- A task programming means 35 generates a plurality of teachingdata which include vj and wXtj entered at the teaching datainput means 34. The task programming means 35 also prepares atask program on the basis of the teaching data and the settingdata (Et and Ew) entered at the setting data input means 19, andstores the thus prepared task program. 
- Next, the operation of the control apparatus 1 according tothe third embodiment is described. The control apparatus 1 ofthe third embodiment can be used to control the robot 2 withrespect to a plurality of tools although only one tool 7 isillustrated in Fig. 25. 
- Fig. 26 is a flow diagram showing the steps up to making atask program. 
- First, the numeral zero (0) is entered as the serial number jof the teaching data in S1. 
- In S301, the positional and attitudinal relation Et of thetool tip Eo relative to the base reference point Bo as well as thepositional and attitudinal relation Ew of the workpiece referencepoint Wo relative to the mechanical interface point Ho issupplied from the setting data input means 19 (see Fig. 25). 
- In S3, j is increased by one (1) to be ready for making the teaching data. 
- In S303, the teach pendant 11 (Fig. 2) is operated to enterthe positional components Sx, Sy, Sz and attitudinal components x,  y,  z of the tool tip Eo relative to the workpiecereference point Wo, whereby the positional and attitudinalrelation wXt of the tool tip Eo relative to the workpiecereference point W is calculated according to the formula (21). 
- In S7, the translational speed vj of the workpiece Wrelative to the tool is numerically entered by the teaching datainput means 34 (see Fig. 25). Further, the task programming means35 (Fig. 20) is caused to prepare and store a teaching dataincluding vj and wXtj . 
- The steps S3-S7 are repeated with respect to a requirednumber of teaching points. Thereafter, in S8, the END button 44(see Fig. 2) of the teach pendant 11 is pressed to terminate theteaching procedure. 
- In S9, the task programming means 35 (Fig. 25) is caused toprepare and store a task program which includes a series ofteaching data together with the setting data (Et and Ew). 
- The playback procedure for the third embodiment can becarried out substantially in the same manner as that for the firstembodiment, so that it is not described here to avoid duplicatedexplanation. 
- As can be clearly understood, the third embodiment is verysimilar to the first embodiment but differs therefrom only in thatthe wXtj teaching data are prepared without actually moving therobot 2 according to the third embodiment. More specifically,the positional and attitudinal relation T of the robot mechanical interface point Ho relative to the base reference point Bo isnecessary for determining wXtj according to the first embodiment(see the T determination means 20 connected to the wXtdetermination means 21 in Fig. 8), whereas the relation T is notnecessary for determining wXtj according to the third embodiment(see the T determiantion means 20 connected only to the trajectoryplanning means 26 in Fig. 25). Thus, the third embodiment isparticularly significant for example when the CAD (computer aideddesign) data of the workpiece W are directly usable forcalculation of wXtj. 
10. Description of fourth Embodiment:- Next, the fourth embodiment of the present invention isdescribed with reference to Figs. 27 and 28. 
- Referring to Fig. 27, the control apparatus 1 of the fourthembodiment comprises a setting data input means 19, a Tdetermination means 20, a teaching data extraction means 24, atrajectory planning means 26, an interpolation means 27 and aninstruction means 28, similarly to the control apparatus of thefirst embodiment. Further, the control apparatus 1 alsocomprises an identifying means 29, a file making means 30, asetting data extraction means 40, similarly to the controlapparatus of the second embodiment. 
- Like the third embodiment, the control apparatus 1 of thefourth embodiment also comprises a teaching data input means 38which is used for entering the positional and attitudinalrelation wXtj of the tool tip Eo relative to the workpiecereference point Wo, and the translational speed vj of the workpiece W relative to the tool 7. However, the teaching datainput means 38 of the fourth embodiment has an additionalfunction of numerically entering the identifiers for thecorresponding setting data (Et and Ew). 
- A task programming means 41 generates a plurality of teachingdata which include the translational speed vj , the wXtj dataand the setting data identifers all entered at the teaching datainput means 38. The task programming means 41 also prepares atask program on the basis of the teaching data, and stores thethus prepared task program. 
- Next, the operation of the control apparatus 1 according tothe fourth embodiment is described. Again, the control apparatus1 of this embodiment is used to control the robot 2 successivelywith respect to a series of tools although only one tool 7 isillustrated in Fig. 27. 
- First, the steps corresponding to S100-S107 shown in Fig. 21for the second embodiment are performed for making a file ofdifferent setting data (Et and Ew). These setting datarespectively have different identifiers and correspond todifferent tools 7. 
- Fig. 28 is a flow diagram showing the steps up to making atask program. 
- First, the numeral zero (0) is entered as the serial number jof the teaching data in S1, which is followed by S3 wherein j isincreased by one (1) to be ready for making the teaching data. 
- In S401, the teach pendant 11 (Fig. 2) is operated to enterthe positional components Sx, Sy, Sz and attitudinal components x,  y,  z of the tool tip Eo relative to the workpiece reference point Wo, whereby the positional and attitudinalrelation wXtj of the tool tip Eo relative to the workpiecereference point W is calculated according to the formula (21). 
- In S402, the teach pendant 11 (Fig. 2) is operated to enterthe identifiers corresponding to the tool 7 and workpiece W (Fig.20) which are undergoing teaching at the jth teaching point. 
- In S151, the translational speed vj of the workpiece Wrelative to the tool is numerically entered by the teach pendant11 (see Fig. 2). Further, the task programming means 41 (Fig. 27)is caused to prepare and store a teaching data including vj ,wXtj and the identifiers of Et, Ew. 
- The steps S3-S151 are repeated with respect to a requirednumber of teaching points (covering the series of tools 7) .Thereafter, in S8, the END button 44 (see Fig. 2) of the teachpendant 11 is pressed to terminate the teaching procedure. 
- In S152, the task programming means 41 (Fig. 27) is caused toprepare and store a task program which includes a series ofteaching data which are required for operating the robot 2successively with respect to the series of tools 7. 
- The playback procedure for the fourth embodiment can becarried out substantially in the same manner as that for thesecond embodiment, so that it is not described here to avoidduplicated explanation. 
11. Description of Alternative Robbot Arrangement:- All of the joints 3a-3f of the robot 2 shown in Figs. 1 and 5make only rotational movement. However, the present inventionmay be also used for controlling a robot which has one or morelinearly movable joints (translational joints). An example ofsuch a robot is shown in Figs. 29 and 30. 
- The alternative robot 2' shown in Figs. 29 and 30 includes aa base link 39a serving as a base 9', a first link 39b serving asa first linearly movable joint, a second link 39c serving as asecond linearly movable joint, a third link 39d serving as athird linearly movable joint, a fourth link 39e serving as afourth rotary joint, a fifth link 39f serving as a fifth rotaryjoint, and a sixth link 39g serving as a sixth rotary joint.Different coordinate systems Bo-XYZ, OT0-X0Y0Z0 to OT5-X5Y5Z5 andHo-X'Y'Z' are related to the respective links 39a-39g. 
- According to the DH notation already described above, therelation An between each two successive coordinate systems isexpressed by the formula (17) which is given hereinbefore.An = Rot(Z,  n)· Trans(0, 0, dn) · Trans(an, 0, 0) ·Rot(X, αn) 
- The parameters  n, dn, an and α n for the respective links39a-39g are given in the following Table 2. | No. | Likn | n | an | dn | αn |  | 0 | Base Link | 0.0 | 0.0 | d0 | +π /2 |  | 1 | 1st Link | 0.0 | 0.0 | d1 | -π /2 |  | 2 | 2nd Link | +π /2 | 0.0 | d2 | +π /2 |  | 3 | 3rd Link | +π /2 | 0.0 | d3 | 0.0 |  | 4 | 4th Link | 4 | 0.0 | d4 | -π /2 |  | 5 | 5th Link | 5 | 0.0 | 0.0 | +π /2 |  | 6 | 6th Link | 6 | 0.0 | d6 | 0.0 |  
 
- As appreciated by comparing Tables 1 and 2, the jointvariables 1-3 for the robot 2 of Figs. 1 and 5 need bereplaced by the joint varibales d1-d3 for the robot 2' of Figs.29 and 30. By doing so, the control apparatus 1 according to thepresent invention may be used for controlling the alternativerobot 2'. 
12. Advantages of embodiments of the present invention:- The four different embodiments described are featured by thefact that the taskprogram prepared and stored in the task programming means 23, 33,35, 41 includes the setting data (Et and Ew) as well as thepositional and attitudinal relation wXt of the tool tip Eorelative to the workpiece reference point Wo (see Figs. 11 and23). Thanks to this feature, these embodiments have the following advantages. 
- (1) Since the task program (teaching data) itself includesthe wXt data which is directly indicative of the relation betweenthe tool and the workpiece, the state of the treatment (work)performed by the tool can be easily recognized. Indeed, the mostimportant parameter for controlling the robot is the relationbetween the tool and the workpiece because the robot movement is afactor which should be controlled to realize the requiredpositional and attitudinal relation between the tool and theworkpiece. Thus, it is better that the task program includes thewXt data than the data directly indicative of the robot movement.
- (2) Since the wXt data is directly related to theconfiguration and dimension of the workpiece, the CAD datarelating to the workpiece, if available, can be immediatelyutilized for making the teaching data (including the wXt data)even without actually moving the robot itself, as alreadydescribed in connection with the third and fourth embodiments(see Figs. 25-28).
- (3) If the task program prepared for a particular combinationof a tool and a workpiece is later found to require a correctionas to the relation between the tool and the workpiece, such acorrection can be easily performed because the task program itselfincludes the wXt data which need be corrected.
- (4) When the position and attitude of the tool are changed,it is only necessary to modify the existing task program withrespect to the positional and attitudinal relation Et relative tothe base reference point Bo of the robot 2. In other words, theteaching data of the existing task program can be simply copied to make a new task program which is perfectly applicable to the newposition and attitude of the tool, as already described withreference to Figs. 13-15.
- (5) Similarly, when there is a change of the workpieceholding position (and/or attitude) provided by the robot 2, it isonly necessary to modify the existing task program with respect tothe positional and attitudinal relation Ew of the workpiecereference point Wo relative to the mechanical interface point Hoof the robot 2. In other words, the teaching data of the existingtask program can be simply copied to make a new task programwhich is perfectly applicable to the new workpiece holdingposition, as already described with reference to Figs. 16 and 17.
- (6) When the configuration of the workpiece is slightlychanged, it is usually sufficient to modify only a part of theexisting teaching data (wXt), as already described with referenceto Figs. 18 and 19.
- (7) In case the task program includes respective wXt data(corresponding to all of the teaching points) together withrespective identifiers for a series of tools, it is possible tooperate the robot successively with respect to the series oftools, as described in connection with the second embodiment ofFigs. 20-24 and the fourth embodiment of Figs. 27 and 28.