Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Sinusoidal Velocity Profiles for Motion Control

A review on traditional solutions and a proposal for a solution with reduced piece–wise
constructors and reduced harmonic content of the kinetic perturbations
Victor M. Arevalo
Augen Opticos, S.A., Ensenada, B.C., Mexico 22830
Background As long as assertions like: “Over the past 30 years the
price of computer processing power has declined by an
When facing the simplest and first question to be made
annual average of 30% in real terms”, and “... the cost
with a motorized motion: how to perform the change
of a unit of computer processing power has fallen by
of position from one point to another, the present
99% over the decade”[1] can be made, it is clear that
technical literature provides similar answers to those
computer utilization in motion control is not an affected
given 30 years ago.
trend, but a strong foundation.
The available solutions can be summarized as follows:
Proposal
• Constant Velocity Window.- For mass–reduced,
This work proposes a motion profile named Sinusoidal
robust mechanisms, with enough power to
Velocity Profile. It is a piece–wise construct with 3
tolerate the acceleration impulses at the beginning
components: An acceleration zone, a constant speed zone
and the end of this type of motion. This method
and the corresponding decelerating zone, similar to the
is not regarded as a "solution" herein.
construction used in trapezoidal profiles.
• Trapezoidal Velocity Profile.- Produces Procedures
rectangular acceleration windows. The jerk
obtained is in the form of impulses (4 in total), The calculation procedures will be developed in a dual
aligned with the edges of the acceleration fashion: As a procedural review of the traditional
windows. S–Curve, and as a presentation of the proposed
Sinusoidal profile.
• S–Curve Velocity Profile.- Part of the work
The following parameters are required:
reported in this paper is the development of a
procedure that generalizes the treatment of this • Vm ≡ Maximum Velocity allowed (absolute
family of profiles. The generalization includes value).
the special cases of "short travel" and allows to • Am ≡ Maximum Acceleration peak value
"select" the particular profile by means of a single allowed (absolute value).
parameter (denoted as γ in the example figures).
• Throw ≡ The travel distance (positive or negative).
By varying continuously γ from 0.0 to 1.0, the
profile respectively evolves from “impulsive Also, when dealing with the S-Curve profile, the
jerks” (i.e. the Trapezoidal Velocity Profile, parameters set must include γ, dimensionless quantity
appearing as a particular and extreme case of the varying from 0.0 to 1.0 as explained above. The
S–Curve family of functions), to its maximum effects of some typical values are shown in the final
"smoothness", namely, triangular acceleration summary table.
profile and minimization of both, jerk and
The numerical format for these and the rest of the
peak–power values.
variables employed herein is not restricted to be integer
The analytical flexibility offered by these solutions is a and the units adopted for these variables can be freely
tradeoff with their features. As shown in the final selected according to the natural specification of the
summary table, the benefit of reduced peak values of motion environment (resolver counts, micrometers,
power and jerk has a cost of additional components in millimeters, meters, inches, etc.). The general idea
the piece–wise construct of the functions. Even after with this approach is that, for the sake of
the identification and utilization of symmetry points for self–documentation and clarity, the calculation part of
mirror simplification, the constructors count is still the control system contains the user’s abstraction of the
high. problem, and the required conversions (resolver integer
As a final word, the traditional velocity profiles are counts, stepper pulses, etc.) can be made at the final
solutions of such numerical simplicity that can be used “delivery” stage of the process. Conversely, when
when computing power is expensive, limited or absent. “reading” from the physical devices, the conversion of
However, the use of computerized control increases to units made at the “source” of the information favors
the point that in some cases it is mandatory. maintenance and inspection versatility.
With the “user” set of parameters in hand, another set of Profile
12 (with a temporary Yaux added for a total of 13) No.
Type
Initialization (continued...)
“calculation” parameters is obtained prior to the
Ys − Ya
utilization of the procedural formulas. In terms of 11 Both Tk = 2 ⋅
software implementation it is convenient that this Vm
initialization procedure be confined in a function (or Tk
subroutine). This will be referred to, as the 12 Both Ts = Ta +
Initialization Sequence: 2
Profile 13 Both Tt = 2 ⋅ Ts
No.
Type
Initialization

1 Both Sgn = sgn( Throw ) The following figures are generic outlines for arbitrary
(S–Curve or Sinusoidal) profiles, intended as a graphical
2 Both Yf = | Throw | description of some of the the variables employed in this
section.
Yf
3 Both Ys = y(t)
2 Yf
 Vm 2  Tk
Yf-Ya
S-Curve Yaux = 12 ⋅ (1+ γ ) ⋅  
 Am  Ys
4
Vm2
Sinusoidal Yaux = Ya
Am
Ys ∀ Ys ≤ Yaux 0
Ta Ts Tt-Ta Tt t

