SPINDLE POSITIONING METHOD

Abstract: A main spindle positioning method which makes the most of deceleration of a spindle motor and speeds up a spindle positioning operation. It is assumed that the spindle motor is running under speed control. In response to a command for a stop at a given position, the spindle motor is decelerated to a speed N below a maximum rotating speed N1 determining a constant torque region on the basis of the speed control (Step S1), and the speed control is switched to a position control at the position at which the speed N is reached. At this time, a value which takes into consideration the present position at one rotating position of the spindle and a target stop position as an initial position error are set to an error counter (Steps S5 to S11). Thereafter, a position feedback quantity Pf from a position sensor is received by the error counter so as to execute linear acceleration/deceleration control to a final stop position (Step S12) and a speed command Vcmd is determined (Step S13), and a speed loop processing follows.

Description: The present invention relates to a spindle positioning method for enabling a spindle motor to stop at a desired position stably in a shortest possible period of time, by making the best use of the decelerating capability of the spindle motor. In a known method of stopping a rotating spindle motor at a desired position, the motor is first decelerated to a base speed for positioning control in the stage of speed control; then control mode for the spindle motor is switched from the speed control mode to position control mode; and position loop control is carried out using the difference between a commanded stop position and a current position as a position deviation. Such a method is disclosed in EP-A-0150216. In order to shorten the time required for the positioning in this method, the value of position gain may be increased. If, however, the position gain is increased disregarding the accelerating/decelerating characteristics of the spindle motor, the spindle motor may fail to follow the speed command, causing an undesired overshoot. Conversely, if the value of the position gain of the position loop is set too small for fear of the occurrence of overshoot, the time required for the positioning will inevitably be prolonged. Thus, it is difficult to prevent overshoot and achieve quick positioning at the same time. JP-A-63-273114 discloses a constant position stop controller wherein the constant position stop operating time is reduced by making the speed command smoothly continuous before the switch from speed to position control mode. An object of the present invention is to provide a spindle positioning method not only being capable of preventing an undesired overshoot but also capable of positioning a spindle of a machine tool at a desired stop position in a short time. To achieve the above object, according to the present invention, when a fixed-position stop command is generated while operation of a spindle motor is controlled in accordance with speed control, the rotational speed of the spindle motor is reduced, according to the speed control, to a speed lower than or equal to a maximum rotational speed defining a constant torque region; a value specifying the relation between present position and commanded stop position of the motor with respect to one revolution of the motor is set as an initial position deviation when the motor speed is reduced to the speed lower than or equal to the base speed, and operation control mode for the motor is switched from the speed control mode to position control mode; and linear acceleration/deceleration control is carried out thereafter until the commanded stop position is reached. Further, the method comprises the steps of: detecting the speed of a spindle motor and a rotational position of the spindle motor with respect to one revolution of the spindle when the speed of the spindle motor becomes lower than or equal to said base speed; obtaining a minimum amount of movement required if the spindle motor is decelerated along a deceleration line set based on the detected speed, as well as a distance from the detected rotational position to a target stop position; successively adding an amount of movement corresponding to one revolution of the spindle to the distance until the distance becomes greater than the minimum amount of movement and setting the obtained value as a position deviation; carrying out position loop control, based on a speed command obtained, by multiplying the square root of the position deviation by a set position loop gain; and controlling operation of the spindle motor based on the speed command. Preferably, the minimum amount of movement is obtained by dividing the square of the detected speed by a parameter value preset according to the deceleration line, and the position loop gain equals the square root of the parameter value. Furthermore, a development of the method of the present invention comprises the steps of: (a) reducing the rotational speed of a spindle motor to a speed N, lower than or equal to a maximum rotational speed N1 which defines a constant torque region, when a fixed-position stop command is generated; (b) calculating a number of pulses P1 that a position detector will output when the spindle motor is decelerated from the rotational speed N at a predetermined gradient (deceleration) until a final stop position is reached; (c) calculating a number of pulses α, which is required for the spindle to rotate in a forward direction from a present position to a commanded stop position within one revolution of the spindle; (d) comparing the number of pulses P1 calculated in the step (b) with the number of pulses α calculated in the step (c); (e) setting the number of pulses α in an error counter as an initial position deviation when the number of pulses α is greater than the number of pulses P1, or setting α + n·Prev in the error counter as the initial position deviation when the number of pulses P1 is greater than or equal to the number of pulses α, where Prev is a number of pulses that the position detector outputs during one revolution of the spindle, the value α + n·Prev satisfying the relationship of α + (n - 1)·Prev < P1 ≦ α + n·Prev where n is an integer greater than or equal to "1"; and (f) subtracting the number of feedback pulses Pf, output from the position detector, from the initial position deviation obtained in the step (c) to obtain a speed command by multiplying the square root of the obtained difference by a gain which is determined by a motor deceleration characteristic so that the operation of the spindle motor is controlled based on the speed command. As mentioned above, according to the present invention, when the rotating spindle is to be stopped at a predetermined position, the rotational speed of the spindle motor is first reduced to a speed region which is lower than or equal to the base speed and in which the torque is constant. Since in this region the torque is constant and thus linear acceleration/deceleration control is feasible, the spindle motor can be subjected to position control according to the predetermined deceleration line so as to be stopped at the final position. Thus, in the stage of deceleration before stoppage, the decelerating capability of the spindle motor is utilized most effectively, and the positioning time can be shortened without causing overshoot. Brief Description of the Drawings Fig. 1 is a block diagram showing a principal part of a spindle control circuit of a machine tool to which a method according to one embodiment of the present invention is applied; Fig. 2 is a functional block diagram showing details of a motor control circuit according to the embodiment; Fig. 3 is a flowchart illustrating an outline of a fixed-position stop processing to be executed by the motor control circuit of the embodiment; Fig. 4 is a diagram illustrating principles of a method for calculating a parameter used in the fixed-position stop processing; and Fig. 5 is a conceptual diagram illustrating the relationship between current position of a spindle motor and commanded stop position of a spindle. Fig. 1 is a block diagram showing a principal part of a spindle control circuit of a machine tool according to an embodiment. A spindle 1 is rotated by a spindle motor 4 via a power transmission mechanism 2 comprising gears, a timing belt, or the like. A position detector 3 is mounted on the spindle 1 for generating a given number, Prev, of position detection pulses per revolution and outputting a one-revolution signal per revolution. The spindle motor 4 for rotating the spindle 1 is mounted with a speed detector 5 for detecting the rotational speed of the motor 4. The position detector 3 and the speed detector 5 are connected to a motor control circuit 7. The spindle motor 4 is connected to the motor control circuit 7 through a power circuit 6, while the motor control circuit 7 is connected to a numerical control (NC) device 8, which controls various axes of the machine tool. The motor control circuit 7 includes a speed control section for controlling the speed of the spindle motor 4, a position control section for controlling the stoppage and positioning of the motor 4, a processor for carrying out various calculations, a ROM, a RAM, etc., and controls the operation of the spindle motor 4 via the power circuit 6 such as a transistor inverter or the like. The motor control circuit 7 further includes a counter for counting position feedback pulses Pf supplied from the position detector 3, and a latch circuit for latching the value of the counter each time it receives the one-revolution signal from the position detector 3. The power transmission mechanism 2 of this embodiment has a reduction ratio of 1:1. Fig. 2 is a functional block diagram of the motor control circuit 7. In the figure, symbol "a" denotes an error counter for storing the position deviation at the time of motor stoppage and positioning; "b", software means for executing a speed command calculation processing; and "c" and "d", proportional and integral gains of a speed control loop, respectively. Symbols "h" and "f" each denote a term of transfer function of the spindle motor 4, wherein Kt is a torque constant and Jm is inertia, and symbol "g" denotes an integral term of the transfer function for integrating the speed to obtain the position. S1 and S2 are switches illustrated for convenience' sake, and are selectively operated depending on whether the control mode of the spindle 1 is for the speed control or for the positioning control. First, the operation according to this embodiment will be outlined. Normally, the switch S2 is opened while the switch S1 is closed, and speed control is carried out based on a rotational speed command Vcmd supplied from the numerical control device 8, as in a conventional system. Specifically, a speed feedback signal Vf outputted from the speed detector 5 is subtracted from the rotational speed command Vcmd to obtain a speed deviation, and the product of the speed deviation and the speed loop proportional gain "c" is added to the product of a value obtained by integrating the speed deviation and the speed loop integral gain "d" to obtain a torque command. Thus, the operation of the spindle motor 4 is controlled through the power circuit 6. When a stop-and-position command and a spindle stop position (specific rotational position with respect to one revolution) are outputted from the numerical control device 8, the processor of the motor control circuit 7 starts a "fixed-position stop processing" (described in detail later), shown in the flowchart of Fig. 3, to control the operation of the spindle motor 4 while preventing overshoot and making the best use of the decelerating capability of the spindle motor 4, so that the spindle may be positioned at the specified stop position. Referring now to Fig. 4 illustrating the principles underlying the invention, a method for obtaining a parameter will be described. Such parameter is required when carrying out fixed-position stop control while making the best use of the decelerating capability of the motor. In a rotational region not higher than a certain rotational speed N1 (rpm), the spindle motor 4 produces a constant torque, and thus linear acceleration/deceleration control is feasible in this region. This rotational speed N1 (rpm), or a maximum rotational speed per minute defining the constant torque region, is hereinafter referred to as the base speed N1. The linear acceleration/deceleration control is illustrated in the graph of Fig. 4, wherein the axis of abscissas represents time; the axis of ordinates, rotational speed; and a straight line L (deceleration line) in the figure indicates a decelerating action. In Fig. 4, when a stopping time required to bring the spindle motor 4 rotating at the base speed N1 to a stop by a maximum decelerating action is T1, and a time required to bring the spindle motor 4 rotating at an arbitrary rotational speed N (rpm) lower than the base speed N1 to a stop along the deceleration line L is T, the following relationship is fulfilled, since the gradient (deceleration) of the deceleration line L is fixed: T = T1 N1 ·N Then, assuming that the number of the position feedback pulses outputted from the position detector 3 during one revolution of the spindle 1 is Prev (pulses), P1, a number of pulses to be generated by the position detector 3 from the time the spindle motor 4 starts decelerating from an arbitrary rotational speed N, lower than or equal to the base speed N1, along the deceleration line L until the motor is rotated to a commanded stop position is calculated. Since the area of a small triangle defined by the vertical dashed line, the deceleration line L, and the time axis (axis of abscissas) in Fig. 4 is equivalent to the number of revolutions which the spindle makes until it stops, P1, the number of pulses is given by the following equation: P1 = 1 2 ·T· N 60 ·Prev From equations (1) and (2), the following equation is derived: P1 = Prev 120 · T1 N1 ·N 2 Solving equation (3) for the rotational speed N provides the following equation: N = 120 Prev · N1 T1 ·P1 Provided the motor output torque, motor inertia and load inertia in the constant torque region are Tm, Jm, and JL, respectively, the following equation holds true based on the general formula related to torque and acceleration: T1 = Jm + JL Tm · 2π 60 ·N1 From the above equation (5), equation (6) is derived. N1 T1 = Tm Jm + JL · 60 2π Substituting the left side of equation (6) into the right side of equation (4) provides N = 120 Prev · Tm Jm + JL · 60 2π ·P1 In the above equation (7), since the motor output torque Tm, the motor inertia Jm, the load inertia JL, and the number Prev of pulses per revolution of the spindle 1 are known, part of equation (7) can be used as using a parameter according to the motor characteristic, and expressed as follows: PRM = 120 Prev · Tm Jm + JL · 60 2π The value of the parameter PRM in equation (8) is written in advance in the ROM of the motor control circuit 7. Based on equation (8), equation (7) can be expressed as follows: N = P1 · PRM Equation (9) indicates that, when the present speed is N, the most efficient deceleration till stoppage can be implemented by carrying out a position loop control, wherein a position command of pulses P1 is given as an initial value of position deviation; a position deviation is obtained by subtracting the position feedback pulse Pf from the position deviation, and a speed command is calculated by multiplying the square root of the position deviation by the square root of the parameter PRM as the position loop gain. That is, the spindle motor 4 is decelerated and stopped along the deceleration line L shown in Fig. 4. Solving equation (9) for P1, the number of pulses, corresponding to the distance moved before the stoppage, provides the following equation: P1 = N·N/PRM Equation (10) indicates that, when the rotational speed of the spindle motor 4 is N, the initial value of position deviation equals P1, the number of pulses, calculated by equation (10). Thus, in order to stop the spindle 1 in short time by making the best use of the decelerating capability of the spindle motor 4, the rotational speed of the spindle motor 4 is first reduced to a rotational speed N lower than or equal to the base speed N1, and the position loop control is carried out using P1, the number of pulses calculated by equation (10) as the initial value of position deviation, whereby the spindle 1 can be stopped at the position specified by P1, the number of pulses in the shortest time. When the spindle motor 4 has to be stopped by the stop-and-position command, a predetermined position within one revolution of the spindle 1 is specified as a target position. Specifically, the target position is previously specified as a rotational position, which corresponds to a predetermined number of position detection pulses (P2 pulses), from the time of generation of the one-revolution signal. Here, as shown in Fig. 5, let us consider the case where the spindle is currently at a rotational position ("current position"), and P0 position detection pulses have been generated from the time of output ("signal") of the one-revolution signal until the time at which the spindle reaches the current position. In order for the spindle to rotate in a forward direction (clockwise in the example shown in Fig. 5) and stop at a position (target position) coinciding with a position which is within one revolution from the current position, the amount of rotation of the spindle can be expressed in terms of the number of position detection pulses α (< Prev), as follows: When P2 ≧ P0 as shown in Fig. 5(a), α = P2 - P0; and when P2 < P0 as shown in Fig. 5(b), α = P2 - P0 + Prev. After performing the calculation by equation (10) based on the rotational speed N to obtain P1, the number of pulses corresponding to the difference between the current position and the stop position, if it is found that the obtained value P1 is smaller than the value α (P1 < α), it means that the present speed N is lower than a speed for enabling the spindle to cover the distance equivalent to the pulses α in the shortest time. In this case, the amount of pulses α, not P1, the number of pulse, is set in the error counter as the initial value of position deviation. Then, the feedback pulse Pf delivered from the position detector is subtracted from the initial position deviation α; the square root of the resulting value is multiplied by a coefficient determined by the motor deceleration characteristic to obtain a speed command (see equation (9) above); and the position loop control is carried out (the switch S1 is OFF, while switch S2 is ON as shown in Fig. 2). As a result, the speed rises once above the present speed; however, still it is possible to position the spindle in the shortest time along the deceleration line L. When P1, the number pulses corresponding to the difference between the current position and the stop position is greater than or equal to the value α (P1 ≧ α), "α + n·Prev", where n is an integer greater than or equal to "1" and satisfies the relationship: α + (n - 1)·Prev < P1 ≦ α + n·Prev is set as an initial value α' of position deviation. Then, the feedback pulse Pf delivered from the position detector is subtracted from the initial position deviation α'; the square root of the resulting value is multiplied by the coefficient determined by the motor deceleration characteristic to obtain a speed command (see equation (9) above); and the position loop control is carried out (switch Si is OFF, while switch S2 is ON as shown in Fig. 2). Since the value α' set as the initial value is equal to or slightly greater than P1, the speed may, in some cases, rise once somewhat above the present speed, but is thereafter immediately slowed down along the deceleration line L, and the spindle reaches the final stop position in accordance with the deceleration line L in the shortest time without causing overshoot. Fig. 3 is a flowchart showing an outline of the "fixed-position stop processing" employed in this embodiment to carry out the above-described control method. In the following, a spindle positioning method of this embodiment will be described with reference to the flowchart. Upon receiving the stop-and-position command from the numerical control device 8 and a stop position signal, which is given as the number of pulses P2 after generation of a one-revolution signal, the processor of the motor control circuit 7 executes the processing shown in the flowchart of Fig. 3 with every predetermined period. First, it is determined whether the present speed N of the spindle motor 4 is within a rotational speed region which is lower than or equal to the base speed N1 (Step S1). If the rotational speed N of the spindle motor 4 is not lower than or equal to the base speed N1, the base speed N1 is thereafter outputted as the rotational speed command Vcmd with every predetermined period until the rotational speed N becomes lower than or equal to the base speed N1 (Step S2), thereby slowing down the rotational speed N of the spindle motor 4 to a level lower than or equal to the base speed N1. Specifically, with the switch S2 of Fig. 2 turned off while the switch S1 of the same turned on, the base speed N1 is continuously outputted as the rotational speed command Vcmd. If it is concluded thereafter in Step S1 that the present rotational speed N has become lower than or equal to the base speed N1, the processor of the motor control circuit 7 determines whether a distance setting completion flag F is set (Step S3). At this stage, since the distance setting completion flag F remains reset because of initialization, the calculation by equation (10) is performed, using the value of the present rotational speed N, to obtain a number of pulses P1, which corresponds to the distance over which the spindle motor 4 will rotate before being stopped when the spindle motor 4 is decelerated along the deceleration line L, and the obtained data P1 is stored in register (Step S4). Subsequently, the processor of the motor control circuit 7 subtracts the value of the counter at the time of detection of the one-revolution signal, latched in the latch circuit, from the value of the counter for counting the position feedback pulses to obtain the rotational position P0 of the spindle starting from the position of detection of the one-revolution signal, and also subtracts the present position P0 from the stop position P2 falling within one revolution of the spindle to obtain a number of pulses α (= P2 - P0) equivalent to the distance between the present position and the stop position (Step S5). If the value α is "0" or a positive value, it is stored in a position deviation register R(e) as an initial value; if the value α is negative, the sum of the value α and the number of pulses Prev corresponding to one revolution of the spindle is stored in the position deviation register R(e) as the initial value (Steps S6 to S8). If the number of pulses α (= P2 - P0) obtained in Step S5 is positive, this indicates the presence of a state in which the present position P0 is before the stop position P2 when considered on the basis of a one-revolution range starting from generation of the one-revolution signal, as shown in Fig. 5(a). On the other hand, when the present position P0 of the spindle motor 4 is past the stop position P2, as shown in Fig. 5(b), that is, if P0 > P2 and α < 0 (Step S6), the number of pulses Prev corresponding to one revolution of the spindle 1 is further added to α (= P2 - P0) , and the value obtained or [ P2 - P0 + Prev = α + Prev ] is stored in the position deviation register R(e) as the initial value of position deviation. The processor then compares the obtained number of pulses P1 obtained in Step S4 with the value α stored in the position deviation register R(e), i.e., the number of pulses α corresponding to the distance to the stop position P2. If the value stored in the register R(e) is smaller than or equal to the obtained number of pulses P1 (Step S9), the sum of the value α stored in the register R(e) and the number of pulses Prev corresponding to one revolution of the spindle is stored in the register R(e) as a new value (Step S10), and the flow returns to Step S9 wherein the new value α stored in the position deviation register R(e) is compared with the number of pulses P1. As Steps S9 and S10 are repeated in this manner, the value stored in the register R(e) gradually increases. When the value stored in the register R(e) has become greater than the number of pulses P1, that is, an integer n satisfying equation (11) is found, the flag F is set (Step S11), and the position loop control is initiated. Specifically, the switch S1 in Fig. 2 is turned off, and the switch S2 is turned on. Then, the position feedback quantity Pf of the present cycle is subtracted from the position deviation e, which is stored in the position deviation register R(e) as the initial value, to obtain a new position deviation e which is then stored in the register R(e) (Step S12), and the square root of the position deviation e, stored in the register R(e) is multiplied by the square root of the parameter PRM to obtain a speed command Vcmd (Step S13). The obtained speed command is transferred to the speed loop process and the processing of the present cycle is ended. In the subsequent and succeeding cycles, Steps S1, S3, S12 and S13 are repeatedly executed to carry out the position loop process, since the distance setting completion flag F is set. When the value stored in the position deviation register R(e) becomes "0", that is, when the position deviation becomes "0", the speed command also becomes "0" and the spindle 1 will be stopped. The above-described embodiment is concerned with the case wherein the reduction ratio of the power transmission mechanism 2 is 1:1 (as in the case where the spindle 1 is directly coupled to the spindle motor 4), but the spindle positioning method of this embodiment can be applied to a system having a different reduction ratio, by appropriately correcting the various equations mentioned above.

