Control for an Autonomous

Neil H. Getz Jerrold E. Marsden

Department of Electrical Engineering Department of Mathematics

University of California University of California

Berkeley,CA94720 Berkeley,CA94720

[email protected] [email protected]

IEEE International Conference on Rob otics and Automation, 21-27 May 1995, Nagoya

m

Abstract

The control of nonholonomic and underactuated

systems with symmetry is il lustrated by the problem

ontrol ling a bicycle. We derive a control ler which, of c Component of

force on ground axis

ering and rear-wheel torque, causes a model using ste p

parallel to ground plane

of a riderless bicycle to recover its balancefrom a near

onverge to a time parameterizedpath

fal l as wel l as c c

in the ground plane. Our construction utilizes new re-

Contact Line

oth the derivation of equations of motion for sults for b ur

nonholonomic systems with symmetry, as wel l as the Constrained directions

ontrol of underactuatedrobotic systems. c of wheel travel

b

1 Intro duction

Figure 1: Side view of the bicycle mo del with =0.

Control of the bicycle is a rich problem o ering a

the tracking control of nonminimum phase systems.

numb er of considerable challenges of current research

The pap er pro ceeds as follows: By exploitation of

interest in the area of mechanics and rob ot control.

the bicycle's constraints and symmetry we rst derive

The bicycle is an underactuated system, sub ject to

a reduced set of equations of motion for the bicycle.

nonholonomic contact constraints asso ciated with the

We then review how the bicycle can b e made to fol-

rolling constraints on the front and rear wheels. It is

low arbitrary roll-angle tra jectories, thus allowing the

unstable (except under certain combinations of fork

to recover from near falls and disturbances. A

geometry and sp eed) when not controlled. It is also,

purely kinematic mo del of the bicycle is then intro-

when considered to traverse at ground, a system sub-

duced in order to showhow, disregarding the unstable

ject to symmetries; its Lagrangian and constraints are

roll-angle dynamics, the bicycle may b e made to con-

invariant with resp ect to translations and rotations in

verge to a desired tra jectory in the plane. Wethen

the ground plane.

showhowwemay use our knowledge of howtosteer

Though a numb er of researchers have studied the

the kinematic bicycle to construct a controller that

stability of and under a nominal

allows a leaning bicycle to track planar tra jectories

linear mo del of rider control (See Hand [1] for a sur-

without falling.

vey), as far as weknow our work presents the rst

controller allowing tracking of arbitrary tra jectories

while maintaining balance. Control of balance and

2 The Mo del

roll-angle tracking for the bicycle mo del we use here

has b een addressed byGetz[2]. In addition to extend- The control of a simpli ed bicycle mo del illustrated

ing those results to tracking in the plane we also utilize in Figures 1 and 2 will b e considered. The wheels of

some new results from Blo ch, et al. [3] on the deriva- the bicycle are considered to have negligible inertial

tion of equations of motion for nonholonomic systems moments, mass, radii, and width, and to roll without

with symmetries, and from Getz and Hedrick[4]on side or longitudinal-slip. The vehicle is assumed to

lo city along the path traveled, and the generalized co-

ordinate corresp onding to v is the integral in time of

?

elo city along a direction p erp endicular

b φ the rear-wheel v

h, by virtue of the constraints,

α θ to the rear-wheel whic

ays zero.

v⊥ c is alw

It will b e assumed that the bicycle exerts a control

force u (see Figure 1) on the ground at the site of

y vr r

tofcontact b etween the rear-wheel and the

Contact Line the p oin

ground. The force u will b e considered to act along

r

the contact line as indicated in Figure 1 and is the gen-

eralized force corresp onding to v . A torque generator

x r

ariable  , the gener-

Ground Frame is asso ciated with the steering v

alized torque b eing u .We consider a vehicle with a



rigid or non-existent passenger under automatic con-

Figure 2: Top view of the bicycle mo del rolled away

