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

Similar documents
State Feedback Controller for Position Control of a Flexible Link

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

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

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

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

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

Lab 3: Quanser Hardware and Proportional Control

YTÜ Mechanical Engineering Department

2.004 Dynamics and Control II Spring 2008

Double Inverted Pendulum (DBIP)

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

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

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

Experiment # 5 5. Coupled Water Tanks

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

Rotary Flexible Link. Workbook FLEXGAGE. Student Version

EE 422G - Signals and Systems Laboratory

State space control for the Two degrees of freedom Helicopter

Positioning Servo Design Example

Chapter 7. Digital Control Systems

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

Lab 5a: Pole Placement for the Inverted Pendulum

YTÜ Mechanical Engineering Department

State Feedback MAE 433 Spring 2012 Lab 7

Inverted Pendulum: State-Space Methods for Controller Design

1 x(k +1)=(Φ LH) x(k) = T 1 x 2 (k) x1 (0) 1 T x 2(0) T x 1 (0) x 2 (0) x(1) = x(2) = x(3) =

EEE 480 LAB EXPERIMENTS. K. Tsakalis. November 25, 2002

CYBER EXPLORATION LABORATORY EXPERIMENTS

EE480.3 Digital Control Systems. Part 7. Controller Design I. - Pole Assignment Method

QNET DC Motor Control

Performance of Feedback Control Systems

The control of a gantry

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

ECSE 4962 Control Systems Design. A Brief Tutorial on Control Design

The Control of an Inverted Pendulum

Mo de ling, Ide nti cat ion, and Control of a DC-Servomotor

Inverted Pendulum. Objectives

Lab 6a: Pole Placement for the Inverted Pendulum

Video 5.1 Vijay Kumar and Ani Hsieh

Feedback Control of Linear SISO systems. Process Dynamics and Control

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

Experiment A11 Chaotic Double Pendulum Procedure

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

Rotary Flexible Joint

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

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

Introduction to Digital Control. Week Date Lecture Title

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

(a) Find the transfer function of the amplifier. Ans.: G(s) =

PID Control. Objectives

Chapter 13 Digital Control

(b) A unity feedback system is characterized by the transfer function. Design a suitable compensator to meet the following specifications:

EEE 188: Digital Control Systems

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

EE 380 EXAM II 3 November 2011 Last Name (Print): First Name (Print): ID number (Last 4 digits): Section: DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO

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

STUDENT Workbook IP02 Base Unit Experiment for MATLAB /Simulink Users

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

DC-motor PID control

FEEDBACK CONTROL SYSTEMS

Inverted Pendulum System

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

IfA Fachpraktikum - Experiment 3.7A : Flexible Shaft A

Teaching State Variable Feedback to Technology Students Using MATLAB and SIMULINK

Control System Design

CDS 101/110a: Lecture 8-1 Frequency Domain Design

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Control Systems. University Questions

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

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

Linear State Feedback Controller Design

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

Circular Motion and Centripetal Force

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

Introduction to Feedback Control

ECE3510 Lab #5 PID Control

Computer Aided Control Design

Flexible Pendulum (FLEXPEN)

Lecture: Sampling. Automatic Control 2. Sampling. Prof. Alberto Bemporad. University of Trento. Academic year

LABORATORY INSTRUCTION MANUAL CONTROL SYSTEM II LAB EE 693

Laboratory Exercise 1 DC servo

IMPROVED TECHNIQUE OF MULTI-STAGE COMPENSATION. K. M. Yanev A. Obok Opok

Appendix A: Exercise Problems on Classical Feedback Control Theory (Chaps. 1 and 2)

Systems Analysis and Control

EE480.3 Digital Control Systems. Part 7. Controller Design I. - Pole Assignment Method - State Estimation

Experiment 81 - Design of a Feedback Control System

The Control of an Inverted Pendulum

Controls Problems for Qualifying Exam - Spring 2014

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

Classify a transfer function to see which order or ramp it can follow and with which expected error.

EL2450: Hybrid and Embedded Control Systems: Homework 1

Chapter 5 HW Solution

6.1 Sketch the z-domain root locus and find the critical gain for the following systems K., the closed-loop characteristic equation is K + z 0.

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

Control Systems I Lecture 10: System Specifications

Digital Control Systems

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

Digital Control Semester Project

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING. MSc SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2015/2016

Transcription:

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

