Teaching State Variable Feedback to Technology Students Using MATLAB and SIMULINK

Similar documents
Design of a Model of a System to Control the Pitch angle of Helicopter using State Estimator

Trajectory Design using State Feedback for Satellite on a Halo Orbit

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

CYBER EXPLORATION LABORATORY EXPERIMENTS

Control Systems Design

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

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

YTÜ Mechanical Engineering Department

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

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

Laboratory Exercise 1 DC servo

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

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

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

(Refer Slide Time: 00:01:30 min)

Modification of a Sophomore Linear Systems Course to Reflect Modern Computing Strategies

FEEDBACK CONTROL SYSTEMS

YTÜ Mechanical Engineering Department

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

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

2.004 Dynamics and Control II Spring 2008

CONTROL SYSTEMS ENGINEERING Sixth Edition International Student Version

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

Department of Electrical and Computer Engineering ECED4601 Digital Control System Lab3 Digital State Space Model

The Control of an Inverted Pendulum

Transient Response of a Second-Order System

Pole placement control: state space and polynomial approaches Lecture 2

State Regulator. Advanced Control. design of controllers using pole placement and LQ design rules

Controls Problems for Qualifying Exam - Spring 2014

Feedback Control part 2

Keywords - Integral control State feedback controller, Ackermann s formula, Coupled two tank liquid level system, Pole Placement technique.

Lab 6a: Pole Placement for the Inverted Pendulum

Lab Experiment 2: Performance of First order and second order systems

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

Example: DC Motor Speed Modeling

Lab 3: Quanser Hardware and Proportional Control

06 Feedback Control System Characteristics The role of error signals to characterize feedback control system performance.

Inverted Pendulum. Objectives

Positioning Servo Design Example

Linear State Feedback Controller Design

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

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

R10 JNTUWORLD B 1 M 1 K 2 M 2. f(t) Figure 1

Introduction to Modern Control MT 2016

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

Computer Aided Control Design

CHAPTER 5 : REDUCTION OF MULTIPLE SUBSYSTEMS

State Feedback Controller for Position Control of a Flexible Link

Inverted Pendulum: State-Space Methods for Controller Design

Performance of Feedback Control Systems

AMME3500: System Dynamics & Control

6.302 Feedback Systems

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

Classical Dual-Inverted-Pendulum Control

(a) Torsional spring-mass system. (b) Spring element.

Control Systems Lab - SC4070 Control techniques

DEPARTMENT OF ELECTRONIC ENGINEERING

Control of Manufacturing Processes

Digital Control: Part 2. ENGI 7825: Control Systems II Andrew Vardy

Answers to multiple choice questions

Mechatronics Engineering. Li Wen

DC Motor Position: System Modeling

THE REACTION WHEEL PENDULUM

Independent Control of Speed and Torque in a Vector Controlled Induction Motor Drive using Predictive Current Controller and SVPWM

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

The control of a gantry

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

Feedback Control of Linear SISO systems. Process Dynamics and Control

The Control of an Inverted Pendulum

MATHEMATICAL MODELING OF OPEN LOOP PMDC MOTOR USING MATLAB/SIMULINK

Lab 1: Dynamic Simulation Using Simulink and Matlab

Methods for analysis and control of dynamical systems Lecture 4: The root locus design method

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

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

Evaluation Performance of PID, LQR, Pole Placement Controllers for Heat Exchanger

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

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

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

PID Control. Objectives

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

Using Laplace Transforms to Build a Linear/Non-linear Speedometer

Lab # 4 Time Response Analysis

Control Systems. University Questions

Stabilizing the dual inverted pendulum

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

Root Locus Design Example #4

Linear Control Systems

Example on Root Locus Sketching and Control Design

Dr Ian R. Manchester Dr Ian R. Manchester AMME 3500 : Review

King Saud University

School of Mechanical Engineering Purdue University. ME375 Dynamic Response - 1

Methods for analysis and control of. Lecture 4: The root locus design method

Lecture 6: Control Problems and Solutions. CS 344R: Robotics Benjamin Kuipers

