Double Inverted Pendulum (DBIP)

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

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

Flexible Pendulum (FLEXPEN)

Experiment # 5 5. Coupled Water Tanks

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

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

Lab 3: Quanser Hardware and Proportional Control

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

STUDENT Workbook IP02 Base Unit Experiment for MATLAB /Simulink Users

Rotary Flexible Joint

Rotary Flexible Link. Workbook FLEXGAGE. Student Version

Inverted Pendulum System

YTÜ Mechanical Engineering Department

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

ACKNOWLEDGEMENTS Quanser Inc., All rights reserved.

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

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

The Control of an Inverted Pendulum

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

Hands-on Lab 3. System Identification with Experimentally Acquired Data

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

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

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

The Control of an Inverted Pendulum

YTÜ Mechanical Engineering Department

2.004 Dynamics and Control II Spring 2008

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

QNET DC Motor Control

QNET Experiment #05: HVAC System Identification. Heating, Ventilation, and Air Conditioning Trainer (HVACT) Student Manual

Lab 6a: Pole Placement for the Inverted Pendulum

LQG/LTR CONTROLLER DESIGN FOR ROTARY INVERTED PENDULUM QUANSER REAL-TIME EXPERIMENT

EE 4443/5329. LAB 3: Control of Industrial Systems. Simulation and Hardware Control (PID Design) The Torsion Disks. (ECP Systems-Model: 205)

DC-motor modelling and parameter identification

Lab 5a: Pole Placement for the Inverted Pendulum

State space control for the Two degrees of freedom Helicopter

Lab 4 Numerical simulation of a crane

Angle estimation using gyros and accelerometers

Lab 1: Dynamic Simulation Using Simulink and Matlab

The control of a gantry

Old Dominion University Physics 112N/227N/232N Lab Manual, 13 th Edition

THE REACTION WHEEL PENDULUM

Experiment A11 Chaotic Double Pendulum Procedure

ECE 5670/6670 Lab 8. Torque Curves of Induction Motors. Objectives

ECE 320 Linear Control Systems Winter Lab 1 Time Domain Analysis of a 1DOF Rectilinear System

Angle estimation using gyros and accelerometers

Magnetic Fields. Experiment 1. Magnetic Field of a Straight Current-Carrying Conductor

1 Introduction. 2 Process description

Week 14 The Simple Pendulum

AKD SYSTEM CONFIGURATION WITH KOLLMORGEN DDL LINEAR MOTORS By Kenny Hampton 1/12/2017 Rev. L

ISSP User Guide CY3207ISSP. Revision C

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

EE 476 DC Motor Control Lab

DC-motor PID control

AE2610 Introduction to Experimental Methods in Aerospace DYNAMIC RESPONSE OF A 3-DOF HELICOPTER MODEL

THE FLOATING DUTCHMEN Three Dimensional Driven-Arm Inverted Pendulum

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

EE/ME/AE324: Dynamical Systems. Chapter 4: Block Diagrams

Automatic Control II Computer exercise 3. LQG Design

Belt Tension Clamp. Drive Motor. Friction Brake. Load. Encoder 2. Drive. (4000 lines/rev incremental) Encoder 1. (4000 lines/rev incremental)

BioMechanics and BioMaterials Lab (BME 541) Experiment #5 Mechanical Prosperities of Biomaterials Tensile Test

Digital Pendulum Control Experiments

Assembly and Operation Manual. April 2016

CONTROL SYSTEMS LABORATORY ECE311 LAB 1: The Magnetic Ball Suspension System: Modelling and Simulation Using Matlab

THE swing-up and stabilization of a single inverted pendulum

DOUBLE ARM JUGGLING SYSTEM Progress Presentation ECSE-4962 Control Systems Design

Mechatronic System Case Study: Rotary Inverted Pendulum Dynamic System Investigation

Kinematics. Become comfortable with the data aquisition hardware and software used in the physics lab.

Matlab-Based Tools for Analysis and Control of Inverted Pendula Systems

Laboratory handout 5 Mode shapes and resonance