EE 461 Experiment #1 Digital Control of DC Servomotor 1 Objectives The objective of this lab is to introduce to the students the design and implementation of digital control. The digital control is implemented on a lab-scale DC Servomotor in the control systems laboratory. The performance of the resulted digital control system is compared with the continuous-time control system performance. The effect of sampling period T s (or sampling frequency f s = 1 T s ) is studied. When doing the lab, the software packages MATLAB with Control Systems Toolbox, and the Simulink are used for the analysis and design of control systems. 2 Introduction An important approach to digital controller (filter) design is to start with a well-designed analog controller. The digital controller C(z) is then implemented by discretizing the continuoustime controller C(s). This design method is also called design by emulation, which is widely used by control engineers in practice. It is known that for a properly chosen sampling period, this method can provide a useful digital controller with satisfactory performance. In this lab, students are asked to implement the digital controllers, obtained by discretizing a pre-specified analog controller using some common discretization methods. The effect of sampling frequency is also studied by comparing different system responses with respect to f s. In the last part of the experiment, the students are asked to implement a digital controller designed directly for the discrete-time dc-motor model, and the system response is obtained for comparison purpose. 1

3 Preparation Before the lab begins, students are required to read and understand the Control System Laboratory Manual for the hardware and software description. In addition, it is recommended that the students complete the following pre-lab work. The Quanser dc-servomotor in the control systems laboratory has the following model (with a low gear ratio and in the load free case): P(s) = 20020. The analog control system can s(s+42) be implemented by using a continuous-time controller C(s): Figure 1: Analog Control System for a DC-Motor In this lab, the analog controller is given as a lead compensator C(s) = 0.08s+0.08 s+3, which can generate a satisfactory transient and steady-state performance of the system step response. By discretizing C(s), one can implement a digital control system: Figure 2: Digital Control System for a DC-Motor 1. With the sampling interval chosen as T s = 0.001, and T s = 0.01, use the Bilinear transformation (Tustin s method) to obtain the discrete-time models of C(s), denoted by C 1 (z) and C 2 (z), respectively. This can be done by using c2d command in Matlab. Record down C(s), C 1 (z), and C 2 (z), and they will be used in the following experiment procedure. 2

4 Experiment Procedure 1. Check and understand the wiring between the dc-motor, power module(upm) and the computer. 2. Start the MATLAB, and Simulink. It can be noticed that a Quanser toolbox is installed in the Simulink, and it contains the blocks to interface with the real system setup. 4.1 Part 1. Implementation of Analog Control 3. Build a simulink model (use Simulink and Quanser toolbox) to implement the analog control system in Figure 1, with C(s) given there. The motor shaft Encoder is used to measure the angular position, and a calibration gain of -360/4096 needs to be added to the encoder to convert the angular signal to degree. The reference input is set to a step signal of 30 degrees. 4. Compile your program by going to WinCon in the manual bar and clicking Build, a WinCon interface window will then appear if there is no error in your simulink model. Remember to adjust your motor shaft to zero position before start running the system every time. You can also select scopes to monitor the signals in real-time. For example, choose scopes to monitor the angular position Θ(t) and the control signal u(t) 5. Run the system by clicking Start, after 6 seconds (it can be seen from the scope), stop the program by clicking Stop and save the data for later analysis. Another way to stop the program is to add the following timer in your Simulink model, which allows the simulation to stop automatically. Figure 3: Timer 3