ENGG4420 LECTURE 7. CHAPTER 1 BY RADU MURESAN Page 1. September :29 PM

EEE 184 Project: Option 1

Lab 5a: Pole Placement for the Inverted Pendulum

Mini Lecture 2.1 Introduction to Functions

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

Compensator Design to Improve Transient Performance Using Root Locus

Transcription:

Teaching State Variable Feedback to Technology Students Using MATLAB and SIMULINK Kathleen A.K. Ossman, Ph.D. University of Cincinnati Session 448 I. Introduction This paper describes a course and laboratory in State Variable Feedback developed as a technical elective for students in the Electrical and Computer Engineering Technology (ECET) program at the University of Cincinnati. Students pursuing the EET degree are required to take courses in Signals and Systems and Feedback Controller Design. They learn to design lead, lag, and proportional-integral-derivative controllers (both analog and digital) for single-input singleoutput systems. The technical elective in State Variable Feedback allows students to explore the added benefits of a state variable controller when applied to multi-input multi-output systems and/or systems where constraints are imposed on the controller (i.e., tracking in minimum time or tracking with minimum control effort expended). In the past, a course in State Variable Feedback would have been too mathematically rigorous to include in a technology program. However, with the use of MATLAB and SIMULINK, students are able to design state variable feedback controllers and simulate the system responses without getting caught up in complicated matrix manipulations and integral calculations. II. Modeling Systems The course begins with modeling of several types of systems including electrical circuits, mechanical translational systems, motors, a robot gripper, an inverted pendulum on a cart, and pitch control for a helicopter using both differential equations and state variable models 2,3. Students have been exposed to system modeling using differential equations and transfer functions in the pre-requisite courses, but state equations are an entirely new concept. In course assignments and in lab, students build models of systems in SIMULINK using both transfer function blocks and state space blocks in order to better understand the similarities between these system models. In MATLAB, the functions ss2tf and tf2ss are introduced as tools for switching between the two types of system models for single-input-single-output (SISO) systems. As an example, one of the systems explored in lab is the two-mass system shown in Figure. y (t) y 2 (t) f(t) Applied Force Spring, K Rolling Friction = B (constant) Figure : Two-mass System Page 7.94.

The connection between the two carts is modeled using a spring with a spring constant, K. The friction is assumed to be a constant, B. M and M 2 represent the mass of Cart and Cart 2 respectively. Students are first asked to derive the differential equations that model this system: M d 2 y /dt 2 = f(t) K(y y 2 ) Bdy /dt M 2 d 2 y 2 /dt 2 = K(y y 2 ) Bdy 2 /dt The next step is to derive the state model by defining the states to be the position and velocity of each of the carts. Defining the states as physical system variables as opposed to the states of the controllability model is extremely important in promoting technology students' understanding of the concept of a state. By defining x = y (position of cart ), x 2 =y 2 (position of cart 2), x 3 = dy /dt (velocity of cart ), and x 4 = dy 2 /dt (velocity of cart 2), students derive the following state variable model: x x d/dt x 2 = x 2 + f(t) x 3 -K/M K/M -B/M x 3 /M x 4 K/M 2 -K/M 2 -B/M x 4 The final step of this exercise is for students to build the system in SIMULINK and explore the system step response using several different values for the spring constant, K, and the coefficient of friction, B. The following example illustrates the effect of the spring constant on relative cart displacement. Figure 2(a) shows the block diagram constructed in SIMULINK and Figure 2 (b) shows the resulting cart displacements. Step =.5 N x' = Ax+Bu y = Cx+Du Spring Constant = 2 N/m Displacement of Carts Step =.5 N x' = Ax+Bu y = Cx+Du Spring Constant =.2 N/m Displacement of Carts Figure 2 (a): Two-mass System in SIMULINK Page 7.94.2