MODELLING AND SIMULATION OF AN INVERTED PENDULUM SYSTEM: COMPARISON BETWEEN EXPERIMENT AND CAD PHYSICAL MODEL

Lab 1g: Horizontally Forced Pendulum & Chaotic Motion

Appendix A MoReRT Controllers Design Demo Software

State Feedback MAE 433 Spring 2012 Lab 7

HMS-5000 Manual. Product Name: HMS-5000 Hall Effect Measurement System with variable temperature from 80K to 350K. - Manual version: ver 5.

Circular Motion and Centripetal Force

Inverted Pendulum: State-Space Methods for Controller Design

UNIWERSAŁ observatory dome

MECHATRONICS II LABORATORY Experiment #4: First-Order Dynamic Response Thermal Systems

Applications of Newton's Laws

Controlling the Inverted Pendulum

MinSeg balancing using pole-placement

O P E R A T I N G M A N U A L

Industrial Servo System

Lamp and Control Panel (Lamp Panel)

Integrator Windup

The University of Hong Kong Department of Physics. Physics Laboratory PHYS3350 Classical Mechanics Experiment No The Physical Pendulum Name:

Chem 1 Kinetics. Objectives. Concepts

Industrial Servo System

Digital Control Semester Project

Hands-on Lab. Damped Compound Pendulum System ID (Experimental and Simulation) L Bar length m d Pivot to CG distance m m Mass of pendulum kg

Exp. #1-1 : Measurement of the Characteristics of the Centripetal Force by Using Springs and a Computer Interface

Mathematical Modelling Using SimScape (Electrical Systems)

10 - Celestron Telescope II: Operation

Position Control Experiment MAE171a

Example: DC Motor Speed Modeling

Appendix A Prototypes Models

Table of Contents 1.0 OBJECTIVE APPARATUS PROCEDURE LAB PREP WORK POLE-PLACEMENT DESIGN

E6C-N. Ideal for Out-of-step Detection of Stepping Motors and Position Control of Rotors and Unloaders

Quick Start Guide. The ieq45 GoTo German Equatorial Mount # 8000C

Transcription:

Linear Motion Servo Plant: IP01_2 Linear Experiment #15: LQR Control Double Inverted Pendulum (DBIP) All of Quanser s systems have an inherent open architecture design. It should be noted that the following experimental setup, accompanying files, and configuration are merely one of the many possible uses of this product. Laboratory Manual

Table of Contents 1. Laboratory Objectives...1 2. Prerequisites...1 3. Experiment Design Files...1 4. DBIP Controller Design...2 4.1. DBIP System Modeling...2 4.2. State-Feedback Controller Design...3 5. In-Lab Procedure...5 5.1. Experimental Setup Components...5 5.2. System Wiring and Hardware Setup...6 5.2.1. System Wiring and Setup...6 5.2.2. Double Pendulum Wiring and Setup...6 5.3. Controller Simulation...7 5.3.1. Objectives...7 5.3.2. Procedure...7 5.4. Controller Real-Time Implementation...10 5.4.1. Objectives...11 5.4.2. Experimental Procedure...11 6. References...13 Document Number: 535 Revision: 4.1 Page: ii

1. Laboratory Objectives The challenge in this laboratory is to design a state-feedback control system that keeps a double inverted pendulum (consisting of two pendula coupled vertically) balanced and tracks the IP01_2 cart to a commanded position. 2. Prerequisites To successfully carry out this laboratory, the prerequisites are: To be familiar with your IP01 or IP02 main components (e.g. actuator, sensors), your data acquisition card (e.g. Q8), and your power amplifier (e.g. VoltPAQ), as described in References [1], [2], and [3], respectively. To be familiar in using QUARC to control and monitor the plant in real-time and in designing their controller through Simulink. Otherwise, review Reference [4] as needed. To be familiar with the complete wiring and operating procedure of your IP01 or IP02 plant and dedicated amplifier, as discussed in Reference [1]. 3. Experiment Design Files Table 1, below, lists and describes the various computer files coming with the experiment. File Name IP01_2 DBIP Equations.mws quanser_tools.mws Description Maple worksheet used to analytically derive the system's nonlinear equations of motion as well as its state-space model. Waterloo Maple 9, or a later release, is required to open, modify, and execute this file. Executing this worksheet generates the quanser repository containing the Quanser_Tools package. The two package files are named: quanser.ind and quanser.lib. The Quanser_Tools module defines the generic procedures used in Lagrangian mechanics and resulting in the determination of a given system's equations of motion and state-space representation. It also contains data processing routines to save the obtained state-space matrices into a MATLAB-readable file. Document Number: 535 Revision: 4.1 Page: 1