trol.

from uprightby angle . Bold arrows indicate wheel

directions at the ground plane.

3 Equations of Motion

have a xed steering-axis that is p erp endicular to the

Wecho ose a b o dy-frame for the bicycle centered at

at ground when the bicycle is upright. For simplic-

the rear-wheel ground contact, with one axis p oint-

itywe concern ourselves with a p oint mass bicycle.

ing forward along the line of intersection of the rear

The rigid frame of the bicycle will b e assumed to b e

wheel plane with the ground, another axis orthogonal

symmetric ab out a plane containing the rear wheel.

to the rst and in the ground plane, and an axis nor-

Consider a ground- xed inertial reference frame

mal to the ground, p ointing in the direction opp osite

with x and y axes in the ground plane and z -axis p er-

to (see Figure 2). The b o dy frame is a natural

p endicular to the ground plane in the direction opp o-

frame in which to write the Lagrangian of the bicy-

site to gravity.Theintersection of the vehicle's plane

cle for a numb er of reasons. In particular the rolling

of symmetry with the ground plane forms a contact-

constraints takeonavery simple form. The general-

line. The contact-line is rotated ab out the z -direction

ized velo cities of the bicycle are contained in the par-

T T

_

bya yaw-angle,  . The contact-line is considered di-

titioned co ordinatesr _ =[_ ;v ; _ ] ands _ =[; v ] .

r ?

rected, with its p ositive direction from the rear to the

In these velo city co ordinates the nonholonomic con-

front of the vehicle. The yaw-angle  is zero when the

straints asso ciated with the front and rear wheels, as-

contact-line is in the x direction. The angle that the

sumed to roll without slipping, are expressed very sim-

bicycle's plane of symmetry makes with the ground is

ply by_s + A(r;s)_r =0 or

the rol l-angle, 2 (=2;=2). Front and rear-wheel

2 3

   

_

contacts are constrained to havevelo cities parallel to

_

 0  0

4 5

+ v =0 (1)

the lines of intersection of their resp ective wheel planes r

v 0 0 0

?

_

and the ground-plane, but free to turn ab out an axis

through the wheel/ground contact and parallel to the

The mapping represented bymatrixA(r;s)isan

z -axis.

Ehresmann connection [3], connecting the base velo ci-

Let  2 (=2;=2) b e the steering-angle between

tiesr _ to the ber velo citiess _ . Due to symmetries of the

the front-wheel-plane/ground-plane intersection and

Lagrangian with resp ect to translations and rotations

the contact-line as shown in Figure 2. With  we

in the plane, A(r;s) is a function only of r .

asso ciate a moment of inertia J .For simplicitywe

Let s := sin( )and c := cos ( ): The Lagrangian

will parameterize the steering angle by  := tan(=b).

for the bicycle is

The comp onent of the velo city of the rear-

 

2

wheel/ground contact along the contact line is v .

b_ 1

r

J L = mg pc +

2 2

2 1+b 

 

The velo city of the rear contact p erp endicular to this

1

2 2 2

_ _

(v + ps +  ) +(v p _ c + c ) +(p s_ )

line and in the ground plane is v . The angle of the

r ?

?

2

contact-line with resp ect to the x-axis of the ground-

(2)

xed inertial frame is  .

where m is the mass of the bicycle, considered for

Note that the generalized co ordinate corresp onding simplicitytobea point mass, and J is the moment

to v is the the integral in time of the rear-wheel ve- of inertia asso ciated with the steering action.

r 2

 .Thevariable  is thus decoupled. For convenience Incorp orating the constraints into the Lagrangian

later wewillcho ose _ as a control and call it w .The we obtain the constrainedLagrangian for the bicycle



equations of motion then take on the simpler form

2 2

b J _

L = (g mpc )+

2 2 2 c

2(1+b  )

1

2 2 2 2 2

_ = w