Claims: A spindle positioning method for positioning a spindle at a desired rotational position, comprising the steps of: reducing the rotational speed of a spindle motor (4), in accordance with speed control, to a speed (N) lower than or equal to a base speed (N1) which is a maximum rotational speed defining a constant torque region, when a fixed-position stop command is generated while operation of the spindle motor (4) is controlled in accordance with the speed control; setting, as an initial position deviation, a value specifying the relation between present position and commanded stop position of the motor (4) with respect to one revolution of the motor (4) when the motor speed is reduced to the speed (N) lower than or equal to the base speed (N1), and switching operation control mode of the motor (4) from the speed control to position control; and carrying out linear acceleration/deceleration control thereafter until the commanded stop position is reached; the method comprising: detecting the speed of the spindle motor (4) and a rotational position of the spindle motor (4) with respect to one revolution of the spindle when the speed of the spindle motor (4) becomes lower than or equal to a said base speed (N1) which is a maximum rotational speed defining a constant torque region; obtaining a minimum amount of movement required if the spindle motor (4) is decelerated along a deceleration line (L) set based on the detected speed, as well as a distance from the detected rotational position to a target stop position; successively adding an amount of movement corresponding to one revolution of the spindle to said distance until said distance becomes greater than the minimum amount of movement and setting the obtained value as a position deviation; carrying out position loop control based on a speed command obtained by multiplying the square root of the position deviation by a set position loop gain; and controlling operation of the spindle motor (4) based on the speed command. The method according to claim 1, wherein said minimum amount of movement is obtained by dividing the square of the detected speed by a parameter value preset according to the deceleration line, and the position loop gain equals the square root of the parameter value. A spindle positioning method according to claim 1 or 2, and comprising the steps of: (a) reducing as aforesaid the rotational speed of the spindle motor (4) to a speed N, which is lower than or equal to a maximum rotational speed N1 defining a constant torque region, when a fixed-position stop command is generated; (b) calculating a number of pulses P1 that a position detector (3) will output when the spindle motor (4) is decelerated from the rotational speed N at a predetermined deceleration until a final stop position; (c) calculating a number of pulses α that the position detector (3) will output while the spindle rotates from a present position to a commanded stop position which is within one revolution of the spindle; (d) comparing the number of pulses P1 calculated in said step (b) with the number of pulses α calculated in said step (c); (e) setting the number of pulses α in an error counter as an initial position deviation when the number of pulses α is greater than the number of pulses P1, or setting α + n·Prev in the error counter as the initial position deviation when the number of pulses P1 is greater than or equal to the number of pulses α, where Prev is a number of pulses that the position detector outputs during one revolution of the spindle, said α + n·Prev satisfying the relationship of α + (n - 1)·Prev < P1 ≦ α + n·Prev where n is an integer greater than or equal to "1"; and (f) subtracting the number of feedback pulses Pf, output from the position detector (3), from the initial position deviation obtained in said step (c) to obtain a speed command by multiplying the square root of the obtained difference by a gain which is determined by a motor deceleration characteristic so that operation of the spindle motor (4) is controlled based on the speed command.

Inventors: FUKUKURA MASAAKI, KONO SHINICHI, FUKUKURA, MASAAKI, KONO, SHINICHI, FUKUKURA, MASAAKI RM 6-305 FANUC MANSHONHARIMOMI, KONO, SHINICHI RM 7-203 FANUC MANSHONHARIMOMI
Applicants: FANUC LTD, FANUC LTD.
Application year: 1993
Main classification: B23Q15
IPC codes: B23Q5, B23Q15, G05B19, G05D3