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

Similar documents
Inverted Pendulum. Objectives

Lab 6a: Pole Placement for the Inverted Pendulum

Lab #2: Digital Simulation of Torsional Disk Systems in LabVIEW

Lab 5a: Pole Placement for the Inverted Pendulum

SRV02-Series Rotary Experiment # 1. Position Control. Student Handout

Lab 3: Model based Position Control of a Cart

Computer Aided Control Design

θ + mgl θ = 0 or θ + ω 2 θ = 0 (2) ω 2 = I θ = mgl sinθ (1) + Ml 2 I = I CM mgl Kater s Pendulum The Compound Pendulum

Rotational Kinetic Energy

base 2 4 The EXPONENT tells you how many times to write the base as a factor. Evaluate the following expressions in standard notation.

LAB 3 - VELOCITY AND ACCELERATION

Math Lab 8: Electric Fields Integrating Continuous Charge Distributions II Due noon Thu. Feb. 1 in class

Stabilizing the dual inverted pendulum

Partner s Name: EXPERIMENT MOTION PLOTS & FREE FALL ACCELERATION

MEAM 510 Fall 2011 Bruce D. Kothmann

TORQUE Diandra Leslie-Pelecky Edited by Anne Starace

Simple Harmonic Motion - MBL

Lab 3: Quanser Hardware and Proportional Control

Designing Information Devices and Systems I Fall 2017 Homework 3

Flipping Physics Lecture Notes: Demonstrating Rotational Inertia (or Moment of Inertia)

Laboratory Exercise. Newton s Second Law

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

Laboratory 11 Control Systems Laboratory ECE3557. State Feedback Controller for Position Control of a Flexible Joint

MEAM 510 Fall 2012 Bruce D. Kothmann

Please read this introductory material carefully; it covers topics you might not yet have seen in class.

Name: School: Class: Teacher: Date:

Physics 8 Wednesday, October 19, Troublesome questions for HW4 (5 or more people got 0 or 1 points on them): 1, 14, 15, 16, 17, 18, 19. Yikes!

Engineering Mechanics Prof. U. S. Dixit Department of Mechanical Engineering Indian Institute of Technology, Guwahati Introduction to vibration

THE REACTION WHEEL PENDULUM

Lecture 14 - Using the MATLAB Control System Toolbox and Simulink Friday, February 8, 2013

Control of Electromechanical Systems

1 Newton s 2nd and 3rd Laws

Inverted Pendulum System

SRV02-Series Rotary Experiment # 7. Rotary Inverted Pendulum. Student Handout

Bangladesh University of Engineering and Technology. EEE 402: Control System I Laboratory

Physics 8 Monday, October 9, 2017

Alex s Guide to Word Problems and Linear Equations Following Glencoe Algebra 1

Good Vibes: Introduction to Oscillations

Mechanics Cycle 1 Chapter 12. Chapter 12. Forces Causing Curved Motion

Sec. 1 Simplifying Rational Expressions: +

LAB 2 - ONE DIMENSIONAL MOTION

Purpose of the experiment

Chapter 6. Net or Unbalanced Forces. Copyright 2011 NSTA. All rights reserved. For more information, go to

Dynamics Final Report

Homework #19 (due Friday 5/6)

LAB 3: WORK AND ENERGY

Lab 4. Current, Voltage, and the Circuit Construction Kit

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

PH 120 Project # 2: Pendulum and chaos

Chapter 14: Finding the Equilibrium Solution and Exploring the Nature of the Equilibration Process

Lab 11 Simple Harmonic Motion A study of the kind of motion that results from the force applied to an object by a spring

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

P - f = m a x. Now, if the box is already moving, for the frictional force, we use

Physics E-1ax, Fall 2014 Experiment 3. Experiment 3: Force. 2. Find your center of mass by balancing yourself on two force plates.

Physics 212E Spring 2004 Classical and Modern Physics. Computer Exercise #2

Lecture 12. Upcoming labs: Final Exam on 12/21/2015 (Monday)10:30-12:30

Physics 201 Lab 2 Air Drag Simulation

PHY131H1F Class 5. Clicker Question

Lab 1: Dynamic Simulation Using Simulink and Matlab

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

LAB 4: FORCE AND MOTION

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

Rational Expressions & Equations