4.2 Part 2. Implementation of Digital Control by Emulation 6. Implement the digital control system in Figure 2. Set the sampling time as T s = 0.001 sec., then replace the analog controller in your Simulink model by the discretized one C 1 (z). Remember to set the same sampling time in the input block, and in the Simulation > Parameters... (change simulation method to discrete, and set the fixed step size as same as T s ). 7. Repeat steps (4) and (5), and save the data 8. Set T s = 0.01 sec., implement C 2 (z). Repeat steps (6) and (7) 4.3 Part 3. Digital Control by Direct Design In the following steps, we are going to implement a digital controller directly designed based on the discretized plant (i.e. the ZOH equivalent model of P(s)), rather than discretizing an analog controller. This method is referred to as direct design method. 9. By setting T s = 0.01 sec., a discrete-time compensator of the form C 3 (z) = K( z 0.657 z 0.35 ) is chosen. Implement C 3 (z) in your model, and repeat the steps (4) and (5). Observe the system response and save the data. Note: The gain K in C 3 (z), can be tuned to get a good performance. ( Warning: the system is very sensitive to the selection of K, too large K may result in instability, a suitable rang is [0.2, 0.05]), a suitable choice is K = 0.12) 10. When changing the sampling interval to T s = 0.1 (a rather slow sampling), one has to re-design the discrete-time compensator, it is chosen as C 4 (z) = 0.04( z 0.6 ). Implement C 4 (z), and observe the system z 0.35 response. Caution: during the experiment, the motor may run without control, such as turning extremely fast and making unpleasant noises, in these cases, stop the program immediately, and ask for assistance. 5 Analysis and Discussion Finally, after all the trials, load the data into Matlab and plot the time responses of the dcmotor angular position. Evaluate the performance by calculating the percent of overshoot (P.O.), settling time (T s, and steady-state error e ss. It is recommended to plot the reference input signal and the output signals that you want to compare in the same graph. 4

1. Compare the step responses of the dc-motor using the discretized controller C 1 (z), and C 2 (z) with that of analog controller C(s), in terms of P.O., T s, and e ss. What can you observe? 2. How does the sampling time affect the system responses in the experiment in Part 2? 3. Compare the system response by using C 3 (z) in Part 3, step (9), with the system response using C 2 (z) in step (8), what can you say about the performance of these two digital controllers? (remember that they are obtained by emulation and direct design ) 4. From all above procedures when trying different sampling intervals, make a discussion on the effects of sampling time to the system performance. 6 Lab Report Individual reports are required although the students may work in groups. should contain: The reports The pre-lab work A brief introduction of the experiment. Printouts of Simulink models, and all the plots. Your discussions by answering the question in section 5. Any conclusions you would like to draw. The lab report is due by 4pm on Feb. 14, 2011 for section H3 and 4pm on Feb. 28, 2011 for section H4. Please drop your report into the box assigned to EE461 LAB outside the main office at 2nd floor ECERF. 5

EE 461 Experiment #2 Computer Simulation of Digital Control Systems 1 Objectives The objectives of this lab is to perform the inter-sample response analysis and the computer simulation of a sampled-data system using MATLAB. 2 Introduction A typical sampled-data system is shown in Figure 1, where S and H represent the Sampler (A/D converter) and the Holder (D/A converter) respectively. Figure 1: Sampled-Data System Unlike a pure analog system (that has an analog controller and the continuous-time plant), or a pure discrete-time system (with a digital controller and the discretized model of the plant), the sampled-data system has both the digital controller and the continuous-time plant. The signals passing through the entire system is a mixture of sampled data and continuoustime signals. Most control system simulation software packages such as MATLAB only have functions for continuous-time and discrete-time simulations, e.g., lsim, step, and dstep, dlsim, etc., but none for sampled data simulation. This lab is to write a general MATLAB program (function) to simulate the step response of a sampled-data (digital) control system. 1

3 Preparation Before the experiment, the students should understand the procedure of the sampled-data simulation, and the procedure for calculating the inter-sample response. 4 Experiment Procedure The analog plant P(s) that we considered in this lab is a flexible beam system: P(s) = 1.6188s 2 0.1575s 43.9425 s 4 + 0.1736s 3 + 27.9001s 2 + 0.0186s Assume that you have designed an advanced digital controller for this complex system (at sampling period T = 0.5 sec), i.e. as in Figure 1: C d (z) = 0.1084z5 0.01202z 4 + 0.1708z 3 + 0.08469z 2 0.09198z 0.04313 (2) z 6 0.6528z 5 0.8377z 4 + 0.4495z 3 + 0.4709z 2 0.5820z + 0.1521 Before we can implement this digital controller on-line and perform real-time control on the real flexible beam system, first of all, we need to test the control system performance in a computer environment. This can be achieved by sampled-data (digital) simulation. The following steps describe the procedure for simulating the step response of the sampleddata system using existing MATLAB functions: 1. Define the models of the digital controller and the analog plant, e.g. (1) sysc d = tf(numc d, denc d, T) Create a discrete-time transfer function with sampling period T (T = 0.5 ) sysp = tf(nump,denp) 2. Discretize the continuous-time plant P(s) to obtain the ZOH equivalent P d (z) (P d (z) = SP(s)H ) via the MATLAB function c2d. 2

The discretized system is shown in Figure 2: Figure 2: The Discretized System Here r d is the sampled input sequence, which is a discrete-time unit step. Figure 2 is the exact model of Figure 1 at sampling instants. 3. Obtain the control signal sequence u d. First of all, compute the transfer function from r d to u d in Figure 2, G 1 (z) = U d(z) R d (z) = C d (z) 1 + C d (z)p d (z) (3) G1 = feedback(sysc d, sysp d) and then compute the discrete-time control sequence u d via dstep, e.g. [numg1,deng1] = tfdata(g1, v ) u d = dstep(numg1,deng1,n) Note: N is the number of samples to be simulated 4. Simulate zero-order-hold, i.e., compute the continuous-time control input u after the ZOH in Figure 1 (u = Hu d ). Suppose we would like to compute n inter-sample points for every sampling period (of length T ), the time increment (step size) in u is then T/n. Thus the vector u is obtained by holding each value of (u d for n time, i.e. u = [u d (1)u d (1)...u d (1)u d (2)...u d (2)...u d (N)...u d (N)] (4) (the for-end loops can be used to obtain u, and the length of u is N n) 5. With input u to P(s) obtained from above, the output y(t) of P(s) in Figure 1 can finally be computed by continuous-time simulation, e.g. lsim. 3

(The obtained y(t) is in fact the computer approximation of the actual continuous-time output in the real system. It should be a good approximation because 10 points of the inter-sample response are calculated during each sampling interval T.) Finally, the above steps can be integrated into a general function named sdstep (or choose your own preferred name) in MATLAB: [y,u,t] = sdstep(numc d,denc d,nump,denp,t,n,n) For this function, the user can define the model of the digital controller in numc d and denc d, and the model of the continuous-time plant in nump and denp. T and N are sampling period and number of samples to be simulated, respectively; and the integer n is the ratio of sampling period T to the time increment T 1 used when calculating the inter-sample response. The returned variables of the above function are the output from continuous-time plant P(s), y(t) (see Figure 1, and the corresponding input u(t) and the time vector t. (Actually, during debugging and the experiment, you can return as many inter-variables as you prefer.) Once you have programmed the function sdstep, perform the following for this experiment: Debug your program(sdstep.m) and simulate the step responses of the sampleddata system with C d (z), P(s) given in Eqs. (1) and( 2), with the sampling period T = 0.5, number of samples N = 40, and the intersample ratio n = 10. Calculate the discrete-time output y d based on the control sequence u d and the discrete-time model using dlsim, the time sequence t d can be chosen as t d = [0:T:(N-1)*T];The time sequence t d with N samples and the interval as T On the same figure, plot the discrete-time control sequence u d vs. t d, and the continuous-time control sequence u vs. t, for example, use: plot(t d,u d, *,t,u, r ) Can you see the effect of the zero-order-hold? On the same figure, plot the continuous-time output y vs. t, and the discrete-time output (t d vs. y d ). 4

plot(t d,y d, *,t,y, r ) Does the discrete-time output samples match the continuous-time output at the sampling instants? 5 Lab Report Your report should contain: A brief introduction. Your program in MATLAB for the sampled-data simulation function: sdstep.m All the plots. Answering the questions given at the end of Section 4. Any conclusions you would like to draw. The lab report is due by 4pm on Mar. 7, 2011 for students in section H3 and 4pm on Mar. 14, 2011 for students in section H4. Please drop your report into the box assigned to EE461 LAB outside the main office at 2nd floor ECERF. 5

EE 461 Experiment #3 State Feedback Control of the Flexible Link System 1 Objectives One of the major advantages of state-space modeling and esign techniques lies in the fact that they can be easily implemented using computers, which have superior processing power and speed in handling matrix computations. In this lab, several types of state feedback designs are implemented on a flexible link setup built by Quanser. The Simulink with Quanser tool box is used as control system development software. Students are expected to understand the design procedure of pole placement design technique and some practical issues in applying theory to real world problems. 2 Introduction The flexible link apparatus consists of a Quanser DC servomotor - SRV02 and a Flexgage module mounted on SRV02. For detailed hardware descriptions and the connections, please refer to the attachment of the Lab Preliminary. The state space model of the flexible link is given as follows (for more details about the derivation of this model, see Appendix of flexible link manual, also available at Lab website): ẋ = 0 0 1 0 0 0 0 1 0 1060.9 57.658 0 0 1465.2 57.658 0 x(t) + 0 0 107.39 107.39 u(t) (1) 1

where x = [θ, α, θ, α] ; θ denotes the motor shaft angle, α the tip deflection angle of the ruler, θ the motor angle velocity, and α the deflection angle velocity. The input u is the voltage applied to motor armature. The design objective for this setup is to move the link within a range of angles (driven by the motor), while maintaining a small deflection at the tip all the time. This is a typical tracking plus regulation problem. Two sensors are installed, one is a shaft encoder to measure motor angle θ, and the other a strain gauge to measure tip deflection angle α. The calibration factors of the shaft encoder and strain gauge are listed as follows: Motor shaft angle: 2π 4096 for radian Deflection angle: 0.0254 0.48 for radian Since there is no sensor to measure angle velocity, θ and α are estimated by two differential filters (their functions are to calculate the differentiation of angles), which are implemented using default Simulink modules. The following figures illustrate analog and digital state feedback controls. In this lab, we are going to implement both of them on the flexible link. It needs to be point out that when implementing digital state feedback control, the selection of sampling period is crucial, especially for this flexible link, because theoretically it is marginally unstable and also has under-damped modes that tend to be more oscillatory. This can be observed by checking the open loop eigenvalues: eig(a). In this case, the analog design can help us to determine suitable sampling period. r(t) + u(t) (A, B) x(t) _ r(t) (A-BL a, B) x(t) L a Figure 1: Analog state feedback control 2

r(k) _ u(k) u(t) x(t) ZOH (A, B) S x(k) r(k) ( Φ ΓL, Γ) x(k) L Figure 2: Digital state feedback control 3 Preparation In the pre-lab section, students are expected to obtain the following results beforehand: 1) The analog state feedback gain L a ; 2) The digital state feedback gain L; and 3) A suitable range of the sampling frequency when implementing the digital state feedback. Note: It is strongly recommended that you have all the results available at least before proceeding to the next part of the lab: Implementation. The Lab TA will check with each group to see whether or not your choice of sampling period and the computed state feedback gains are correct (or reasonable ). This is important, because a careless mistake may result in a severe damage on the hardware. We work with a real system, not a simulation! 1. The set of closed-loop poles for the analog system (in Figure 1) are given as follows: p = ( 150, 16, 10 + j15, 10 j15). For this set of poles, compute and write down the analog state feedback gain L a using MATLAB functions: place or acker. 2. Once L a is obtained, the bandwidth ω B of the analog regulator system can be evaluated based on the bode plot of the following transfer function. Bode plot can be obtained using MATLAB function bode( ): G 1 (s) = L a [si (A BL a )] 1 B (2) The bandwidth is the frequency at which the magnitude response drops 3dB from the magnitude response at the low frequency, i.e. ω = 0. The sampling frequency ω s can then be selected within the following ranges: 40 ω s ω B 3

