DEVICE FOR CONTROLLING SERVO MOTOR

Abstract: Generally, in a machine provided with a servo motor controller which has a position feedback loop, a speed feedback loop, and a current feedback loop, a current instruction value is preset to the voltage that corresponds to the frictional torque at the time when the motor starts to rotate and/or when the direction of rotation is reversed in order to compensate the delay of response of the motor caused by the frictional torque. According to the invention relating to an improvement in this technology, the value of an integration element constituting the speed control unit is inverted according to a function after the speed instruction of the motor has changed from a positive value to a negative one or vice versa, or after a measured speed of the motor has changed from a positive value to a non-positive one or from a negative value to a non negative one. The output value is then added to the current instruction value or to the integration term thereof, thereby improving the delay in response and decreasing errors in the machine working.

Description: [Field of Art] The present invention relates to an apparatus which controls a servo motor that drives a machine tool to machine an object according to instructions from an command function generator and, more particularly, to a technique for compensating for the delay of the response of a servo motor incorporated in a machine whose internal characteristics differ according to direction because of gravity or other reasons, the delay being introduced when the motor is reversed or started. [Background of the Invention] As shown in Fig. 1, a servo motor control circuit having a position feedback loop and a digitally controlled velocity loop is generally equipped with both a velocity feedback loop for controlling the rotational speed of a motor 10 and a current feedback loop for controlling the current flowing through the motor 10. In addition there is the position feedback loop for controlling the position, angular or otherwise position of the movable mechanical part (not shown) of the motor 10. In the current feedback loop, the motor current I d is controlled so that instructed analog current I s ' equals motor current I d , as detected with a resistor 11. The motor velocity is controlled so that the difference Δ.V between motor velocity V d , found by a velocity-calculating portion 21, and velocity V s , instructed from a position control portion 19, is reduced down to zero. The motor position is controlled by the position feedback loop in such a way that the difference Δℓ between position ℓ d and instructed value ℓ s produced from an command function generator 16 is reduced down to zero. The position ℓ d is detected by a position detector 15 such as a pulse encoder or a linear scale and counted by a position counter 20. Also shown in Fig. 1 are a velocity control portion 12, a D/A converter 14, a power amplifier 17, and subtracters 18a, 18a, 18c. In the area surrounded by the dot-and-dash line, signals are processed digitally. Digital signals are indicated by ⇒, while analog signals are indicated by →. Usually, the position control section 19 performs an arithmetic function given by V s = K p · Δℓ where K p is a constant. Where the velocity is controlled by making use of PI (proportional plus integration) action, the velocity control portion 12 performs arithmetic functions given by where K v and K I are constants, and Σ means summation. Where the velocity is controlled by making use of I-P action, the velocity control portion 12 which determines the relation among the instructed velocity V s , the velocity V d , and the instructed current I, performs arithmetic functions given by In the prior art servo motor control apparatus construction as shown in Fig. 1, if the rigidity of the motor shaft is ideal, then the instructed motor velocity V s , and the motor current I d , which are taken when the rotation of the motor is reversed, show characteristics as indicated by 30V s , 31V d , 32I d , respectively, in Fig. 2. In these graphs, the instant at which an instruction for reversing the direction is given is at the origin, and these three characteristics V s , V d , and I d are plotted against time t. Io is a value obtained by transforming the friction torque produced in the machine into a motor current. In the illustrated example, the instructed velocity is reduced at a constant rate, i.e., the acceleration is a constant negative value. As can be seen from these graphs, when an instruction for reversing the direction is entered at instant t=0, the motor current I d indicated by the curve 32I d decreases gradually, but the velocity V d indicated by the curve 31Vd is kept null until the motor current I d reaches - I o , whereupon the motor begins to reverse. That is, a time delay of T 1 occurs between the instant at which an instruction for reversing the direction is entered and the instant at which the motor begins to reverse. Of course, this time delay produces an error in controlling the machining process. More specifically, as shown in Fig. 3, when a command pulse train is distributed along a genuine circle and a cutting work should be caused to proceed along the genuine circle as indicated by curve 40, the response is delayed on reversal of the direction of the rotation. Therefore, in the portion in which the cut quadrant of the arc is switched, the actual cut portion has a bulge as indicated by curve 41. This undesirable phenomenon is now described in further detail by referring to Fig. 3. In arc I, only the X-axis moves, and the velocity assumes the maximum value. The Y-axis is at rest. In arc II, the Y-axis begins to move but a genuine circle is not attained. In arc III, both X- and Y-axes move, and a genuine circle trajectory is accomplished. When the Y-axis moves in one direction after kept at rest, the start of the movement is delayed, thus producing arcs I and II. If the machining deviation from the genuine circle is taken, a bulge appears. Since the present numerical control uses only distribution of pulses to circles and straight lines, problems occur when machining work is done along an arc. In addition, when the direction of movement along one axis is instructed to reverse while the direction of movement along another axis is maintained constant (i.e., a trajectory in which a pause takes place being followed) for example a parabolic contour is followed, similar problems take place. With respect to the start of the motor, it does not begin to move until the motor current I d exceeds - I o , thus producing a time delay. Where instructed motor velocity Vs and the degree of friction differ among the axes, as encountered on a machine having several axes such as a robot, it is inevitable that the effect of time delay differs among the axes. As a result, the trajectory deviates at the machine point. In view of these problems, the present applicant has already proposed an improved method of reversing the sign of the integration term obtained from the velocity control portion 12 without changing the absolute value at the instant of the reversal of the direction, or for setting the integration term to a certain value at the instant of reversal by making use of the fact that the voltage determining the instructed current value Is when an instruction for reversing the direction is entered is in proportion or corresponds to the sum of friction torque, torque equivalent to work to the outside, and acceleration torque, as well as making use of the fact that the voltage determining the instructed current value Is is the value of the integration term of the velocity control portion 12, since the instructed velocity V s and the motor velocity V d are almost null, as disclosed in Japanese Patent Laid-Open Nos. 150688/1986, 150689/1986, 150690/1986, and 173684/1986. In this method, however, the instructed current value Is is changed in a step by step fashion. This produces the possibility that the response of the motor becomes excessive because of the resilience determined by the rigidity of the motor shaft. For this reason, a workpiece may be machined excessively. Patent Abstracts of Japan, vol. 6, no. 147 (E-123)(1025) and JP-A-57 71282 disclose a servo motor controller adapted to compensate for a delay in the response of a motor owing to a friction torque with generation of a compensation voltage reverse in the polarity but equal in the absolute value to the voltage which determines a current command value. The generation of the compensation voltage is based on a first order delay element which can avoid excessive machining. However, the control methods and controllers mentioned above can not compensate for greatly differing positive and negative friction characteristics, i.e. friction characteristics of a positive and negative direction of motor movement, respectively. [Disclosure of the Invention] It is a goal of the present invention to provide a control apparatus which solves the problems with the prior art control as described above. This goal is achieved by the servo motor control apparatus as defined in claim 1. The velocity control portion using a microcomputer to perform its processing compensates for the response delay of a motor introduced by friction torque, when the rotational direction of the motor is reversed, to thereby enhance control accuracy. It is another goal of the invention achieved by the servo motor control apparatus of claim 1 to provide a control apparatus which, when a motor begins to move, compensates for the response delay introduced by friction torque by use of a means similar to the means used upon reversal of the rotational direction of the motor, to enhance the control accuracy. A first embodiment of the invention comprises a servo motor control apparatus having a velocity control portion consisting of a microcomputer, a motor velocity feedback loop (with either a motor torque feedback loop or a motor current feedback loop formed inside the velocity feedback loop) and a controller included in the velocity control portion having at least proportional and integrated elements. This servo motor control apparatus further includes a means which reverses the sign of the value of the integration element of the velocity control portion by using a function which smooths a stepwise change of the input. The function may be, for example, a constantly increasing function, an exponential function, or an S-shaped function , and adds the output value either to the instructed current value or to the integration term. This is done after the value of the instructed motor velocity changes from a positive value to a negative value or vice versa, or after the detected velocity of the motor changes from a positive value to a nonpositive value or from a negative value to a nonnegative value. The first embodiment of the invention further includes a means which changes the value of the integration element of the velocity control portion according to the function, so that the value may correspond to positive or negative friction, depending, respectively, on whether the motor rotates forwardly or rearwardly. It also adds the output value to the instructed current value or the integration term after the instructed motor velocity changes from a positive value to a negative value or vice versa, or after the detected velocity of the motor changes from a positive value to a nonpositive value or from a negative value to a nonnegative value. A second embodiment of the invention is based on the servo motor control apparatus described above and further includes a means which changes the value of the integration element of the velocity control portion according to function, so that the value may become equal to a value corresponding to positive or negative friction, depending respectively, on whether the motor rotates forwardly or rearwardly, and adds the output value either to the instructed current value or to the integration term after the instructed velocity of the motor changes from zero to a nonzero value. In the first embodiment of the invention, the input applied to the instructed current value I s , used in the control method proposed by the present applicant, is passed through a filter element rather than being changed in a stepwise fashion to prevent excessive response of the motor. Also, the required time is reserved for the instructed current value I s to reach the sum of friction torque, torques equivalent to work done to the outside, and acceleration torque. In the first embodiment of the invention, when the direction is varied from a positive value to a negative value, the integration term of the velocity control portion is set to stationary negative value - I rI . When the direction is varied from a negative value to a positive value, the integration term is set to stationary positive value - I rI . If the value corresponding to the friction is previously known by calculations, actual measurement, or state observer's method, then the integration term can be determined based on the known value. Hence, the control apparatus can cope with cases where positive characteristics differ greatly from negative characteristics, in particular where the effect of gravity is great. The second embodiment of the invention differs only in the timing at which the function output value Q is added to the instructed current value or to the integration term of the velocity control portion when the motor begins to move. Consequently, the second embodiment can yield the same advantages as the first embodiment. Other objects and features of the invention will appear in the course of the description thereof which follows. [Brief Description of the Drawings] Fig. 1 is a circuit diagram of the prior art servo motor control circuit; Fig. 2, (a), (b), (c) are response diagrams of the instructed velocity of a servo motor, the detected velocity of the motor, and the electric current flowing through the motor when the motor is reversed; Fig. 3 is a diagram illustrating error introduced in machining a workpiece to fabricate a genuine circle; Fig. 4 is a block diagram of a control apparatus according to the invention; Fig. 5, (a), (b), (c) are graphs of functions used in the present invention; Fig. 6, (a), (b), (c) are flowcharts illustrating programs for realizing the functions shown in Fig. 5, (a), (b), (c), respectively; Fig. 7 is a flowchart illustrating the operation of a velocity control portion not distinguishing between positive and negative friction; Fig. 8 is a flowchart illustrating the operation of a velocity control portion according to the invention; and Fig. 9 is a block diagram illustrating processing for finding a value which corresponds to the instructed velocity and is used to detect reversal of the direction of the rotation. Fig. 4 shows a control apparatus embodying the concept of the present invention. This apparatus comprises a numerically controlled machine 200, a command function generator 16, an X-axis motor control section 220, a Y-axis motor control section 230, a cutting machine 240, an X-axis motor 10X, and a Y-axis motor 10Y. The numerically controlled machine 200 is similar to the prior art machine shown in Fig. 1 except that a function of performance processing upon detection of the reversal of the direction of the rotation is added to the velocity-calculating portion 21, and another function is added to the velocity control portion 12 to perform further processing. These differences are now described in detail. The processing performed upon detection of the reversal of the direction of the rotation is intended to change FLAG 1 from 0 to 1 when the motor velocity V d changes from a positive value to a nonpositive value or from a negative value to a nonnegative value, the FLAG 1 being incorporated as a control flag in the velocity control portion 12. The function portion (called "FILTER 1") of the control portion 12 shows response Q when an input P, that prompts changes in a stepwise fashion is applied. The kind of function may be determined, taking into account the friction torque characteristics of the cutting machine 240 and the motors 10X and 10Y. The time constant is decided depending on the acceleration torque value generated from the command function generator 16, on the adjusted gain of the servo loop, and also on the spring constant determined by the rigidity of the motor shaft. One kind of function increases at a constant rate, as shown in Fig. 5(a). Another kind changes exponentially, as shown in Fig. 5(b). A further kind varies like the letter S, as shown in Fig. 5(c). The function may be created outside the apparatus and take the form of a table, or may be programmed into the apparatus after preparing the flowchart of Fig. 6 (a), (b), or (c). In Fig. 6(a), ma is a constant. Under the initial condition, N=0 and Q=0. In Fig. 6(b), Kb is a constant. Under the initial condition, Q=0. In Fig. 6(c), m b , m c , m d , P 1 , P 2 , and P 3 are constants. Under the initial condition, N=0 and Q=0. It is to be noted that the following relations hold: P 2 = P 1 · (2m b - 1) P 2 = Q 1 + P 3 P = Q 1 + P 3 · m d - m c + 1 The PI (proportional plus integral) action performed by the velocity control portion is illustrated by referring to Fig. 7. First, the value of FLAG 1 is checked (step 51). If it is 0, the function output value Q is set to 0 (step 52a). If it is 1, then the input value P of FILTER 1 is set to the previous integration term I rI of the velocity control portion multiplied by -2, and the value of FLAG 1 is set to 2 (step 52b). If the value of FLAG 1 is 2, then the previous output value Q of the function is saved on Q 1 . Subsequently, the present output value of FILTER 1 is set to Q (step 52c). Thereafter, the processing is similar to the processing which is given by formulae (3) above and conducted by the prior art velocity control portion mentioned at the outset, i.e., Additionally, the instructed current value I is calculated (step 53). Finally, the rate of change of the output value of FILTER 1 is calculated by taking the difference Q - Q 1 . If it is 0, and if FLAG 1 is 2, then arithmetic operations given by are performed (step 54). Where I-P action is performed, formulae (4) are replaced by Fig. 8 is a flowchart illustrating the invention by an example of PI action performed by the velocity control portion 12. First, a decision is made to see whether the processing is to be the initial processing (step 61). If so, for the preliminary stage, the motor is run both forward and rearward at an appropriate constant velocity. After the motor settles itself into a stationary state, the value of the integration term of the velocity control portion is stored in I rIP and I rIM (step 62). Then, normal operation is started. The value of FLAG 1 is checked (step 63). If it is 0, the output value Q of the function is set to 0 (step 64a). If it is 1, if the motor action changes from a positive value to a negative value, the input P of FILTER 1 is set to I rIM -I rI , while if the motor action changes from a negative value to a positive value, then the input value P of FILTER 1 is set to I rIP -I rI . The value of FLAG 1 is set to 2 (step 64b). If the value of FLAG 1 is 2, then the previous output value Q of the function is saved on Q 1 . Thereafter, the present output value of FILTER 1 is set to Q (step 64c). Subsequently, processing given by formulae (4) is performed, and the instructed current value I r is calculated (step 65). Finally, the rate of change of the output value of FILTER 1, or Q -Q 1 , is calculated. If it is 0, and if FLAG 1 is 2, then processing given by formulae (5) is conducted (step 66). In case of I-P action, formulae (4) are replaced by formulae (6). When the motor begins to move, processing similar to the processing performed on reversal of the direction of the velocity is conducted except that FLAG 1 in the velocity control portion 12 is varied from 0 to 1 when the motor velocity V d changes from 0 to a nonzero value. Some modified examples are next described. Where the stationary value of the integration term of the velocity control portion changes according to posture , as in a robot, FLAG 1 is changed from 0 to 1 in the processing on detection of reversal of the direction of the velocity. Additional processing for setting the integration term of the velocity control portion to I rIP or I rIM is added to the above processing to update I rIP or I rIM , thus coping with changes in the stationary value. Generally, step 0 can be omitted by the addition of this processing. In particular, if I rIP and I rIM are interrelated as given by I rIP = α · I rIM - β where α and β are constants and previously known by experiments or calculations, and if they do not change during the operation, then the input value P to the function when FLAG 1 = 1 can be given by using the integration term I rI of the velocity control portion. The function is given by P = (α - 1) · I rI + β provided that the value changes from a positive value to a negative value and given by P = (1 - α) · I rI - β provided that the value varies from a negative value to a positive value. Thus, it is not necessary to store either I rIP or I rIM . Consequently, only simple processing is required. Where the value corresponding to friction is previously known by calculations, actual measurement, or state observer's technique, step 62 of Fig. 8 can be omitted. The value of the input P to the function can be determined by using that value instead of I rIP or I rIM . Also, the processing of FILTER 1 can be omitted by adding a filter of an exponential function to the output stage of the velocity control portion. This can be done whether the direction of the velocity of the motor is reversed or rotation is started. Detection of reversal of the direction of the velocity can be regarded as a change in the sign of the instructed velocity value V s . Alternately, arithmetic processing shown in Fig. 9 is conducted, using a processing portion 19' equivalent to the position control portion 19, and an integration processing portion 22 to calculate the value V c corresponding to the instructed velocity, from the instructed position value ℓ s generated from the command function generator. The change in the sign is detected, or the change in the sign of the estimated velocity value using a state observer is detected. Where the stationary velocity deviates, depending on the type of the instruction or the type of control system, reversal of the direction of the motor velocity V d is regarded as occurring after a lapse of a given time from the instant at which the sign of the instructed velocity value V s , or of the value V c corresponding to the instructed velocity, changes. A differentiation element can be added to the function portion, and the output value can be added to the integration term of the velocity control portion so that the output value of the function may be reflected in the instructed current value. The same principles can be applied to PID or I-PD control provided by the velocity feedback system whose control portion includes a differentiation element. Also, the principles can be applied irrespective of the kind of the servo motor used, i.e., whether it is a DC servo motor or an AC servo motor. Where the characteristics of the friction torque differ, depending on whether the direction of the rotation of the motor is positive or negative, the first embodiment of the present invention can be applied simply by establishing the relation P = - α · I rI where α is a constant, without using either the second or third embodiment. The value of the constant α may be changed, depending on whether the direction is positive or negative. The kind of function and time constant may be changed on reversal of the direction. As described thus far, in accordance with the present invention, after the instructed motor velocity changes from a positive value to a negative value or vice versa, or after the detected motor velocity changes from a positive value to a nonpositive value, or from a negative value to a nonnegative value, or after the instructed velocity changes from zero to a nonzero value, the value of the integration element of the velocity control portion is varied from the present integrated value to a negative or positive stationary value according to a function. The output value is added to the instructed current value or to the integration term. In this manner, by making the velocity follow the characteristic of the function, the integration term of the velocity control portion or the instructed current value can be changed quickly through a filter so as to overcome friction resulting from the instant of reversal of the velocity direction or from the beginning of rotation. Where the characteristic of the friction torque differ, depending on the direction, i.e., especially where the effect of gravity cannot be neglected, the compensation can be quickly and appropriately made upon reversal of the direction. Hence, the delay in the servo system due to friction torque can be largely compensated. Accordingly, by applying the present invention to a servo motor control apparatus for use with a numerically controlled machine, the machining error produced on reversal of the direction of rotation or at the beginning of the rotation can be made much smaller than heretofore. Consequently, improvements in machining accuracy and quick response of the motor can be accomplished. [Industrial Applicability] The present invention can find applications where the servo mechanism is required to have a high resolution such as with accurate machining, semiconductor fabrication, and a spherical lens machining.

