METHOD OF RETURNING ROTARY SHAFT TO REFERENCE POINT

Abstract: A work coordinate system constituting a programming reference is determined with respect to a mechanical coor­ dinate system, and NC program data, which include at least NC data for determining an angle r between the origin (WR) in the work coordinate system and the reference point (MR) in the mechanical coordinate system, and radial positioning data based on the work coordinate system, are prepared, the position-controlling of the rotary shaft being done on the basis of the NC program. The present positions P m , P w in the mechanical coordinate system and work coordinate system of a fixed point Q on the rotary shaft (11) are altered in accordance with the rotation of the rotary shaft, and an angle a which satisfies the following formula: P m = 360.n + a, P w = 360.n + a-r is determined in accor­ dance with a reference point returning instruction. The ro­ tary shaft is then turned by a° to return the fixed point Q to the reference point (MR) in the mechanical coordinate. The present positions P m , P w in the mechanical and work coor­ dinate systems are then altered in accordance with the following formulae: P m -360.n→P m , P w -360.n→P w . The ro­ tary shaft (11) is then returned to the reference point (MR) within one revolution thereof, and the mechanical and work coordinate systems are returned to the original positions (P m =O, P w = -r).

Description: This invention relates to a method of restoring a rotary table to a reference point. More particularly, the invention relates to a rotary table reference point restoration method for rotating the rotary table of a machine to position the table at a predetermined angular position. In a machine tool having a rotary table, the rotary table is rotated about an axis to a desired angular position by numerical control in the same manner that control is performed along linear axes (e.g. X, Y and Z axes) so that a workpiece placed upon the table may be subjected to boring and other machining. In numerical control, (1) a rotational direction workpiece coordinate system serving as a programming reference for a rotational direction machine coordinate system is decided, (2) data specifying an angle r between the origin of the workpiece coordinate system and a reference point in the machine coordinate system are commanded by a program (a G-function instruction for setting a coordinate system), and (3) the position of the rotary table is controlled by NC program data created on the basis of the workpiece coordinate system, and present angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, are monitored. Note that Pm = 0, Pw = -r will hold when the rotary table is situated at the reference point. When the rotary table is to be restored to the reference point in the machine coordinate system, it is desired to perform the reference point restoration by rotation through less than one revolution in order to shorten restoration time. Conventionally, therefore, whenever the present position Pm in the machine coordinate system surpasses 360°, the present position Pm is reset to 0 so that the value of Pm is kept below 360° at all times. As a result, when a reference point restoration command is generated, the rotary table is rotated only by Pm degrees to be restored to the reference point, so that the amount of rotation required for the reference point restoration operation is less than one revolution. However, when a reference point restoration is performed in a case where the present position Pw in the workpiece coordinate system is more than one revolution away from the origin of the workpiece coordinate system, the present angle Pm in the machine coordinate system becomes 0° in correct fashion, but the value of the present angle Pw in the workpiece coordinate system does not become -r. Accordingly, the workpiece coordinate system does not return to its original attitude, thus making it necessary to reset the coordinate system after the reference point restoration. The reason why Pw does not become -r is that only Pm is reset to 0 when it exceeds 360°, whereas Pw is not reset to 0 when it exceeds 360°. The reason why Pw cannot be reset to 0 is that since a target angle may be set in excess of 360° by the NC data, correct positioning would no longer be possible if Pw were reset to 0. According to the present invention, there is provided a method of restoring a rotary table to a reference point in which a rotational direction workpiece coordinate system serving as a programming reference with respect to a rotational direction machine coordinate system is decided, data specifying an angle r between an origin of the workpiece coordinate system and the reference point in the machine coordinate system are commanded by a program, the rotary table is positionally controlled by NC program data created based on the workpiece coordinate system, and the rotary table is restored to the reference point by a reference point restoration command, said method being characterised by having:- a first step of updating angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, in dependence upon rotation of said rotary table and, in response to the reference point restoration command, obtaining an angle a that satisfies the equations Pm = 360·n+a, Pw = 360·n+a-r where n is the net number of revolutions effected by the table; a second step of comparing |a| and 180 in terms of magnitude and restoring the rotary table to the reference point by rotating it |a|° in a case where |a| ≦ 180 holds; a third step of restoring the rotary table to the reference point by rotating it (360 - |a|)° in a case where |a| > 180 holds; and a fourth step of establishing the relations Pm = 0, Pw = -r for the present angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, by performing calculations defined by expressions Pm - 360·n → Pm Pw - 360·n → Pw in a case where |a| ≦ 180 holds and performing calculations defined by expressions Pm - (360·n±1) → Pm Pw - (360·n±1) → Pw (where the signs in parentheses are made + when a is positive and - when a is negative) in a case where |a| > 180 holds. Thus, an embodiment of the invention can provide a rotary table reference point restoration method whereby the table is restored to a reference point by rotation through less than one revolution, and in which the workpiece and machine coordinate systems can both be returned to their original attitudes (i.e. in which the relations Pm = 0, Pw = -r can be established) after the reference point restoration. Reference is made, by way of example, to the accompanying drawings in which:- Fig. 1 is a view for describing the general features of the present invention; Fig. 2 is a block diagram of an NC unit to which the present invention can be applied; Fig. 3 is a flowchart of processing not in accordance with the invention, but useful for explanatory purposes, where a reference point restoration is made by rotation through less than 360°; and Fig. 4 is a flowchart of processing according to the present invention, in which a reference point restoration is made by rotation through less than 180°. Fig. 1 is a view for describing the general features of the present invention. MR represents a rotating direction reference point (hereafter referred to simply as a "reference point") in a machine coordinate system, and WR denotes a rotating direction origin of a workpiece coordinate system. The angle between the reference point MR and the origin WR of the workpiece coordinate system is r. Let the clockwise direction and counter-clockwise directions be positive and negative, respectively, and let the present angular positions of a fixed point Q on a rotary table 11 in the machine coordinate system and workpiece coordinate system be Pm, Pw (neither of which is reset to 0 even if 360° is exceeded), respectively. Of the fixed points Q, Q' on the rotary table 11, the fixed point Q is situated at the reference point MR and the fixed point Q' is situated at the origin WR of the workpiece coordinate system when the rotary table has been restored to the reference point, as shown in Fig. 1(A). If the rotary table 11 is rotated by (360·n+a)° from this state, where n is the net number of revolutions effected by the table, the positional relationship among the fixed points Q, Q', reference point MR and the origin WR of the workpiece coordinate system will be as illustrated in Fig. 1(B). The present position Pm in the machine coordinate system becomes Pm = 360·n+a (1) and the position Pw in the workpiece coordinate system becomes Pw = 360·n+a-r (2) The following steps are executed:- (a) If a reference point restoration command is generated with the rotary table in the state shown in Fig. 1(B), the angle a that satisfies Eq. (1) is obtained; (b) The rotary table 11 is rotated by |a|° in a direction opposite to the sign of angle a in order to be restored to the reference point MR in the machine coordinate system. Note that if a > 0 holds, the reference point restoration is performed by rotating the rotary table 11 a° in the counter-clockwise direction; if a < 0 holds, the reference point restoration is performed by rotating the rotary table 11 |a|° in the clockwise direction. Pm, Pw become as follows by rotating the table |a|°:- Pm = 360·n (3) Pw = 360·n-r (4) (c) Finally, the values of Pm, Pw are updated in accordance with the expressions Pm - 360·n → Pm (5) Pw - 360·n → Pw (6) whereupon Pm becomes 0 and Pw becomes -r. The machine and workpiece coordinate systems thus are restored to their original attitudes. It should be noted that operations 0 → Pm, -r → Pw cannot be performed directly without relying upon the calculations indicated by expressions (5), (6). The reason is that the value of r is not stored in the NC Unit. It is possible to establish the relations Pm = 0, Pw = -r by performing the operations Pw - Pm → Pw (5)' 0 → Pm (6)' rather than the operations indicated by the expressions (5), (6). The foregoing relates to a case where the reference point restoration is executed within one revolution (360°) of rotation. However, according to the present invention, restoration is effected within 1/2 revolution (180°) of rotation and the machine and workpiece coordinate systems are returned to their original states. This is accomplished as follows:- (1) If a reference point restoration command is generated with the rotary table in the state shown in Fig. 1(B), the angle a that satisfies Eqs. (1), (2) is obtained. (2) Next, |a| and 180 are compared in terms of magnitude. If |a| ≦ 180 holds, the rotary table is rotated by |a|° to be restored to the reference point MR in the machine coordinate system. Note that the rotary table is restored to the reference point by being rotated counter-clockwise if a > 0 holds and clockwise if a < 0 holds. The values of Pm, Pw are updated to the values indicated by Eqs. (3), (4) by |a| o of rotation. If |a| > 180 holds, the rotary table is rotated by (360 - |a|) o to be restored to the reference point in the machine coordinate system. Note that the rotary table is restored to the reference point by being rotated clockwise if a > 0 holds and counter-clockwise if a < 0 holds. The values of Pm, Pw are updated as follows by (360 - |a|) o of rotation Pm = 360·(n±1) (7) Pw = 360·(n±1) - r (8) In Eqs, (7), (8), the signs in the parentheses become + when a is positive and - when a is negative. (3) Thereafter, the present positions Pm, Pw in the machine and workpiece coordinate systems, respectively, are updated in accordance with expressions (5), (6) if |a| ≦ 180 holds, and in accordance with the expressions Pm - 360·(n±1) → Pm (9) Pw - 360·(n±1) → Pw (10) if |a| > 180 holds. Note that it is also possible to establish the relations Pm = 0, Pw = -r in accordance with the following expressions rather than using expressions (9), (10): Pw - Pm → Pw (9)' 0 → Pm (10)' The foregoing enables the reference point restoration to be completed within 180 o of rotation and also permits Pm = 0, Pw = -r to be achieved to return both the machine coordinate system and workpiece coordinate system to their original attitudes. Fig. 2 is a block diagram of a numerical control unit to which the present invention can be applied, and Fig. 3 is a flowchart of processing not according to the invention. In Fig. 2, numeral 101 denotes a processor, 102 a ROM storing a control program, 103 a RAM, 104 a working memory, 105 an NC tape, 106 an input unit for reading NC program data from the NC tape 105 and for inputting the data, 107 a pulse distributor, 108 a servo circuit, 109 a motor for driving the rotary table, 110 an operator's panel, and 111 a bus line. The NC data are read from the NC tape 105 and stored in the RAM 103. If the system is now started by pressing a start button on the operator's panel 110, the processor 101 reads NC data out of the RAM 103 one block at a time and executes predetermined numerical control processing. By way of example, if a G-function instruction for setting a coordinate system is read, the processor 101 stores an angle specified by the instruction in the working memory 104 as the present angle Pw in the workpiece coordinate system. If a positioning command is issued, positioning processing, described below, is executed. Note that the description will deal with a case where the rotary table is subjected to simultaneous one-axis control. In response to the positioning command, the processor obtains a rotary table incremental value Ri and performs an operation in accordance with the expression F· ▵ T → ▵ A (11) (where F is the rotational velocity and ▵ T is a predetermined period of time) to calculate an amount of movement ▵ A to be traversed in the time ▵ T. Next, ▵ A is applied to the pulse distributor 107 at intervals of Δ T, and the pulse distributor 107 generates distributed pulses P A applied to the servo circuit 108, thereby rotating the motor 109 to rotate the rotary table 11 shown in Fig. 1. Further, the processor updates the present angular position and a remaining amount of rotation Ar at intervals of ▵ T. Specifically, the present angle Pm in the machine coordinate system and the present angle Pw in the workpiece coordinate system, both of which are stored in the working memory 104, are updated every ▵ T in accordance with the expressions Pm ± ▵ A → Pm (12) Pw ± ▵ A → Pw (13) Similarly, the remaining amount of rotation AR, which has been stored in the working memory 104, is updated in accordance with the expression Ar - ▵ A → Ar (14) In expressions (12), (13), + signifies clockwise rotation and - signifies counter-clockwise rotation. In addition, if reference point restoration has been accomplished, Pm = 0, Pw = -r will hold. Furthermore, the initial value of Ar in expression (14) is the incremental value Ai. The processor 101 thereafter checks whether Ar = 0 holds. If Ar = 0, positioning processing is ended; if Ar ≠ 0, the processor checks whether Ar ≧ ▵ A holds. If Ar ≧ ▵ A is found to hold, the above-described processing is repeated every ▵ T. If the operation Ar → ▵ A is performed and the foregoing processing is executed when the relation Ar < ▵ A comes to hold, then the relation Ar = 0 will be established and positioning processing is ended. If an origin restoration command is generated by the operator's panel 110 when the rotary table 11 has been rotated and stopped at the position shown in Fig. 1(B) by the foregoing processing, the processor 101 subsequently executes origin restoration processing in accordance with the flowchart shown in Fig. 3. It should be noted that the reference point restoration is assumed to be performed within 360 o of rotation. (a) The processor 101 obtains the angle a that satisfies Eqs. (1), (2). It should be noted that if a quotient n and a remainder a are obtained by dividing the present position Pm in the machine coordinate system by 360 o , the remainder a will be the a that satisfies Eqs. (1), (2). (b) Next, the processor 101 executes processing similar to that for the above-described positioning control, whereby the rotary table 11 is rotated by |a| o in a direction conforming to the sign of angle a to restore the rotary table to the reference point of the machine coordinate system. Note that the reference point restoration is performed by rotating the rotary table 11 a o in the counter-clockwise direction if a > 0 holds and |a| o in the clockwise direction if a < 0 holds. Pm, Pw take on the following values owing to a o of rotation: Pm = 360·n Pw = 360·n-r (c) Thereafter, when the processor 101 updates Pm, Pw in accordance with expressions (5), (6), Pm becomes 0 and Pw becomes -r, so that the mechanical and workpiece coordinate systems are returned to their original states. In order to perform the reference point restoration by an amount of rotation within 180 o , processing is executed in accordance with the flowchart shown in Fig. 4. Specifically, the following steps are executed if a reference point restoration command is generated when the rotary table is in the state shown in Fig. 1(B): (a) The angle a that satisfies Eqs. (1), (2) is obtained through a method similar to that described above. (b) Next, |a| and 180 are compared in terms of magnitude. If |a| ≦ 180 holds, processing similar to that for the above-described positioning control is executed and the rotary table is rotated by |a| o to be restored to the reference point MR in the machine coordinate system. Note that the rotary table is restored to the reference point by being rotated counter-clockwise if a > 0 holds and clockwise if a < 0 holds. The values of Pm, Pw are updated to the values indicated by Eqs. (3), (4) by |a| o of rotation. If |a| > 180 holds, the rotary table is rotated by (360 - |a|) o to be restored to the reference point in the machine coordinate system. Note that the rotary table is restored to the reference point by being rotated clockwise if a > 0 holds and counter-clockwise if a < 0 holds. The values of Pm, Pw are updated to the values indicated by the Eqs. (7), (8) by (360 - |a|) o of rotation. (c) Thereafter, the present angles Pm, Pw in the machine and workpiece coordinate systems, respectively, are updated in accordance with expressions (5), (6) if |a| < 180 holds, and in accordance with the expressions (9), (10) if |a| > 180 holds. The foregoing enables the reference point restoration to be completed within 180 o of rotation and also permits Pm = 0, Pw = -r to be achieved to return both the machine coordinate system and workpiece coordinate system to their original attitudes. Thus, reference point restoration can be executed by a first step of updating the present angles Pm, Pw in the machine and workpiece coordinate systems, respectively, in dependence upon rotation of the rotary table and, in response to a reference point restoration command, obtaining the angle a that satisfies the equations Pm = 360 n+a, Pw = 360 n+a-r a second step of rotating the rotary axis by a o to return the rotary table to the reference point in the machine coordinate system, and a third step of updating the present positions Pm, Pw in the machine and workpiece coordinate systems, respectively, in accordance with, e.g. the following expressions: Pm - 360·n → Pm Pw - 360·n → Pw As a result, the reference point restoration can be performed by rotation through less than 360 o , namely in a short period of time, and the workpiece coordinate system can be returned to its original state after the reference point restoration. This dispenses with the need to set the workpiece coordinate system after the restoration is completed, as is necessary in the prior art. According to the present invention, the arrangement is such that reference point restoration is executed by a first step of updating the angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, in dependence upon rotation of the rotary table and, in response to a reference point restoration command, obtaining the angle a that satisfies the equations Pm = 360·n+a, Pw = 360·n+a-r a second step of comparing |a| and 180 in terms of magnitude and restoring the rotary table to the reference point by rotating it |a| o in a case where |a| < 180 holds, a third step of restoring the rotary table to the reference point by rotating it (360 - |a|) o in a case where |a| > 180 holds, a fourth step of updating the angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, in accordance with, e.g. the following expressions: Pm - 360·n → Pm Pw - 360·n → Pw in a case where |a| < 180 holds and updating the present positions Pm, Pw in the machine and workpiece coordinate systems, respectively, in accordance with, e.g. the following expressions: Pm - (360·n±1) → Pm Pw - (360·n±1) → Pw (where the signs in the parentheses are made + when a is positive and - when a is negative) in a case where |a| > 180 holds. Accordingly, a reference point restoration can be executed within 180 o of rotation to achieve a further reduction in the time needed for the reference point restoration.