File Name quanser_tools.rtf Description Rich Text Format presentation of the quanser_tools.mws file. It allows to view the content of the Maple worksheet without having Maple 9 installed. No modifications to the Maple procedures can be performed when in this format. setup_lab_ip01_2_dbip.m The main MATLAB script that calls setup_sp_configuration.m, and DBIP_ABCD_eqns.m, to set the model and configuration parameters and design the controller. Run this file only to setup the laboratory. setup_ip01_2_configurati on.m Returns the model parameters Jm, Kt, Eff_m, Mc, r_mp, and Beq, the encoder resolution constant K_EC and K_EP, the amplifier current gain Ka, and the voltage and current saturation of the amplifier. setup_sp_configuration.m Returns the Single Pendulum (SP) model parameters Mp, Lp, lp, Jp, and Bp according to the pendulum specified. DBIP_ABCD_eqns.m s_dbip_lqr_ip02.mdl q_dbip_lqr_ip02.mdl Table 1 Laboratory Design Files MATLAB script file generated using the Maple worksheet IP01_2 DBIP Equations.mws. It sets the A, B, C, and D matrices for the state-space representation of the DBIP openloop system used in the Simulink models s_dbip_lqr_ip02.mdl and q_dbip_lqr_ip02.mdl. Simulink file that simulates the closed-loop DBIP system using its linear equations of motion model and an LQR controller. Simulink file that implements the real-time state-feedback controller for the DBIP system. 4. DBIP Controller Design 4.1. DBIP System Modeling As already mentioned in Table 1, above, the Maple worksheet named IP01_2 DBIP Equations.mws (or its HTML equivalent IP01_2 DBIP Equations.html) derives both nonlinear and linear models of the DBIP system. The free body diagram that accompanies the dynamic model derivation of the system is given in Figure 1. Document Number: 535 Revision: 4.1 Page: 2

Figure 1 Free body diagram of DBIP system. The model will not be summarized since the state-space matrices are too large to be printed in this document. It may be useful to view the model summary given in Reference [5] for the single-inverted pendulum system. 4.2. State-Feedback Controller Design Like the single inverted pendulum device, the double-inverted pendulum is an unstable, non-minimum phase system that is controllable through feedback. The cart is to follow a reference position while balancing the double-link pendulum. That is, the cart position, x c, tracks a desired setpoint position, x c,d, and both upright pendulum angles, α and θ, are Document Number: 535 Revision: 4.1 Page: 3

stabillized about 0. Assuming no actuator saturation, i.e. I m = u, consider the state-feedback law u = K ζ [9] where ζ T = x c x c, d, α, v x, v, α d x c x c, d t [10] is the augmented error state. The cart velocity, v x, is found using the high-pass filter V x ( s ) = D 1 ( s ) X c ( s ), [11] the angular rate of the pendulum 1, v α, is calculated using V α ( s ) = D 2 ( s ) α ( s ) [12] and the angular rate of the pendulum 2, v α, is calculated using V θ ( s ) = D 2 ( s ) θ ( s ) [13] where the high-gain observers D 1 (s) and D 2 (s) are defined in Reference [1]. The closed-loop system implemented is depicted in Figure 3. Figure 2 Closed-loop DBIP system. Given the derived state-space matrices and using the Matlab lqr command with the weighting matrices Document Number: 535 Revision: 4.1 Page: 4