Volume vs. Diameter. Teacher Lab Discussion. Overview. Picture, Data Table, and Graph

LAB 3: VELOCITY AND ACCELERATION

EE363 Automatic Control: Midterm Exam (4 problems, 90 minutes)

Linear State Feedback Controller Design

4.4 Energy in multiple dimensions, dot product

Math Lab 10: Differential Equations and Direction Fields Complete before class Wed. Feb. 28; Due noon Thu. Mar. 1 in class

Calculations to predict motion or move objects (done repetitively in a loop)

PHY 101L - Experiments in Mechanics

Motion in Two Dimensions Teacher s Guide

The Physics of Boomerangs By Darren Tan

Lab 5: Rotational Motion II

1.1 Units and unit conversions

Coulomb s Law. 1 Equipment. 2 Introduction

Before this course is over we will see the need to split up a fraction in a couple of ways, one using multiplication and the other using addition.

Physics 8 Monday, October 12, 2015

Lab 5: Rotational motion at the playground Essentials of Physics: PHYS 101

Quadratic Equations Part I

Positioning Servo Design Example

The Spring: Hooke s Law and Oscillations

Linear Motion with Constant Acceleration

The PROMYS Math Circle Problem of the Week #3 February 3, 2017

Lab 7 Energy. What You Need To Know: Physics 225 Lab

Scott Hughes 12 May Massachusetts Institute of Technology Department of Physics Spring 2005

Static and Kinetic Friction

AP Physics Ch 6 Day 4

Multi Rotor Scalability

LABORATORY 4: ROTATIONAL MOTION PLAYGROUND DYNAMICS: THE MERRY-GO-ROUND Written May-June 1993 by Melissa Wafer '95

Chapter 15+ Revisit Oscillations and Simple Harmonic Motion

Gravity Pre-Lab 1. Why do you need an inclined plane to measure the effects due to gravity?

PHY131H1F - Class 9. Today, finishing Chapter 5: Kinetic Friction Static Friction Rolling without slipping (intro) Drag

Rotational Motion. Variable Translational Motion Rotational Motion Position x θ Velocity v dx/dt ω dθ/dt Acceleration a dv/dt α dω/dt

ECEn 483 / ME 431 Case Studies. Randal W. Beard Brigham Young University

Solving Quadratic & Higher Degree Equations

#29: Logarithm review May 16, 2009

FTF Day 1. Feb 2, 2012 HW: Ch 3 Review Q s and Key Terms (Friday) Topic: Newton s 2 nd and 3 rd Laws Questions

Lab 4 Numerical simulation of a crane

farads or 10 µf. The letter indicates the part tolerance (how close should the actual value be to the marking).

Transcription:

University of Utah Electrical & Computer Engineering Department ECE 3510 Lab 9 Inverted Pendulum p1 ECE 3510 Lab 9, Inverted Pendulum M. Bodson, A. Stolp, 4/2/13 rev, 4/9/13 Objectives The objective of this lab is to experiment with the stabilization of an unstable system, the inverted pendulum. First you ll play with an animation in Matlab to get a feel for the challenges of control. If you have a yardstick handy, you can try the real thing in two dimensions. (If you can stabilize something shorter than a yardstick, you ve got faster reflexes than I do.) After you experience the difficulties of manual control, you ll design a linear controller is using root-locus techniques, and make the controller move the inverted pendulum to different positions on the track. Introduction The inverted pendulum system is a favorite experiment in control system labs. Stabilization of this highly unstable plant can be an impressive demonstration of the capabilities of feedback systems. The inverted pendulum is considered a simplified representation of the initial flight of a rocket, when the only force is at the bottom. Once the rocket is moving fast enough its fins can stabilize the flight with no need for a feedback system. A diagram of an inverted pendulum system is shown at right. The base block can move left or right along the horizontal surface to some set limits. It will be controlled either manually by you or automatically by your controller. A vertical column (the inverted pendulum) is attached to the base by a hinge joint. The hinge only allows it to swing left and right, so this is just a onedimensional problem. θ is the angle of the pendulum and should be kept close to zero to keep it from falling over. X is the position of the center of the pendulum. The inverted pendulum can challenge you in several ways. The first challenge is to simply stabilize the pendulum, especially in the presence of disturbances. The second challenge is to also keep it at some position x, and the final challenge is to move it from one x position to another. Base motion is limited to the width of the horizontal surface. If your task requires a base motion beyond the limit, it may be impossible to achieve the