3 Displacement with K= 2 3 Displacement with K=.2 25 25 2 2 5 5 5 5-5 5 5 2 time(sec) -5 5 5 2 time(sec) Figure 2 (b): Cart Displacements with Varying Spring Constants Three important teaching considerations emerge from this section on modeling: Using a wide variety of system models generates student interest in the subject. Defining the states as physical system variables as opposed to the states of the controllability model is extremely important in promoting technology students' understanding of the concept of a state. Building the system in SIMULINK gives students a much clearer picture of the system model than using MATLAB commands to generate system responses. III. Transient Response An understanding of how pole and zero locations affect the transient response of a system is critical when designing a state feedback controller based on pole placement. The equations for 2 nd order systems that relate percent overshoot and settling time for the step response to the damping coefficient and natural frequency of the closed-loop system poles are given by: Percent Overshoot = exp(-pz / sqrt(-z 2 ) ) Settling Time = 4 / (zw n ) Where: w n = natural frequency = magnitude of poles z = damping ratio = - Real[pole]/w n Students are familiar with these equations from a previous course in output feedback. The effect of extra poles and zeros on the system response is then reviewed. In lab, students complete some Page 7.94.3

simple yet useful examples which illustrate that zeros in the vicinity of the dominant complex poles will increase the percent overshoot while extra poles can slow the system response significantly. One of the exercises showing the effect of zeros on system response is included here..5 Step Response A.5 Step Response B.5.5 2 3 4 2 Step Response C.5 2 3 4 Step Response D -2.5-4 2 3 4 2 3 4 Figure 3: Effect of Zeros on System Transient Response System A is a 2 nd order system with complex poles at 3 + j5. System B has the same poles as System A with an additional zero at 4. The graph shows the increase in percent overshoot due to this additional zero, which is located fairly close to the complex poles. System C has the same poles as System A with an additional zero at + (non-minimum phase system). This right half plane zero causes the system response to initially go the wrong way. System D has the same poles as System A with an additional zero at 5. Since this zero is not close to the complex pole, it has virtually no effect on the step response. Three important teaching considerations emerge from this section on transient response: It is critical for students to understand the relationship between pole locations and transient response (percent overshoot, rise time, and settling time) in order to be able to choose desirable pole locations for a state feedback controller. It is also critical for students to understand how additional poles and/or zeros in the system can have undesirable effects on the transient response and to understand how to counteract these effects. Examples using MATLAB and SIMULINK facilitate students making the necessary connections between pole and zero locations and system transient response. Page 7.94.4

IV. Advantages of State Feedback over Output Feedback Although output feedback is sufficient for many systems, state feedback is very useful for multiinput multi-output systems and for control systems with optimal constraints such as those requiring minimal control effort or minimum time to final value. Several examples are discussed in lecture and lab that illustrate the advantages of state feedback. Only one example, a position control system for an armature-controlled dc motor, is included in this paper. The differential equations modeling the motor are derived in class. A state model is derived by defining two states: the position of the motor shaft and the velocity of the motor shaft. The system is first modeled in Simulink where students compare the motor response when feeding back only the shaft position (output feedback) to the motor response when both shaft position and shaft velocity are fed back (state feedback). A portion of the Simulink results is included here. The first block diagram in Figure 4 is a position control system using output feedback and the second block diagram is a position control system using state feedback (both position and velocity). Students experiment with several different gain values and observe the effect on the system response. 2.5 s+4 s ypos Step Gain Transfer Fcn Integrator To Workspace Output Feedback 2.5 s+4 s ystate Step Gain Transfer Fcn Integrator To Workspace 2.5 Gain2 State Feedback Figure 4: Output Feedback and State Feedback for a DC Motor Page 7.94.5

The response for one particular set of gains is shown in the scope plot in Figure 5. Including velocity feedback adds damping to the system (reduces overshoot) and speeds up the system response (reduces settling time)..4 Shaft Position.2.8 Output Feedback Response State Feedback Response.6.4.2.5.5 2 2.5 3 3.5 4 time Figure 5: Shaft Position of Motor In lab, students experiment with output and state feedback using a Servo Trainer designed by Feedback Incorporated 4. Students are able to vary the feed-forward gain and the tachometer gain and observe the effects on the motor response. This lab is valuable in providing a good visual illustration of the power of state feedback. As a final exercise, students derive the transfer functions of the state feedback and output feedback systems leaving the gains as variables. They can then show state feedback gives them enough degrees of freedom to place the closed-loop poles in any desired position. Output feedback on the other hand, limits their choice of closed-loop pole positions. Important teaching considerations that emerge from this section on state feedback are: Examples using MATLAB and SIMULINK that clearly illustrate the advantages of state feedback are critical in helping students understand the advantage of using the more complicated state-feedback controller. A hands-on lab such as the DC motor lab described above is an invaluable tool for demonstrating the concept of state-feedback, particularly if the states are physical variables of the system. Page 7.94.6