70. (The upper and lower bound is chosen higher than normally required because of the open loop characteristics of this flexible link setup: under-damped and marginally unstable.) Based on the above justification, compute and write down an appropriate sampling period T = 2π ω s. 3. In the following, you are required to compute the digital state feedback gain based on different design methods: First of all, compute the ZOH discrete plant (Φ, Γ) using the c2d function, with the selected sampling period T (T should be within the above range; a default choice is T = 0.001sec). (Φ, Γ) will be used in the following steps to obtain digital state feedback gains. With your selection of sampling period T, map the closed-loop poles for the analog control system in (1) to z-plane poles z, using the mapping relationship z = e pt, where p = ( 150, 16, 10 + j15, 10 j15). Then use place() or acker() to compute the digital state feedback gain L 1 (in Figure 2) which can achieve the desired z-plane poles p d. In this lab, a Digital Linear Quadratic Regulator (DLQR) is to be implemented as an alternative controller. This design yields a state feedback controller that can achieve the stabilization (regulation) objective as well as minimizing the following performance index: J = x T [k]qx[k] + u T [k]ru[k] (3) k By selecting Q = 3000 0 0 0 0 10000 0 0 0 0 15 0 0 0 0 5 and R = 10, compute the optimal state feedback gain using Matlab function dlqr(). Write it down as L 2 for later use. 4 Experiment Procedure Note: during the experiment, allow enough space for flexible link to turn around. The motor may run extremely fast and make unpleasant noises. In this case, stop experiment immediately and ask for help. 4