task or even to recover stability. The first step to analyzing this system is to understand the forces on the pendulum affect the angle, θ. Refer to the free-body diagram of the pendulum at right. The vertical forces are the weight of the pendulum (mg) acting at the center-of-gravity (Cg), and the balancing upward force at the base. As long as the angle, θ is small, the vertical acceleration of the pendulum will also be small and these two forces can both be considered mg. (m is the mass of the pendulum and g is the acceleration of gravity.) The distance between the hinge pin and the center-ofgravity is L cg, so the torque due to gravity is T mglcgsin( θ) g The horizontal forces are a little more complex. A purely horizontal (x-direction) acceleration, a, of the pendulum will be resisted by its mass with a force of ma acting at its center-of-gravity. This ma also creates a moment about the hinge pin. The force at the base has to be both the balance of the moment couple (ma) as well as provide the force for the horizontal acceleration, ma, ie it s 2ma. The torque, however is simple T malcgcos( θ) a The moment of inertia of a slender, uniform rod of length L, about one end is J 1 3 ml 2 4 3 ml 2 cg Angular acceleration, α, is related to torque in the same way that linear acceleration is related to force, X(s) p2 ECE 3510 Lab 9, Inverted Pendulum T Ja Using the 4 equations above and small-angle approximations (needed for lineariz ation), Derive the following transfer function of the pendulum in your notebook: s 2 4 3 L s 2 cg g This system has two zeros at the origin and poles at s 2 2 3 Ls 2 g s ± 2L. Obviously, the pole in the right-half plane is the source of this systems instability and the instability worsens when the pendulum is short (as one might expect). Another tricky problem is that the system has two zeros at s 0. This is due to the fact that an x acceleration is required to impact the pendulum angle. On the other hand, this property makes stabilization possible for arbitrary base positions. A more complex model would assume that the control variable is the force applied to the

base, rather than the x position. This assumption is more realistic in many cases, but makes manual control very difficult. Instead, the simulation program of this lab will represent the dynamics of the base control system as a simple first-order system. P(s) X(s) 3f 2L s2 (s + f)(s + 2L )(s f s + f where x com is the commanded base position, x is the base position, and f > 0. The overall transfer function of the system is then or f s 2 (s + f) ( 2 3 Ls2 g) 2L ) bs 2 (s + f)(s + a)(s a) where, 3f a and b 2L 2L Manual control Download invpend_xxx.zip from the class web site for the required files. Create (if you need to) a Matlab workspace folder and unzip the files into your work space. The simulation program resides in invpend.m. The program will ask you for the length (L) of the pendulum and then limit x to ±2L. The pendulum angle is prevented from exceeding ±30E. The value of f is 5, so that the base responds relatively quickly to commands. However, even with such rapid position control of the base the system is difficult to control with the mouse for short length pendulums. Make the pendulum longer for easier control. The program will also ask allow you to choose automatic control, but it won t work yet because you haven t modified the invpeninit.m file. Have fun trying to keep the pendulum balanced. If you feel comfortable with it, try to move the base from the left line to the right line, while keeping the pendulum balanced. Describe in words the challenges of the control problem and your strategies for control. How short can you let the pendulum be and still keep it stabile indefinitely? How short can you let the pendulum be and still be able to move it to one of the lines on the horizontal surface and the to the other? Automatic control Stabilizing controller First, make a root-locus plot of the transfer function (P(s)) above as though it is in a unityfeedback loop with no controller (C(s)). Use g 9.81, L 2, and f 5. Is there any way to stabilize this system without a controller (additional poles and/or zeros)? Realizing that you cannot effectively cancel a pole with a zero in the right-half plane (RHP), is there any p3 ECE 3510 Lab 9, Inverted Pendulum

