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

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

Lab 6a: Pole Placement for the Inverted Pendulum

Digital Pendulum Control Experiments

PID Control. Objectives

YTÜ Mechanical Engineering Department

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

Controlling the Inverted Pendulum

Inverted Pendulum: State-Space Methods for Controller Design

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

Topic # Feedback Control Systems

Lab 5a: Pole Placement for the Inverted Pendulum

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

Example: Modeling DC Motor Position Physical Setup System Equations Design Requirements MATLAB Representation and Open-Loop Response

Rotary Inverted Pendulum

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

State space control for the Two degrees of freedom Helicopter

Lab 3: Quanser Hardware and Proportional Control

Double Inverted Pendulum (DBIP)

Lab 3: Model based Position Control of a Cart

Contents. PART I METHODS AND CONCEPTS 2. Transfer Function Approach Frequency Domain Representations... 42

System simulation using Matlab, state plane plots

The Control of an Inverted Pendulum

Application Note #3413

Computer Aided Control Design

The Control of an Inverted Pendulum

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

YTÜ Mechanical Engineering Department

Application of Neural Networks for Control of Inverted Pendulum

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

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

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

Feedback Control part 2

State Feedback MAE 433 Spring 2012 Lab 7

Introduction to Feedback Control

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

Linear State Feedback Controller Design

Inverted Pendulum. Objectives

Example: DC Motor Speed Modeling

DC Motor Position: System Modeling

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

Comparison of LQR and PD controller for stabilizing Double Inverted Pendulum System

Lab 4 Numerical simulation of a crane

State Feedback Controller for Position Control of a Flexible Link

University of Petroleum & Energy Studies, Dehradun Uttrakhand, India

Course Outline. Higher Order Poles: Example. Higher Order Poles. Amme 3500 : System Dynamics & Control. State Space Design. 1 G(s) = s(s + 2)(s +10)

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

Closed-loop system 2/1/2016. Generally MIMO case. Two-degrees-of-freedom (2 DOF) control structure. (2 DOF structure) The closed loop equations become

EECS C128/ ME C134 Final Wed. Dec. 15, am. Closed book. Two pages of formula sheets. No calculators.

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

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

FALL UNIVERSITY OF NEVADA, LAS VEGAS DEPARTMENT OF MECHANICAL ENGINEERING MEG 421 Automatic Controls Design Project

The control of a gantry

Modelling, identification and simulation of the inverted pendulum PS600

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

5HC99 Embedded Vision Control. Feedback Control Systems. dr. Dip Goswami Flux Department of Electrical Engineering

Neural Network Control of an Inverted Pendulum on a Cart

School of Mechanical Engineering Purdue University. ME375 Feedback Control - 1

The basic principle to be used in mechanical systems to derive a mathematical model is Newton s law,

D(s) G(s) A control system design definition

Fuzzy modeling and control of rotary inverted pendulum system using LQR technique

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

Control. CSC752: Autonomous Robotic Systems. Ubbo Visser. March 9, Department of Computer Science University of Miami

The output voltage is given by,

Solution to HW State-feedback control of the motor with load (from text problem 1.3) (t) I a (t) V a (t) J L.

= 0 otherwise. Eu(n) = 0 and Eu(n)u(m) = δ n m

x(n + 1) = Ax(n) and y(n) = Cx(n) + 2v(n) and C = x(0) = ξ 1 ξ 2 Ex(0)x(0) = I

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

Multivariable Control Laboratory experiment 2 The Quadruple Tank 1

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

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

Experiment # 5 5. Coupled Water Tanks

EE 16B Midterm 2, March 21, Name: SID #: Discussion Section and TA: Lab Section and TA: Name of left neighbor: Name of right neighbor:

Factors Limiting Controlling of an Inverted Pendulum

Mechatronics Engineering. Li Wen

Automatic Control II Computer exercise 3. LQG Design

System Modeling: Motor position, θ The physical parameters for the dc motor are:

Table of Laplacetransform

Laboratory Exercise 1 DC servo

