Stabilizing the dual inverted pendulum

Similar documents
Classical Dual-Inverted-Pendulum Control

Inverted Pendulum. Objectives

6.302 Feedback Systems

Topic # Feedback Control Systems

Control Systems I. Lecture 9: The Nyquist condition

6.302 Feedback Systems Recitation 16: Compensation Prof. Joel L. Dawson

Lab 6d: Self-Erecting Inverted Pendulum (SEIP)

Control Systems I. Lecture 9: The Nyquist condition

Linear Control Systems Lecture #3 - Frequency Domain Analysis. Guillaume Drion Academic year

Recitation 11: Time delays

Classify a transfer function to see which order or ramp it can follow and with which expected error.

A Light Weight Rotary Double Pendulum: Maximizing the Domain of Attraction

Systems Analysis and Control

Compensator Design to Improve Transient Performance Using Root Locus

r + - FINAL June 12, 2012 MAE 143B Linear Control Prof. M. Krstic

SWINGING UP A PENDULUM BY ENERGY CONTROL

Systems Analysis and Control

AMME3500: System Dynamics & Control

(b) A unity feedback system is characterized by the transfer function. Design a suitable compensator to meet the following specifications:

Lecture 17 Date:

Topic # Feedback Control

Control Systems I Lecture 10: System Specifications

D G 2 H + + D 2

16.30/31, Fall 2010 Recitation # 2

CDS 101/110a: Lecture 8-1 Frequency Domain Design

University of Utah Electrical & Computer Engineering Department ECE 3510 Lab 9 Inverted Pendulum

MAE143a: Signals & Systems (& Control) Final Exam (2011) solutions

FEEDBACK CONTROL SYSTEMS

Digital Pendulum Control Experiments

6.302 Feedback Systems Recitation 17: Black s Formula Revisited, and Lead Compensation Prof. Joel L. Dawson

The loop shaping paradigm. Lecture 7. Loop analysis of feedback systems (2) Essential specifications (2)

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

FUZZY LOGIC CONTROL Vs. CONVENTIONAL PID CONTROL OF AN INVERTED PENDULUM ROBOT

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

R a) Compare open loop and closed loop control systems. b) Clearly bring out, from basics, Force-current and Force-Voltage analogies.

IC6501 CONTROL SYSTEMS

Homework 7 - Solutions

Table of Laplacetransform

(Continued on next page)

FEL3210 Multivariable Feedback Control

Control Systems I. Lecture 2: Modeling. Suggested Readings: Åström & Murray Ch. 2-3, Guzzella Ch Emilio Frazzoli

CONTROL SYSTEMS ENGINEERING Sixth Edition International Student Version

Unit 11 - Week 7: Quantitative feedback theory (Part 1/2)

ECE 486 Control Systems

Chapter 10 Feedback. PART C: Stability and Compensation

Chapter 9 Robust Stability in SISO Systems 9. Introduction There are many reasons to use feedback control. As we have seen earlier, with the help of a

Analysis of SISO Control Loops

Introduction to Feedback Control

MEM 355 Performance Enhancement of Dynamical Systems

Frequency Response Techniques

Robust Performance Example #1

H(s) = s. a 2. H eq (z) = z z. G(s) a 2. G(s) A B. s 2 s(s + a) 2 s(s a) G(s) 1 a 1 a. } = (z s 1)( z. e ) ) (z. (z 1)(z e at )(z e at )

Intro to Frequency Domain Design

MEM 355 Performance Enhancement of Dynamical Systems

Lab 6a: Pole Placement for the Inverted Pendulum

Appendix A: Exercise Problems on Classical Feedback Control Theory (Chaps. 1 and 2)

DESIGN USING TRANSFORMATION TECHNIQUE CLASSICAL METHOD

Course Outline. Closed Loop Stability. Stability. Amme 3500 : System Dynamics & Control. Nyquist Stability. Dr. Dunant Halim

Frequency methods for the analysis of feedback systems. Lecture 6. Loop analysis of feedback systems. Nyquist approach to study stability

Control of Electromechanical Systems

FUZZY SWING-UP AND STABILIZATION OF REAL INVERTED PENDULUM USING SINGLE RULEBASE

6.302 Feedback Systems Recitation 27: Final Recitation and Review Prof. Joel L. Dawson

Control Systems I. Lecture 2: Modeling and Linearization. Suggested Readings: Åström & Murray Ch Jacopo Tani

Chapter 2. Classical Control System Design. Dutch Institute of Systems and Control

EE 3CL4: Introduction to Control Systems Lab 4: Lead Compensation

Outline. Classical Control. Lecture 2

OSCILLATIONS ABOUT EQUILIBRIUM

The dynamics of a Mobile Inverted Pendulum (MIP)

Exercise 1 (A Non-minimum Phase System)

Implementation Issues for the Virtual Spring

Positioning Servo Design Example

Lecture 11 - Advanced Rotational Dynamics

LMI Methods in Optimal and Robust Control

6.302 Feedback Systems Recitation 6: Steady-State Errors Prof. Joel L. Dawson S -

x(t) = x(t h), x(t) 2 R ), where is the time delay, the transfer function for such a e s Figure 1: Simple Time Delay Block Diagram e i! =1 \e i!t =!