Claims: A servo motor control apparatus (200) having a motor velocity feedback loop with a motor current feedback loop formed inside the velocity feedback loop, a velocity control portion (12) consisting of a microcomputer, and a controller included in the velocity control portion (12) and having at least a proportional element and an integration element, said servo motor control apparatus (200) comprising means connected to change the output value (I r ) of the integration element of the velocity control portion with a function (a, b, c) that smooths stepwise changes of an input to said velocity control portion (12) so as to assume a value corresponding to friction and to add the output value (Q) of the function (a, b, c) either to an instructed current value (I s ) or to the output value (I r ) of the integration element after an instructed motor velocity (V s ) changes from zero to a nonzero value, or from a positive value to a negative value or vice versa, or after the detected velocity (V d ) of the motor (10) changes from a positive value to a nonpositive value, or from a negative value to a nonnegative value, characterized in that the output value (Q) added either to the instructed current value (I S ) or to the output value (I r ) of the integration element is such that it assumes a value corresponding to positive or negative friction, depending upon whether the motor (10) rotates, respectively, forwardly or rearwardly. A servo motor control apparatus according to claim 1 wherein the output value (Q) added either to the instructed current value (I s ) or to the output value (I r ) of the integration element is such that it overcomes positive or negative friction, respectively.

Inventors: HIRAGA YOSHIJI, TOHYA TAKAYUKI, YAMAMOTO YOICHI, HIRAGA, YOSHIJI, TOHYA, TAKAYUKI, YAMAMOTO, YOICHI, HIRAGA, YOSHIJI, TOKYO PLANT, KK YASKAWA DENKI, TOHYA, TAKAYUKI, KOKURA PLANT, KK YASKAWA DENKI, YAMAMOTO, YOICHI, KOKURA PLANT, KK YASKAWA DENKI
Applicants: YASKAWA DENKI SEISAKUSHO KK, KABUSHIKI KAISHA YASKAWA DENKI SEISAKUSHO
Application year: 1990
Main classification: G05B19
IPC codes: G05B19