DO NOT DO HOMEWORK UNTIL IT IS ASSIGNED. THE ASSIGNMENTS MAY CHANGE UNTIL ANNOUNCED.

Design of Fuzzy PD-Controlled Overhead Crane System with Anti-Swing Compensation

Mechatronic System Case Study: Rotary Inverted Pendulum Dynamic System Investigation

Feedback Basics. David M. Auslander Mechanical Engineering University of California at Berkeley. copyright 1998, D.M. Auslander

UNIVERSITY OF WASHINGTON Department of Aeronautics and Astronautics

EE 422G - Signals and Systems Laboratory

MEM04: Rotary Inverted Pendulum

EE C128 / ME C134 Fall 2014 HW 6.2 Solutions. HW 6.2 Solutions

Linear Control Systems

CHAPTER 5 : REDUCTION OF MULTIPLE SUBSYSTEMS

Positioning Servo Design Example

THE REACTION WHEEL PENDULUM

Unit 8: Part 2: PD, PID, and Feedback Compensation

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

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

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Mechanical Engineering 2.04A Systems and Controls Spring 2013

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

Lecture 9. Introduction to Kalman Filtering. Linear Quadratic Gaussian Control (LQG) G. Hovland 2004

Inertia Identification and Auto-Tuning. of Induction Motor Using MRAS

Appendix A MoReRT Controllers Design Demo Software

2.004 Dynamics and Control II Spring 2008

MECH 3140 Final Project

Transcription:

LAB 4 ENGI 38: ADVANCED CONTROLS -------------------------------------------------------------------- Lab Partners: (Alphabetically) Figliomeni, Dan Malyshev, Andrey McGrath, Adam TO: WARREN PAJU ELECTRICAL ENGINEERING DEPT. LAKEHEAD UNIVERSITY ATAC56 INVERTED PENDULUM

Table of Contents. OBJECTIVE... 3 2. APPARATUS... 3 3. PROCEDURE... 3 4. LAB PREP WORK... 3 4. POLE-PLACEMENT DESIGN... 4 4.2 LQR COMPENSATOR... 4 4.3 DIGITAL LQR COMPENSATOR... 5 5. THEORY... 5 6. OBSERVATIONS... 8 6. POLE-PLACEMENT... 8 6.2 LINEAR QUADRATIC REGULATOR... 9 6.3 DIGITAL CONTROLLER... 7. CONCLUSION... 2 APPENDIX A MATLAB file for pole placement and LQR... 3 APPENDIX B MATLAB file for digital LQR compensator design... 4 2

3. OBJECTIVE The purpose of this lab is to design compensators with error tracking integrator using state space methods to stabilize an inverted pendulum on a moving car 2. APPARATUS Inverted Pendulum set up 3. PROCEDURE The procedure is described in the Engineering 38 Advanced Controls II lab manual. 4. LAB PREP WORK The state space derivation of the inverted pendulum model is provided in the manual as follows: x y u x x = + = 3.335.824 4.673 3.46 36.98 3.628. (.) The output regulation with the integrator action modifies these matrices in order to have the position of the pendulum converge to a set parameter. The state-space representation becomes x y u x x = + = 3.335 8.24 4.673 3.46 36.98 3.628. (.2) This system can be used to design for 5 gain values. The fifth gain will represent the integrator gain K I =K 5.