+m((v + p s v ) + p s _ + (c v pc _ ) )

r r r

   

2

 u

(3)

r

~ ~ ~

M = F + B (7)

v_ w

Of course the equations of motion for the constrained

r 

Lagrangian are not Lagrange's equations. The correct

where

formulation of the equations of motion based up on the

 

2

constrained Lagrangian are derived in [3] and shown

p cpc 

~

M = (8)

2 2 2 2

to b e equivalent to d'Alemb ert's equations for con-

cpc  1+ (c + p s ) +2p s

 

strained systems. They are

2

gps +(1+ p s )pc v

r

~

F =

2

(1 + p s )2pc v _ cp s _

@L @L @L d @L

r

c c c

a b

 

+ A = B r_ (4)

b

cpc v 0

dt @ r_ @r @s @ s_

r

~

B = (9)

2

(c  + ps (1 + p s ))v 1=m

r

b

where B denote the co ordinates of the curvature of

the connection A(r;s),

~

Note that the rst column of B has v as a factor

r

!

con rming the intuitive notion that if v = 0 then the

r

b b

b b

@A @A

@A @A

b a a

steering action can have no a ect on either or v .

r

B = (5) + A A

a a

@r @r @s @s

Also, as v gets closer and closer to zero the steer-

r

ing velo city w must get larger and larger in order to



The reduced equations of motion from L are of the

c

maintain in uence over and v . It is practical then

r

form

to cho ose controls suchthatv >v > 0.

r min

M r = F + Bu (6)

T 33 3 32

4 Roll-Angle Tracking

wherer _ =[_ ; v ; _ ] ;M 2 R ;F 2 R ;B 2 R ;

r

T

and u =[0;u ;u ] : The comp onents of M; F; and B

r 

Let (t)andv (t) b e desired tra jectories for (t)

d rd

are

and v (t) that remain within the domain of de nition

r

2

M = p ; M = M = cpc 

11 12 21

of our mo del. Consider the control

     

M = M = M = M =0

13 31 23 32

V u

r

1

~ ~ ~

M F (10) = B

2 2 2 2 2

M =1+c  +2p s + p  s

V w

22

 

2 2 2 2

M =(b J )=(m(1 + b  ) )

33

where

1 2

V =  K (_ _ ) K ( ) (11)

d 1 d 0 d F = gps +(1+ p s )pc v

r

V = v_ K (v v ) (12)

r r r 0 r rd +cpc v _

r

2 2

F = (1 + p s )2pc v _ cp s _

2

r

and the p olynomials s + K s + K and s + K

1 0 r 0

2

(c  + ps (1 + p s ))v _

r

have ro ots with real parts less than zero. Substitut-

3 4 2 2 2 3

~

ing (10) into (7) and noting that M is nonsingular,

F = (2b J_ )=(m(1 + b  ) )

it is apparent that by virtue of our choice of input,

and v are made to exp onentially converge to their

r

B = B = B = B =0; B = B =1=m

11 12 22 31 21 32

desired counterparts and v . The graphs of Fig-

d rd

ures 3 through 5 show an example, from simulation, of

Wemay further reduce our mo del through a prac-

how these controls cause the bicycle to recover from a

tical control consideration. We will assume that we

near fall and track a constant roll-angle tra jectory and

have adequate steering torque and a suciently small

aconstant v . The resulting circular path is shown

rd

value of the steering inertia J so that wemaymake 

in Figure 5.

trackany smo oth tra jectory  (t) that we wish. Conse-

quently we will ignore transientbehavior of the  and

5 Controlling the Kinematic Bicycle

assume that the steering variable will exactly track

By controlling the roll-angle and rear wheel velo c- any signal  that we wish. This allows us to rede-

d

ne our controls to b e u and any time derivativeof

itywehave not stabilized motion in the ground plane.

r 3

Path in Plane

where, as part of the mo del de nition, wemaintain

6 cle

