21
A kinematic cost Reza Shadmehr

A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Embed Size (px)

Citation preview

Page 1: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

A kinematic cost

Reza Shadmehr

Page 2: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Subject’s performance Minimum jerk motion

)()( 22 tytx )(tx

Flash and Hogan, J Neurosci 1985

Point to point movements generally exhibit similar characteristics:

• hand trajectory is along a straight line

• hand speed follows a smooth, bell

shaped time course• hand speed is typically symmetric about the midpoint of the movement.

Page 3: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

)()( 22 tytx

Page 4: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Straight hand paths often translate into curved trajectories for the joints of the arm. This computation is performed using inverse kinematics transformation.

Sergio & Scott, Exp Brain Res 1998

Average hand path for normal subjects with eyes open.

Subjects rested their hand on a board at chest level and were shown a small cylinder to reach to at a target location.

Page 5: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Sergio & Scott, Exp Brain Res 1998

Movements tend to be straight, even in congenitally blind individuals

In the blindfold condition, the experimenter takes the hand of the subject to the start and target positions and asks them to make a few practice movements between the two points.

Same procedure is used for the blind individuals.

Blind individuals tend to show even straighter movements that those with vision.

Page 6: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

We adapt our movements so that they appear straight to us

Subject sits in front of a digitizing tablet and holds a mouse. He is viewing an image that corresponds to the position of his finger. He is given a target to move to. During the movement, the computer either displays his actual hand position, or an altered version of it. If he is shown his actual hand position, the hand moves in a fairly straight line.

Here, the perturbation is a hemi-sinusoid in the negative x-direction. The perturbation makes it so that a straight hand path will become slightly curved to the left. The alteration is so small that the subjects are not consciously aware of it. Despite this, subjects change their hand motion (after practice) so that it appears to them that the hand is moving in a nearly straight path.

no perturbation

Post-perturbationafter practice

Wolpert et al., Exp Brain Res 1995

Page 7: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Computing a maximally smooth trajectory for point to point movements

Smoothness can be quantified as the mean squared magnitude of jerk. Jerk is the rate of change of acceleration with respect to time, hence the third time derivative of position.

end

0

2

3

2

1 :functioncost smoothness

)( :jerk

t

dtx

dt

xdtx

0.1 0.2 0.3 0.4 0.5

2

4

6

8

10

0.1 0.2 0.3 0.4 0.5

5

10

15

20

25

30

35

0.1 0.2 0.3 0.4 0.5

-200

-100

100

200

0.1 0.2 0.3 0.4 0.5

-2000

-1000

1000

2000

3000

4000

)(tx

)(tx

)(tx

)(tx

Page 8: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

)(tx

)(tη

)()( tetx 1e2e

Objective: find the function x(t) that minimizes the cost

Approach: calculus of variations

50

0

2

2

1))((

.

t

dtxtxH

0)5.0(0)0(

0)5.0(0)0(

0)5.0(0)0(

:)( of Properties

0)(

)()()(

0

t

e

exdH

tetxtx

e

Page 9: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

5.0

0

)4(5.0

0

)4(0.5

0

5.0

0

)4(

5.0

0

0.5

0

5.0

0

5.0

0

5.0

00

5.0

0

5.0

0

2

5.0

0

2

, , ,

-

)(

)()(

)(2

1)(

)()()(

)(2

1))((

dtxdtxxdtx

vdtxdudtdvxu

duvuvdvudtx

dtxe

exdH

dtexe

exdH

dtexexH

tetxtx

dttxtxH

e

Minimizing the cost function: calculus of variation

5.0

0

)6(5.0

0

)6(0.5

0

)5(5.0

0

)5(

5.0

0

)5(5.0

0

)5(0.5

0

)4(5.0

0

)4(

)5()4(

5.0

0

0.5

0

5.0

0

5.0

0

)4(

, , ,

dtxdtxxdtx

dtxdtxxdtx

vdtxdudtdvxu

duvuvdvudtx

0 :Therefore ).(function

any for trueholdmust Above

0)(

)6(

5.0

0

)6(

0

xt

dtxe

exdH

e

Page 10: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

5.0

0

2

543

543

35

2432

45

34

231

55

44

330

35

2432

45

34

2321

55

44

33

2210

)6(

2

1))(( :cost theminimizesfunction This

sec5.00 19202400800)(

1920,2400,800

0)5.0(20)5.0(12)5.0(60)5.0( ,00)0(

0)5.0(5)5.0(4)5.0(30)5.0( ,00)0(

10)5.0()5.0()5.0(10)5.0( ,00)0(

201262 )(

5432 )(

)( :ofsolution general has 0

dtxtxH

tttttx

aaa

aaaxax

aaaxax

aaaxax

tatataatx

tatatataatx

tatatatataatxx

Initi

al c

ond

ition

s

This is called the minimum jerk trajectory in one dimension

0.1 0.2 0.3 0.4 0.5

2

4

6

8

10

)(tx

Page 11: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Homework

1. Find the trajectory x(t) that minimizes the cost function:

• find the general solution using calculus of variation

• solve the differential equation using the following initial conditions

The x(t) that you found is called a minimum acceleration trajectory.

2. Plot x(t) and for

3. Compute the value of the cost function for the

x(t) that you found in question 1.

4. Compute the value of the cost function for the

x(t) that you found in question 1.

50

0

2

2

1))((

.

t

dtxtxH

0)5.0( ,0)0(

10)5.0( ,0)0(

xx

xx

)(tx 5.00 t

50

0

2

2

1))((

.

t

dtxtxH

50

0

2

2

1))((

.

t

dtxtxH

Page 12: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

General Form of the Minimum Jerk Trajectory

The limb is at position x=xi. We wish to move to x=xf in t=a seconds.

543

543

0

22

543

0

2

)/(6)/(15)/(10)(

)/(6)/(15)/(10)()( :solution

)(2

1))(( :movement ldimensiona twoaFor

)/(6)/(15)/(10)()( :solution

0)(,0)0(,0)(,0)0(,)(,)0(

:conditions initial with 2

1))(( Minimize

atatatyyy

atatatxxxtx

dtyxtxH

atatatxxxtx

axxaxxxaxxx

dtxtxH

ifi

ifi

a

t

ifi

fi

a

t

Page 13: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

10)5.0(

0)0(

2

1))((

5.0

0

2

x

x

dtdt

xdtxH n

n

Minimizing higher order derivatives

As the order of the derivative in the cost function increases, x(t) approaches a step function, and its first derivative (speed) becomes narrower and taller. This means that the ratio of peak speed to average speed gets larger. Ratio=r.

(n=2, r =1.5), (n =3, r =1.875), (n =4, r =2.186)

For simple planar movements, humans exhibit motion that most resembles minimum jerk (n =3). r for these sorts of movements in humans is ~1.75.

Page 14: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Example: Making a point to point movement with a two-joint arm

1. Eyes foveate the hand. From angle of each eye and position of the neck muscles, the brain estimate current hand position: xi

2. Eyes foveate the target. From angle of each eye and position of the neck muscles, the brain estimate the target position: xf

3. A decision is made on how much time the movement should take: a seconds. A desired tarjectory for the hand in terms of a change in its current position is calculated:

)()(

)/(6)/(15)/(10)()( 543

txxtx

atatatxxtx

did

ifd

desired change in hand position

desired change in hand positionwith respect to its initial position

desired hand position with respect to the shoulder

Page 15: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

-0.4 -0.3 -0.2 -0.1 0.1 0.2

0.1

0.2

0.3

0.4

0.5

)(txd

Points are 10 msec apart

seconds 0.5 :imemovement t desired

29.0

39.0

meters 51.0

09.0

f

i

x

x

0.1 0.2 0.3 0.4 0.5

-0.35

-0.3

-0.25

-0.2

-0.15

-0.1

0.1 0.2 0.3 0.4 0.5

0.3

0.35

0.4

0.45

0.5

)(txd

)(tyd

t (sec)

Page 16: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Translating the desired trajectory into joint rotations

Goal:

Forward kinematics:

Jacobian:

Mapping:

)()( tqtxdd

-0.4 -0.3 -0.2 -0.1 0.1 0.2

0.1

0.2

0.3

0.4

0.5

)sin()sin(

)cos()cos()(

21211

21211

qqlql

qqlql

y

xqx

)cos()cos()cos(

)sin()sin()sin()(

)(

21221211

21221211

21

21

qqlqqlql

qqlqqlqlqJ

dq

dy

dq

dydq

dx

dq

dx

qd

xdqJ

xqJqqqJdt

qd

qd

xd

dt

xdx )( )( 1

Page 17: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Translating the desired trajectory into joint rotations

With the inverse Jacobian, we can map desired hand velocities into joint velocities. Velocities are change in position, so if we know the initial hand position, we can use this map to calculate what rotations the joints need to do to bring the hand to the desired target.

0.1 0.2 0.3 0.4 0.5

-0.5

-0.4

-0.3

-0.2

-0.1

)(txd

)(tyd

m/s

0.1 0.2 0.3 0.4 0.5

-0.2

-0.1

0.1

0.2

0.3

0.4

0.5

)(txd

)(tyd

m

0.1 0.2 0.3 0.4 0.5

0.2

0.4

0.6

0.8

)(1 tq)(2 tq

xqJq )(1

rad/s

Page 18: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Planning: errors in mapping xd(t) onto qd (t)

The display (projector) shows the finger position to be either 17 cm to the left or to the right of its actual position.

A target is shown, and subject is asked to make a movement.

Visual feedback is provided throughout the movement.

Actual armposition

Displayed fingerposition

Displayed target

Example: displayed position = actual position - 17 cm

Goodbody & Wolpert, Exp Brain Res 1999

Page 19: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

0.05 0.1 0.15 0.2

0.35

0.4

0.45

qd

xd

x

q

If there were no visual feedback during the movement, one would expect that the hand would move to the right of the target.

actual handposition

perceived handposition

dd

d

xqJq

tx

)ˆ( .2

)( compute we.11

target

)(tx d )(1 qJ

q̂perceived angular position of the arm

)(tqd

Page 20: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

0.05 0.1 0.15 0.2

0.35

0.4

0.45

0.5

If visual feedback was available during the movement, we would see that our hand is not moving to the target, and so we would incorporate this error into the desired trajectory as the error became available. This is an example of feedback control. In the following simulation, we have assumed that errors in position are added to the desired hand trajectory (with a moderate gain).

)(tx d

)(ˆ tx

)(1 qJ

q̂perceived

position of the arm

)(tqd

motor

commandsarm

dynamics

)(tx

visualdistortion

)(tx d

)(ˆ tx_+

+

gain

perceived errorin arm position

perceived armposition

actual armposition

Page 21: A kinematic cost Reza Shadmehr. Subject’s performanceMinimum jerk motion Flash and Hogan, J Neurosci 1985 Point to point movements generally exhibit similar

Displacement of the visual feedback is to the left

Goodbody & Wolpert, Exp Brain Res 1999