1) Check and understand the wiring between the DC motor, Flexgage module, power module (UPM) and the computer. 2) Start the MATLAB and Simulink. Implementation of Analog State Feedback: 3) Build a Simulink model, and implement the analog state feedback control shown in Figure 1, with the gain L a obtained in Section 3. Pay attention to the calibration factors. The reference input is set to a step signal of magnitude 10. 4) Compile your Simulink model by going to WinCon in the manual bar and clicking Build, a WinCon interface window will then appear if there is no error in your model. Remember to adjust the ruler to zero position before start running the system every time. Select scopes to monitor the signals in real-time. For example, choose scopes to monitor the angular position θ, α, and the control signal u. 5) Run the system by clicking Start, after 4-6 seconds (it can be seen from the scope), stop the program by clicking Stop and save the data for later analysis. Another way to stop the program is to add a timer in your Simulink model (refer to the Lab 1 manual). Implementation of Digital State Feedback: 6) Set the sampling period as the value selected in the pre-lab section wherever it is needed in the Simulink model (default choice is T = 0.001sec). Implement the digital state feedback control u[k] = L 1 x[k], where L 1 is obtained by matching the continuous poles used in the analog design. Repeat the steps 4) and 5). Observe the system response and save the data. 7) With the sampling period fixed as in 6), implement the digital linear quadratic regulator u[k] = L 2 x[k], and repeat steps 4) and 5). Observe system response and save the data. 5 Analysis and Discussion Finally, after all the trials, load the data into MATLAB and plot the time responses of the motor shaft angular position θ and tip deflection angle α. For the above three state feedback controllers (i.e., the analog L a, the digital L 1 by matching continuous closed-loop poles, and 5

the optimal DLQR L 2 ), evaluate and compare the performance by calculating the percentage of overshoot (P.O.) and settling time (T s ). Note: Since tracking performance is not explicitly considered in the design of state feedback, the angle position θ is expected to have a tracking error. 6 Lab Report Individual reports are required although the students are allowed to work in groups. The report should contain: The pre-lab work. A brief introduction of the experiment. Printouts of Simulink models and all plots. Your analysis and discussions in section 5. Any conclusions you would like to draw. The lab report is due by 4pm on Mar. 21, 2011 for students in section H3 and 4pm on Mar. 28, 2011 for students in section H4. Please drop your report into the box assigned to EE461 LAB outside the main office at 2nd floor ECERF. 6