Ya = 
y’(t)
5 Both
Yaux ∀ Ys > Yaux Vm

Vm
 Ys ⋅ Am 2
Tk

 ∀ Ys ≤ Yaux
S-Curve Vw =  1 ⋅ (1+ γ ) 0 t
 2 Tm Ta Ts Tt-Ta Tt

Vm ∀ Ys > Yaux To


Generic Long Throw Motion: Vw=Vm
6
 Ys ⋅ Am ∀ Ys ≤ Yaux y(t)
Sinusoidal Vw =  Yf

Vm ∀ Ys > Yaux


Tk = 0

Ya =Ys
Vw
7 Both To =
Am 0 t
Ts Tt
y’(t) Ta

Ta = To ⋅ (1 + γ )
Vm
S-Curve Vw
Vw
2
8
0 Tm Ts Tt t

Ta = 2 ⋅ To To Ta
Sinusoidal
Generic Short Throw Motion: Vw<Vm,
Ya=Ys, Ta=Ts
S-Curve τ = γ ⋅To
The procedural equations can be stated in several ways
9
2⋅π and the adoption of a particular style is a matter of taste,
Sinusoidal ω= and available space. That is the reason for the adoption
Ta of the “recursive” style. Although the software
Ta implementation was experimented following both, the
S-Curve Tm = “classical” style (using auxiliary functions) and the
2 “recursive” style, apart from the characteristic
10
Ta ⋅Vw compactness of the later, there are not improvements in
Sinusoidal Ks =
4 ⋅π 2 performance in following a particular style.
y(t) = Sgn⋅ yˆ (t)
 0 ∀ t ≤0
   3 
  1 ⋅ Vw ⋅  t  ∀ 0 < t<τ
  2 To   3⋅ τ  y(t) = Sgn⋅ yˆ (t)

yˆ(t) =   1 Vw   τ  τ  
2
∀ t ≤0
2
0
  ⋅  ⋅  t −  +  ∀ τ < t ≤ To  Am
 2 To   2  12   ⋅ t + Ks⋅ (cos(ω ⋅ t ) − 1) ∀
2
0 < t ≤ Ta
Ys + Vw ⋅ (t − Ts) + yˆ (Ta − t) ∀ To < t ≤ Ts yˆ(t) =  4
 Ys + Vw ⋅( t − Ts) ∀ Ta < t ≤ Ts
 Yf − yˆ (Tt − t) ∀ Ts < t 
 Yf − yˆ (Tt − t) ∀ Ts < t
Equations Set 1-a: S-Curve Profile Position Equations Set 2-a: Sinusoidal Profile Position

y ′(t) = Sgn ⋅ yˆ′(t )


 0 ∀ t≤0
   t2
  Am
⋅  ∀ 0<t<τ
  2   τ  y′ (t) = Sgn⋅ yˆ′ (t )
 
yˆ ′(t) =   Am  0 ∀ t≤0
   ⋅ (2 ⋅t − τ ) ∀ τ < t ≤ To 
 Ks ⋅ω ⋅ (ω ⋅ t − sin (ω ⋅ t) ) ∀
 2  yˆ ′ (t) = 
0 < t ≤ Ta
Vw − yˆ′ (Ta − t) ∀ Tm < t ≤ Ts  Vw ∀ Ta < t ≤ Ts
  yˆ ′ (Tt − t) ∀ Ts < t
 yˆ ′(Tt − t) ∀ Ts < t
Equations Set 1-b: S-Curve Profile Velocity Equations Set 2-b: Sinusoidal Profile Velocity

y ′′(t) = Sgn ⋅ yˆ ′′(t)


 0 ∀ t≤0 y ′′(t) = Sgn ⋅ yˆ ′′(t)
  Am 
  ⋅t ∀ 0< t<τ  0 ∀ t ≤0
  τ   Am
yˆ ′′(t) =  Am
yˆ ′′(t) =  2 (
 ∀ τ < t ≤ To  ⋅ 1 − cos(ω ⋅ t )) ∀ 0 < t ≤ Ta
yˆ ′′(Ta − t) ∀ Tm < t ≤ Ts 
 ∀ Ta < t ≤ Ts
 − yˆ′′(Tt − t) ∀ Ts < t  ˆ 0
 − y ′′(Tt − t ) ∀ Ts < t
Equations Set 1-c: S-Curve Profile Acceleration Equations Set 2-c: Sinusoidal Profile Acceleration

