Lab 5a: Pole Placement for the Inverted Pendulum

Similar documents
Lab 6a: Pole Placement for the Inverted Pendulum

Lab 3: Quanser Hardware and Proportional Control

Lab 3: Model based Position Control of a Cart

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

State Feedback Controller for Position Control of a Flexible Link

Quanser NI-ELVIS Trainer (QNET) Series: QNET Experiment #02: DC Motor Position Control. DC Motor Control Trainer (DCMCT) Student Manual

Rotary Motion Servo Plant: SRV02. Rotary Experiment #01: Modeling. SRV02 Modeling using QuaRC. Student Manual

The control of a gantry

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

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

Rotary Motion Servo Plant: SRV02. Rotary Experiment #11: 1-DOF Torsion. 1-DOF Torsion Position Control using QuaRC. Student Manual

Inverted Pendulum. Objectives

Lab 1: Dynamic Simulation Using Simulink and Matlab

The Control of an Inverted Pendulum

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

Real-Time Implementation of a LQR-Based Controller for the Stabilization of a Double Inverted Pendulum

Laboratory handout 5 Mode shapes and resonance

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

Controlling the Inverted Pendulum

Inverted Pendulum: State-Space Methods for Controller Design

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

Positioning Servo Design Example

The Control of an Inverted Pendulum

Rotary Flexible Joint

System Parameters and Frequency Response MAE 433 Spring 2012 Lab 2

MECH 3140 Final Project

EE 476 DC Motor Control Lab

Earth s Magnetic Field Adapted by MMWaite from Measurement of Earth's Magnetic Field [Horizontal Component] by Dr. Harold Skelton

Linear Experiment #11: LQR Control. Linear Flexible Joint Cart Plus Single Inverted Pendulum (LFJC+SIP) Student Handout

Linear Motion Servo Plant: IP02. Linear Experiment #4: Pole Placement. Single Pendulum Gantry (SPG) Student Handout

DC Motor Position: System Modeling

Mechatronics Engineering. Li Wen

Department of Electrical and Computer Engineering. EE461: Digital Control - Lab Manual

Feedback Control Systems

Double Inverted Pendulum (DBIP)

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

MEM04: Rotary Inverted Pendulum

1. [30] Y&F a) Assuming a small angle displacement θ max < 0.1 rad, the period is very nearly

FEEDBACK CONTROL SYSTEMS

EE 474 Lab Part 2: Open-Loop and Closed-Loop Control (Velocity Servo)

IfA Fachpraktikum - Experiment 3.7A : Flexible Shaft A

3 Lab 3: DC Motor Transfer Function Estimation by Explicit Measurement

State Feedback MAE 433 Spring 2012 Lab 7

ACKNOWLEDGEMENTS Quanser Inc., All rights reserved.

Lab 4 Numerical simulation of a crane

Rotary Inverted Pendulum

Flexible Pendulum (FLEXPEN)

Laboratory handouts, ME 340

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

THE REACTION WHEEL PENDULUM

Computer Aided Control Design

Manufacturing Equipment Control

Integrator Windup

2.004 Dynamics and Control II Spring 2008

In the presence of viscous damping, a more generalized form of the Lagrange s equation of motion can be written as

PARAMETER IDENTIFICATION, MODELING, AND SIMULATION OF A CART AND PENDULUM

Simple Harmonic Motion - MBL

Lab 1g: Horizontally Forced Pendulum & Chaotic Motion

ME 3210 Mechatronics II Laboratory Lab 4: DC Motor Characteristics

ECEN 420 LINEAR CONTROL SYSTEMS. Lecture 6 Mathematical Representation of Physical Systems II 1/67

Rotary Flexible Link. Workbook FLEXGAGE. Student Version

sc Control Systems Design Q.1, Sem.1, Ac. Yr. 2010/11

kx m x B N 1 C L, M Mg θ

CALIFORNIA INSTITUTE OF TECHNOLOGY Control and Dynamical Systems

Mechatronic System Case Study: Rotary Inverted Pendulum Dynamic System Investigation

Inverted Pendulum System

QNET Experiment #04: Inverted Pendulum Control. Rotary Pendulum (ROTPEN) Inverted Pendulum Trainer. Instructor Manual

Project Lab Report. Michael Hall. Hao Zhu. Neil Nevgi. Station 6. Ta: Yan Cui

Mechatronics. MANE 4490 Fall 2002 Assignment # 1

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

Chapter 15+ Revisit Oscillations and Simple Harmonic Motion

Unit 7: Oscillations

Experiment # 5 5. Coupled Water Tanks

Torque. Physics 6A. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

CHAPTER 1 Basic Concepts of Control System. CHAPTER 6 Hydraulic Control System

Q2. A machine carries a 4.0 kg package from an initial position of d ˆ. = (2.0 m)j at t = 0 to a final position of d ˆ ˆ

Review: control, feedback, etc. Today s topic: state-space models of systems; linearization