the restriction v >v > 0. min

5 r

ed ab ove the ground plane motion of the

4 As deriv

bicycle is governed by_x = v c andy _ = v s . Di er-

 r 

3 r

entiating with resp ect to time gives

2

      

1 2

x c v s v_ v_

  r

y [m] r

r

= =: G (13) xy

0 2

y s v c  

  r

-1

_

where wehave used the fact that  = v  . Since we

-2 r

have already shown howwecanmake v and  be

-3 r

what wewantthemtobewe could use (13) to control -4

-6 -4 -2 0 2 4

x and y along x and y as long as v >v .Let

d r min

x [m] d

V =x K (_x x_ ) K (x x )andV =

x d xy 1 d xy 0 d y

y K (_y y_ ) K (y y ). Settingx  = V and

Figure 3: Resulting path in the ground plane for track-

d xy 1 d xy 0 d x

y = V in (13), solving forv _ and  , and calling the

ing a constant roll angle.

y r

results v and  gives d

2 rd

   

1 

c s

v_ V

  rd 0 x

phi [rad]

= (14)

s c

 

 V

2 2 d

-1 y v v r 0 2 4 6 8 10 12 14 16 18 20 r

t [s]

Thus ifv _ =_v and  =  , then x and y converge

rd d

5 r

1

x and y (assuming v >v ) .

4 to

d d r min

3 v_r [m/s]

2

0 2 4 6 8 10 12 14 16 18 20

6 Path Tracking with Balance t [s]

1

Having determined desired values of v_ and 

r

h, in the absence of roll-dynamics, would cause 0 whic

alpha [rad]

the bike to track(x ;y ), wenow seek a b ounded tra- d -1 d

0 2 4 6 8 10 12 14 16 18 20

compatible withv _ and  (14). We

t [s] jectory for rd d

know from Section 4 that we can make tracka

Figure 4: The steering angle  (top), rear-wheel velo c-

smo oth tra jectory and weknow from Section 5 that

ity v (middle), and roll angle (b ottom) for tracking

if we ignore the roll angle, we can make the bicycle

r

of a constant roll angle.

follow tra jectories in the plane. However,ifweignore

roll angle in controlling the tra jectory of the bicycle in

If a disturbance were to p erturb the bicycle from the

the plane, the bicycle will fall. Our approach will b e

desired roll tra jectory,itwould quickly recover, but

to determine a roll angle tra jectory that will b e com-

its ground path would no longer b e the same circle

patible with the error dynamics of the ground plane

as b efore. In this section we will take x and y as our

tracking. We will control to track that angle.

outputs and cause those outputs to track desired coun-

Weintend to control on a much faster time scale

terparts x and y .We will, for the moment, ignore

d d

than weintend to control the x; y p osition. This allows

roll and mass, pretending that the bicycle cannot fall

us to consider  andv _ to b e approximately xed

d rd

over. We call the resulting mo del the kinematic bicy-

in the time scale. We will control to an \equilib-

rium" compatible with  andv _ . This \equilibrium"

d rd

is time-varying, dep ending on the desired path in the

plane, as well as the error dynamics asso ciated with

following that path. Let w denote the value of w

d 

that holds  at  . Recall that _ = w . The \equilib-

d 

rium" equation for is

0 = gs + c v + pc s v + cc  v_ + cc v w

r r rd r d

= F ( ; ;v ; v_ ;w ) (15)

r rd d

Figure 5: Simulation 1. The rst 7 seconds of the

1

It is a simple matter to mo dify the control for the kinematic

ride showing the bicycle's con guration in 0.5 second

bike in order to enforce the minimum sp eed requirement. For

increments starting from t =0.

simplicity of exp osition, however, we do not do this here. 4

Ground Path

e will call the solution .We will showhow

and w 6



to obtain a running estimate for below. For now 

5

^

assume that wehave such an estimate. De ne F :=

T

^