Automatic Control (TSRT15): Lecture 7

CHAPTER 7 : BODE PLOTS AND GAIN ADJUSTMENTS COMPENSATION

2.010 Fall 2000 Solution of Homework Assignment 1

1 x(k +1)=(Φ LH) x(k) = T 1 x 2 (k) x1 (0) 1 T x 2(0) T x 1 (0) x 2 (0) x(1) = x(2) = x(3) =

Lab 5a: Pole Placement for the Inverted Pendulum

Stability of Feedback Control Systems: Absolute and Relative

CONTROL * ~ SYSTEMS ENGINEERING

Mechatronics Engineering. Li Wen

Transient response via gain adjustment. Consider a unity feedback system, where G(s) = 2. The closed loop transfer function is. s 2 + 2ζωs + ω 2 n

Spontaneous Speed Reversals in Stepper Motors

The Pendulum Plain and Puzzling

ECE-320: Linear Control Systems Homework 8. 1) For one of the rectilinear systems in lab, I found the following state variable representations:

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Mechanical Engineering Dynamics and Control II Fall 2007

Computer Aided Control Design

Design Methods for Control Systems

Updated 2013 (Mathematica Version) M1.1. Lab M1: The Simple Pendulum

Nonlinear Adaptive Robust Control. Theory and Applications to the Integrated Design of Intelligent and Precision Mechatronic Systems.

CDS 101/110a: Lecture 10-1 Robust Performance

EE C128 / ME C134 Final Exam Fall 2014

Feedback Control of Linear SISO systems. Process Dynamics and Control

Compensation 8. f4 that separate these regions of stability and instability. The characteristic S 0 L U T I 0 N S

MAE143 B - Linear Control - Spring 2017 Final, June 15th

Chapter Eleven. Frequency Domain Design Sensitivity Functions

Digital Control Systems

Lecture 8: Sensorless Synchronous Motor Drives

Transcription:

Stabilizing the dual inverted pendulum Taylor W. Barton Massachusetts Institute of Technology, Cambridge, MA 02139 USA (e-mail: tbarton@mit.edu) Abstract: A classical control approach to stabilizing a dual inverted pendulum system with linear control is presented, along with measured results of the completed system. The emphasis of this work is on both the system s implementation details and its role in a feedback course at the Massachusetts Institute of Technology. The control method includes a variety of techniques that makes this system not only an ideal lecture demonstration but also an excellent source of examples for theoretical discussion. Keywords: stability, feedback, linear control systems, control education, implementation 1. INTRODUCTION The inverted pendulum is a favorite demonstration in feedback courses for good reason: the control of an inherently unstable system is by nature interesting to the control engineer, and the resulting stable system is an exciting visual demonstration of the capabilities of feedback control. This work presents a dual inverted pendulum system that has been constructed for use as a demonstration in the course 6.302 (Feedback Systems) at the Massachusetts Institute of Technology (MIT) in Cambridge, MA USA. The system is used both as a vehicle for teaching various analytic techniques and as an example of the sort of sophisticated control system that can be designed using classical control techniques. A distinction must be made between the dual and the double inverted pendulum systems. The former, presented in this work, is shown in Figure 1. The system plant consists of two independent pendulums constrained to fall in one plane and controlled by the movement of a single cart. In contrast, the double inverted pendulum is a single pendulum assembly with a hinged middle driven either by a cart or as a Furuta pendulum. Although largely ignored in favor of the double inverted pendulum system, the dual inverted pendulum system has been addressed by a small number of authors. It has been theorized that the system can be stabilized using a variety of techniques, including classical control methods by Lundberg and Roberge [2003], nonlinear model predictive control by Alamir and Murilo [2008], and energy control by Åström and Furuta [1996]. These and other papers, however, rely on simulations and largely ignore the practical details of implementation. The dual inverted pendulum system presented in this paper is used as a design example and lecture demonstration in MIT s course 6.302. This course is a graduate level introduction to the design of feedback systems with a focus on linear systems. It is lectured by Prof. J. K. Roberge who is cited in this work for his stabilization of the single inverted pendulum in 1960. Recitations are currently taught by the author, who uses the inverted pendulum system Fig. 1. The dual inverted pendulum system. throughout the course as an example for various analytic techniques. At the end of the course the dual inverted pendulum is presented as a lecture demonstration. With the specific course material, particularly the focus on linear system control in mind, the system described in this paper is stabilized using classical control methods and plant linearization only. The transfer function of the plant is first derived and then linearized about the vertical operating point. For the purposes of this research, the swing-up problem is not addressed. The structure of this paper is as follows. First, the theoretical background is established, including the system equations of motion and a review of the single inverted pendulum system. In Section 3, the theory of the stabilization of the dual inverted pendulum is presented. Important practical considerations are introduced and addressed in Section 4, and the results of the constructed system are given. Finally, the pedagogical implications of this work are discussed. 2. BACKGROUND In this section, theoretical background necessary for understanding the dual inverted pendulum is presented. The equations of motion describing an inverted pendulum on a cart are derived and then applied to the single inverted pendulum system.

slow pendulum (τ ss1)(τ ss 1) fast pendulum (τ f s1)(τ f s 1) Θ s Θ f Fig. 2. Block diagram modeling the dual inverted pendulum plant. 2.1 Equations of Motion As derived by Siebert [1963], a transfer function can be derived that relates the position of the cart to the angle of an inverted pendulum. For a single ideal pendulum consisting of a mass m on the end of a massless rod of length l, the equation of motion relating pendulum angle from vertical θ and cart position x is θ = g l sinθ ẍ cosθ (1) l where g is the gravitational constant. Linearizing this equation with the approximations sin θ θ and cos θ 1 and taking the Laplace transform of the result gives the ideal transfer pendulum function P(s): P(s) = Θ(s) (s) = (τs 1)(τs 1) (2) where the time constant is τ = l/g. The natural frequency of a pendulum is therefore ω = g/l. A second inverted pendulum added to the cart will have a transfer function of the same form, but with a different natural frequency. Both pendulum angles are controlled by the cart position x. Thus, the dual inverted pendulum system can be described by the block diagram in Figure 2. In this paper, the time constant associated with the slow (longer) pendulum will be denoted with τ s and that of the fast (shorter) pendulum with τ f. The linearizing assumption made in deriving this transfer function has two major effects. On one hand it allows the use of linear control, which is advantageous both in simplifying the control approach and in making it accessible as a teaching tool in a feedback course. On the other hand, this assumption limits the range of angles over which the control scheme can function. The practical implications of this limited range are discussed in Section 4. 2.2 Review of Single Inverted Pendulum Control As described in Section 3, the dual inverted pendulum system includes a minor loop identical to the single inverted pendulum system. This single pendulum loop can be controlled using classical control methods as shown by Roberge [1960]. Because it will be incorporated in the dual pendulum system, the control will be briefly discussed here. A block diagram of the system is shown in Figure 3. A motor transfer function relating the cart position (s) to the acceleration command Ẍcmd(s) is assumed here to be (s)/ẍcmd(s) = K m /s 2. This transfer function is ultimately enforced using a motor control loop as described Θ cmd Θ G f (s) Ẍ cmd (τ f s1)(τ f s 1) pendulum motor Fig. 3. Block diagram of single inverted pendulum system (a) Lead zero placed below the pendulum poles in frequency K m s 2 (b) Lead zero placed above the pendulum poles in frequency Fig. 4. Single pendulum loop root locus for two choices of lead compensator in Section 4.2. The angle command input Θ cmd is zero under normal operating conditions, i.e. the pendulum is driven to have zero deviation from vertical. The ideal choice of compensator G f (s) for this system is a lead compensator, i.e. G f (s) = G f0 ατ 1 s 1 τ 1 s 1 (3) where α > 1 and the time constant τ 1 is chosen in conjunction with gain G f0 for best performance. The parameters of G f (s) can be chosen such that the frequency of the compensating zero lies either above or below the natural frequency of the pendulum. Although moving the zero up in frequency allows for a higher loop crossover frequency, the resulting system has complex poles unless the gain G f0 is sufficiently large. This is most easily seen from the root locus plots in Figure 4. In practice there is an upper limit to G f0 due to additional high frequency poles from e.g. the motor control which contribute additional negative phase shift at higher frequencies. If the zero of G f (s) is placed above the natural frequency of the pendulum, therefore, the resulting closed loop system is likely to have peaking in the frequency domain. This peaking must be avoided when the single pendulum is used as a minor loop in the dual inverted pendulum system because any amount of peaking will significantly lower the system s gain margin. Thus the compensator should have a zero placed at or just below the pendulum natural frequency. As the root locus plot in Figure 4(a) shows, for a proper choice of G f0 the closed loop transfer function of this system will have two real axis poles at a frequency above the natural frequency of the pendulum. For a large enough loop gain and crossover frequency, the closed loop transfer function can be approximated as the reciprocal of the feedback path, or

