12
26 Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific system, the inverted pendulum. The system consists of a cart that can be pulled foward or backward on a track. Mounted on the cart is an inverted pen- dulum, i.e., a pendulum pivoted at its base and with the weight at the top. Con- sequently, with the cart stationary, the pendulum is unstable; even if balanced in unstable equilibrium, any external disturbance will cause the pendulum to fall. To balance the pendulum, the cart can be moved forward or backward under the weighted rod. Thus, the forces acting on the system are the cart ac- celeration and any external disturbances. In principle, if all of the external disturbances are exactly specified (an unreasonable assumption) and if the system dynamics are precisely understood, then the cart acceleration can be specified in such a way as to maintain the rod in a vertical position. A more reasonable approach to balancing the rod or, equivalently, stabilizing this un- stable system, however, is to constantly measure the angle of the rod and choose the cart acceleration based on this measurement. This then corre- sponds to a feedback system in which the measured angle is fed back through an appropriate choice of feedback dynamics to control the cart acceleration. We carry out an analysis of the open-loop system and explore several possible choices for the feedback dynamics. Under the assumption that the angular displacement of the rod from perpendicular is kept small, the behav- ior of the inverted pendulum can be described through a second-order linear constant-coefficient differential equation, or equivalently through a system function with two real-axis poles, one in the left half of the s-plane and the other in the right half of the s-plane, and therefore associated with the system instability. A first, more or less obvious, choice for the feedback dynamics is to simply choose the cart acceleration proportional to the measured angle. The resulting system function again has two poles, the positions of which are, of course, dependent on the feedback gain. Examination of the locus of these poles as a function of gain (often referred to as the root locus) shows that for the feedback gain negative, the right half-plane pole moves even further into the right half-plane so that the instability becomes even more severe. If the feedback gain is greater than zero, as the gain increases the two poles move 26-1

Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Embed Size (px)

Citation preview

Page 1: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

26Feedback Example:The Inverted Pendulum

In this lecture, we analyze and demonstrate the use of feedback in a specificsystem, the inverted pendulum. The system consists of a cart that can bepulled foward or backward on a track. Mounted on the cart is an inverted pen-dulum, i.e., a pendulum pivoted at its base and with the weight at the top. Con-sequently, with the cart stationary, the pendulum is unstable; even if balancedin unstable equilibrium, any external disturbance will cause the pendulum tofall.

To balance the pendulum, the cart can be moved forward or backwardunder the weighted rod. Thus, the forces acting on the system are the cart ac-celeration and any external disturbances. In principle, if all of the externaldisturbances are exactly specified (an unreasonable assumption) and if thesystem dynamics are precisely understood, then the cart acceleration can bespecified in such a way as to maintain the rod in a vertical position. A morereasonable approach to balancing the rod or, equivalently, stabilizing this un-stable system, however, is to constantly measure the angle of the rod andchoose the cart acceleration based on this measurement. This then corre-sponds to a feedback system in which the measured angle is fed back throughan appropriate choice of feedback dynamics to control the cart acceleration.

We carry out an analysis of the open-loop system and explore severalpossible choices for the feedback dynamics. Under the assumption that theangular displacement of the rod from perpendicular is kept small, the behav-ior of the inverted pendulum can be described through a second-order linearconstant-coefficient differential equation, or equivalently through a systemfunction with two real-axis poles, one in the left half of the s-plane and theother in the right half of the s-plane, and therefore associated with the systeminstability. A first, more or less obvious, choice for the feedback dynamics isto simply choose the cart acceleration proportional to the measured angle.The resulting system function again has two poles, the positions of which are,of course, dependent on the feedback gain. Examination of the locus of thesepoles as a function of gain (often referred to as the root locus) shows that forthe feedback gain negative, the right half-plane pole moves even further intothe right half-plane so that the instability becomes even more severe. If thefeedback gain is greater than zero, as the gain increases the two poles move

26-1

Page 2: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Signals and Systems26-2

toward each other, meeting at the origin and then traveling along the imagi-nary axis. The presence of a pole in the right half-plane indicates that evenwith a very small input (such as a small displacement of the rod), the rod anglewill increase exponentially. With the poles on the imaginary axis, any dis-placement will result in an oscillatory behavior. Consequently, the system re-mains unstable for all values of the feedback gain.

A second type of feedback to consider corresponds to choosing the cartacceleration proportional to the derivative of the angular displacement. Thischoice is motivated by the possibility that perhaps the pendulum can be stabi-lized by accelerating the cart faster if the angular displacement is increasingfaster. Examination of the root locus with derivative feedback demonstratesagain that for the feedback gain less than zero the system becomes increas-ingly unstable while with the feedback gain greater than zero the system be-comes more stable but is never completely stabilized. Finally, we consider acombination of proportional plus derivative feedback, and in this case by ap-propriate choice of the two gain factors the system can be stabilized.

The demonstration accompanying this lecture, besides being entertain-ing, is hopefully very instructive. In addition to showing that the system can infact be stabilized by appropriate choice of feedback, we are able to show thatfeedback is able to compensate for external disturbances and to changes inthe system dynamics.

Suggested ReadingSection 11.3, Root-Locus Analysis of Linear Feedback Systems, pages 700-