State Space Representation

Mechatronics Modeling and Analysis of Dynamic Systems Case-Study Exercise

YTÜ Mechanical Engineering Department

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

MCE 366 System Dynamics, Spring Problem Set 2. Solutions to Set 2

Application of Neural Networks for Control of Inverted Pendulum

PreLab 2 - Simple Harmonic Motion: Pendulum (adapted from PASCO- PS-2826 Manual)

EE Homework 3 Due Date: 03 / 30 / Spring 2015

Model of a DC Generator Driving a DC Motor (which propels a car)

Modelling of Ball and Plate System Based on First Principle Model and Optimal Control

CHAPTER 12 OSCILLATORY MOTION

Full Order Observer Controller Design for DC Motor Based on State Space Approach

Chapter 14 Oscillations. Copyright 2009 Pearson Education, Inc.

MATHEMATICAL MODEL ANALYSIS AND CONTROL ALGORITHMS DESIGN BASED ON STATE FEEDBACK METHOD OF ROTARY INVERTED PENDULUM

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

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

Chapter 4. Oscillatory Motion. 4.1 The Important Stuff Simple Harmonic Motion

DC-motor modelling and parameter identification

Assignment 9. to roll without slipping, how large must F be? Ans: F = R d mgsinθ.

State space control for the Two degrees of freedom Helicopter

Automatic Control II Computer exercise 3. LQG Design

Physics 8 Friday, October 20, 2017

t = g = 10 m/s 2 = 2 s T = 2π g

Transcription:

Lab 5a: Pole Placement for the Inverted Pendulum November 1, 2011 1 Purpose The objective of this lab is to achieve simultaneous control of both the angular position of the pendulum and horizontal position of the cart on the track using full-state feedback. We will be considering small angle perturbations and sine wave reference tracking. 2 Theory The setup consists of a pendulum attached to a movable cart as shown in the figure below. We ignore friction and assume that the entire mass of the pendulum is concentrated at its center of mass, which is half-way up the length of the pendulum (L p = L/2). N and P are the horizontal and vertical components, respectively, of the reaction force between the cart and the pendulum. Here are the values of the physical system: 1

Symbol Description Value Resolution of cart position encoder 439.6 counts/cm Resolution of angle encoder 666.7 counts/rad M Mass of cart and motor 0.94 kg m Mass of pendulum 0.230 kg L p Pendulum distance from pivot to center of mass 0.3302 m I c Moment of inertia of pendulum about its center ml 2 p/3 I e Moment of inertia of pendulum about its end 4mL 2 p/3 K t Motor torque constant 0.00767 N*m/A K m Motor back emf constant 0.00767 V*s/rad K g Motor gearbox ratio 3.71 R m Motor winding resistance 2.6Ω r Radius of motor gear 0.00635 m J m Motor moment of inertia 3.9 10 7 kg*m 2 3 Pre-lab a) Derive the equations of motion of the inverted pendulum-cart system. One way of doing this is by considering the free-body diagrams of the cart and the pendulum separately and writing their equations of motion. (Hint: While deriving, use the small-signal approximation sin(θ) θ and cos(θ) 1. This will simplify the math a little). The equations should turn out to the be the following: (M + m)ẍ + ml P θ = Fa (1) ml P ẍ + 4mL2 P 3 θ mgl P θ = 0 (2) Here, F a equals the force exerted on the cart by the attached motor. b) Use the motor dynamics derived in the Lab 2 (in the form F a = f(v, x, ẋ)) and substitute this into the cart-pendulum dynamics from part a to obtain the complete system dynamics. The outputs of our interest are the position of the cart (x) and the pendulum angle (θ) and the available control input is the voltage applied to the motor (V ). Thus, our system is a 1-input, 2-output system (SIMO). Substitute the model parameters and obtain the state-space model for the complete [ T system. Use x = x ẋ θ θ] as your state vector. Make sure you do this derivation symbolically. Once you have the expressions for your state space representation, be sure to use a MATLAB script file to plug in your values. We actually have two different sets of pendulums in the lab, and this will save you a lot of headaches down the road if you need to alter your parameters. To help you verify your solution, you may check your numerical answers against what is shown below. Derived formula errors tend to propagate across entire rows. 2