G s (s) Θ f k p G f (s) (τ f s1)(τ f s 1) fast pendulum motor K m s 2 L(jω) 10 1 10 0 φm 90 135 L (degrees) G p (s) Θ s (τ ss1)(τ ss 1) slow pendulum 180 10 1 10 2 10 1 10 0 ωc 10 1 10 2 ω (rps) Fig. 5. Block diagram of complete dual inverted pendulum system. Θ (s) = (τ fs 1)(τ f s 1) s 2 /g 3. DUAL INVERTED PENDULUM CONTROL (4) As discussed in Lundberg and Roberge [2003], the intuitive way to stabilize two pendulums of different lengths is to catch the shorter one first, since it falls more quickly, and to try to do so in a way that brings the taller one closer to vertical. A classical control system is ideal for the dual inverted pendulum, as it directly parallels this intuitive method. The correlation to intuition makes the control system a good example for teaching since students can relate to it easily. The intuitive approach describes a minor loop configuration, where the fast pendulum is driven as a function of the slow pendulum s angle. This configuration is shown in the block diagram in Figure 5. There are in fact four significant control loops in this system. The minor loop shown in Figure 5 consisting of the fast pendulum, compensator G f (s), and the motor transfer function is identical to a single inverted pendulum system. The motor transfer function is represented here by a single block but in fact is another minor loop designed to achieve the desired K m /s 2 transfer function. A major loop consisting of the slow pendulum and the associated compensator G s (s) is constructed around the fast pendulum loop. Additional feedback from the cart position through k p provides position feedback that is necessary to maintain the cart position on the track. Initially, the system can be analyzed without position feedback. In this case, the pendulums will be kept upright but the cart will tend to drift away from the center of the track. In the block diagram in Figure 5, a system without position feedback corresponds to k p = 0 and G p (s) = 1. When the minor loop is designed as in Section 2.2 the loop transmission of the major loop is L(s) = (τ fs 1)(τ f s 1) (τ s s 1)(τ s s 1) G s(s) (5) Between the frequencies ω s = 1/τ s and ω f = 1/τ f, the magnitude drops off as -40dB/decade, but the phase is always equal to 180 degrees. In order to stabilize the system a lead compensator is used, with the pole and zero located at the natural frequency of the fast and slow pendulum, respectively: Fig. 6. The dual inverted pendulum system compensated with a lead network. τ s s 1 G s (s) = G s0 (6) τ f s 1 The gain G s0 is chosen so that the loop crossover frequency occurs at the frequency corresponding to peak phase margin, i.e. at ω c = ω s ω f. The stability of this system is demonstrated with a Bode plot of L(s) as in Figure 6. 3.1 Position Feedback The system described above will keep both pendulums upright, but does not control the position of the cart relative to the center of the track. If there is an offset in the angle measurement, the system will drive the pendulum to a nonzero angle that must be maintained with a constant acceleration. To keep the cart from going off the track, its position is measured and added as a scaled offset to the slow pendulum angle measurement. The effect is to always lean the slow pendulum in towards the center, causing the cart to move in that direction. Note that this technique introduces positive feedback. The system with position feedback can be analyzed by considering the loop consisting of the k p and G s (s) blocks and the single pendulum loop to be a minor loop of the complete system. This minor loop has two open loop poles at s = 0 and open loop zeros at s = ω f and s = ω s. The effect of closing this loop with positive feedback is to move the poles away from the origin of the complex plane and into the left and right half planes. When the slow pendulum transfer function is included and the major loop analyzed, the resulting system is too complex to be easily analyzed using root locus techniques. Instead, a Nyquist plot analysis is preferred. Because the open loop system has two poles in the right half plane, from the slow pendulum and the motor, the system is stable if there are two negative encirclements of the -1 point in the Nyquist plane. In the plots in Figure 7, the convention used is that clockwise encirclements are positive. Figure 7(a) shows a Nyquist plot for the system when G p (s) = 1. The system is unstable as there are no encirclements of the -1 point. For stability, the phase must go more negative than -180 degrees for the curve to cross the negative real axis where the magnitude is unity. One way to achieve this negative phase shift is to use a lag compensator, that is by choosing G p = τ ps 1 (7) ατ p s 1