4. POLE-PLACEMENT DESIGN Realistically, a settling time of 5.25 seconds and an overshoot of.95 percent is a good performance to design for. These parameters yield p =.76±.63,2 j These poles would represent the position and velocity of the cart. A set of faster poles can be chosen for the angle and angular velocity of the pendulum because we want them to converge faster than the cart position. In fact, the angular velocity should converge the fastest otherwise the system is unstable. Therefore, the angular velocity pole is placed far to the left. The integrator must converge fast, but if it converges too fast, the angular velocity will become an issue and the system will become unstable. Therefore, a compromise is necessary for the integrator pole that is fast converging and reasonable. In the end the following set of poles results..762+ j.626.762 j.626 p = 3.5 3.5 6 In light of the compromises made to achieve reasonable performance, the system became much slower. The simulated settling time exceeds 4 seconds and the pendulum experiences severe oscillations before achieving stability. The gains of the system are K K K K K K = [ 2 3 4 ] [ 69 4.6 5.3 9.7 6.84] = I 4.2 LQR COMPENSATOR The LQR controller offers a better solution to the inverted pendulum problem. For the design a few Q and R values were simulated. Reasonable performance was achieved for most of them but the better compromise for pole locations and gain values have been achieved with the following: Q =, R=.5 The obtained K vector was K = 49.43.8.8 K I [ 5.92] = 4.47 4

4.3 DIGITAL LQR COMPENSATOR A digital controller can be designed using the original state space representation defined by (.). The controller is simulated using the linear digital state space block in simulink. Good performance was achieved with the following set of parameters. 5 Q =, R=.5 5 The obtained K gain vector was K = 59.7 2.25 6.7 9.45 [ ] 5. THEORY The lab set up is depicted in figure. Figure : Stabilized inverted pendulum on a moving cart 5

The mathematical model of the system can be derived using the Newton balance of forces method acting on the inverted pendulum. Figure 2: Forces acting on the inverted pendulum The following set of non-linear equations describes the inverted pendulum system..... ( M + m) x+ mlθ cos( θ) mlθ sin( θ).... 2 ( I + ml ) θ mgl sin( θ) = mlx cos( θ). = F (2.) Where the force F acting on the cart can be described in terms of the input voltage to the motor as 2 2 K. gkm KgKm F = u x (2.2) 2 rr r R A A Substituting (2.2) into (2.) and rearranging for...ẋ θ and we obtain 2 2 K.... gkm KgKm u x mlθ cos( θ) + mlθ sin( θ).. 2 rra r RA x= M + m.. mgl sin θ = ( ) ( θ) mlx cos( θ).. 2 ( I + ml ) (2.3) This set of equations may be used to build the non-linear model of the system in MATLAB as shown in figure 3. This model is created into a subsystem and substituted into the control law model as shown in figure 4 to perform controller design simulations. 6

Figure 3: Non-linear model of the inverted pendulum Figure 4: Non-linear simulation of the inverted pendulum The saturation block in figure 4 limits the input voltage to ± 2V 7

6. OBSERVATIONS 6. POLE-PLACEMENT The simulated performance of the system is displayed in figures 5, 6 and 7. The simulation is performed according to the following criteria - Alpha disturbance of pi/2 occurs at t=sec and dissipates at t=.3sec - Position reference changes at t=sec Figure 5: Pole-Placement compensator angle simulation result Figure 6: Pole-Placement compensator position simulation result 8

Figure 7: Pole-Placement control effort simulation The pole-placement simulation indicates that the system is stable and all state variables gradually converge to zero. The actual system behaved similar to simulation. 6.2 LINEAR QUADRATIC REGULATOR The simulated performance of the system is displayed in figures 8, 9 and. The simulation is performed according to the following criteria - Alpha disturbance of pi/2 occurs at t=sec and dissipates at t=.3sec - Position reference changes at t=sec - Q =, R=. 5 9

Figure 8: LQR compensator angle simulation result Figure 9: LQR compensator position simulation result

Figure : LQR control effort simulation As seen in figures 8, 9, and all simulated state variables converge to zero well using the LQR compensator. Testing of the actual system confirmed simulation results. 6.3 DIGITAL CONTROLLER The digital controller was tested using a linear digital state-space representation of the inverted pendulum as shown in figure. Figure : Digital LQR compensator simulation The system simulated well and the position converges from initial conditions as shown in figure 2. The initial condition specified for the simulation was the angle of the pendulum with respect to the vertical axis of pi/2. The system converges in less than 2 seconds as seen in figure 2.