EE 461 Experiment #4 Design of Observer-Based State-feedback Control for a Flexible Link System 1 Objectives State estimation(observer) schemes are extremely useful in practical systems, especially when systems states can not be completely measured. The observer-based state feedback control is one of the most important design techniques for modern control systems. In this experiment, students will be given the opportunity to implement such a controller on a lab-scale flexible link system, which is claimed as a difficult system to control because of the inherent underdamped (oscillatory) properties of the system. The real life example of this setup is the Canada Arm (the large scale long flexible beam robotic manipulator) in the outer space. 2 Introduction The state space model of the flexible link is obtained as follows: ẋ(t) = 0 0 1 0 0 0 0 1 0 1060.9 57.658 0 0 1465.2 57.658 0 x(t) + 0 0 107.39 107.39 u(t), (1) where x = [θ, α, θ, α] ; θ represents motor shaft angle, α the tip deflection angle of the ruler, θ motor angle velocity, and α deflection angle velocity. The input u is the voltage applied to motor armature. The design objective for this setup is to move the link within a range of angles (driven by the motor), while maintaining a small deflection at the tip all the time. This is a typical tracking plus regulation problem. Two sensors are installed, one is the shaft encoder to measure the motor angle θ and the other is the strain gauge to measure the tip 1

deflection angle α. The calibration factors of shaft encoder and strain gauge are listed as follows: Motor shaft angle: 2π 4096 for radian Deflection angle: 0.0254 0.48 for radian Since there is no sensor instrumented in this setup to measure angle velocities, θ and α will be estimated in this lab by using a full-order observer, together with the estimated angles θ and α, four system states will all be available for state feedback control. Recall that in the experiment 3, the angular velocity rates are calculated by taking differentiations of angles. From Experiment #3, students may have noticed that the sensor of deflection angle α may not work very well; there may exist an offset/bias in α measured by the strain gauge. This bias is caused by an improperly calibrated sensor. Later when comparing the tip angle, the observation should be made on the oscillation magnitude of α. Considering that the system is still observable with one measurement θ, we will consider to build an observer based on y(t) = [ 1 0 0 0 ] x(t). In this set-up, measurement of α is not needed, and only the measurement of θ is used to construct an observer for state vector. The true state feedback control and the observer-based state feedback control are illustrated in Figure 1 and 2. Figure 1: True state feedback control 2