1 STABLE 1 this net phase shift is equal to the angle labeled φ M in Figure 9. Using the trigonometric law of sines it is possible to write an expression for the maximum achievable phase margin ( ) ωf ω s φ M = arcsin (9) ω f ω s (a) System with position feedback and G p(s) = 1. (b) Compensated with G p(s) as lag network. Fig. 7. Nyquist plots of complete dual inverted pendulum system. L(jω) 10 1 10 0 10 1 10 2 10 3 10 4 10 5 10 3 10 2 10 1 10 0 10 1 10 2 10 3 10 4 ω (rps) 90 135 180 225 270 Fig. 8. Bode plot of complete dual inverted pendulum system. ωf ω s jω φ M ωs (ω s ω f ) ωf (ω f ω s ) θ p ω f ω s Fig. 9. Geometric derivation of maximum phase margin based on an optimal compensation scheme. where α > 1 and with 1/(τ p α) at the frequency where the loop transmission magnitude is unity. The Nyquist plot in Figure 7(b) demonstrates the stability of this system. The corresponding Bode plot is shown in Figure 8. 3.2 Maximum achievable phase margin Following the analysis by Lundberg and Roberge [2003], there is a maximum possible phase margin that can be achieved with the compensation approach described. If the compensating poles and zero are placed ideally, i.e. as in (6), the phase margin is set by the ratio of the natural frequencies of the pendulums. The loop transfer function is L(s) = (τ fs 1)(τ f s 1) (τ s s 1) (τ s s 1)(τ s s 1) (τ f s 1) = τ fs 1 (8) τ s s 1 as plotted in the complex plane in Figure 9. The peak phase shift from this system occurs at the geometric mean of the frequency elements, i.e. at ω c = ω f ω s = 1/(τf τ s ), and is equal to the sum of the positive phase contributed by the zero (θ z ) and the negative phase contributed by the pole (θ p ). By geometric construction θ z σ L (degrees) This equation shows that a larger separation in pendulum lengths corresponds to a larger possible phase margin. This result agrees with the intuition that dual inverted pendulums of equal lengths cannot be made stable. A real-world system will have higher order poles that will contribute negative phase shift at the crossover frequency. It is therefore important when implementing this system to minimize any additional phase shift. 4. IMPLEMENTATION AND RESULTS Once explained, the control of the dual inverted pendulum system is fairly straightforward to understand. This property, along with the complexity of the system, makes the dual inverted pendulum system an excellent example for control education. There are practical considerations, however, that complicate its actual construction. It is the author s opinion that it is important to expose the students to some of the implementation details. Doing so reinforces the idea that the techniques they are learning are meant to be applied to real-world problems rather than existing as purely theoretical exercises. 4.1 Building the Pendulums In a physical system, the measured length l meas of a pendulum will not be related to its natural frequency ω as exactly ω = g/l meas. Instead, it is possible to derive an effective pendulum length from measurements of the period of the pendulum made in a normal (non-inverted) orientation. The effective length l is simply l = g(t/2π) 2 where T is the period of oscillation. It is this measured l that is used in the control system derivations above. As derived in Section 3.2, the maximum achievable phase margin is directly related to the ratio of the effective pendulum lengths. In this work a ratio of 13.3 was used, which corresponds to a maximum possible phase margin of 34.7 degrees. There is a minimum reasonable length for the fast pendulum due to the details of its construction, such as the effects of friction or other nonidealities, which led to an effective length of 0.2m for the fast pendulum. This choice, along with the choice of phase margin, implies that the slow pendulum must be 2.66m long. Clearly this is not a practical length, among other reasons because the very long structure would likely exhibit unwanted resonances. Therefore, for the slow pendulum a counter weighted structure was used instead of the simple pendulum construction sketched in Figure 1. The long pendulum structure is shown in Figure 10. As shown, the pendulum consists of two masses m on the end of relatively massless rods of lengths l 1 and l 2. It rotates about the axis of rotation indicated. If the two masses are assumed to be equal, then the rotational inertia of the pendulum is J = m(l 2 1 l2 2 ) (10)

