Disclosure of Invention
Technical problem
A method of generating a motion profile is provided that is capable of generating an asymmetric velocity profile with arbitrarily limited jerk values and with arbitrarily constant initial and final velocities and capable of overlapping two or more motions.
Technical scheme
According to an aspect of the present disclosure, a method of generating a motion profile by using an S-shaped curve, the method comprising: calculating a time period of each of an acceleration interval, a maximum speed interval, a deceleration interval, and a maximum deceleration interval under one or more constraints; generating a motion profile by applying the calculated time period and jerk to a polynomial expression defined for each interval; and generating an overlapping motion profile in which two or more motion profiles overlap each other, wherein a final velocity of a previous motion is an initial velocity of a next motion.
The initial and final speeds may comprise any constant.
The step of calculating the time period may comprise: the time period of each interval is calculated by using a corresponding polynomial expression according to a result of comparing a movement distance to a destination position with a first critical distance and a second critical distance, wherein the second critical distance is longer than the first critical distance.
When the movement distance is equal to or less than the first critical distance, the time period of each interval may be calculated by using the following polynomial expression:
T a =T v =T d =0
wherein, T a Time period, T, which may represent a maximum acceleration interval v Time period, T, which may represent a maximum speed interval d Time period, T, which may represent a maximum deceleration interval ja Time period, T, which may represent an acceleration interval jd Can representThe period of the deceleration interval.
When the movement distance is between the first critical distance and the second critical distance, the time period of each interval may be calculated by using the following polynomial expression:
T v =0
wherein, T a Time period, T, which may represent a maximum acceleration interval d Time period, T, which may represent a maximum deceleration interval ja Time period, T, which may represent an acceleration interval jd May represent a period of the deceleration interval.
When the movement distance is greater than the second critical distance, the time period of each interval may be calculated by using the following polynomial expression:
wherein, T a Time period, T, which may represent a maximum acceleration interval v Time period, T, which may represent a maximum speed interval d Time period, T, which may represent a maximum deceleration interval ja Time period, T, which may represent an acceleration interval jd Can represent the time period of the deceleration interval, and satisfies the T of the maximum acceleration ja May be T ja * T satisfying maximum deceleration jd May be T jd *。
The one or more constraints may include a first constraint (C1), a second constraint (C2), and a third constraint (C3), wherein the first constraint (C1) is an equality constraint between the start position and the end position, the second constraint (C2) is a constraint that the value of the velocity does not cross zero (0), and the third constraint (C3) is that the jerk, acceleration, and velocity may be within predetermined limit values at any point in time.
The step of calculating the time period may comprise: the time period for each interval is calculated by a non-linear programming technique that seeks a value that minimizes an objective function that takes the time period for each interval as a parameter.
According to one or more embodiments, a computing device for generating a motion profile by using an S-shaped curve, the computing device comprising: a preprocessor configured to: calculating a time period of each of an acceleration interval, a maximum speed interval, a deceleration interval, and a maximum deceleration interval under one or more constraints; and a contour generator configured to: generating a motion profile by applying the calculated time period and jerk to a polynomial expression defined for each interval, and generating an overlapped motion profile in which two or more motion profiles in which a final velocity of a previous motion is an initial velocity of a next motion overlap each other.
The initial and final speeds may comprise any constant.
The preprocessor may be configured to: the time period of each interval is calculated by using a corresponding polynomial expression according to the result of comparing the movement distance to the destination position with the first critical distance and the second critical distance, which is longer than the first critical distance.
The preprocessor may be configured to calculate a time period of each interval by using the following polynomial expression when the motion distance is equal to or less than the first critical distance:
T a =T v =T d =0
wherein, T a Time period, T, which may represent a maximum acceleration interval v Time period, T, which may represent a maximum speed interval d Time period, T, which may represent a maximum deceleration interval ja Time period, T, which may represent an acceleration interval jd May represent the time period of the deceleration interval.
The preprocessor may be configured to: when the movement distance is between the first critical distance and the second critical distance, the time period of each interval is calculated by using the following polynomial expression:
T v =0
wherein, T a Time period, T, which may represent a maximum acceleration interval d Time period, T, which may represent a maximum deceleration interval ja Time period, T, which may represent an acceleration interval jd May represent a period of the deceleration interval.
The preprocessor may be configured to: when the movement distance is greater than the second critical distance, the time period of each interval is calculated by using the following polynomial expression:
wherein, T a Time period, T, which may represent a maximum acceleration interval v Time period, T, which may represent a maximum speed interval d Time period, T, which may represent a maximum deceleration interval ja Capable of indicating an acceleration intervalThe time period, tjd, may represent the time period of the deceleration interval, T, satisfying the maximum acceleration ja May be T ja * T satisfying maximum deceleration jd May be T jd *。
The one or more constraints may include a first constraint (C1), a second constraint (C2), and a third constraint (C3), wherein the first constraint (C1) is an equality constraint between the start position and the end position, the second constraint (C2) is a constraint that the value of the velocity does not cross zero (0), and the third constraint (C3) is that the jerk, the acceleration, and the velocity are within predetermined limit values at any point in time.
The preprocessor may be further configured to: the time period for each interval is calculated by a non-linear programming technique that looks for a value that minimizes the time period for each interval as an objective function of the parameter.
Advantageous effects
According to the embodiment, a motion profile capable of allowing the motor to move at an optimal time while satisfying the restriction condition may be generated.
Detailed Description
In the manner disclosed
Hereinafter, one or more embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Fig. 1 is a diagram of a computing device that generates a motion profile according to an embodiment of the present disclosure.
Referring to fig. 1, a computing device 10 may generate a motion profile for controlling a motor or the like. Computing device 10 may be implemented as various numbers of hardware or/and software configurations that perform particular functions. For example, the computing device 10 may represent a data processing device built in hardware and include physically structured circuits for executing functions represented by codes or commands included in programs.
Computing device 10 may include a preprocessor 20 and a contour generator 40. Computing device 10 may be connected to display 60 and input device 80 via wires or wirelessly.
Preprocessor 20 may calculate an optimal time period for each interval in the motion profile. A method of calculating the time period of each interval will be described in detail later. The optimal time period may be a minimum time to minimize a moving distance during the interval.
The contour generator 40 may generate the motion contour by using a polynomial expression defined for each interval. The motion profile may include a position profile, a velocity profile, and an acceleration profile.
When the optimal time period for each interval is calculated, the contour generator 40 may calculate the acceleration, velocity, and position for each interval by applying the time and jerk to the polynomial expression defined for each interval. In one embodiment, the profile generator 40 may calculate acceleration by integrating jerk, velocity by integrating acceleration, and position by integrating velocity.
The contour generator 40 may generate overlapping motion contours for connecting two or more motions. To generate the overlapping motion profiles, the profile generator 40 applies the final velocity V of the previous motion f Set to the initial speed of the next move. Final speed V f And an initial velocity V i May be any constant. The constant may comprise 0.
According to the trapezoidal or S-curve velocity profile according to the related art, an asymmetric profile in which the acceleration time and the deceleration time are different from each other can be generated, but the velocities at the start point and the arrival point are limited to 0, and therefore, in order to generate a continuous motion, the next motion must be generated after the previous motion (velocity: 0) is finished.
According to an embodiment of the present disclosure, a motion profile having a constraint condition for limiting an initial speed and a final speed to arbitrary constants is generated, and the two motion profiles overlap each other without stopping the motion to reduce an operation time and improve productivity.
The display 60 is connected to the computing device 10 via wire or wirelessly to process a signal of an image output from the computing device 10 and provide the processed image to a user. The display 60 may include a Liquid Crystal Display (LCD) panel, an Organic Light Emitting Display (OLED) panel, an electrophoretic display (EPD) panel, and the like. The display 60 may be implemented as a touch screen to receive user input via touch operations and may serve as a user input interface.
The input device 80 is connected to the computing device 10 via a wire or wirelessly to generate input data for controlling the computing device 10. The input device 80 may include a keyboard, a dome switch, a touch pad, a mouse, a remote controller, a jog dial (jog dial), a jog switch (jog switch), and the like
Fig. 2 shows an example of a position profile (a), a velocity profile (b), and an acceleration profile (c) generated according to an embodiment of the present disclosure.
A motion profile according to an embodiment may comprise an acceleration phase for accelerating from an arbitrary initial velocity to a maximum velocity, a constant velocity phase continuing with the acceleration phase, and a deceleration phase following the constant velocity phase for reducing the velocity to an arbitrary final velocity.
The entire interval from the start to the end of the motion profile may be classified into seven intervals T 0 To T 7 . Here, the section T 0 To T 3 Corresponding to the acceleration phase, interval T 3 To T 4 Corresponding to the constant speed phase, interval T 4 To T 7 Corresponding to the deceleration phase.
The acceleration phase may be divided to include an interval T 0 To T 1 And a section T 2 To T 3 And includes the interval T having the maximum acceleration 1 To T 2 The maximum acceleration interval of (2). The constant speed phase may include a maximum speed interval, e.g. interval T where the motor is constantly operating at maximum speed 3 To T 4 . The deceleration phase may be divided to include an interval T 4 To T 5 And T 6 To T 7 And a section T including the motor operating at the maximum deceleration 5 To T 6 The maximum deceleration interval. As shown in velocity profile (b), initial velocity V (T) 0 ) And a final speed V (T) 7 ) May have a value other than 0.
In the velocity profile (b), the initial velocity and inclination of the acceleration section may be different from the final velocity and inclination of the deceleration section, and thus, an asymmetric S-curve velocity profile may be generated.
Hereinafter, the period for which the preprocessor 20 calculates each interval will be described below.
The constraint conditions for the time period for calculating the motion profile according to the embodiment of the present disclosure are as follows.
C1:
P(T 0 )=0,P(T 7 )=P f
V(T 0 )=V i ,V(T 7 )=V f
A(T 0 )=0,A(T 7 )=0
The constraint C1 includes an equality constraint between a starting position and an ending position, that is, the starting position is the origin 0 and the ending position is the destination position P f . Since the movement distance is from the origin to the destination position, the destination position is equal to the movement distance. Initial velocity V at the starting position i And a final speed V at the end position f Can be any constant. Any constant may include 0. The acceleration at the start position and the end position is 0.
C2:
sign(P f )=sign(V i )=sign(V f )
sign(a)=1,a>1
sign9a)=0,a=1
sign(a)=-1,a<1
Constraint C2 includes a constraint that the speed value does not cross speed 0. That is, in each of the acceleration section and the deceleration section, the speed does not change from a negative value to a positive value or vice versa, but has a negative value or a positive value.
C3:
|j(t=T 0 ~T 3 )|≤J a
|j(t=T 4 ~T 7 )|≤J d
|a(t=T 0 ~T 3 )|≤A m
|a(t=T 4 ~T 7 )|≤D m
|v(t=T 0 ~T 7 )|≤V m
The constraint C3 includes the constraint: at an arbitrary time point (T) 0 ≤t≤T 7 ) Jerk j, acceleration a, and velocity v are within predetermined limits. During the acceleration phase, the jerk is equal to or less than the first jerk limit J a And the acceleration is equal to or less than the maximum acceleration A m . During the deceleration phase, jerk is equal to or less than a second jerk limit J d And the deceleration is equal to or less than the maximum deceleration D m . In all the intervals, the speed is equal to or less than the maximum speed V m 。
First jerk limit J a And a second jerk limit J d Can be determined by the following formulas 1 and 2, respectively.
Here, β a And beta d Is a constant set by a user, and may represent the smoothness of the motion profile, and may be set to have a value greater than 0 and equal to or less than 1. Can be obtained by using beta a And beta d An S-curve speed profile is generated with asymmetric time periods of acceleration and deceleration intervals.
First jerk limit J a Can pass through the maximum acceleration A m Maximum velocity V m Initial velocity V i And beta a To calculate. Second jerk limit J d Through a maximum deceleration D m Maximum velocity V m Final speed V f And beta d To calculate.
Since the motion profile depends on time and motion distance, the method of generating the motion profile according to the embodiment of the present disclosure may be classified into three cases: such as short range, medium range, and long range.
Short range with short movement distance P f Therefore, the acceleration | a (t) | and the velocity | v (t) | may not reach the maximum acceleration a m Maximum deceleration D m And a maximum speed V m . Distance of movement P according to the medium distance situation f The acceleration | a (t) | can reach the maximum acceleration A m And maximum deceleration D m However, the velocity | V (t) | may not reach the maximum velocity V m . Due to the fact thatLong distance of movement P f Sufficiently long so that the acceleration | a (t) | and the velocity | v (t) | can reach the maximum acceleration A m Maximum deceleration D m And a maximum speed V m 。
Preprocessor 20 compares the movement distance (i.e., destination location P) f ) And a first threshold value P short And a second critical value P medium The comparison is made, and the time period of each section can be calculated by using a polynomial expression defined according to the case corresponding to the movement distance Pf among the short distance, the middle distance, and the long distance.
Preprocessor 20 may calculate first critical value P by using the following equations 3 and 4, respectively short And a second critical value P medium 。
When the distance P is moved f Satisfies the following condition of equation 5, i.e., the movement distance P f Is equal to or less than a first critical value P short (P f ≤P short ) Preprocessor 20 may then determine a movement distance P f Corresponding to a short distance.
P f ≤P short …(5)
When the distance P is moved f When equation 5 is satisfied, preprocessor 20 may calculate a time period for each interval as shown in equation 6 below.
T a =T v =T d =0
Here, T a Represents a section T 1 To T 2 Time period of (1), T v Represents a section T 3 To T 4 Time period of (1), T d Represents a section T 5 To T 6 Time period of (1), T ja Represents a section T 0 To T 1 And a section T 2 To T 3 Time period of (D), T jd Represents a section T 4 To T 5 And a section T 6 To T 7 The time period of (a).
At a short distance, the interval T 1 To T 2 Interval T 3 To T 4 And a section T 5 To T 6 Is omitted, interval T 0 To T 1 And interval T 2 To T 3 Time period T of ja And a section T 4 To T 5 And interval T 6 To T 7 Time period T of jd Can be calculated by using a numerical solution of a non-linear equation. Here, T may be obtained by applying Newton's method to equations f1 and f2 ja And T jd Calculated as a value. Numerical solutions of nonlinear equations and methods of calculating the values by using the newton method are well known in the art, and thus, detailed descriptions thereof are omitted.
When the distance P is moved f Satisfies formula 7, i.e., the movement distance P f At a first critical value P short And a second critical value P medium (P short <P f ≤P medium ) In between, preprocessor 20 may determine a movement distance P f Corresponding to the intermediate distance.
P short <P f ≤P medium …(7)
When the distance P is moved f When equation 7 is satisfied, preprocessor 20 may calculate the time period of each interval as shown in equation 8 below.
T v =0
In the case of intermediate distances, the interval T 3 To T 4 Is omitted and in the interval T 0 To T 1 And a section T 2 To T 3 In each interval of (1), calculating a constraint J imposed by the first jerk a Up to the maximum acceleration a m The time period spent; in the interval T 4 To T 5 And a section T 6 To T 7 In each interval of (1), calculating a constraint J by the second jerk d Up to the maximum deceleration D m The time period it takes. In this case, in the interval T 0 To T 1 And interval T 2 To T 3 During each interval of (a), the jerk area is equal to the maximum acceleration A m (ii) a In the interval T 4 To T 5 And a section T 6 To T 7 During each interval in (2), the jerk area is equal to the maximum deceleration D m . In the constraint condition C3, | a (T = T) is satisfied ja )|=A m T of (A) ja Is denoted as T ja * Satisfy | a (T = T) jd )|=D m T of jd Is denoted as T jd *。
The interval T can be calculated by using a numerical solution of a nonlinear equation 1 To T 2 And a section T 5 To T 6 Of each interval. Here, the equation f can be obtained by applying Newton's method to the equation 1 And equation f 2 Will T a And T d Calculated as a value.
When the distance P is moved f Satisfies formula 9, i.e., when the distance P is moved f Is greater than the second critical value P medium (P f >P medium ) Preprocessor 20 may then determine a movement distance P f Corresponding to long distances.
P f >P medium …(9)
When the distance P is moved f When equation 9 is satisfied, preprocessor 20 may calculate a time period for each interval as shown in equation 10 below.
The acceleration phase comprises an acceleration interval to a maximum acceleration and a constant acceleration interval at a maximum acceleration, and the deceleration phase comprises a deceleration interval to a maximum deceleration and a constant deceleration interval at a maximum deceleration.
In the case of long distances, as in medium distances, in the interval T 0 To T 1 And a section T 2 To T 3 In each interval of (1), calculating a constraint J imposed by the first jerk a Up to the maximum acceleration a m The time period spent; in the interval T 4 To T 5 And a section T 6 To T 7 In each interval of (1), calculating a constraint J imposed by the second jerk d To the maximum decelerationDegree D m The time period it takes. In this case, in the interval T 0 To T 1 And interval T 2 To T 3 During each interval of (2), the jerk area is equal to the maximum acceleration A m (ii) a In the interval T 4 To T 5 And interval T 6 To T 7 During each interval in (2), the jerk area is equal to the maximum deceleration D m . In the constraint condition C3, | a (T = T) is satisfied ja )|=A m T of ja Is denoted as T ja * Satisfy | a (T = T) jd )|=D m T of (A) jd Is represented as T jd *。
In addition, at time T of the acceleration phase 0 To T 3 And time T of deceleration phase 4 To T 7 During which the acceleration area is equal to the maximum velocity. In the constraint condition C3, | v (T = T) is satisfied ja +T a +T ja ) T of | = Vm a Is represented as T a * And satisfies | v (T = T) jd +T d +T jd ) T of | = Vm d Is denoted as T d *。
As described above, the preprocessor 20 determines and compares the critical distance with the movement distance according to the destination position, and can calculate the optimal period of time for each section by using the polynomial expression corresponding to the case determined according to the comparison result.
In another embodiment, preprocessor 20 may calculate the optimal time period for each interval by using a non-linear programming technique. The nonlinear programming technique uses a constraint optimization method as shown in equation 11 below. Non-linear programming techniques using the constraint optimization method are well known in the art, and thus, a description thereof is omitted.
For l ≦ T n ≤u,
h(T n )≤0,
g(T n )=0 (11)
Objective function f (T) minimizing time n ) The integral of the square of time as shown in equation 12 is used.
Inequality constraint h (T)
n ) Is a condition of arbitrary limit value as in C3, and the equation constrains the condition g (T)
n ) Is a condition indicating that the g function is 0 at the end point of each time interval as in C1. The lower limit l of the optimization variable is 0 and the upper limit u is calculated using when the movement distance is a long distance
|T
v |。
Preprocessor 20 may calculate an optimal time for each interval by finding a value that minimizes a preset objective function under a predetermined constraint.
Fig. 3 illustrates an example of generating a motion profile according to a calculation of time per interval by comparing a critical distance with a destination location according to an embodiment of the present disclosure. Fig. 4 illustrates an example of generating a motion profile from a calculation of time for each interval by using non-linear programming according to an embodiment of the present disclosure. Fig. 3 and 4 show motion profiles with respect to an initial velocity and a final velocity having arbitrary values other than 0. (a) is a position profile, (b) is a velocity profile, and (c) is an acceleration profile. Referring to fig. 3 and 4, the motion profiles generated by both methods show similar results.
Fig. 5 is a flow chart illustrating a method of generating a motion profile according to an embodiment of the present disclosure. A method of generating a motion profile according to an embodiment of the present disclosure may be performed by the computing device 10 of fig. 1. Hereinafter, description about the above elements will be omitted.
Referring to fig. 5, the computing device 10 may receive constraints for generating a motion profile according to an embodiment of the present disclosure (S31). The computing device 10 may receive constraints determined according to a method of computing an optimal time.
The calculation means 10 may calculate an optimal time period for each interval in the motion profile under the constraint condition (S33). The calculation means 10 may calculate the optimal period of time for each interval by using a polynomial expression corresponding to the case determined according to the result of comparing the critical distance with the movement distance. In addition, the computing device 10 may calculate the optimal time period for each interval by using a non-linear programming technique.
The computing device 10 may generate a motion profile based on the optimal time period and the jerk for each interval (S35). The calculation device 10 calculates the acceleration a (t) by integrating the jerk j (t) for each section, calculates the velocity v (t) by integrating the acceleration a (t), and calculates the position p (t) by integrating the velocity v (t).
Computing device 10 may generate an overlapping motion profile by overlapping two or more motion profiles. The computing device 10 may calculate the final velocity V of the previous motion f Set as the initial velocity V of the next movement i To generate an overlapping motion profile.
Fig. 6 is a flowchart illustrating a method of calculating an optimal time for each interval illustrated in fig. 5. Fig. 6 shows an example of calculating an optimal period of time for each section by using a polynomial expression corresponding to a case determined according to a result of comparing the critical distance with the movement distance.
Referring to fig. 6, the calculation apparatus 10 receives the constraints C1 to C3 for generating the motion profile according to the embodiment of the present disclosure, and may calculate the optimal time period for each interval in the motion profile according to the constraints.
The constraint C1 is an equality constraint between the start position and the end position. The constraint C2 includes a constraint that the speed value does not pass through the speed 0. The constraint C3 includes the constraint: at an arbitrary time point (T) 0 ≤t≤T 7 ) Jerk J, acceleration a, and velocity v are at predetermined limits (J) a 、J d 、A m 、D m And V m ) And (4) the following steps.
The calculation means 10 can calculate the jerk limit value J in the acceleration section by equations 1 and 2 a And jerk limit value J in deceleration section d (S331)。
The calculating device 10 calculates the first critical value P as shown in equations 3 and 4 short And a second critical value P medium And can map the destination position P f And a first threshold value P short And a second critical value P medium Comparison is performed (S332 and S334).
When the destination position Pf is equal to or less than the first critical value P short At this time (S332), the computing apparatus 10 determines the movement distance P from the origin to the destination position f Corresponds to a short distance, and the time period of each interval may be calculated by using a numerical solution of a nonlinear equation as in equation 6. Here, the sections may include an acceleration section, a maximum speed section, a deceleration section, and a maximum deceleration section.
When the destination position P f Is greater than a first critical value P short And is equal to or less than the second critical value P medium At this time (S334), the computing apparatus 10 determines the movement distance P from the origin to the destination position f Corresponds to the middle distance, and the time period of each interval may be calculated by using a numerical solution of a non-linear equation as in equation 8 (S335).
When the destination position P f Greater than a second critical value P medium At this time (S334), the computing apparatus 10 determines the movement distance P from the origin to the destination position f Corresponds to a long distance, and the time period of each interval may be calculated by using equation 10 (S336).
The computing device 10 may be configured to calculate the acceleration interval based on the time T ja To determine the interval T 0 To T 1 And a section T 2 To T 3 According to the maximum acceleration interval T a To determine the interval T 1 To T 2 According to the time Tv of the maximum speed interval, determining the interval T 3 To T 4 According to the time T of the deceleration section jd To determine the interval T 4 To T 5 And a section T 6 To T 7 According to the time period T of the maximum deceleration interval d To determine the interval T 5 To T 6 Time period (S337).
As shown in fig. 5, the computing device 10 may generate a motion profile and an overlay motion profile based on the optimal time and jerk for each interval.
Fig. 7 illustrates an example of overlapping motion profiles where two motion profiles overlap each other, according to an embodiment of the disclosure. (a) is a position profile, (b) is a velocity profile, and (c) is an acceleration profile.
Referring to fig. 7, the final speed when the motion 1 ends is a value other than 0, and the motion 2 following the motion 1 has the final speed of the motion 1 as the initial speed. Thus, motion 1 does not need to be decelerated to final speed 0, and motion 2 does not need to be accelerated from speed 0. Thus, the time taken to perform the motion may be reduced.
That is to say the final speed V of the previous movement f Is set as the initial velocity V of the next movement i Two or more continuous motion profiles may overlap without stopping the motion, and thus, the operation time may be reduced and the motion may be performed in an optimized time, thereby improving productivity.
Further, according to an embodiment of the present disclosure, the final velocity V of the motion profile f And an initial velocity V i Can be set to an arbitrary constant other than 0, and therefore, it is not necessary to make the final speed V f The deceleration is 0, thereby saving time.
Further, according to the embodiments of the present disclosure, the initial speed and inclination of the acceleration section may be different from those of the deceleration section, and thus, an asymmetric S-shaped curve profile may be generated and vibration in the overlapping motion may be effectively reduced.
While the present disclosure has been particularly shown and described with reference to exemplary embodiments thereof, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure as defined by the following claims.