The presented sets of equations are for y(t) –position–, is a set of impulses even for the smooth case.
y ′(t) –velocity–, and y ′′(t) –acceleration– (sets 1–a, Conversely, the jounce for the Sinusoidal profile is a
1–b and 1–c respectively for S–Curve and sets 2–a, 2–b pair of windowed cosine functions. This result is
and 2–c respectively for Sinusoidal). The independent associated to the fact that the harmonic content of the
variable t is the local time in terms of a particular sinusoidal curves (acceleration and jerk), by definition is
profile motion which starts at t = 0 , and finishes with the minimum attainable, when compared with the
t = Tt . Any subsequent motion restates its own t . triangular and rectangular counterparts.
The experimental work with these procedures in a target
Note that the following validation checks are performed:
servomechanism confirmed the expectations made with
y(t) = 0 ∀ t ≤ 0 and y(t) = Throw ∀ t > Tt the Sinusoidal profile. Although the observations were
for position boundaries. made while comparing the different profiles, the test
Also, all the velocity and acceleration boundaries results are qualitative rather than quantitative. The
(when t ≤ 0 and t ≥ Tt ) are validated to ZERO values. bottom line is that the difference between the canonical
Results S-Curve ( γ = 1 ) and the sinusoidal profile is
perceptible but far from dramatic. Probably the major
Higher order derivatives, jerk (acceleration derivative) and
advantage, apart from marginal reductions in servo
the so called “jounce” (jerk derivative) can be similarly
positioning errors, lies in the procedural simplicity of
obtained. Note that the jounce for the S-Curve profile
the implementation.
A word about the test implementation: In a i486–DX4 Summary Table of Velocity Profiles
type processor at 66 Mhz (with FPU integrated), Normalized
Peak Power
running an ISR (interrupt service routine) that feeds a Velocity
Profile
Normalized Total
Normalized
Transition Piece Wise Jerk Value Jerk Shape per Unity of
Type Time (Ta) Constructors Mass
servo controller at a rate of 250 Hz, under a
multitasking OS (Linux), there is not an appreciable 1.00
difference for the computational load of calculating any
Trapezoidal
γ =0
(Reference 3 ∞ 4
Impulses
1.00
(Reference)
and lowest)
of the profiles reviewed. S–Curve 4
1.25 7 4.00 0.88
Also available as a complement of these procedures is γ = 0.25 windows
S–Curve 4
the solution to the opposite problem: For a given travel 1.50 7 2.00 0.75
γ = 0.50 windows
time, What is the required parameter change (velocity in S–Curve 4
this case) that satisfies the motion conditions?. 1.75 7 1.33 0.63
γ = 0.75 windows

This can be useful when synchronizing motion in 1.00 2 pairs of


S–Curve 0.54
2.00 7 linked
several axes, or in the case when the calculated Tt in γ = 1.0 (Reference
and lowest) (Lowest)
windows
Initialization has to be adjusted upwards to the nearest 2
multiple of the sampling period. In this case the Sinusoidal 2.00 3 1.57 windowed 0.63
sinusoids
parameters to be given are:
• Am ≡ Maximum Acceleration peak value
allowed.
• Tt ≡ Elapsed time required for the motion.
• Throw ≡ The travel distance (positive or negative). Velocity
• Vm ≡ The original Maximum Velocity allowed Functions
(absolute value) for validation of the Tt
provided.
The procedure verifies the validity of the parameters and
finds in closed form (a quadratic) the result: Two values
Acceleration
of velocity that, when adopted as Vm, will work as a
solution to the problem of traveling the Throw in Tt
seconds.
The Tt equation for the S–Curve is
Yf Vw
Tt = + ⋅ (1 + γ ) ,
Vw Am Jerk
and for the Sinusoidal profile
Yf Vw
Tt = + 2⋅ .
Vw Am
Both formulas are similar and, for the purpose of this
analysis, a convenient simplification consists in using Normalized Power
only the S–Curve formula and regarding the Sinusoidal per unit of mass
profile case as an S–Curve with γ = 1 .
The pertinent solutions are [2]
 Am  1  1 + γ  
V1 =   ⋅ ⋅
 Tt + Tt − 4⋅   ⋅ Yf 
2

1 +γ  2   Am  ,

2 ⋅Yf Final Comment
V2 = .
1 +γ  Contrary to the traditional methods, the Sinusoidal
Tt + Tt 2 − 4 ⋅   ⋅ Yf
 Am  Profile requires computing power for the trigonometric
V1 ≡ The solution that minimizes (or cancels) the evaluation (FPU, series expansion or lookup tables), but
constant velocity zone. provides a simplified algorithmic implementation.
V2 ≡ The solution that maximizes the constant velocity 1.-“The price of age,” The Economist, Dec 23rd 2000,
zone. pp 91-94.
Both solutions are valid, but only V2 guarantees the 2.- Press, W.H. et al,"Numerical Recipes", 2nd ed.,
security condition V2 ≤ Vm . Cambridge UP, New York, 1995.

You might also like