Claims: A method of restoring a rotary table (11) to a reference point (MR) in which a rotational direction workpiece coordinate system serving as a programming reference with respect to a rotational direction machine coordinate system is decided, data specifying an angle r between an origin (WR) of the workpiece coordinate system and the reference point (MR) in the machine coordinate system are commanded by a program, the rotary table (11) is positionally controlled by NC program data created based on the workpiece coordinate system, and the rotary table is restored to the reference point (MR) by a reference point restoration command, said method being characterised by having:- a first step of updating angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, in dependence upon rotation of said rotary table (11) and, in response to the reference point restoration command, obtaining an angle a that satisfies the equations Pm = 360·n+a, Pw = 360·n+a-r where n is the net number of revolutions effected by the table; a second step of comparing |a| and 180 in terms of magnitude and restoring the rotary table to the reference point (MR) by rotating it |a|° in a case where |a| ≦ 180 holds; a third step of restoring the rotary table to the reference point (MR) by rotating it (360 - |a|)° in a case where |a| > 180 holds; and a fourth step of establishing the relations Pm = 0, Pw = -r for the present angular positions Pm, Pw in the machine and workpiece coordinate systems, respectively, by performing calculations defined by expressions Pm - 360·n → Pm Pw - 360·n → Pw in a case where |a| ≦ 180 holds and performing calculations defined by expressions Pm - (360·n±1) → Pm Pw - (360·n±1) → Pw (where the signs in parentheses are made + when a is positive and - when a is negative) in a case where |a| > 180 holds.

Inventors: KIYA, NOBUYUKI YOKOKAWACHO-JUTAKU 13-106
Applicants: FANUC LTD.
Application year: 1985
Main classification: G05B19
IPC codes: G05D3, G05B19