Minimumjerk
Minimumjerk
Minimumjerk
Wise
A MINIMUM-JERK TRAJECTORY
Neville Hogan (1984a) noted that smoothness can be quantified as a function of jerk, which is the time
derivative of acceleration. Hence, jerk is the third time derivative of location (i.e., position). If the location
of a system is specified by variable x (t ) , then the jerk of that system is:
d 3 x (t )
x (t ) =
jerk
dt 3
For your CNS to move your hand or some other end effector smoothly from one point to another,
it should minimize the sum of the squared jerk along its trajectory. For a particularly trajectory x1 (t ) that
starts at time ti and ends at time t f , you can measure smoothness by calculating a jerk cost:
tf
∫ x (t ) dt
2
1
t = ti
Note that jerk cost is a scalar; the expression above assigns a number to the function x1 (t ) . Hogan
wondered what function x (t ) most smoothly connects a starting point to a target in a given amount of
time. This function x (t ) , among all possible functions, has the minimum jerk cost. Some people find this
fact interesting, others simply find it tedious. If you find yourself in the latter category, you might consider
skipping over the remainder of this chapter.
To make the issue concrete, imagine that you wish to move something 10 cm in a 0.5 s period.
The object will be at rest at start time and at the end of the movement. You can write this as:
⎧ x (0) = 0 x (0.5) = 10
⎪
Properties of x (t ) : ⎨ x (0) = 0 x (0.5) = 0
⎪
⎩ x (0) = 0 x (0.5) = 0
What trajectory x (t ) has the smoothest path? To find x (t ) , you need to assign a jerk cost to
each possible trajectory, and then find the trajectory with the least cost. Mathematically, this calculation
corresponds to minimizing the functional:
0 .5
1
H ( x (t )) = ∫ x 2dt
2 t =0
(The ½ factor in the front makes the calculations come out a little prettier; otherwise it has no special
significance). To find the minimum of this functional, Hogan used a technique called the calculus of
variations. The idea resembles finding the minimum of a function: you find the derivative of the function
with respect to a small perturbation and when that derivative is zero, you have found a minimum. The
Supplementary documents for “Computational Neurobiology of Reaching and Pointing”, by R. Shadmehr and S. P. Wise
x(t )
e=2 x(t ) + eη (t )
e =1
η(t )
Figure 1 shows an example of η (t ) . The variation has the special property that it smoothly goes
away at the boundary conditions, i.e., at the beginning and end of movement:
⎧η (0) = 0 η (0.5) = 0
⎪
Properties of η (t ) : ⎨η (0) = 0 η (0.5) = 0
⎪η(0) = 0 η(0.5) = 0
⎩
Supplementary documents for “Computational Neurobiology of Reaching and Pointing”, by R. Shadmehr and S. P. Wise
x(t )
e=2 x (t ) + eη (t )
e =1
η(t )
x (t ) 6 x (t ) + eη (t )
0.5
1
H ( x + eη ) = ∫ (x + eη) dt
2
2 0
dH ( x + eη )
0.5
e
= ∫ (x + eη)η dt
0
dH ( x + eη )
0.5
e e =0
= ∫ xη dt
0
Using integration by parts, you can rewrite this integral as:
0.5 0.5 0.5
∫ xη dt = ∫ u dv = uv 0 - ∫ v du
0.5
0 0 0
x , dv = η
u = dt , du = x dt , v = η (4)
0 0 0
u = x , dv = η dt , du = x dt , v = η
(4) (5)
0
0 0 0
0.5 0.5 0.5
∫ η x − ∫ η x (6) dt = − ∫ η x (6) dt
0.5
(5)
dt = x (5)η
0
0 0 0
This final integral is the derivative of your functional, and you have:
dH ( x + eη )
0.5
= − ∫ η x (6) dt ≡ 0
e e=0 0
The above property must hold true for any function η (t ) , and therefore you have the fact that
x (6) = 0 ,
which means that some function x (t ) that happens to have its sixth derivative equal to zero will
minimize your jerk function. The differential equation x = 0 has the general solution of:
(6)
10 x(t ) x(t )
2
8
1
cm
6
m/s2
4 0.1 0.2 0.3 0.4 0.5
2 -1
-2
0.1 0.2 0.3 0.4 0.5
35 x (t ) x(t )
40
25 30
cm/s
m/s3
20
15 10
0.1 0.2 0.3 0.4 0.5
5 -10
-20
0.1 0.2 0.3 0.4 0.5
Time (sec) Time (sec)
Figure 2 plots this function along with its first three derivatives: velocity, acceleration, and jerk. The
function x (t ) represents the minimum jerk trajectory in one dimension. Hogan noted that, in general, if
something you wanted to move something from location x = xi to x = x f in t = d seconds, the
minimum jerk trajectory would be:
x(t ) = xi + ( x f − xi ) (10(t / d )3 − 15(t / d ) 4 + 6(t / d )5 )
(1)
Supplementary documents for “Computational Neurobiology of Reaching and Pointing”, by R. Shadmehr and S. P. Wise
10 x(t ) x(t )
2
8
1
cm
6
m/s2
4 0.1 0.2 0.3 0.4 0.5
2 -1
-2
0.1 0.2 0.3 0.4 0.5
35 x (t ) x(t )
40
25 30
cm/s
m/s3
20
15 10
0.1 0.2 0.3 0.4 0.5
5 -10
-20
0.1 0.2 0.3 0.4 0.5
Time (sec) Time (sec)
Figure 2. Minimum jerk trajectory. The function x(t ) that has the minimum jerk cost
function as it travels 10 cm over 0.5 seconds.
Flash and Hogan (1985) found that, for end-effector locations specified as a vector of two or more
dimensions, Eq. (1) described the minimum jerk trajectory for each dimension. For example, for a
movement in two dimensions, the functional to minimize is:
a
1
H ( x (t )) = ∫ (x 2 +
y 2 )dt
2 t =0
and the minimum jerk trajectory in two dimensions is:
⎡ xi + ( x f − xi ) (10(t / a )3 − 15(t / a ) 4 + 6(t / a )5 ) ⎤
x (t ) = ⎢ ⎥
⎢ yi + ( y f − yi ) (10(t / a )3 − 15(t / a ) 4 + 6(t / a )5 )⎥
⎣ ⎦
(2)
Supplementary documents for “Computational Neurobiology of Reaching and Pointing”, by R. Shadmehr and S. P. Wise
Eq. (2) implies that a minimum jerk trajectory in two or three dimensions always corresponds to a
-0.1
-0.2 x (t ) y
0.5
-0.3
x (t )
0.4
0.5 0.3
y (t ) 0.2
0.4
0.1
0.3
x
-0.4 -0.3 -0.2 -0.1 0.1 0.2
straight line.
Figure 3 exemplifies this relationship, for a two-joint arm moving from an initial- to a final location in
0.5 s. Note how each component of location in cartesian coordinate moves smoothly to its final value and
end-effector location moves along a straight line.
-0.1
-0.2 x (t ) y
0.5
-0.3
x (t )
0.4
0.5 0.3
y (t ) 0.2
0.4
0.1
0.3
x
-0.4 -0.3 -0.2 -0.1 0.1 0.2
Figure 3. A minimum jerk motion in two dimensions is a straight line. The end-effector
location of a two-link arm is moved from (-0.09, 0.51) to (-0.39, 0.29) in 0.5 seconds.
The trajectory of x- and y- components of end-effector location are plotted, as well as
end-effector location.
H ( x (t )) = ∫ ⎜ n ⎟ dt
2 ti ⎝ dt ⎠
(3)
They found that as the order of the derivative n increased, the solution to the functional x (t )
A B
Figure 4A shows the minimum jerk, snap, and crackle trajectories. Note how the first derivative
(speed) of each trajectory becomes narrower and taller as you minimize jerk, snap and crackle. Therefore,
if you wish to minimize snap, the fourth derivative of location, you get a movement with a higher peak
speed than a trajectory that minimizes jerk. This means that as you increase n in Eq. (3), the solution yields
a trajectory with a larger peak speed relative to average speed.
Supplementary documents for “Computational Neurobiology of Reaching and Pointing”, by R. Shadmehr and S. P. Wise
A B
Figure 4. Movements with minimum jerk, snap, or crackle. A. A minimum jerk (n=3), a
minimum snap (n=4), and a minimum crackle (n=5) trajectory. The variable n refers to
the order of the derivative in Eq.(3). B. Speed of the movement for each trajectory. Note
that the ratio of peak speed to average speed increases as n increases.
If you call this ratio of peak speed to average speed r, then a minimum-acceleration trajectory [i.e.,
where n = 2 in Eq. (3)], has a ratio of r = 1.5. For a minimum-jerk trajectory, n = 3 and r = 1.875; for a
minimum-snap trajectory, n = 4 and r = 2.186. Psychophysical experiments reveal that your reaching
movements have a ratio r that is about 1.75, and thus most resemble minimum-jerk trajectories (Flash and
Hogan 1985).
implies that the trajectory is a fifth order polynomial. Let us normalize our measure of time so that it is 0
when we start the movement and 1 when we reach the target. If τ represents this normalized time, we
have:
t − t0
τ= D = t f − t0
D
Supplementary documents for “Computational Neurobiology of Reaching and Pointing”, by R. Shadmehr and S. P. Wise
−3 D 2
a3 = pi − 6 Dvi + 10( x f − xi )
2
3D 2
a4 = pi + 8 Dvi − 15( x f − xi )
2
D2
a5 = − pi − 3Dvi + 6( x f − xi )
2
This gives us an expression for x(t ) that is valid for any initial condition. For example, at any time into
the movement t , label that time t = t0 , and assume that we are at state q = xi [ vi pi ] . The change
T
Given the current position of the hand with respect to target, and the hand’s velocity and acceleration, the
above expression provides a method for calculating a desired change in hand position, velocity, and
acceleration, so that the hand arrives at the target in an optimally smooth way.
Reference List
Flash T, and Hogan N (1985) The coordination of arm movements: an experimentally confirmed
mathematical model. J Neurosci 5: 1688-1703
Hoff B, Arbib MA (1992) A model of the effects of speed, accuracy, and perturbation on visually
guided reaching. In: Control of arm movement in space: neurophysiological and
computational approaches (Caminiti R, Johnson PB, Burnod Y, eds), pp 285-306.
Richardson MJ, Flash T (2002) Comparing smooth arm movements with the two-thirds power law
and the related segmented-control hypothesis. J Neurosci 22: 8201-8211.