way to stabilize this system without that controller having at least one pole in the RHP? Justify your answer with an explanation in your notebook. You should have reached a very interesting conclusion in the previous paragraph. Although you have seen many root-locus plots in class where an inherently unstable system can be stabilized simply by placing it in a feedback loop and adjusting the gain, this may be the first time you have encountered a unstable system which can only be stabilized by a controller which is also unstable. Think of it this way. If you wished to stabilize the pendulum at any angle other than 0E, the base would have to endlessly accelerate in the direction of the angle. If that ain t unstable, what is? Alternatively, if you wanted to move the pendulum from one x-position to another, you have to start by moving the base in the opposite direction. Now you know why it was called Rocket Science and why so many early rockets had such short flights. By-the-way, bottle rockets avoid this problem by placing the trust above the center of gravity and model rockets avoid it by using a guide rod for the first few feet, after which the rocket is moving fast enough that the aerodynamic effects of the fins keep it stable. One of the reasons that learning to ride a bike can be difficult for children is that they are dealing with a very similar problem. In order to turn left, they must first steer right! You do too, you just don t realize it anymore. Enter the plant transfer function in Matlab and fire-up the SISOtool. Verify your rootlocus plot. Use the following compensator, leaving only c and k as unknowns that you need to find. (s + a)(s + f) C(s) k (s a)(s + c) You will design this controller to bring the pendulum angle to zero at the zero track location. Note that, with the cancellations, the closed-loop system has three poles. The controller has two parameters k and c to be adjusted. Document the following work in your notebook. First play with the value of c. Plot one case where c > a/2, showing that it cannot be stabilized. Decide on value of c that allows you to place the closed-loop poles in desirable positions. Find the gain necessary gain factor, k. Modify the invpeninit.m file to implement your controller. Look at the comments near the top of the file. They will tell you where to enter or calculate the values of a, c, and gc (which is our k). Specify the numerator and denominator of C(s) in numc and denc (yes you will have to determine to coefficients, do so in terms of a, c, f, etc. and enter them that way). Save the file and try the automatic control for a 2 meter pendulum. Most likely nothing will happen. Edit the invpend.m file (around line 20) and find the line that has been commented out which will set the initial angle to 5E. Make the line active. Run the simulation again and watch to see if it recovers. Now back to the math for a minute. Show in your notebook that it is possible to choose the parameters c and k so that all three closed-loop poles are placed at s -a/2. (Hint: assume the denominator of closed-loop transfer function is (s + a/2) 3 and back-calculate what c and k need to be in terms of other known parameters like g, a, f, etc..) Compute the parameters required for the system and plot the root-locus in SISOtool. What will p4 ECE 3510 Lab 9, Inverted Pendulum

happen if the gain is increased or decreased significantly? Determine the minimum gain for the system to be BIBO stable. Modify the invpeninit.m file to implement your controller, only now make sure that you enter a, c, and gc (which is our k) in terms of other known parameters like g, a, f, etc.. This will allow the automatic control to work for different of pendulum lengths. Save the file and try the automatic control for a different size pendulums. For a 2-meter pendulum, plot the responses of the pendulum angle and of the base position resulting from the initial 5E error. Check that the pendulum angle returns to zero within the expected time period and with the expected dynamics, given the pole locations. Tracking controller Modify the controller so that an arbitrary set-point of the base position can be imposed. Replace X com (s) -C(s) by X com (s) X ref (s) -C(s). You will find the appropriate lines and commented lines in invpendc.m Note that this is an unusual configuration for a feedback system, because the reference command is applied to the plant input rather than the controller input. Interestingly, the plant output cannot be set to an arbitrary position in this problem, but the plant input can. Generate steps of position reference alternating between +L/2 and -L/2 every 20 seconds (again, look for the appropriate lines and commented lines in invpendc.m). Save the invpendc.m file. Comment out the initial 5E angle in the invpend.m file and run the automatic control for a 2-meter pendulum. Let it run for a few cycles to accumulate enough data. Plot the responses of x, xcom, and θ for 60 seconds (you may find invpendplot.m handy). You should observe an overshoot in the response of the base. You should also observe that x com initially moves (after a very small blip) in the direction opposite to the step applied. Explain why it has to do that. Repeat your plots for a 6-meter pendulum. Checkoff and conclusions Show your code and demonstrate the real-time operation to the TA (any pendulum length, your choice). Your conclusion should include some description of challenges and strategies for manual control and a qualitative description of how the automatic controller achieves this. Compare the automatic control to the manual. Include other observations and comments. p5 ECE 3510 Lab 9, Inverted Pendulum