and 10 0 0 0 0 0 0 0 50 0 0 0 0 0 0 0 50 0 0 0 0 Q = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 [14] R=0.1 [15] With the controller defined in [9], the ζ state converges towards zero. Thus the cart position approaches its setpoint, x c (t) x c,d (t), while both pendulum angles are stabilized about the origin, i.e. α(t) 0 and θ(t) 0. The integration term improves the steady-state error of the cart position. 5. In-Lab Procedure 5.1. Experimental Setup Components To setup this experiment, the following hardware and software are required: Power Module: Quanser VoltPAQ, or equivalent. Data Acquisition Board: Quanser Q8-USB, QPID or equivalent. Linear Motion Servo Plant: Quanser IP01_02 Double Pendulum: Quanser Double Inverted Pendulum, Real-Time Control Software: The QUARC-Simulink configuration, as detailed in Reference [4], or equivalent. For a complete and detailed description of the main components comprising this setup, please refer to the corresponding manuals. Document Number: 535 Revision: 4.1 Page: 5

5.2. System Wiring and Hardware Setup 5.2.1. System Wiring and Setup Refer to Reference [1] for the setup information required to carry out this control laboratory. Reference [1] provides the specifications and a description of the main components composing the IP01-02 system. It also fully describes the wiring conventions and the default wiring procedure for the IP01_02 plant. More importantly, Reference [1] gives some safety operating guidelines and the start-up procedure to properly wire the system. 5.2.2. Double Pendulum Wiring and Setup Follow the steps described below: 1. Mount the double-pendulum to the cart front pendulum shaft. Tighten the set-screw enough such that the pendulum T-Fitting is securely fastened to the metal shaft. 2. Connect cable #7 from the double-pendulum encoder connector to the "Encoder Input #2" connector on the Terminal Board. This connection is done using the 5-pin-stereo- DIN to 5-pin-stereo-DIN encoder cable described in Reference [1]. It carries the signals required to measure the angle of the longer, bottom link of the double-pendulum assembly and its associated variable is θ. This connection is summarized in Table 2. Cable # Cable Type From To Function 7 Encoder Cable: 5-pin-stereo-DIN to 5-pin-stereo-DIN Table 2 Wiring Summary Encoder Connector on Double- Pendulum Encoder #2 on the Terminal Board Measures angle of longest link, θ. Document Number: 535 Revision: 4.1 Page: 6

5.3. Controller Simulation The Simulink model entitled s_dbip_lqr_ip02 is shown in Figure 3 and is used to simulate the DBIP system. The cart setpoint position can be changed in the Setpoint Amplitude (m) block. Figure 3: Simulink model used to simulate the IP02 + DBIP system. 5.3.1. Objectives Investigate the closed-loop performance of the controller using the nonlinear model of the DBIP system. Ensure the controller does not saturate the actuator before implementing it on the actual system. 5.3.2. Procedure Follow these steps to simulate the controller: 1. Open Simulink model s_dbip_lqr_ip02.mdl shown in Figure 3 above. 2. Run the MATLAB script setup_lab_ip01_2_dbip.m to set the model parameters and the control gain K. 3. Click on the black arrow located in the toolbar (or click on Simulation-Start in the menu) to simulate the closed-loop system. As shown in Figure 4, the purple trace in Document Number: 535 Revision: 4.1 Page: 7

the xc (mm) scope is the simulated cart position and the yellow trace is the desired position. The position of the cart should track the commanded square position signal, x c (t) x c,d (t), while balancing the pendulum. Thus the bottom link, shown in Figure 5, and the top link, shown in Figure 6, should both be stabilized about zero, α(t) 0 and θ(t) 0. Figure 4 Simulated cart response. Figure 5 Simulated response link 1. Figure 6 Simulated response of link 2. 4. Verify that the motor input current shown in the Im (A) scope is relatively smooth and not saturated, as depicted in Figure 7. Document Number: 535 Revision: 4.1 Page: 8

Figure 7 Simulated control input. Alternatively, the user may also set the setpoint to zero and view the response of the system when subject to a set of initial conditions. Document Number: 535 Revision: 4.1 Page: 9