Figure 2: Observer-based state feedback control 3 Preparation Note: It is strongly recommended that you have all the results available at least before you proceed to the next part of the lab: Implementation. The Lab TA will check with each group to see whether or not your computed state feedback gains and observer gains are correct (or reasonable ). In the pre-lab section, students are expected to obtain the following results: 1) digital state feedback gain L; 2) digital observer gain K. 1. Digital State Feedback Gain L (with sampling period T = 0.001sec) As in Experiment #3, given the closed-loop poles of analog state feedback control system p 0 = ( 100, 16, 10 + j15, 10 j15), obtain the corresponding z-plane poles using the mapping p d0 = e p 0T, T = 0.001. Compute the ZOH discrete system plant (Φ,Γ) using MATLAB function c2d, and then compute the digital state feedback gain L to achieve closed-loop poles at p d0. 2. Digital Observer Gain K Given two sets of poles p 1 = ( 200, 70, 20+j15, 20 j15) and p 2 = ( 120, 30, 20+ j15, 20 j15), map them to z-plane poles p d1 and p d2. Then respectively compute 3

the observer gain K 1 and K 2 to place observer poles with the ZOH discrete plant (Φ,Γ) obtained in Part 3-1. 4 Experimental Procedure During the experiment, allow enough space for the flexible link to turn around. The motor may run without control, turning fast and making unpleasant noises. In this case, stop the program immediately, and ask for assistance. In the following procedures, students are expected to implement both the true state feedback with the state feedback gain L obtained in (1) (follow the same procedure as in Experiment #3), and the observer based state feedback control. The responses of the system output θ and α, are compared in these two designs. Estimation error of the observer will be examined. The effect of choosing different observer poles are also tested with the two different observer gains K 1 and K 2. Case 1: Implementation of the True State Feedback Control: 1) Build a Simulink model to implement the true feedback control shown in Figure 1 with the gain L obtained in Section 3. Pay attention to the calibration factors. The reference input is set to a step signal of magnitude 20 degree in this lab. 2) Set the sampling time as T = 0.001sec. Compile and run your program for 4-6 seconds. Select scopes to monitor the signals in real-time. For example, choose scopes to monitor the angular position θ, and α, and the control signal u. Make sure to save data for later analysis, preferably in the form of.mat files. Case 2: Implementation of Digital Observer-Based State Feedback Control: 3) Set the sampling time as T = 0.001sec. Implement the digital observer-based state feedback control as shown in Figure 2 in the Simulink model, with the state feedback gain L and the observer gain K 1 obtained in the pre-lab section. Select scopes to monitor the signals θ, α, ˆθ, ˆα, and the estimation errors ϵ θ = θ - ˆθ and ϵ α = α - ˆα, where θ and α are true measurement from the plant, and ˆθ and ˆα are estimates from the observer. 4) Compile and run your program, monitor the signals θ, α, ϵ θ, ϵ α in real time and save data for analysis and comparison. 5) With observer gain vector K 2 (computed in the pre-lab section to achieve the poles p 2 (p d2 ), repeat steps 3) - 4). Save the data for analysis and comparison. 4

5 Analysis and Discussion Finally, after all the trials, load the data into MATLAB: 1. Plot the time responses of the motor shaft angular position θ and the tip deflection angle α for the true state feedback and the observer-based state feedback design with K 1. Can you observe any difference? Comment on the performance of the observer-based design. 2. Plot the time responses of motor angle θ, the tip deflection angle α, and the estimation errors ϵ θ and ϵ α, for the observer-based state feedback design with K 1 and K 2 respectively. Can you observe any difference, especially in the estimation error signal recorded? Make discussions on the effect of the observer poles on the overall system performance. 3. Make your own analysis on the possible sources of the estimation errors, which appear to exist in our design. 6 Lab Report Individual reports are required which should contain: The pre-lab work A brief introduction of the experiment Printouts of Simulink models, and all the plots Your analysis and discussions in section 5 Any conclusions you would like to draw The lab report is due by 4pm on Apr. 4, 2011 for students in section H3 and 4pm on Apr. 11, 2011 for students in section H4. Please drop your report into the box assigned to EE461 LAB outside the main office at 2nd floor ECERF. 5