6.8312 A = B = 3.4625 C =? D =? c) Determine the eigenvalues of the state matrix A and the poles of the state-space representation. Is the open-loop system internally stable? BIBO stable? Also, check if the system is controllable and observable. (For this part, use the MATLAB commands eig, ctrb, obsv, and rank). d) Simulate the output response of the system for a step input in the applied voltage. What would you expect to happen to x and θ in the physical system (assume infinite track length)? What are the discrepancies between the simulation and the physical system? Why might these discrepancies be there? e) We will use a state-feedback controller to achieve the desired performance specifications. For the purpose of design, we assume that all the state variables are available for measurement and can use them for feedback (i.e. the entire state vector x is known). The full-state feedback controller is u = K x. The gain matrix K is chosen such that the closed-loop eigenvalues lie at some desired values. These desired values of the eigenvalues are found based on the performance specifications desired to be achieved. We would like our closed-loop eigenvalues to lie at 1.9 ± 10j and 1.6 ± 1.3j. Using MATLAB, find the feedback gain matrix K that will help us achieve this. You may use the acker or place commands for pole placement. f) Now your system dynamics are x = A x+bu, u = K( r x), where r is your reference input. Using the calculated gain matrix K and MATLAB, calculate the closed loop transfer function from the first component in the reference r (position reference input) to the output x (only the position of the cart). Use the ss and tf commands. Plot the Bode plot of this transfer function. You should notice that the DC gain for this transfer function is unity. 4 Lab Based on which station you use, you will either have a long or short pendulum. The different pendulum physical properties are listed below: Symbol Description Value m L Mass of pendulum (long) 0.230 kg L P,L Pendulum distance from pivot to center of mass (long) 0.3302 m m S Mass of pendulum (short) 0.127 kg L P,S Pendulum distance from pivot to center of mass (long) 0.1778 m 3

a) Implement the state-feedback controller with the Quanser I/O blocks in Simulink. Here is a review of some of the blocks you will use: HIL Initialize block: change the board type to Q4 HIL Encoder Input block: change the encoder indices to [0 1] to get both encoders HIL Analog Output block: see notes about gear protection below dx/dt derivative blocks: We only have measurements for x and θ. We will need to approximate ẋ and θ in order to perform full state feedback. Use the derivative blocks for this. Mux and Demux blocks: This will help keep your diagram tidy. You can combine all four signals (x, ẋ, θ, θ) into a vector signal with the mux block, and break them out with the demux block. Gain block: You can use a single gain block to implement the K matrix. Change the multiplication option from elementwise to matrix. Scopes and To Workspace blocks: Don t forget to instrument your system to allow you to save data for your lab report. Gear protection: In order to prevent the gear from slipping, you must put a saturation block before the Analog Output block. You have two choices: A conventional saturation block, set to ±4. Create an Embedded MATLAB code block and use the following code: function [u_sat,max_lim,min_lim]= fcn(xdot,u) % Setting the bounds max_lim = min(8,max(4,10*xdot+5)); min_lim = min(-4,max(-8,10*xdot-5)); end % Dynamic Saturation u_sat = max(min_lim,u); u_sat = min(max_lim,u_sat); You must connect this block to the ẋ signal as well as the control signal for saturation. It applies different bounds depending on ẋ: once the cart is moving, it allows higher forward voltages, while disallowing big reverse voltages. The u sat output is the saturated signal, while max lim and min lim allow you to plot/analyze the limits. θ sign: The direction we have defined θ to increase and the direction the hardware encoder increases are opposite of each other. Make sure to use a negative factor for angular unit conversion. Units: Watch your units! Everything in this system should match the units you used for your state-space derivation. Don t forget to save your Simulink diagrams for use in your lab report. 4

b) Run the controller on the hardware (with r set to 0) and make sure it balances. You will need to hold the pendulum vertical before starting the program. Give the pendulum small perturbations manually and check the response. c) Introduce a sine wave reference signal and and analyze the results. Your reference [ T will be r = M sin(ωt) 0 0 0]. Start with a reasonable amplitude (M = 0.1 m), and use frequencies ω = 1, 5, 10 rad/s. Make sure to start at the center of the track! Hold the pendulum vertical when you start the program. Check your response. d) Save all your data (especially reference input and position output) for the post lab. Demonstrate to the GSI for check off. 5 Post-Lab For Part b) in the lab section, plot the variation of the cart and pendulum position with time for small perturbations (manually-induced) about the equilibrium value. Comment on the controller s general performance. Why does the hardware continue to oscillate about the equilibrium point? For Part c) in the lab section, calculate the gain and phase for each of the frequencies in your frequency response (ignoring the offset from the hardware response). Locate these frequencies on the Bode plot from Part f) of your prelab and compare the results. Do your values match for each frequency? If not, explain possible causes for the difference. 6 Revision History Semester/ Revision Fall 2011 Rev 2.0 Fall 2010 Rev 1.5 Winter 2009 Rev 1.4 Fall 2009 Rev 1.3 Winter 2008 Rev 1.2 Fall 2008 Rev 1.1 Fall 2008 Rev 1.0 Authors Andrew Tinka Wendjie Chen and Jansen Sheng Pranav Shah Comments L A TEX-ified. Modified some constants. New tips on building the Simulink diagram. Added a post lab section and modified other sections. Corrections and additions after Fall 2009 runthrough. Updated table of constants for new equations including moment of inertia. Corrections and additions after Fall 2008 runthrough and feedback. Converted lab to Word, fixed free body diagram and other errors. Initial lab write-up. 5