5.4. Controller Real-Time Implementation The q_dbip_lqr_ip02.mdl Simulink model shown in Figure 8 implements the previously designed balance controller. Figure 8: Simulink model that controls the DBIP system. Similarly to the cart safety limits found in the IP02 + DBIP subsystem a watchdog is placed in this subsystem that stops the real-time controller when α goes beyond the ALPHA_MIN and ALPHA_MAX limits, given that ALPHA_LIM_ENABLE = 1, and when θ goes exceeds the THETA_MIN and THETA_MAX limits, given that THETA_LIM_ENABLE=1. The limits are both specified in the setup_lab_ip01_2_dbip.m file. The pendulum begins in the gantry position. The control design is based on a model that defines α = 0 when the bottom pendulum is in the upright position and θ = 0 when the top pendulum is in the upright position relative to the bottom pendulum. Therefore given that the bottom pendulum begins in the gantry position an offset of -π rad (-180 ) is applied to angle α. The controller is activated when both pendula are rotated until their angles are Document Number: 535 Revision: 4.1 Page: 10

within the tolerance specified in the box labelled "Desired Initial Angle (deg)". By default the tolerance is set to 0.5. 5.4.1. Objectives Implement the previously designed controller with QUARC to balance the Double Inverted Pendulum (DBIP) system on the linear track. 5.4.2. Experimental Procedure Follow the steps described below to implement the designed controller in real-time and observe its effect on the actual IP02 + DBIP plant: 1. Open Simulink model q_dbip_lqr_ip02.mdl shown in Figure 6 above. 2. Execute the design file setup_lab_ip01_2_dbip.m to setup the workspace before compiling the diagram and running it in real-time with QUARC. This file sets the state-space model of the IP02+DBIP system. It also calculates the feedback gain vector K and enters it in the MATLAB workspace. Further, various parameters used in the IP02+DBIP subsystem such as the filter cutoff frequencies, cart position safety limits and amplifier gain must also be loaded prior to compilation. 3. The real-time code corresponding to the diagram can now be built by selecting the QUARC Build item from the Simulink menu bar. After successful compilation and download you should be able to run your controller on the actual system in real-time. 4. If not already opened, double-click on the sinks xc (mm), alpha (deg), and theta (deg) found in the Scopes folder. The xc (mm) scope displays the cart setpoint, the measured cart position, and the simulated cart position generated by the state-space model. The alpha (deg) scope displays the measured and simulated angle of the bottom pendulum and the theta (deg) scope displays the measured and simulated angle of the top pendulum. 5. Ensure the real-time code is ran safely by manually moving the IP02 cart to the middle of the track (i.e. home position) so it is free to move on both sides. 6. Verify that the suspended pendulum is not moving before starting the controller. 7. Start your real-time controller by clicking on QUARC Start from the Simulink model menu bar. 8. Slowly rotate the entire double pendulum assembly counter-clockwise until it is vertical. When both the bottom and the top pendulum are within 0.5 degrees of their vertical position (pointing upwards), the motion control loop will automatically start and balance the double pendulum. 9. Release the pendulum as soon as the controller is activated. Any obstructions are not compensated for and may lead to instability. 10. Figure 9 depicts the measured and simulated responses of the cart position, the Document Number: 535 Revision: 4.1 Page: 11

bottom pendulum angle, and the top pendulum angle. Since the cart setpoint is zero, the simulation traces all remain at zero. Figure 10 displays the corresponding cart motor current used to balance the double-pendulum. Figure 9 Measured and simulated DBIP closed-loop response. Document Number: 535 Revision: 4.1 Page: 12

Figure 10 Measured and simulated control input. 11. Click on the Stop button in the Simulink model tool bar to stop running the real-time controller. Turn off the power amplifier. 6. References [1] IP01_2 User Manual. [2] DAQ User Manual. [3] Power amplifier User Manual [4] QUARC User Manual (type doc QUARC in the MATLAB Command Prompt). [5] HFLC Single Inverted Pendulum Laboratory Manual. Document Number: 535 Revision: 4.1 Page: 13