Command value interpolation apparatus and servo driver
11494465 · 2022-11-08
Assignee
Inventors
Cpc classification
G05B2219/39358
PHYSICS
G05B19/404
PHYSICS
G06F17/17
PHYSICS
International classification
Abstract
Provided is an interpolation technique in which command values chronologically input can be interpolated without increasing a jerk and with less follow-up delay with respect to a command. A control unit (10) of a servo driver (20) has a function of sequentially generating, on the basis of four command values from x(k−2) to x(k+1), a kth interpolation function for calculating command values in a kth (≥3) time interval and a function of generating, as the kth interpolation function, a fifth-order equation with respect to time in which function values at a start time and an end time of the kth time interval match x(k) and x(k+1), respectively, and in which a second derivative value at a start time of the kth time interval matches a second derivative value at an end time of a (k−1)th time interval corresponding to a (k−1)th interpolation function.
Claims
1. A command value interpolation apparatus that interpolates a command value x(k) sequentially input (where k is an integer value indicating an order of input of the command value) at a predetermined cycle t.sub.s, the command value interpolation apparatus comprising a processor configured with a program to perform operations for driving a servo driver, the operations comprising: generating a kth interpolation function y.sub.k(t) in which function values at a start time y.sub.k(t=0) and an end time y.sub.k(t=t.sub.s) of a kth time interval match a command value x(k) and a command value x(k+1), respectively, for each k value of greater than or equal to 1 in ascending order of k values; and repeating, in the ascending order of the k values, processing for calculating a plurality of command output values in the kth time interval by using the kth interpolation function y.sub.k(t), the command output values provided to the servo driver, wherein generating the kth interpolation function y.sub.k(t) comprises generating, on the basis of four command values comprising a command value x(k−2) to a command value x(k+1), the kth (where k≥3) interpolation function y.sub.k(t), the kth (where k≥3) interpolation function y.sub.k(t) is generated, using the four command values, as a fifth-order equation with respect to time such that function values at the start time y.sub.k(t=0) and the end time y.sub.k(t=t.sub.s) of the kth time interval match a command value x(k) and a command value x(k+1), respectively, and the kth interpolation function y.sub.k(t) is generated such that a second derivative value of the generated kth interpolation function y.sub.k(t) at a start time of the kth time interval matches a second derivative value of a generated (k−1)th interpolation function y.sub.k−1(t) at an end time of a (k−1)th time interval, wherein the processor is configured with the program to perform operations such that; generating, using the four command values, the kth (where k≥3) interpolation function y.sub.k(t) as the fifth-order equation with respect to time in which function values at the start time and the end time of the kth time interval match the command value x(k) and the command value x(k+1), respectively, comprises generating the kth interpolation function y.sub.k(t) such that a first derivative value and the second derivative value of the generated kth interpolation function y.sub.k(t) at the start time of the kth time interval respectively match a first derivative value and the second derivative value of the generated (k−1)th interpolation function y.sub.k−1(t) at the end time of the (k−1)th time interval; generating, using the four command values, the kth (where k≥3) interpolation function y.sub.k(t) as the fifth-order equation comprises generating the fifth-order equation with respect to an elapsed time t from the start time of the kth time interval, by calculating coefficients a.sub.1 to a.sub.6 that satisfy an equation (1):
2. The command value interpolation apparatus according to claim 1, wherein the processor is configured with the program to perform operations such that generating the kth interpolation function y.sub.k(t) comprises; performing processing for generating the kth (where k≥1 and ≥3) interpolation function y.sub.k(t) when a command value x(k+1) has been input, and repeating, in ascending order of k values, processing for calculating the plurality of command output values in the kth time interval comprises starting processing for calculating command output values in the kth time interval when the kth interpolation function y.sub.k(t) has been generated.
3. The command value interpolation apparatus according to claim 1, wherein the processor is configured with the program to perform operations such that generating the fifth-order equation with respect to an elapsed time t from the start time of the kth time interval, by calculating the coefficients a.sub.1 to a.sub.6 that satisfy the equation (1) comprises; generating a first interpolation function y.sub.k(t) that satisfies the equation (1), assuming that values of x(−1) and x(0) are (3.Math.x(1)−2.Math.x(2)) and (2.Math.x(1)−x(2)), respectively, and generating a second interpolation function y.sub.k(t) that satisfies the equation (1), assuming that a value of x(0) is (2.Math.x(1)−x(2)).
4. The command value interpolation apparatus according to claim 1, wherein the processor is configured with the program to perform operations such that generating the fifth-order equation with respect to an elapsed time t from the start time of the kth time interval, by calculating the coefficients a.sub.1 to a.sub.6 that satisfy the equation (1) comprises; generating a first interpolation function y.sub.k(t) that satisfies the equation (1), assuming that values of x(−1) and x(0) are both x(1) and, generating a second interpolation function y.sub.k(t) that satisfies the equation (1), assuming that a value of x(0) is x(1).
5. The command value interpolation apparatus according to claim 1, wherein, in a case in which a command value x(k+1) is not input at input timing at which the command value x(k+1) (k≥3) is supposed to be input, the processor is configured with the program to perform operations such that repeating, in ascending order of k values, processing for calculating the plurality of command values in the kth time interval comprises calculating command values in a kth time interval by using a (k−1)th interpolation function y.sub.k−1(t).
6. The command value interpolation apparatus according to claim 1, wherein, in a case in which a command value x(k+1) is not input at input timing at which the command value x(k+1) (k≥3) is supposed to be input, the processor is configured with the program to perform operations such that repeating, in ascending order of k values, processing for calculating the plurality of command values in the kth time interval comprises estimating a command value x(k+1) by using a (k−1)th interpolation function y.sub.k−1(t) and generating a kth interpolation function y.sub.k(t) by using the estimated command value x(k+1).
7. A servo driver that drives a servo motor on the basis of a command value x(k) sequentially input (where k is an integer value indicating an order of input of the command value) at a predetermined cycle t.sub.s, and a command output value, the servo driver comprising: a power circuit configured to drive the servo motor; a processor coupled to the power circuit and configured with a program to perform operations comprising: generating, upon input of a command value x(k+1) (k≥1), a kth interpolation function y.sub.k(t) in which function values at a start time y.sub.k(t=0) and an end time y.sub.k(t=t.sub.s) of a kth time interval match a command value x(k) and a command value x(k+1), respectively; calculating a plurality of command output values in the kth time interval by using the generated kth interpolation function y.sub.k(t); and controlling the power circuit on the basis of each command output value of the calculated plurality of command output values, wherein generating, upon input of the command value x(k+1) (k≥1), the kth interpolation function y.sub.k(t) comprises generating, on the basis of four command values comprising a command value x(k−2) to a command value x(k+1), the kth (where k≥3) interpolation function y.sub.k(t), the kth (where k≥3) interpolation function y.sub.k(t) is generated, using the four command values, as a fifth-order equation with respect to time such that function values at the start time y.sub.k(t=0) and the end time y.sub.k(t=t.sub.s) of the kth time interval match a command value x(k) and a command value x(k+1), respectively, and the kth interpolation function y.sub.k(t) is generated such that a second derivative value of the generated kth interpolation function y.sub.k(t) at a start time of the kth time interval matches a second derivative value of a generated (k−1)th interpolation function y.sub.k−1(t) at an end time of a (k−1)th time interval; and generating, using the four command values, the kth (where k≥3) interpolation function y.sub.k(t)) as the fifth-order equation comprises generating the fifth-order equation with respect to an elapsed time t from the start time of the kth time interval, the fifth-order equation including by calculating coefficients a.sub.1 to a.sub.6 that satisfy an equation (1):
8. A command value interpolation apparatus that interpolates a command value x(k) sequentially input (where k is an integer value indicating an order of input of the command value) at a predetermined cycle t.sub.s, the command value interpolation apparatus comprising a processor configured with a program to perform operations for driving a servo driver, the operations comprising: generating a kth interpolation function y.sub.k(t) in which function values at a start time y.sub.k(t=0) and an end time y.sub.k(t=t.sub.s) of a kth time interval match a command value x(k) and a command value x(k+1), respectively, for each k value of greater than or equal to 1 in ascending order of k values; and repeating, in the ascending order of the k values, processing for calculating a plurality of command output values in the kth time interval by using the kth interpolation function y.sub.k(t), the command output values provided to the servo driver, wherein generating the kth interpolation function y.sub.k(t) comprises generating, on the basis of four command values comprising a command value x(k−2) to a command value x(k+1), the kth (where k≥3) interpolation function y.sub.k(t), as a fifth-order equation with respect to time such that function values at the start time y.sub.k(t=0) and the end time y.sub.k(t=t.sub.s) of the kth time interval match a command value x(k) and a command value x(k+1), respectively, the kth interpolation function y.sub.k(t) is generated such that a first derivative and a second derivative value of the generated kth interpolation function y.sub.k(t) at a start time of the kth time interval matches a first derivative and a second derivative value of a generated (k−1)th interpolation function y.sub.k−1(t) at an end time of a (k−1)th time interval, and generating, using the four command values, the kth (where k≥3) interpolation function y.sub.k(t) as the fifth-order equation comprises generating the fifth-order equation with respect to an elapsed time t from the start time of the kth time interval, by calculating coefficients a.sub.1 to a.sub.6 that satisfy an equation (24):
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
DESCRIPTION OF EMBODIMENTS
(12) Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
(13)
(14) The servo driver 20 according to the present invention is an apparatus for driving a motor (a three-phase motor) 40. As illustrated in
(15) The power circuit 21 is a circuit for generating a three-phase alternating current supplied to the motor 40. The power circuit 21 includes a rectifier circuit 22 for rectifying a three-phase alternating current supplied from a three-phase power supply 50 and a smoothing capacitor 23. In addition, the power circuit 21 includes the inverter circuit 24 for converting voltage output from the rectifier circuit 22 and smoothed by the smoothing capacitor 23 into a three-phase alternating current.
(16) The control unit 10 includes a processor, a flash ROM, a RAM, a gate driver, etc. As illustrated in
(17) In addition, the flash ROM in the control unit 10 stores a program developed for the servo driver 20. The control unit 10 operates as a unit having various kinds of functions, which will be described below, by causing the processor to read the program into the RAM and execute the read program.
(18) Hereinafter, the functions of the control unit 10 will be described.
(19) The control unit 10 is a unit that basically controls the inverter circuit 24 in accordance with a command value (a current command value in the present embodiment) periodically input from a higher-level apparatus 30 such as a PLC (Programmable logic controller) at a predetermined cycle t.sub.s (for example, 4 ms). Hereinafter, a kth command value (k≥1; the head command value is the first command value) from the higher-level apparatus 30 is represented by x(k). In addition, a time interval from a time when a kth command value is input to a time when a (k+1)th command value is input and a time interval from a time when a kth command value is output to a time when a (k+1)th command value is output will be referred to as a kth command interval.
(20)
(21) The interpolation function generation unit 11 is a unit (a functional block) that generates an interpolation function for a command interval per command interval. The interpolation function generation unit 11 generates a fifth-order equation with respect to time t as an interpolation function y.sub.k(t) for a kth (≥1) command interval, which will be described in detail below.
y.sub.k(t)=a.sub.1+a.sub.2t+a.sub.3t.sup.2+a.sub.4t.sup.3+a.sub.5t.sup.4+a.sub.6t.sup.5
(22) As schematically illustrated in
(23) The interpolation unit 12 (
(24) The drive unit 13 is a unit that controls the inverter circuit 24 such that a current value from each of the sensors 25 becomes a value that corresponds to the command value calculated by the interpolation unit 12.
(25) Hereinafter, the functions of the control unit 10 will be described more specifically.
(26) When the first (initial) command value x(1) is input, the interpolation function generation unit 11 in the control unit 10 starts interpolation function generation processing according to procedures illustrated in
(27) Namely, having started this interpolation function generation processing upon the input of the command value x(1), first, in step S101, the interpolation function generation unit 11 waits for an input timing of the next command value. In other words, the interpolation function generation unit 11 waits until a command-value input cycle t.sub.s has elapsed from the input time of the current command value.
(28) When the input timing of the command value has come (step S101; YES), the interpolation function generation unit 11 determines whether the command value has been input (step S102). If the command value has been input (step S102; YES), the interpolation function generation unit 11 determines whether the k value is four or more (whether the command value currently input is a fourth or subsequent command value) (step S103).
(29) If the k value is less than four (step S103; NO), namely, if the command value currently input is a second or a third command value, the interpolation function generation unit 11 performs parameter calculation processing (step S104) and then performs function generation processing (step S105). In contrast, if the command value currently input is the fourth or subsequent command value (step S103; YES), the interpolation function generation unit 11 performs the function generation processing (step S105) without performing the parameter calculation processing.
(30) The function generation processing is processing for calculating coefficients a.sub.1 to a.sub.6 of an interpolation function for the kth command interval “y.sub.k(t)=a.sub.1+a.sub.2t+a.sub.3t.sup.2+a.sub.4t.sup.3+a.sub.5t.sup.4+a.sub.6t.sup.5” by the following equation (1) and notifying the interpolation unit 12 of the calculation result.
(31)
(32) Hereinafter, a procedure of deriving equation (1) will be described. In the following description, an nth derivative of a function ƒ (y.sub.k(t), etc.) is represented by f.sup.(n).
(33) The above equation (1) is obtained as a result of intensive studies on a method for generating a function for command-value interpolation in which first derivatives and second derivatives are made continuous at an interval boundary.
(34) Specifically, an interpolation function in which function values at a command interval boundary match command values and in which first derivatives and second derivatives at the command interval boundary are made continuous needs to satisfy six boundary conditions. Thus, by using the following equation (2) (fifth-order equation with respect to time t) including six coefficients, the interpolation function in which function values at a command interval boundary match command values and in which first derivatives and second derivatives at the command interval boundary are made continuous can be obtained.
(35) [Math. 3]
y.sub.k(t)=a.sub.1+a.sub.2t+a.sub.3t.sup.2+a.sub.4t.sup.3+a.sub.5t.sup.4+a.sub.6t.sup.5 (2)
(36) To determine the six coefficients in equation (2), six command values are needed in principle. However, if a large number of command values are needed for calculating values of coefficients a.sub.1 to a.sub.6, a follow-up delay with respect to a command increases. Accordingly, to reduce the follow-up delay with respect to the command, when the above equation (1) is developed, first derivative values and second derivative values at each interval boundary (a start time “0”, an end time “t.sub.s”) of the kth command interval corresponding to the kth interpolation function are approximated by the following equations (3) to (6).
(37)
(38) Equation (3) is an approximate equation of a first derivative value at an end time of the kth command interval corresponding to the kth interpolation function. Equation (4) is an approximate equation of a second derivative value at an end time of the kth command interval corresponding to the kth interpolation function. These equations are derived by performing Taylor expansion or the like on equation (2).
(39) Specifically, by performing the Taylor expansion on equation (2) around a point t.sub.s, the following equation (7) is obtained.
(40)
(41) If each term of the third order or higher of “t-t.sub.s” on the right side of equation (7) is ignored (regarded as “0”), the following equation (8) is obtained.
(42)
(43) If −t.sub.s and 0 are substituted into t in equation (8), the following equations (9) and (10) are obtained, respectively.
(44)
(45) If these equations are solved as simultaneous equations of y.sub.k.sup.(1)(t.sub.s) and y.sub.k .sup.(2)(t.sub.s), the following equations (11) and (12) are obtained, respectively.
(46)
(47) Equation (3) above is obtained by changing the right side of equation (11) to an equation of x by using relational equations y.sub.k (−t.sub.s)=x(k−1), y.sub.k (0)=x(k), and y.sub.k (t.sub.s)=x(k+1), and equation (4) above is obtained by changing the right side of equation (12) to an equation of x by using the same relational equations as the above.
(48) Equations (5) and (6) above are approximate equations of a first derivative value and a second derivative value, respectively, at a start time of the kth command interval corresponding to the kth interpolation function. These equations are derived by the following procedure.
(49) The kth interpolation function to be obtained is a function in which the first and second derivative values at the start time of the kth command interval match first and second derivative values at an end time (=the start time of the kth command interval) of a (k−1)th command interval corresponding to a (k−1)th interpolation function, respectively. Thus, the kth interpolation function needs to satisfy the following two conditions.
(50) [Math. 9]
y.sub.k−1.sup.(1)(t.sub.s)=y.sub.k.sup.(1)(0) (13)
y.sub.k−1.sup.(2)(t.sub.s)=y.sub.k.sup.(2)(0) (14)
(51) By substituting “k−1” into “k” in equations (3) and (4) above, the following equations (15) and (16) can be obtained, respectively.
(52)
(53) Next, by changing equation (15) by using equation (13), equation (5) is obtained, and by changing equation (16) by using equation (14), equation (6) is obtained. Thus, by satisfying equations (5) and (6), the kth interpolation function in which the first and second derivative values at the start time of the kth command interval match the first and second derivative values at the end time (=the start time of the kth command interval) of the (k−1)th command interval corresponding to the (k−1)th interpolation function, respectively, can be obtained.
(54) As described above, equations (3) and (4) can be used as approximate equations of the first derivative value and the second derivative value, respectively, at the end time of the kth command interval corresponding to the kth interpolation function. In addition, equation (5) can be used as an approximate equation of the first derivative value at the start time of the kth command interval corresponding to the kth interpolation function and a conditional equation of continuity of the first derivative value at the start time of the kth command interval corresponding to the kth interpolation function. Further, equation (6) can be used an approximate equation of the second derivative value at the start time of the kth command interval corresponding to the kth interpolation function and a conditional equation of continuity of the second derivative value at the start time of the kth command interval corresponding to the kth interpolation function. Consequently, since y.sub.k (0)=x(k) and y.sub.k(t.sub.s)=x(k+1), the following equation (17) holds true.
(55)
(56) Namely, as described below, if matrices Y.sub.d, K.sub.X, and X are defined, Y.sub.d=K.sub.X.Math.X holds true.
(57)
(58) In addition, by differentiating both sides of equation (1) (the fifth-order equation with respect to t) by t, the following equation (18) can be obtained, and by differentiating both sides of equation (18) by t, the following equation (19) can be obtained.
(59) [Math. 13]
y.sub.k.sup.(1)(t)=a.sub.2+2a.sub.3t+3a.sub.4t.sup.2+4a.sub.5t.sup.3+5a.sub.6t.sup.4 (18)
y.sub.k.sup.(2)(t)=2a.sub.3+6a.sub.4t+12a.sub.5t.sup.2+20a.sub.6t.sup.3 (19)
(60) Further, y.sub.k (0)=a.sub.1 is obtained from equation (1), and y.sub.k.sup.(1) (0)=a.sub.2 and y.sub.k.sup.(2) (0)=2a.sub.3 are obtained from equation (18) and equation (19), respectively.
(61) Thus, the following equation (20) holds true.
(62)
(63) If a 6×6 matrix and a 6×1 matrix on the right side of this equation (20) are represented by K.sub.A and A, respectively, Y.sub.d=K.sub.A.Math.A holds true. However, Y.sub.d=K.sub.x.Math.X holds true as already described above (see equation (17)).
(64) Since the elements K.sub.X, K.sub.A, and X are all known values, A can be obtained by K.sub.A.sup.−1.Math.K.sub.X.Math.X. If K.sub.A.sup.−1.Math.K.sub.X is actually calculated to obtain A, the following matrix is obtained.
(65)
(66) Thus, A (a.sub.1 to a.sub.6) can be calculated by equation (1) described above.
(67) Referring back to
(68) As is apparent from the above description, function generation processing originally needs four command values continuously input. However, in a case where the function generation processing is performed in such a manner, until the fourth command value is input, the control of the power circuit 21 (the drive control of the motor 40) cannot be started.
(69) Processing prepared for starting the control of the power circuit 21 when the second command value is input is parameter calculation processing in step S104.
(70) Specifically, the function generation processing with the above contents can be executed when four consecutive command values are obtained. Accordingly, if the function generation processing is performed by calculating (estimating) a command value x(−1) and a command value x(0) when a first interpolation function is generated, and if the function generation processing is performed by calculating a command value x(0) when a second interpolation function is generated, the control of the power circuit 21 can be started when the second command value is input. The command value x(−1) is an estimated value of a command value of two values before the command value x(1). The command value x(0) is an estimated value of a command value immediately before the command value x(1).
(71) However, if the command value x(−1) and the command value x(0) are not proper values, undesirable control will be performed on the power circuit 21. To avoid such a fault occurrence, in step S104, parameter calculation processing for calculating the command values x(−1) and x(0) or the command value x(0) is performed on the basis of command values that have already been input.
(72) Hereinafter, a specific example of the parameter calculation processing will be described.
(73) As the parameter calculation processing, processing in which, when k=2, x(−1) and x(0) are calculated (estimated) by the following equations (21) and (22) and when k=3, x(0) is calculated by the following equation (22) can be adopted.
x(−1)=3.Math.x(1)−2.Math.x(2) (21)
x(0)=2.Math.x(1)−x(2) (22)
(74) Namely, in this parameter calculation processing, as schematically illustrated in
(75) Alternatively, as schematically illustrated in
(76) In a case where the former parameter calculation processing (
(77) Namely, trajectory reproducibility can be more improved by adopting the former parameter calculation processing in which the command values x(−1) and x(0) are calculated assuming the constant change rate (
(78) Referring back to
(79) After the interpolation function generation unit 11 finishes the function generation processing, the processing returns to step S101, and the interpolation function generation unit 11 waits for an input timing of the next command value.
(80) Normally, the interpolation function generation unit 11 repeats the above processing. However, if the command value is not input even though the input timing of the command value has come (step S102; NO), the interpolation function generation unit 11 instructs the interpolation unit 12 to perform interpolation by a fifth-order interpolation equation for the previous command interval (steps S106).
(81) Namely, command values input from the higher-level apparatus 30 normally change smoothly over time. Thus, as schematically illustrated in
(82) As described above, on the basis of four command values from a command value x(k−2) to a command value x(k+1), the control unit 10 of the servo driver 20 according to the present embodiment generates a kth interpolation function (a fifth-order equation with respect to time) for calculating command values in a kth command interval from a command value x(k) to a command value x(k+1). In addition, the kth interpolation function generated by the control unit 10 is a function in which function values at a start time and an end time of the kth time interval match a command value x(k) and a command value x(k+1), respectively, and in which a first derivative value and a second derivative value at the start time of the kth time interval match a first derivative value and a second derivative value at an end time of a (k−1)th time interval corresponding to a (k−1)th interpolation function. Thus, by using the interpolation function generated by the control unit 10, the command value can be interpolated with excellent followability to an original trajectory (a time change pattern of the command value subject to interpolation) and without increasing a jerk (increasing acceleration).
(83) Specifically,
(84) In addition, the control unit 10 has a function of generating a first interpolation function and a second interpolation function even when all the four command values cannot be obtained by using an estimated value such as a command value x(0), etc. Thus, with the servo driver 20 (the control unit 10) according to the present embodiment, as illustrated in
(85) <<Variations>>
(86) Various modifications can be made to the servo driver 20 (the control unit 10) according to the above embodiment. For example, an apparatus that corrects command values other than the command values for the motor 40 may be manufactured on the basis of the above technique. In addition, in a case where the command value is not input at the input timing of the command value (step S102; NO), the interpolation function generation processing (
(87) If the second derivatives are made continuous (if the second derivative value at the start time of the kth time interval matches the second derivative value at the end time of the (k−1)th time interval corresponding to the (k−1)th interpolation function), even if the first derivatives are not made continuous, the jerk is still reduced. Thus, instead of equation (5), a different equation may be used to calculate a.sub.1 to a.sub.6. However, when both the first derivatives and the second derivatives are made continuous, the jerk is reduced more. It is, therefore, desirable that equation (5) be used (a.sub.1 to a.sub.6 be calculated by equation (1)).
(88) The following equation (23) may be an example of the equation that can be used instead of equation (5).
(89)
(90) If this equation (23) is used instead of equation (5), a.sub.1 to a.sub.6 are calculated by the following equation (24).
(91)
REFERENCE SIGNS LIST
(92) 10 Servo driver 11 Interpolation function generation unit 12 Interpolation unit 13 Drive unit 21 Power circuit 22 Rectifier circuit 23 Smoothing capacitor 24 Inverter circuit 25 Current sensor 30 Higher-level apparatus 40 Motor 41 Encoder 50 Three-phase power supply