V. Pole Placement Using State Feedback The theory behind pole placement using state feedback is briefly discussed with the students. Proofs are not included in the lecture. We begin with the state model which students at this point have become comfortable with: dx(t)/dt = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) The controllability matrix is then defined as [B AB A 2 B A n- B] where n is the system order or equivalently the number of states. The theorem concerning pole placement is then introduced. Theorem: The system is controllable (i.e., the closed-loop poles can be placed in any desired position) if the determinant of the controllability matrix [B AB A 2 B A n- B] is non-zero. The controllability model for a system is then introduced. It is shown that for any given set of desired poles, a set of feedback gains can be derived to place the system closed-loop poles at the desired positions. Students are reminded of the exercise with the dc motor (discussed in the previous section) where they derived a closed-loop transfer function and showed they had complete freedom in specifying the location of the poles by properly choosing the feedback gains. Finally, Ackermann s formula is introduced to compute the state-feedback gains to place the poles in the desirable positions: K = [ ] [B AB A 2 B A n- B] - a c (A) ( x n) (n x n) (n x n) where a c (s) is the desired characteristic polynomial for the closed-loop system. One of the examples given in lecture is a state-feedback system to control the pitch angle of a helicopter. The equations of motion taken from [3] are given by: d 2 q/dt 2 = -.45 dq/dt. dx/dt + 6.27 d d 2 x/dt 2 = 9.8 q -.43 dq/dt.98 dx/dt + 9.8 d where q is the pitch angle, x is the translation in the horizontal direction, and d is the rotor angle. Students are given a step-by-step procedure for designing a state-feedback controller. The steps with application to the pitch control system for the helicopter are included here. The performance specifications for this controller are a maximum 2% overshoot to a step change in the rotor angle and a maximum settling time of seconds. Step : Derive the state model and enter it into MATLAB. The states are defined as: x = q (pitch angle) x 2 = dq/dt (pitch velocity) x 3 = dx/dt (horizontal velocity) Page 7.94.7

The input is the rotor angle, d, and the output is the resulting pitch angle, q. The MATLAB statements for entering the state model are: a=[ ; -.45 -.; 9.8 -.43 -.98]; b=[; 6.27; 9.8]; c=[ ]; d=; Step 2: Check for controllability of the system. det(ctrb(a,b)) ans = -2.46e+3 Þ The system is controllable. Step 3: Find the zeros of the system. zeros = -2.457e-3 [num,den]=ss2tf(a,b,c,d); format short e zeros=roots(num) Step 4: Determine the desired pole locations based on the performance specifications. The damping coefficient corresponding to a percent overshoot of 2% is z =.45. The natural frequency, w n, needed to satisfy the settling time specification and the resulting closed-loop poles are calculated using the MATLAB statements: wn = 8.8889e- realpart = -4.e- imagpart = 7.938e- zeta=.45; ts=; wn=4/(zeta*ts) realpart=-zeta*wn imagpart=wn*sqrt(-zeta^2) The desired dominant complex poles are at -.4 + j.8. What about the other pole? Place the other pole at -.25 to cancel the effects of the zero. It is a very interesting exercise to show students what happens if this zero is neglected and the third pole is chosen far to the left of the complex poles, say at -2.. Step 5: Find the feedback gains to place the poles at the desired positions. (a) Find the desired denominator for the closed-loop transfer function: desired = conv([.4 +.8j],[.4-.8j]); desired = conv(desired, [.25]); (b) Calculate the feedback gains using Ackermann's formula k=[ ]*inv(ctrb(a,b))*polyvalm(desired,a) k =.276e- 6.4e-2 -.7697e-3 Page 7.94.8