704

Page 3: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Feedback Example: The Inverted Pendulum26-3

'NI

N

Lx(t)

Externaldisturbances

x(t) 1 System

a(t) p dynamics

TRANSPARENCY26.1The invertedpendulum and arepresentation of theopen-loop system.

DEMONSTRATION26.1A simple invertedpendulum.

Page 4: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Signals and Systems

26-4

TRANSPARENCY26.2The invertedpendulum with afeedback loop fromthe pendulum angle tothe cart acceleration.

TRANSPARENCY26.3Equations describingthe dynamics of theinverted pendulum.

L I

s(t)

d2 6(t)L d 2 =g sin [6(t)]

a(t)

+ Lx(t) - a(t) cos 0(t)

sin [0(t)] 0(t)

cos [O(t)] 1

Externaldisturbances

Page 5: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Feedback Example: The Inverted Pendulum26-5

d2 6(tL t - g 0(t) = Lx(t) - a(t)dt 2

0(s) = 2 [LX(s) - A(s)]Ls2

- g

Im

s-plane

X X Re

TRANSPARENCY26.4Linearized dynamicequation when 0(t) issmall and thecorresponding Laplacetransform and pole-zero pattern.

DEMONSTRATION26.2The cart and invertedpendulum representedby Transparency 26.2.

Page 6: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Signals and Systems26-6

TRANSPARENCY26.5Block diagram andsystem function forthe open-loop system.

O(s) = H(s) [LX(s) - A(s)]

H(s) =

x(t)

1Ls2 - g

L +

a (t)

TRANSPARENCY26.6System function andblock diagram withfeedback.

(s)= H(s) [LX(s) - A(s)]

H (s) =Ls2 _ g

x(t)L +

a t)

LH(s)O(s) = + (s) X (s)

1 + G (s) H (s)

0(t)

0(t)

Page 7: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Feedback Example: The Inverted Pendulum26-7

(s) = LH(s)1 + G(s) H(s)

X(s)

Ls2 g

Proportional Feedback:

a(t) = K10(t)

G(s) = K3

1((s) =)

2 _ (g - K,3

Poles at s =

Proportional Feedback:

X(s)

g -K3+ E-K 11L:7

O(s) = 1 X(S)

S2 _ LK1

Im

s-plane

K1 <0

4 XRe

-vg /L + \/gji -

TRANSPARENCY26.7System function withproportional feedback.

TRANSPARENCY26.8Locus of systemfunction poles forproportional feedbackwith ki < 0.

Page 8: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Signals and Systems

26-8

Proportional Feedback:

TRANSPARENCY26.9Locus of systemfunction poles forproportional feedbackwith ki > 0.

TRANSPARENCY26.10Overall systemfunction withderivative feedback.

(s)= 1 X(s)

s2 _

Im

s-plane

K 1 > 0

A 0 A 4( XRe

-v I +v'97i

L H(s)0(s) = H(s) X(s)

1 + G(s) H (s)

H (s) = s1_Ls2 _ g

Derivative feedback:

a(t) = K2 dO(t)dt

G(s) = K2 s

8()= 1s2 + s(K 2/L) - g/L

Poles at

K2

X(s)

(K)2(

Page 9: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Feedback Example: The Inverted Pendulum26-9

Derivative feedback:

0(s) = X(s)S2 + s(K 2 /L) - g/L

22

K2 + 2 (.\

2L - \ 2Li \L/

s-plane

K2<0

Re

Derivative feedback:

0(s) = 1X(s)S 2 + s(K 2 /L) - g/L

K2 ( 29 \s -- +(L + \/

K2>0 s-plane

Re

-/vL+ /g-/

TRANSPARENCY26.11Locus of systemfunction poles forderivative feedbackwith k2 < 0-

TRANSPARENCY26.12Locus of systemfunction poles forproportional feedbackwith k2 > 0.

X---O--

- 1/9 -/L

Page 10: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Signals and Systems

26-10

TRANSPARENCY26.13Overall systemfunction withproportional plusderivative feedback.

Proportional plus derivativefeedback:

a(t) = K1 0(t) + K2 dO (t)dt

G(s) = K1 + K2 s

H(s) =s2 + s (K2 /L) - g/L + K1 /L

Poles at

-K 2s 2L

(K2 2 Kj -9V 2L L

TRANSPARENCY26.14Locus of systemfunction poles forproportional plusderivative feedbackwith k2 > 0 and ki > 0.

Proportional plus derivativefeedback:

H(s) =s2 + s (K2 /L) - g/L + K, /L

-K2 K 2 2 K -g

= 2L V(\ )/~

s-plane

K2>0K1 >0

Re

Page 11: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

Feedback Example: The Inverted Pendulum26-11

Page 12: Lecture 26: Feedback example: the inverted pendulum · Feedback Example: The Inverted Pendulum In this lecture, we analyze and demonstrate the use of feedback in a specific ... 4

MIT OpenCourseWare http://ocw.mit.edu

Resource: Signals and Systems Professor Alan V. Oppenheim

The following may not correspond to a particular course on MIT OpenCourseWare, but has been provided by the author as an individual learning resource.

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.