Figure 2: Position converging from initial conditions using LQR The digital LQR controller performed well on the actual system as expected. 7. CONCLUSION MATLAB is a powerful tool for designing control systems. In this experiment a pole placement, LQR and digital LQR compensators were implemented for the inverted pendulum. All controllers behaved as expected and the pendulum stabilized in the vertical position as expected. The true difficulty was in building the non-linear simulation model in MATLAB. This was a tough task due to complexity of differential equations. The pole-placement control was also difficult since only two poles can be designed for while the other three had to be guesstimated (sync). This was difficult because poleplacement utilizes a linear control to control a highly nonlinear system the inverted pendulum. Nonetheless, the experimental results were satisfactory. 2

APPENDIX A MATLAB file for pole placement and LQR clc; %clear everything %*****************************************************% % System Parameters % %*****************************************************% M=.455; %Kg m=.2; %Kg l=.35; %m r=.645; %m Kg=3.7; Km=.767; RA=2.6; %ohms g=9.8; %m/s^2 I=.65; %Kgm^2 A= [ ; 3.628 36.98 ; ; -3.46-4.673]; B= [; -8.24; ; 3.335]; Cbar= [ ; ]; %for isolating angle and position state variable readings C= [ ]; %used for controller design to control the cart position Anew=horzcat(vertcat(A,-C), zeros(5,)) %forming new A matrix for integrator feedback Bnew=vertcat(B, zeros(,)) %forming new B matrix for the same reasons %Obtaining user inputs for overshoot and settling time OS= input('enter overshoot in percentage form. For.9% enter.9\n') Ts= input('enter Settling time\n') temp= log(os)/(-pi); si= sqrt(temp/(+temp)); wn= 4/(Ts*si); % % adding 2 poles to second order char equn n= input('how far away (remember the -ve sign) e.g. -4\n'); pole= n*si*wn; fprintf('how far away do you want to push the integrator pole from the last two? ex. +2') e= input('enter +ve integer multiplier'); % now calculating the roots of the characteristic equation vector s^2+2*si*wn+wn^2 mainpoles=roots([ 2*si*wn wn^2]) %first two poles fastpoles=ones(2,)*pole %second two poles X=vertcat(fastpoles, mainpoles); %the combined result of four poles Y=[pole*e; X] %final set of 5 poles K_star= acker(anew, Bnew,Y) Kpole=[K_star(:,) K_star(:,2) K_star(:,3) K_star(:,4) ] %pole placement K vector Kipole=[K_star(:,5)] %pole placement Ki fprintf('these are the pole-placement gains!!! Change names in the model \n') Q= eye(5)*input('enter the Q multiplier') %defining Q matrix R= input('enter R for LQR\n') [Klqr,S,E]=lqr(Anew,Bnew,Q,R) K=[Klqr(:,) Klqr(:,2) Klqr(:,3) Klqr(:,4) ] %LQR K vector Ki=[Klqr(:,5)] %LQR Ki 3

APPENDIX B MATLAB file for digital LQR compensator design %38lab4 matlab m file for calculating digital LQR controller gains clc; %clear everything %*****************************************************% % System Parameters % %*****************************************************% % constants for the experiment M=.455; %Kg m=.2; %Kg l=.35; %m r=.645; %m Kg=3.7; Km=.767; RA=2.6; %ohms g=9.8; %m/s^2 I=.65; %Kgm^2 %*****************************************************% A= [ ; 3.628 36.98 ; ; -3.46-4.673]; B= [; -8.24; ; 3.335]; C= [ ]; D=zeros(,); %Obtaining the digital representation using zero-order hold method Ts= input('enter the sampling time Ts in seconds \n') [F,G,H,J] = c2dm (A,B,C,D,Ts,'zoh') %conversion from continuous to digital system fprintf('rank of controllability matrix is ') rank([g F*G]) Q=eye(4); %forming the q matrix Q(,)= input('enter the pendulum angle energy: '); Q(3,3)= input('enter the cart position energy: '); R= input('enter R\n') %R defined by the user [Kd, S, E]=lqrd(A,B,Q,R,Ts) %digital compensator design 4