(c) Check to make sure the closed-loop poles are in the desired locations: anew=a-b*k; [clnum,clden]=ss2tf(anew,b,c,d); poles=roots(clden) poles = -4.e- +8.e-i -4.e- -8.e-i -2.5e-3 Step 6: Simulate the system response to check specifications: The system response can be generated using the MATLAB commands step or lsim but students get a better understanding of the feedback system by building it in SIMULINK using the State Variable block. The block diagram for the pitch angle control system and the system response to a step change in the rotor angle are shown in Figure 6. Commanded Rotor Angle x' = Ax+Bu y = Ix+Du Helicopter Model I = 3x3 Identity Matrix K States Feedback Gains C C = [ ] Pitch Angle Figure 6 (a): State Feedback Controller for Pitch Angle of Helicopter.25 Pitch Angle (rad).2.5..5 5 5 2 Time (sec) Figure 6 (b): Pitch Angle of Helicopter Page 7.94.9

Teaching Considerations that emerge from this section on pole placement include: Although the state-feedback design and simulation can be done completely in MATLAB, building the system using SIMULINK gives students a better understanding of what the physical control system would look like. Having students check the closed-loop poles reinforces the validity of Ackermann s formula and the pole-placement technique. This is a useful replacement of the proofs included in a more rigorous course in state-feedback control. VI. Designing Observers for State Estimation In many systems, some of the states of the system may not be measurable and available for state feedback. In this case, the actual state is replaced by an estimate of that state derived from a state estimator or a state observer. As in the case of state feedback, the theory behind state estimation is discussed in lecture without any formal proofs of theorems. Reduced order state estimators are discussed and designed in lecture and lab but will not be included in this paper. Students are given a step-by-step procedure for designing a state estimator. The steps are similar to those outlined in the previous section and therefore are not included here. An example of state estimation to control pitch angle of the helicopter discussed in the previous section is included. The performance specifications for the controller are the same as those outlined in the previous section: a maximum 2% overshoot to a step change in the rotor angle and a maximum settling time of seconds. Therefore, the feedback controller gains are identical to those computed in the previous section. A desired pitch angle of.2 radians is assumed. Also, the initial conditions of the system are assumed to be q = ; dq/dt=; and dx/dt=5. The initial conditions for the estimator are all assumed to be zero. The state-feedback controller and state estimator are built using SIMULINK. The system block diagram and the system response are shown in Figure 7..3 Pitch (Actual and Estimated).25.2.5..5 -.5 2 4 6 8 2 4 6 8 2 Figure 7 (a): Actual and Estimated Pitch Angles Page 7.94.

Commanded Rotor Angle u(t) B x' = Ax+Bu y = Cx+Du Helicopter Model y(t) G K Feedback Gains State Estimator x' = (A-GC)x+Bu+Gy y = Ix Observer Gains Actual and Estimated Pitch Angle C Estimated Pitch Angle Figure 7 (b): Pitch Control for Helicopter using State Estimation VII. Conclusion A course and lab in state-variable feedback was developed as a technical elective for students in Electrical Engineering Technology at University of Cincinnati. The lectures, exercises, and labs were designed using MATLAB and SIMULINK to illustrate the advantages of state-feedback control without using rigorous mathematics. Bibliography [] MATLAB and SIMULINK, The MathWorks, Inc., 24 Prime Park Way, Natick, MA 76. [2] Feedback Control Systems, Phillips and Harbor, 4 th Edition, Prentice Hall, 2. [3] Modern Control Systems, Dorf and Bishop, 7 th Edition, Addison-Wesley, 995. [4] Feedback Incorporated, P.O. Box 4, 437 Dimmocks Mill Rd., Hillsborough N.C. 27278. Biography Dr. Kathleen Ossman is an assistant professor in the Electrical and Computer Engineering Technology Department at the University of Cincinnati. She received a BSEE and MSEE from Georgia Tech in 982 and a Ph.D. from the University of Florida in 986. Her interests include feedback control systems and digital signal processing. Page 7.94.