m θ s l 2 l 1 m axis of rotation Fig. 10. The long pendulum physical structure. Ẍ cmd G a (s) k as 2 τ as1 accelerometer motor plant K s(τ ms1) Fig. 11. Minor loop used to control the motor. This new structure yields the following equation of motion relating cart position to the slow pendulum angle θ s. ( ) l1 m l 2 m θ = m(l 2 1 l2 2 ) (g sin θ ẍcosθ) (11) Comparing this result to to (1), an expression for the effective length of this structure can be written as l s = l2 1 l 2 2 l 1 l 2 (12) That is, a pendulum build as shown in Figure 10 will have the same natural frequency as a simple pendulum of length l s. The result in (12) makes intuitive sense. If the two lengths l 1 and l 2 are made equal then the structure will not behave like a pendulum at all, but will instead have an infinite natural frequency. If l 1 is only slightly greater than l 2, then the pendulum can be made to have an arbitrarily large effective length l s, without requiring the absolute value of either l 1 or l 2 to be large. Note that if l 2 is greater than l 1 the resulting l s is negative. This situation would correspond to a non-inverted pendulum behavior. 4.2 Motor control The stability of the fast pendulum loop described in Section 2.2 relies on a motor transfer function of the form (s)/ẍcmd(s) = K m /s 2. A minor loop controlling the motor must be used to enforce this transfer function. This motor loop is a prime example for teaching students about minor loop control. The desired transfer function is known to be of the form 1/s 2, thus the feedback block transfer function must be chosen to be the reciprocal of this. An element that has the transfer function of the form s 2 is an accelerometer, so an acceleration loop is made by placing an accelerometer on the cart. The loop is shown in Figure 11, and is a direct replacement for the block labeled motor in Figure 5. In practice, the motor loop compensator G a (s) is designed based on measurements of the specific motor used and includes both a lag and lead compensator in order to maximize crossover frequency. A complete discussion of this approach is given by Barton [2008]. For a more general approach, G a (s) can be chosen to be an integrator, making the low-frequency gain of the forward path large enough that the closed loop transfer function is approximated as the reciprocal of the feedback path. As indicated in Figure 11, the accelerometer used has a pole associated with it at frequency 1/τ a. This frequency is above the loop crossover frequency and has little effect on the closed loop behavior. 4.3 Results The dual inverted pendulum system was built and stabilized using the methods described in this work. Interestingly, the major challenges of the work came out of the implementation details of minor loops such as the motor control and single pendulum loops. It is ultimately the success of these systems that determines the stability of the dual inverted pendulum. The dynamic range of the single inverted pendulum control loop directly controls the range of the overall system. The single inverted pendulum minor loop was measured to stabilize the fast pendulum at angles up to six degrees from vertical. Beyond this angle, nonlinearities in the system cause instability. Because of this limited range, the approach of driving the fast pendulum angle to be a function of the slow pendulum angle severely limits the magnitude of disturbance that can be injected in the system. In this case the fast pendulum angle is driven to roughly twice that of the slow pendulum, so that the system only works when the slow pendulum deviates by no more than three degrees from vertical. Clearly this is not an insignificant limitation on the system. The success of the minor loop also determines the system s overall phase margin. The major loop will have a crossover frequency ω c at the geometric mean of the two pendulums natural frequencies; that is, at ω c = ω s ω f. Based on the analysis in Section 3.2 and the length ratio of 13.3 used here, the maximum possible phase margin at ω c is only 34.7 degrees. In order for the system to be stable, then, any additional negative phase shift from the single pendulum minor loop at ω c must be minimized. The closed loop behavior of the single pendulum minor loop was measured using an HP 3562A dynamic analyzer. The choice of ω s and ω f made in the construction of the pendulums sets ω c = 3.67rps = 0.58Hz. Figure 12 shows the measured results near ω c. These measurements, over the range from 500mHz to 5Hz, show some measurement artifacts that are due to a low number of averages and that can be ignored. The phase at 0.58Hz is approximately two major divisions and one minor division above zero; with 80 degrees/division this corresponds to a phase of 176 degrees. That is, the single pendulum loop contributes a negative phase shift of 4 degrees beyond the expected 180 degrees. Based on these measurements, a net system phase margin of 30.7 degrees is expected. When built and tested, the dual inverted pendulum system displayed the type of overshoot to a disturbance expected from a system with such a phase margin. Exact measurements of phase are complicated by a combination of the overshoot and limited