G [_v ; ] . Then F is the vector eld corresp ond-

rd d

xy 4

ing to the desired motion of x and y . The angle is 

3

a function of the variables x, y , x , y and their time

d d

y

derivatives through the dep endence of  andv _ on rd

d 2

2

those variables. Thus the Lie derivative of in the 

2 1

^

direction of F , L is well de ned as is L .When

^  

^

F

F

is close to and (x; y )isapproximately tracking

 0

2

(x ;y ) then L and L are close to _ and 

d d ^    

^ F F −1

0 10 20 30 40 50 60 70 80 90 100

resp ectively.

x

Wenowcho ose an input w that causes to track



.Itis



Figure 6: The ground path of the controlled bicy-

pV

cle showing convergence to the target tra jectory x =

d

w = (16)



10t[m], y = 0. The scale is in meters.

gs + c v + pc s v + cc  v_

d

r r r

where 0.1

2 2

= L K (_ L ) K ( ) (17)

V 0

 1  0 

^ ^

F F

phi [rad]

ybeveri ed by substituting w into the re-

This ma −0.1  0 2 4 6 8 10 12 14 16 18 20 t

6

duced equations of motion for . For initial values

of and _ suciently close to and L ,and

 ^ 

F 4

vr [m/s]

for a choice of K and K with the real parts of

1 0

2 2

the ro ots of s + K s + K suciently negative,

1 0

0 2 4 6 8 10 12 14 16 18 20 t

0.1

( ; x; y ) converges to an arbitrarily small neighbor-

ho o d of ( ;x ;y )exponentially.

 d d 0

alpha [rad]

Wenow need only construct an approximation of

0 2 4 6 8 10 12 14 16 18 20

.We will construct a dynamical system whose state

 t

is the estimator ^ ,

_

Figure 7: The steering angle (top), rear-wheel velo city

^ = F (^ ;;v ; v_ ;w )+ L (18)

r rd d ^ 

F

=^

v (middle), and roll angle (b ottom) for the lane-

r

where  is suciently large to consider all arguments

change. The dotted curveis .



^

of F other than ^ approximately xed. This provides

^

our fastest time scale. Since @ F=@ ^ is p ositivein

Figures 6 and 7 show the results of a typical lane-

the neighb orho o d of we are guaranteed that ^ con-



change maneuver, where x =5t m;y = 0. The ini-

d d

verges to a small neighborhood of exp onentially at



tial conditions of the bicycle were set to b e x(0)=0,

a rate determined by . The generalization of this

y (0) = 5[m],x _ (0) = 2:5[m=s],y _ (0) = 0,  (0) = 0,

\dynamic inversion" of F is presented in Getz and

 (0) = 0, (0) = 0. The bicycle parameters were

Marsden [5].

m = 30[kg], c =1=2[m], p =1[m],b = 1[m], and

Cho osing w according to (16), along with choices



g =9:8[m=s].

of control constants as sp eci ed ab ove results in sta-

Figure 6 shows the resulting path in the ground

ble approximate tracking of ground plane tra jectories

plane. Figure 7 shows the steering angle (top), the

while retaining balance. In order to make the con-

rear-wheel velo city v (middle), and the roll angle

r

troller more robust wemaymodifyu slightly to as-

r

(b ottom). The path of the rear-wheel contact maybe

sure ourselves that v remains ab ove v .

r min

seen to rst turn out, then in toward the target. This

ground path motion is the result of countersteering,

7 Simulations

the turning of the front wheel in the direction opp o-

In this section we show the results of simulations

site the direction one wishes to go at the start of a

of the controlled bicycle converging to and following a

turn. Countersteering can b e seen at the far left of

straight path and a sinusoidal path.

the top graph of Figure 7. Note that countersteering

2 n

comes naturally out of the controller, as it must for a

The Lie derivative of a function  : R ! R along a vector