Fig. 12. Dynamic Analyzer measurements of the single pendulum minor loop closed loop behavior near major loop crossover frequency. dynamic range. However, when operated the system is seen to be stable. REFERENCES Mazen Alamir and André Murilo. Swing-up and stabilization of a twin-pendulum under state and control constraints by a fast NMPC scheme. Automatica, Volume 44(Issue 5), May 2008. K. J. Åström and K. Furuta. Swinging up a pendulum by energy control. Presented at IFAC 13th World Congress, 1996. Taylor W. Barton. Stabilizing the dual inverted pendulum: A practical approach. Master s thesis, Massachusetts Institute of Technology, 2008. Kent H. Lundberg and James K. Roberge. Classical dual-inverted-pendulum control. Presented at the IEEE Conference on Decision and Control, 2003. James K. Roberge. The mechanical seal. Bachelor s thesis, Massachusetts Institute of Technology, 1960. William McC. Siebert. Circuits, Signals, and Systems. MIT Press, Cambridge, Massachusetts, 1963. 5. THE PENDULUM IN CONTROL EDUCATION The dual inverted pendulum system provides endless examples for teaching classical control. It incorporates a wide variety of compensation techniques including both series and minor loop types and contains many different subsystems that each correspond to different analytic techniques. The direct relation between intuition and the control scheme makes this an ideal system for an engineering course. In 6.302 recitations, the system is first introduced as an example of system linearization using the methods referred to in Section 2.1 of this work. As the course progresses, analytic techniques including Bode, root locus, and Nyquist plots are introduced. Elements of the dual inverted pendulum can be used as an example for each. For example, the single inverted pendulum system can be analyzed using root locus techniques. With a second pendulum and position feedback added, however, Nyquist plots become the preferred analytic method. As in Section 3 of this work, the system can be used as an example of using Nyquist techniques for compensator design. Phase margin is of course a major topic in 6.302, for which the derivation of maximum possible phase margin as in Section 3.2 provides an interesting example. Furthermore, this derivation directly relates to that of the phase contribution from lead and lag compensators. The system contains example of dominant pole (motor loop), lead (single pendulum minor loop), and lag (position loop) compensators, as well as multiple significant minor loops, notably including the acceleration loop around the motor. Finally, a demonstration of the physical system is given. Because this is the first time the course recitations have been taught with such a strong focus on the inverted pendulum system, there is currently little student feedback on the approach. It is the author s belief that the recurring example of the dual inverted pendulum helps students learn the topics outlined above because the system itself is familiar, students can instead focus on a new analytical tool or compensation approach.