eld F is de ned as L  = d  F . stable turn. Note also how the bicycle rolls in mov-

F 5

Ground Path Discussion and Conslusions

1.5 8

For desired tra jectories with large time derivatives,

1

larger control gains must b e used in order to attain

king. The practicality of the controller must

0.5 go o d trac

b e judged on the realizabilityofsuch gains. Choice

y 0

of desired tra jectory must also takeinto accountthe

limitations of the mo del and the fact that the non-

−0.5

holonomic constraints are only an approximationto teraction.

−1 the actual tire/road in

Control of the bicycle is complicated by the non-

ts on the vehicle as well as the −1.5 holonomic constrain 0 10 20 30 40 50 60 70 80 90 100

x

need to track a path in the plane while maintain-

ing balance. Wehave used the nonholonomic nature

Figure 8: Tracking a sinusoidal path in the plane.

of the bicycle to our advantage in obtaining reduced

Note that x and y are plotted at di erent scales. The

equations of motion. A desired vector eld for the

dotted path is the target tra jectory.

ground-plane tracking dynamics was then derived. Us-

ing this vector eld an equilibrium roll-angle manifold

may b e calculated dynamically in continuous time. In-

0.05 put/output linearization of the dynamics from steer-

0

ing control to roll angle was then used to stabilize the phi [rad]

−0.05 roll angle to the equilibrium manifold resulting in go o d 0 2 4 6 8 10 12 14 16 18 20

t

king b ehavior with go o d balance. 5.5 trac

5 The authors are grateful to C.A. Deso er for his com-

vr [m/s] 4.5 ts and advice. 4 men 0 2 4 6 8 10 12 14 16 18 20 t

0 References

alpha [rad]

[1] R. S. Hand, \Comparisons and stability analysis of −0.1 0 2 4 6 8 10 12 14 16 18 20

t linearized equations of motion for a basic bicycle

mo del," Master's thesis, Cornell, 1988.

Figure 9: Steering angle  (top), rear-wheel velo city

[2] N. H. Getz, \Control of balance for a nonlin-

v (middle), and roll-angle b ottom for tracking a

r

ear nonholonomic non-minimum phase mo del of a

sinusoidal path. The dotted curveis .



bicycle," in American Control Conference, (Bal-

timore), American Automatic Control Council,

June 1994.

ing to the target. The bicycle starts upright, leans

[3] A. Blo ch, P. Krishnaprasad, J. Marsden, and

right rst, then leans left, then straightens again as

R. Murray, \Nonholonomic mechanical systems

the target is aprehended. The rear-wheel velo citycan

with symmetry," Tech. Rep. CDS Technical Re-

b e seen to start from its initial value of 2.5 meters p er

p ort 94-013, California Institute of Technology,

second, move up past the target sp eed of 5 meters p er

Spring 1992.

second, then fall to the target sp eed as the target is

apprehended.

[4]N.H.GetzandJ.K.Hedrick, \An internal equi-

librium manifold metho d of tracking for nonlin-

Figures 8 and 9 show the bicycle tracking a si-

ear nonminimum phase systems," in 1995 Ameri-

nusoidal tra jectory in the ground plane. The ini-

can Control Conference, (Seattle), American Au-

tial conditions for the bicycle in this simulation were

tomatic Control Council, June 1995.

v (0) = 4m=s,  (0) = (0) = _ (0) =  (0) = x(0) =

r

y (0)=0. The target tra jectory was x =5tm=s,

d

[5] N. H. Getz and J. E. Marsden, \Dynamic inver-

y (t) = 2 sin(0:2t). Figure 8 shows the resulting

d

sion of nonlinear maps," Tech. Rep. 621, Center

ground-plane path of b oth the target (dotted) and the

for Pure and Applied Mathematics, Berkeley, Cal-

bicycle (solid). Again, countersteering is evidentinthe

ifornia, Decemb er 19 1994.

top graph of Figure 9. 6