LECTURE NOTES ON CONTROL

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

EE C128 / ME C134 Final Exam Fall 2014

Linear State Feedback Controller Design

MAS107 Control Theory Exam Solutions 2008

Controls Problems for Qualifying Exam - Spring 2014

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)

Control Systems Design

APPLICATIONS FOR ROBOTICS

School of Engineering Faculty of Built Environment, Engineering, Technology & Design

Lecture 5: Linear Systems. Transfer functions. Frequency Domain Analysis. Basic Control Design.

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

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

Systems Analysis and Control

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Prüfung Regelungstechnik I (Control Systems I) Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Problem Set 3: Solution Due on Mon. 7 th Oct. in class. Fall 2013

Outline. Classical Control. Lecture 1

Analysis and Design of Control Systems in the Time Domain

Topic # Feedback Control. State-Space Systems Closed-loop control using estimators and regulators. Dynamics output feedback

INTRODUCTION TO DIGITAL CONTROL

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

Identification Methods for Structural Systems

Lecture 1: Feedback Control Loop

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

Time Response Analysis (Part II)

Subject: Optimal Control Assignment-1 (Related to Lecture notes 1-10)

Problem Weight Score Total 100

100 (s + 10) (s + 100) e 0.5s. s 100 (s + 10) (s + 100). G(s) =

Automatic Control 2. Loop shaping. Prof. Alberto Bemporad. University of Trento. Academic year

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Outline. Classical Control. Lecture 2

CONTROL DESIGN FOR SET POINT TRACKING

An Introduction to Control Systems

Introduction to Feedback Control

Raktim Bhattacharya. . AERO 632: Design of Advance Flight Control System. Preliminaries

Control Systems. EC / EE / IN. For

Control Systems I. Lecture 6: Poles and Zeros. Readings: Emilio Frazzoli. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

The output voltage is given by,

Dr Ian R. Manchester

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Exam. 135 minutes, 15 minutes reading time

Professor Fearing EE C128 / ME C134 Problem Set 7 Solution Fall 2010 Jansen Sheng and Wenjie Chen, UC Berkeley

Systems Analysis and Control

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

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

Synthesis via State Space Methods

Introduction to Controls

Homework 7 - Solutions

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

Lec 6: State Feedback, Controllability, Integral Action

Linear Systems Theory

FATIMA MICHAEL COLLEGE OF ENGINEERING & TECHNOLOGY

Autonomous Mobile Robot Design

Exam. 135 minutes + 15 minutes reading time

Introduction to Modern Control MT 2016

EEE 188: Digital Control Systems

5. Observer-based Controller Design

Intro. Computer Control Systems: F9

TRACKING AND DISTURBANCE REJECTION

Control Systems Engineering (Chapter 2. Modeling in the Frequency Domain) Prof. Kwang-Chun Ho Tel: Fax:

INC 341 Feedback Control Systems: Lecture 2 Transfer Function of Dynamic Systems I Asst. Prof. Dr.-Ing. Sudchai Boonto

Control System. Contents

Plan of the Lecture. Goal: wrap up lead and lag control; start looking at frequency response as an alternative methodology for control systems design.

LABORATORY INSTRUCTION MANUAL CONTROL SYSTEM I LAB EE 593

Systems Analysis and Control

MODERN CONTROL DESIGN

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

Index. Index. More information. in this web service Cambridge University Press

ECE 486 Control Systems

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

Time Response of Systems

EE 422G - Signals and Systems Laboratory

Frequency Response Analysis

Control Systems I. Lecture 7: Feedback and the Root Locus method. Readings: Jacopo Tani. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

Richiami di Controlli Automatici

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

agree w/input bond => + sign disagree w/input bond => - sign

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

MATHEMATICAL MODELING OF CONTROL SYSTEMS

Topic # Feedback Control Systems

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

ME 375 Final Examination Thursday, May 7, 2015 SOLUTION

Dr Ian R. Manchester Dr Ian R. Manchester AMME 3500 : Root Locus

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur


Control Systems Design

Lecture 7: Laplace Transform and Its Applications Dr.-Ing. Sudchai Boonto

Learn2Control Laboratory

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

Topic # Feedback Control

Power System Control

Intro. Computer Control Systems: F8

I Laplace transform. I Transfer function. I Conversion between systems in time-, frequency-domain, and transfer

MODELING OF CONTROL SYSTEMS

Section 5 Dynamics and Control of DC-DC Converters

Modeling and Simulation Revision IV D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

EECS C128/ ME C134 Final Wed. Dec. 14, am. Closed book. One page, 2 sides of formula sheets. No calculators.

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

ECE557 Systems Control

Transcription:

Department of Control for Transportation and Vehicle Systems Faculty of Transportation Engineering and Vehicle Engineering Budapest University of Technology and Economics Tamás Tettamanti PhD., Qiong Lu LECTURE NOTES ON CONTROL 2018

Contents 1.1Introduction to control theory 1-1 1.1.1 Open and closed loop control process........................... 1-1 1.1.2 Basic concepts for Linear Time Invariant (LTI) systems................ 1-2 1.1.2.1 Linearity...................................... 1-2 1.1.2.2 Time invariance.................................. 1-2 1.1.2.3 Causality...................................... 1-3 1.1.3 Typical control types.................................... 1-3 1.1.4 Control system....................................... 1-4 1.2Time domain analysis 1-5 1.2.1 Signals applied for analysis................................ 1-5 1.2.2 Laplace transformation................................... 1-5 1.2.3 Example........................................... 1-7 1.2.4 Example........................................... 1-10 1.2.5 Programming........................................ 1-11 2.1Frequency domain analysis 2-1 2.1.1 Connection between Laplace domain and Frequency domain.............. 2-1 2.1.2 RLC circuit......................................... 2-1 2.1.2.1 Impedances..................................... 2-1 2.1.2.2 Transfer function of RLC circuit......................... 2-2 2.1.3 Visualization of the system frequency function..................... 2-4 2.1.4 Basic transfer functions and their Bode diagrams: 0TP, 0TI, 0TD, 1TP, 1TD, PD.. 2-5 2.1.4.1 0TP......................................... 2-5 2.1.4.2 0TD......................................... 2-6 2.1.4.3 0TI......................................... 2-7 2.1.4.4 1TP......................................... 2-8 2.1.4.5 1TD......................................... 2-10 2.1.4.6 PD.......................................... 2-10

3.1Frequency domain analysis tutorial 3-1 3.1.1 Example........................................... 3-1 3.1.2 Example........................................... 3-3 3.2Bode stability 3-4 3.2.1 Open loop transfer function................................ 3-4 3.2.2 Bode Stability........................................ 3-4 3.3Rearranging blocks to reduce block diagram and determine the combined transfer function 3-5 3.3.1 Single block......................................... 3-5 3.3.2 Series connection...................................... 3-6 3.3.3 Parallel connection..................................... 3-6 3.3.4 Simple negative feedback system............................. 3-6 3.3.5 Negative feedback system with block in the feedback loop............... 3-6 3.4Performance parameters 3-7 3.5PID control 3-8 3.6PID controller design example 3-8 4.1Example: cruise control realization 4-1 5.1State-space representation 5-1 5.1.1 Example........................................... 5-2 5.1.2 Question........................................... 5-3 5.1.3 Example........................................... 5-3 6.1Equivalence between state-space representation and system s transfer function 6-1 6.2Stability 6-1 6.3Controllability 6-2 0-1

6.4Observability 6-2 6.5Minimality 6-2 6.6Examples 6-3 7.1Principle 7-1 7.2Design method 7-2 8.1Principle 8-1 8.2LQR design steps 8-2 0-2

Lecture 1: Introduction to control theory and time domain analysis 1-1 Control Theory Lecture 1: Introduction to control theory and time domain analysis In this lecture we introduce basic concepts of control theory and time domain analysis. Website: http://www.kjit.bme.hu/index.php/en/for-students/control-theory 1.1 Introduction to control theory The goal of control theory is control the behavior of a system (we also say command/manage/regulate). There are two kinds of control systems: ˆ open loop control, ˆ closed loop control. Here we give some examples of these two type of control systems. Open loop control system: ˆ hair dryer, ˆ toaster. Closed loop control system: ˆ air conditioner, ˆ cruise control (tempomat). 1.1.1 Open and closed loop control process Figure 1.1: Control process of open loop systems Block diagram of the open loop system control process is shown in Figure 1.1. For the hair drier as example: ˆ Input means that the ON/OFF power button is turned on;

Lecture 1: Introduction to control theory and time domain analysis 1-2 ˆ Controller is an electric switch to allow current (i.e. the Process Input) into the circuit of the dryer; ˆ Process System is the hair dryer itself (more specifically the electric engine within); ˆ Process Output is the output of the dryer, i.e. the hot air blow. Block diagram of the closed loop system control is depicted by Figure 1.2. Figure 1.2: Control process of closed loop systems For example, if we set the temperature of an air conditioner to 20, then 20 is the Reference value. The air conditioner have a Sensor that can detect the indoor temperature. If the temperature is higher than 20, for example, 25, then the Measured error is -5. Accordingly, a well designed Controller will command the System (i.e. the engine of the air conditioner) to cool the room until the Measured error becomes 0. 1.1.2 Basic concepts for Linear Time Invariant (LTI) systems 1.1.2.1 Linearity Linearity: the theory of superposition is valid to the system, i.e. u α u 1 + β u 2 (1.1) y α y 1 + β y 2 (1.2) u and y represent the system input and output signals. α and β are constant coefficients. 1.1.2.2 Time invariance Time invariance: the system response does not depend on the time of the input (i.e. when we apply te input). See as example Figure 1.4!

Lecture 1: Introduction to control theory and time domain analysis 1-3 Figure 1.3: Example for the linearity of the system Figure 1.4: Time invariance of the system 1.1.2.3 Causality Causality: the output of the system only depends on the past (i.e. already applied) input signals and does not depend on future input. 1.1.3 Typical control types ˆ Set point tracking control: maintain a given parameter/feature on a given set point while the environment changes, e.g. car cruise control, air conditioner, etc. ˆ Reference tracking control: continually track a time varying signal (reference), e.g. moving a

Lecture 1: Introduction to control theory and time domain analysis 1-4 robotic arm on a given way, robot-assisted surgery, etc. ˆ Compensation of disturbance (also called as disturbance rejection): minimize the effect of disturbances, e.g. minimizing the vibration inside the car. 1.1.4 Control system The block diagram of a general closed loop control system is shown by Fig. 1.5 where the signals are given in Laplace domain: ˆ R(s) is the reference value; ˆ E(s) means the measured error signal between the R(s) and Y (s); ˆ C(s) is controller s transfer function; ˆ U(s) is the output of controller and also the input of the controlled system; ˆ G(s) is the system transfer function (i.e. the model of the system itself); ˆ D(s) means disturbance signal; ˆ Y (s) stands for the output of the system. Their relationship is shown below: C(s) U(s) E(s) G(s) Y (s) U(s) (1.3) (1.4) E(s) R(s) Y (s) (1.5) Figure 1.5: Closed Loop Control System The controller part is typically realized on digital computers. Two main steps of controller design: ˆ Analysis: we have to analyze and understand the system s behavior based on an appropriate system model. ˆ Synthesis: based on the system model we have to design the closed loop control by considering the given control criterion.

Lecture 1: Introduction to control theory and time domain analysis 1-5 1.2 Time domain analysis 1.2.1 Signals applied for analysis ˆ Impulse function (also called Dirac delta): 0 if t < 0, δ(t) 1 (in engineering practice) or (theoretically) if t 0, 0 if t > 0. As example for a typical impulse function and impulse response function, see Figs. 1.6 and 1.7. ˆ Unit step function 1(t) { 0 if t < 0, 1 if t 0. As example for a typical unit step function and step response function, see Figs. 1.8 and 1.9. Figure 1.6: Dirac delta function Figure 1.7: Impulse response function 1.2.2 Laplace transformation F (s) f(t)e st dt 0 s C L{f(t)} F (s) L 1 {F (s)} f(t)

Lecture 1: Introduction to control theory and time domain analysis 1-6 Figure 1.8: Step function Figure 1.9: Step response function Table 1.1: Table of most common Laplace transformations Time domain: f(t) Laplace domain: F (s) L{f(t)} δ(t) 1 1(t) 1 s α t α s 2 e +αt 1 s α e αt 1 s + α constant a i, b j k f(t) f 1 (t) ± f 2 (t) a i, b j k F (s) F 1 (s) ± F 2 (s) d n f(t) dt n s n F (s), if f(0) 0 f(t)dt 1 s F (s)

Lecture 1: Introduction to control theory and time domain analysis 1-7 Lemma 1.1 Residuum theorem: f(t) n Res pi {F (s) e st } i1 n lim (s p i ) F (s) e st s p i i1 where p i is the i th pole of the system and n is the number of poles. Theorem 1.2 Final value theorem: lim f(t) lim sf (s) lim t 0 s f(t) lim sf (s) t s 0 If {}}{ y(t) g(t) Y (s) G(s) U(s) G(s). 1 Thus: lim g(t) lim sg(s) t 0 s lim g(t) lim sg(s) t s 0 If {}}{ y(t) v(t) Y (s) G(s) U(s) G(s) 1 s. 1 s Thus: lim v(t) lim G(s) t 0 s lim v(t) lim G(s) t s 0 where t R, s C 1.2.3 Example Differential equation of the system: Laplace transformation F spring F damper c(u(t) y(t)) k dy(t) dt c(u(s) Y (s)) ksy (s)

Lecture 1: Introduction to control theory and time domain analysis 1-8 Impulse response For impulse response, U(s) 1. So Figure 1.10: Damper spring system G(s) Y (s) U(s) According to Residuum theorem 1.1 c ks + c 2 4s + 2 0.5 s + 0.5 Y (s) 0.5 s + 0.5 y(t) g(t) L 1 {Y (s) 0.5 s + 0.5 } y(t) According Final value theorem 1.2 s + 0.5 0 p 1 0.5 lim (s + 0.5) 0.5 s 0.5 s + 0.5 est 0.5e 0.5t y(0) lim t 0 y(t) lim Impulse response is shown by Fig. 1.11 Unit step response: s s y( ) lim t y(t) lim 0.5 s + 0.5 lim 0.5 s 1 + 0.5 s s 0 s 0.5 s + 0.5 0 0.5 U(s) 1 s Y (s) G(s)U(s) 0.5 s + 0.5 1 s

Lecture 1: Introduction to control theory and time domain analysis 1-9 Instructions to generate the impulse response diagram of the system in Matlab or in Octave Online: num[0.5]; den[1 0.5]; systf(num,den); impulse(sys); Figure 1.11: Impulse response diagram According to Residuum theorem 1.1 y(t) According Final value theorem 1.2 y(t) v(t) L 1 {Y (s) 0.5 (s + 0.5)s } (s + 0.5)s 0 p 1 0.5, p 2 0 lim (s + 0.5) 0.5 s 0.5 (s + 0.5)s est + lim Unit step response is shown by Fig. 1.12 y(0) lim t 0 y(t) lim s s y( ) lim t y(t) lim s 0 s s 0 s 0.5 (s + 0.5)s est 1 e 0.5t 0.5 s + 0.5 1 s 0 0.5 s + 0.5 1 s 1 Instructions to generate the impuse response diagram of the system: num[0.5]; den[1 0.5]; systf(num,den); step(sys); Figure 1.12: Step response diagram

Lecture 1: Introduction to control theory and time domain analysis 1-10 1.2.4 Example Given the mechanical system below, provide the systems transfer function! Then, calculate the impulse response function g(t) and also provide the plot of g(t)! c 1 2N/m, c 2 3N/m, k 50Ns/m Figure 1.13: Mass-Spring-Damper system Application of Newton s second law to define the system model: c 2 y(t) c 1 [u(t) y(t)] + k[ u(t) ẏ(t)] Laplace transformation: c 2 Y (s) c 1 [U(s) Y (s)] + ks[u(s) Y (s)] Rearrange the equation by Y (s) and U(s) and calulate the system s transfer function from the previous equation: G(s) Y (s) U(s) c 1 + ks c 1 + c 2 + ks 2 + 50s 5 + 50s s + 0.04 s + 0.1 Impulse response calculation: Y (s) G(s) 1 s + 0.1 0 p 1 0.1 g(t) L 1 + 0.04 G(s) lim (s + 0.1)s s 0.1 s + 0.1 est 0.06e 0.1t

Lecture 1: Introduction to control theory and time domain analysis 1-11 Impulse response is shown by 1.14. Figure 1.14: impulse response 1.2.5 Programming MATLAB or Octave Online can be used for plotting the response diagrams. Table 1.2: Table of Matlab/Octave instructions instruction function tf(, ) Create transfer function model, convert to transfer function model impulse( ) generate impulse response diagram step( ) genarate step response diagram Homework: 1. Given the Mass-Spring-Damper system in Fig. 1.15, we know that v(t ) lim t v(t) 0.6 Calculate the transfer function G(s)! Calculate and draw the diagrams of the impulse response (g(t)) and step response functions (v(t))! Parameters: c 2 3 N Ns m, k 35 m 2. The transfer function is given as 1 G(s) 10s + 1 Calculate and draw the diagrams of the impulse response (g(t)) and step response funtions (v(t))!

Figure 1.15: Mass-Spring-Damper system 3. The transfer function is given as G(s) 5s + 3 0.5s 2 + 2.7s + 1 Calculate and draw the diagrams of the impulse response (g(t)) and step response funtions (v(t))! 1-12

Lecture 2: Frequency domain analysis 2-1 Control Theory Lecture 2: Frequency domain analysis In this lecture we introduce frequency domain analysis, basic transfer functions (0TP, 0TI, 0TD, 1TP, 1TD, PD) and their Bode diagrams. In last lecture, we introduced time domain analysis with examples of mechanics system. In this lecture, we will introduce frequency domain analysis with examples of electronic system. 2.1 Frequency domain analysis 2.1.1 Connection between Laplace domain and Frequency domain Figure 2.1: System in Laplace domain Figure 2.2: System in Frequency domain G(s) Y (s) Y (iω) U(s) s iω G(iω) U(iω) Laplace domain Frequency domain system transfer function system frequency function 2.1.2 RLC circuit RLC circuits consist of resistor (R), inductor (L), and capacitor (C), connected in series or in parallel. An RLC circuit is shown by Fig. 2.3. 2.1.2.1 Impedances Table 2.3 shows the impedances in different domains.

Lecture 2: Frequency domain analysis 2-2 Figure 2.3: RLC circuit Table 2.3: Impedances in time and Laplace (Frequency) domain, respectively Time domain Laplace/Frequency domain Resistor R[Ω] R Capacitor C[F ] 1 C s Inductor L[H] L s 2.1.2.2 Transfer function of RLC circuit The transfer function has been introduced in last lecture. Here an example will be used to show the transfer function calculation for RLC circuit. Figure 2.4: A generalized RLC circuit As shown in Fig. 2.4, the transfer function of this circuit is: G(s) Y (s) U(s) V out[v] Z in V in [V] Z out Z 2 Z 1 + Z 2 Example: Consider the RLC circuit in Fig. 2.4! The resistance is R 1 [MΩ] and the capacitance

Lecture 2: Frequency domain analysis 2-3 is C 2µF. The transfer function of the circuit is as follows. G(s) 1 Cs 1 Cs + R 1 RCs + 1 1 1 10 6 2 10 6 s + 1 1 2s + 1 Impulse response G(iω) 1 2iω + 1 { } y(t) g(t) L 1 Y (s) 1 2s + 1 lim s 0.5 (s + 0.5) 0.5 s + 0.5 est 0.5e 0.5t Figure 2.5: Impulse response The time constant is T 2 sec, which means the time interval needed to reach (1 e 1 ) 100 63.2% of its final (asymptotic) value.

Lecture 2: Frequency domain analysis 2-4 2.1.3 Visualization of the system frequency function The mainly used methods to visualize the frequency character are Nyquist diagram and Bode diagram. The Nyquist diagram can be drawn in Cartesian coordinates, the real part of the transfer function is plotted on the X axis. The imaginary part is plotted on the Y axis. The frequency is swept as a parameter, resulting in a plot per frequency. Concerning a given frequency ω 0 in a frequency function, we have G(iω) ReG(iω) + i ImG(iω) A(ω }{{} 0 )[cosϕ(ω 0 ) + isinϕ(ω 0 )] }{{} Algebraic form: x+iy Trigonometric form: r(cosϕ+isinϕ) A example system is shown in Fig. 2.6. Figure 2.6: Nyquist diagram Figure 2.7: An example for Bode diagram The Bode plot for a linear, time-invariant system with transfer function G(s) consists of a magnitude plot and a phase plot (see Fig. 2.7). The Bode magnitude plot is the graph of the function G(s iω) (with i being the imaginary unit).

Lecture 2: Frequency domain analysis 2-5 The ω-axis of the magnitude plot is logarithmic and the magnitude is given in decibels, i.e. a value for the magnitude G(iω) is plotted on the axis at 20 log 10 G(iω). The Bode phase plot is the graph of the phase, commonly expressed in degrees, of the transfer function G(iω) as a function of ω. The phase is plotted on the same logarithmic ω-axis as the magnitude plot, but the value for the phase is plotted on a linear vertical axis. For simple drawing of Bode diagram (typically by hand) piecewise linear asymptotic approximation is applied which is also suitable for system analysis and control. This is represented by dotted line in Fig. 2.7. The real function, however, is shown by solid line (can be plotted easily by Matlab). The asymptotic approximation of Bode diagram is explained by Fig. 2.8. Figure 2.8: Asymptotic approximation of Bode diagram 2.1.4 Basic transfer functions and their Bode diagrams: 0TP, 0TI, 0TD, 1TP, 1TD, PD. 2.1.4.1 0TP The OTP (zero time constant, proportional type) system have no time effect. The transfer function is G(iω) A

Lecture 2: Frequency domain analysis 2-6 The corresponding Nyquist diagram and Bode diagram are shown below. In the Nyquist diagram, there is only one point (A,0). In the Bode diagram, the amplitude is always a 20lgA, and the phase is always 0. Figure 2.9: Nyquist diagram of 0TP Figure 2.10: Bode diagram of 0TP 2.1.4.2 0TD The transfer function of OTD (zero time constant, differential type) system is G(iω) A d iω

Lecture 2: Frequency domain analysis 2-7 The corresponding Nyquist diagram (Fig. 2.11) and Bode diagram (Fig. 2.12) are shown below. In the Nyquist diagram, it starts from origin spreading to the positive infinity along the imaginary axis as the frequency ω increases from 0 to positive infinity. In the Bode diagram, the slope of the Figure 2.11: Nyquist diagram of 0TD straight line in the magnitude plot is 20dB/dec, and the cutting frequency (where the function cuts the 0 decibel horizontal line) is ω c 1/A d. Figure 2.12: Bode diagram of 0TD 2.1.4.3 0TI The transfer function of OTI (zero time constant, integral type) system is G(iω) A I iω A I i ω

Lecture 2: Frequency domain analysis 2-8 The corresponding Nyquist diagram (Fig. 2.13) and Bode diagram (Fig. 2.14) are shown below. In the Nyquist diagram, it starts from negative infinity going to the origin along the imaginary axis as the frequency ω increases from 0 to positive infinity. In the Bode diagram, the slope of the Figure 2.13: Nyquist diagram of 0TI straight line in the magnitude plot is 20dB/dec, and the cutting frequency is ω c 1/A I. Figure 2.14: Bode diagram of 0TI 2.1.4.4 1TP The transfer function of 1TP (1 time constant, proportional type) system is G(iω) A T iω + 1

Lecture 2: Frequency domain analysis 2-9 where A is the gain of the system and T is the time constant of the system. The corresponding Nyquist diagram (Fig. 2.15) and Bode diagram (Fig. 2.16) are shown below. In the Nyquist diagram, it starts from (A, 0) going to the origin along the semi-circular below as the frequency ω increases from 0 to positive infinity. The magnitude of the horizontal part is 20lgA, Figure 2.15: Nyquist diagram of 1TP and the slope of the tilt line is 20dB/dec. The inflection point is (1/T, 20lgA). Two horizontal lines connected by a tilt line. The phase of the two horizontal parts are 0 and -90 respectively. The slope of the tilt line is -45 /dec. The inflection point are (0.1/T, 0 ) and (10/T, -90 ). Figure 2.16: Bode diagram of 1TP

Lecture 2: Frequency domain analysis 2-10 2.1.4.5 1TD The transfer function of 1TD (1 time constant, differential type) system is G(iω) A d iω T iω + 1 where A d is the gain of the system and T is the time constant of the system. The corresponding Nyquist diagram (Fig. 2.17) and Bode diagram (Fig. 2.18) are shown below. In the Nyquist diagram, it starts from origin going to (A d /T, 0) along the semi-circular above as the frequency ω increases from 0 to positive infinity. The slope of the tilt line is 20dB/dec, and Figure 2.17: Nyquist diagram of 1TD the magnitude of the horizontal part is 20lgA. The cutting point is (1/A d, 0). The abscissa of the inflection point is 1/T. Two horizontal lines connected by a tilt line. The phase of the two horizontal parts are 90 and 0 respectively. The slope of the tilt line is -45 /dec. The inflection point are (0.1/T, 0 ) and (10/T, -90 ). 2.1.4.6 PD The transfer function of PD (proportional and differential type with 1 time constant) system is G(iω) T iω + 1 which is the combination of OTP and 0TD P D 0T P + 0T D where T is the time constant of the system. The corresponding Nyquist diagram (Fig. 2.19) and Bode diagram (Fig. 2.20) are shown below.

Lecture 2: Frequency domain analysis 2-11 Figure 2.18: Bode diagram of 1TD Figure 2.19: Nyquist diagram of PD Figure 2.20: Bode diagram of PD

Lecture 2: Frequency domain analysis 2-12 In the Nyquist diagram, it starts from (1, 0) going to (, 1) along the x 1 as the frequency ω increases from 0 to positive infinity. The magnitude of the horizontal part is 0, and the slope of the tilt line is 20dB/dec. The abscissa of the inflection point is 1/T. Two horizontal lines connected by a tilt line. The phase of the two horizontal parts are 0 and 90 respectively. The slope of the tilt line is 45 /dec. The inflection point are (0.1/T, 0 ) and (10/T, 90 ). Example: Calculate the transfer function of the RLC circuit shown by Fig. 2.21. Given ω 0 5rad/sec, calculate the magnitude A(ω 0 ) and phase ϕ(ω 0 )! Parameters: R 1MΩ, C 2µF Figure 2.21: RLC circuit The transfer function of the system is The frequency function is G(s) z out z in 1 Cs R + 1 Cs G(iω) 1 RCs + 1 1 2s + 1 1 2iω + 1

Lecture 2: Frequency domain analysis 2-13 Figure 2.22: Bode diagram of the example The Bode diagram is shown in Fig. 2.22. From the diagram, one can see when ω 0 5rad/sec, the amplitude a(ω 0 ) 20[dB] and phase is ϕ(ω 0 ) 90 From algebraic form, G(iω 0 ) 1 2iω 0 + 1 1 10i + 1 10i 1 (10i + 1)(10i 1) 1 10i 101 1 101 10 101 i

Lecture 2: Frequency domain analysis 2-14 A(ω 0 ) G(iω 0 ) (ReG(iω 0 )) 2 + (ImG(iω 0 )) 2 ( 1 101 )2 + ( 10 101 )2 0.0995 ϕ(ω 0 ) arctg ImG(iω 0) ReG(iω 0 ) arctg( 10) 84.3 There is an obvious difference between the phase value read from diagram (ϕ(ω 0 ) 90 ) in Fig. 2.22 and the phase calculated from the algebraic form (ϕ(ω 0 ) 84.3 ). This is due to the asymptotic approximation of the Bode diagram (solid line) compared to the real function (dotted line). The asymptotic approximation was previously explained by Fig. 2.8. Plot the Bode diagram (both the asymptotic approximation and the real one) now in Matlab/Octave by using the sample code from here: http://kjit.bme.hu/images/stories/targyak/controltheory/bode_asymptotic.zip Draw now the Bode diagram (asymptotic approximation) by hand using lin-log paper together with the lecturer! Consider the lin-log paper on the next page (Fig. 2.23).

Lecture 2: Frequency domain analysis 2-15 Figure 2.23: Linear-logarithmic paper for Bode diagram

Homework: 1. Summarize all Bode and Nyquist diagrams of all the systems we learned in this lecture in one paper which you can use freely during the midterm exam. 2. Given the Mass-Spring-Damper system in Fig. 2.24, calculate the frequency function G(iω), calculate and draw the diagram of the impulse response (g(t)). Parameters: c 1 2 N m, c 2 3 N Ns m, k 50 m Figure 2.24: Mass-Spring-Damper system 3. Calculate the transfer function of the RLC circuit shown by Fig. 2.25. Calculate the frequency function and draw the Nyquist and Bode diagram of the system. When ω 0 0.5 rad/sec, calculate the magnitude A(ω 0 ) and phase ϕ(ω 0 ). Parameters: C 0.5µF, R 4MΩ Figure 2.25: RLC circuit 2-16

Lecture 3: Frequency domain, Bode stability, performance properties 3-1 Control Theory Lecture 3: Frequency domain, Bode stability, performance properties In this lecture we introduce Bode stability criterion and analysis of performance properties. 3.1 Frequency domain analysis tutorial 3.1.1 Example Calculate the transfer function of the RLC circuit shown by Fig. 3.1. function and draw the Nyquist and Bode diagram of the system. Calculate the frequency Figure 3.1: RLC circuit Z out R 2 1 Cs R 2 R 2 Cs + 1 Z in R 2 1 Cs + Ls R 1 R 2 R 2 Cs + 1 + Ls R 1 Ls + R 1 G(s) Z out Z in 0.1 s+1 0.1 s+1 + s s+1 R 2 R 2 Cs+1 R 2 R 2 Cs+1 + Ls R 1 Ls+R 1 0.1 s + 0.1 1 10s + 1 Now, one gets the system transfer function G(s) in time constant form. The frequency function will be obtained after replacing s with iω. Thus, the time constant is T 10 sec and the gain is A 1. The Nyquist and Bode diagram of the system are shown below.

Lecture 3: Frequency domain, Bode stability, performance properties 3-2 Figure 3.2: Nyquist diagram of the system G(s) 1 10s+1 Figure 3.3: Bode diagram of the system G(s) 1 10s+1

Lecture 3: Frequency domain, Bode stability, performance properties 3-3 3.1.2 Example Given the RL circuit below, calculate R 2 if the steady state case of the step response function is given, i.e. v(t ) 0.1 (use the final value theorem)! Provide the system s transfer function! What is the time constant T of the filter? R 1 6kΩ, C 1µF Figure 3.4: RL circuit G(s) Y (s) U(s) Z out Z in R 2 1 Cs R 1 + R 2 R 2 R 1 1 Cs R 1 + 1 Cs + R 2 R 2 (R 1 + 1 Cs ) 1 R 1 Cs + R 2(R 1 + 1 R 1 R 2 Cs + R 2 R 1 R 2 Cs + R 1 + R 2 Cs ) Step response is V (s) G(s) 1 s. In the following, the final value theorem is used: Hence: lim v(t) lim sv (s) R 2 0.1 t s 0 R 1 + R 2 R 2 1 9 R 1 2 3 kω The filter s transfer function is then: Thus: G(s) R 1 R 2 Cs + R 2 R 1 R 2 Cs + R 1 + R 2 T 0.6 msec. 4s + 666.6 0.0006s + 0.1 4s + 6666.6 0.0006s + 1

Lecture 3: Frequency domain, Bode stability, performance properties 3-4 3.2 Bode stability 3.2.1 Open loop transfer function According to Fig. 3.5, the open loop transfer function G OL (s) is G OL (s) C(s) G(s) S Y (s), and the closed loop transfer function G CL (s) is G CL (s) Y (s) R(s). Figure 3.5: The feedback control system 3.2.2 Bode Stability Bode stability means an easy method to check system stability only by considering the open loop transfer function G OL (s). One can decide about the stability of the whole closed loop system based on G OL (s) solely. 1. If the cutting point s slope of the open loop transfer function G OL (s) in the Bode magnitude plot is 20 db dec, then the whole closed-loop system G CL(s) is stable. 2. If the cutting point s slope of G OL (s) is 60 db dec or larger in the Bode magnitude plot, then the whole closed-loop system is unstable. 3. If the cutting point s slope of G OL (s) is 40 db dec in the Bode magnitude plot, then the analysis of Bode phase digram is also needed as follows: ˆ If the phase margin ϕ m (ω) > 0, the whole closed-loop system G CL (s) is stable. ˆ If the phase margin ϕ m (ω) 0, G CL (s) is at the limit of stability and instability.

Lecture 3: Frequency domain, Bode stability, performance properties 3-5 ˆ If the phase margin ϕ m (ω) < 0, G CL (s) is unstable. The limit of stability is always at -180. The phase margin is therefore calculated as given below: ϕ m 180 + ϕ(ω c ) 3.3 Rearranging blocks to reduce block diagram and determine the combined transfer function 3.3.1 Single block G(s) Y (s) U(S)

Lecture 3: Frequency domain, Bode stability, performance properties 3-6 3.3.2 Series connection G(s) Y (s) U(S) G 1(s) G 2 (s) 3.3.3 Parallel connection G(s) Y (s) U(S) G 1(s) + G 2 (s) 3.3.4 Simple negative feedback system G(s) Y (s) R(S) G 1(s) 1 + G 1 (s) 3.3.5 Negative feedback system with block in the feedback loop G(s) G forward (s) 1 + G forward (s) G back (s) The closed loop transfer function G CL (s) of the system shown in Fig. 3.5 is G CL (s) Y (s) R(s) C(s) G(s) 1 + C(s) G(s) S Y (s). The denominator of G CL (s) determines the stability of the system directly. By solving the equation 1 + C(s) G(s) S Y (s) 0, one gets the poles of the system, i.e. the roots of the equation. If the real parts of all solutions (as they can be complex numbers as well) are negative, the system is stable.

Lecture 3: Frequency domain, Bode stability, performance properties 3-7 3.4 Performance parameters The performance parameters are shown by Fig. 3.6. 1. Final value (settling value) y( ) lim t y(t) 2. Settling (control) time T s 0.95 y( ) y(τ) 1.05 y( ) τ T s 3. Steady state error e( ) e( ) y( ) r( ) 4. Overshoot time t m (where m refers to the maximum value) t m max t y(t) y( ) 5. Measure of overshoot (%) y m y( ) y( ) 100% Figure 3.6: Step response function

Lecture 3: Frequency domain, Bode stability, performance properties 3-8 3.5 PID control A PID controller continuously calculates an error value e(t) as the difference between a desired setpoint (SP) and a measured process variable (PV) and applies a correction based on proportional, integral, and derivative terms (denoted P, I, and D respectively). PID transfer function: C(s) 0T P + 0T I + 0T D A + A I s + A ds Figure 3.7: Block diagram of the PID controller Effects of the basic building blocks to the PID control: 1. 0TP: faster response but does not ensure zero error. 2. 0TD: decreases the settling time but amplifies the noise. 3. 0TI: ensures zero steady state error but increases settling time. 3.6 PID controller design example Design a proportional type feedback compensator (i.e. C(s) A) to the system depicted below by using lin-log paper! Ensure a phase margin of ϕ m 45! Calculate the approximate of the settling time(t control )! Finally, by using the designed controller gain,provide the closed-loop transfer function G CL (s)! By applying the final value theorem, calculate y( ) if reference signal is given as r(t) 3 1(t)! G(s) 10 0.1s+0.5, S y(s) 1 s

Lecture 3: Frequency domain, Bode stability, performance properties 3-9 Figure 3.8: The feedback control system The open loop G OL (s) transfer function of the controlled system is G OL (s) C(s)G(s)S Y (s) A 10 0.1s + 0.5 1 s. By setting controller s transfer function C(s) A 1, one arrives at G OL (s) G(s)S y (s), thus G OL (s) 1 s 10 0.1s + 0.5 Rearrange the open-loop transfer function to obtain a product of basic transfer funtions: G OL (s) 20 s Then, draw the Bode plot of G OL (s) (see Fig.3.9): When ϕ m 45, the cutting frequency is ω c 5 rad s. Control time is approximately The measure of shift: 1 0.2s + 1 π ωc T control 3π ωc 0.63s T control 1.89s x +16dB The shift must be converted back from db based on the following rule: 20 lga x Therefore: 20 lga 16 A 10 16 20 0.16

Lecture 3: Frequency domain, Bode stability, performance properties 3-10 Figure 3.9: Bode plot for PID control design

Thus G OL (s) 0.16 s 20 0.2s + 1 3.2 s 1 0.2s + 1 and the closed-loop transfer function is obtained by G CL (s) C(s)G(s) 1 + C(s)G(s)S y (s) 3.2 0.2s+1 1 + 3.2 s(0.2s+1) 3.2s 0.2s 2 + s + 3.2 By applying Laplace transformation to the reference value, one gets: r(t) 3 1(t) R(s) 3 s Hence: Y (s) 3 s 3.2s 0.2s 2 + s + 3.2 9.6 0.2s 2 + s + 3.2 Application of the final value theorem to the response function: y( ) lim t y(t) lim s 0 s Y (s) lim s 0 9.6s 0.2s 2 + s + 3.2 0 3-11

Lecture 4: An application of PID control: Cruise Control 4-1 Control Theory Lecture 4: An application of PID control: Cruise Control In this lecture, we introduce an application of PID control: Cruise Control. 4.1 Example: cruise control realization Cruise control is a system that automatically controls the speed of a motor vehicle by taking over the throttle. The system is a servomechanism that maintain a steady state speed set by the driver despite disturbances from wind or terrain. To accomplish the task, the system shall be able to measure the car s speed and compare the measured value with the reference speed. As shown in Fig. 4.1, the mass m of the car is 500kg, the damping coefficient b is 50 N s m. Design a controller to maintain the speed at 10m/s and make sure the phase margin is ϕ m 45. Figure 4.1: Cruise control vehicle The sum of resistive forces (include rolling and wind drag) are modeled by b v. Here v is the vehicle speed. Application of Newton s second law to define the system model: m a F control b v.

Lecture 4: An application of PID control: Cruise Control 4-2 Using the control theory notation where u(t) denotes control force F control : m ẏ(t) u(t) b y(t). After applying the Laplace transformation we get the following equation: m sy (s) U(s) b Y (s). Rearrange the equation by Y (s) and U(s), then calculate the system s transfer function from the previous equation: G(s) Y (s) U(s) 1 ms + b. So the system s transfer function is: G(s) 1 500s + 50 0.02 10s + 1. The model of the cruise control system is depicted by Fig. 4.2 Figure 4.2: Cruise control system S Y (s) 1. In order to efficiently follow the reference speed, the controller should be 0TI because it ensures zero steady state error: C(s) A I s. The open loop transfer function of the system is therefore: G OL (s) C(s) G(s) S Y (s) C 0.02 10s + 1 1 A I s 0.02 10s + 1 In order to start the calculation, A I is assumed to be 1 in the beginning, i.e. G OL (s) 1 s 0.02 10s + 1 0.02 1 s 10s + 1.

Lecture 4: An application of PID control: Cruise Control 4-3 Figure 4.3: Bode plot for PID control design

Lecture 4: An application of PID control: Cruise Control 4-4 Then, draw the Bode plot of G OL (s) (see Fig. 4.3): From Fig. 4.3, one can see that the ϕ m is around 100, which is far greater than 45. But we want to ensure ϕ m 45 to get stable and fast response. Therefore, we measure the shift at ϕ m 45 : x 14dB. The shift must be converted back from db based on the following rule: 20 lga I x. Therefore: The controller gain is: Thus, the open-loop transfer function is: 20 lga I 14 A I 10 14 20 5. G OL (s) 5 s The closed-loop transfer function is obtained by 0.02 10s + 1 0.1 10s 2 + s. G CL (s) 0.1 C(s)G(s) 1 + C(s)G(s)S Y (s) 10s 2 +s 1 + 0.1 10s 2 +s 1 0.1 10s 2 + s + 0.1. Now, we take an example to demonstrate the zero tracking error of the control design. Set the reference speed to So r(t) 10m/s 10 1(t). R(s) 10 1 s 10 s. We calculate the final value: As we know, so Y (s) G CL (s) R(s) y( ) lim t y(t). G CL (s) Y (s) R(s), 0.1 10s 2 + s + 0.1 10 s 1 s(10s 2 + s + 0.1).

Lecture 4: An application of PID control: Cruise Control 4-5 Application of final value theorem: lim y(t) lim s Y (s) t s 0 lim s 0 s 10m/s. 1 s(10s 2 + s + 0.1) Finally, one can observe that the steady state error of the reference tracking is zero, i.e. the designed cruise control is applicable: e( ) r y( ) 0. This is due to the fact that the controlled system has a integral property, i.e. it encompasses a basic transfer function of integral type (0TI 1 s ). Remake the whole problem in Octave Online or Matlab! For open-loop with initial control gain A I 1: NUM0.02 DEN[10 1 0] systf(num, DEN) bode(sys) For open-loop with optimal control gain A I 5: NUM0.1 DEN[10 1 0] systf(num, DEN) bode(sys) For the closed-loop controlled system (G CL (s)) with reference signal r 10 m/s: NUM0.1 DEN[10 1 0.1] systf(num, DEN) step(10*sys) Homework: 1. Draw the Bode diagram by hand of the lesson example in lin-log paper. 2. Given the system transfer function as G(s) 1 s 2 + 3s + 2

and the transfer function of the sensor dynamics as S Y (s) 5 design a proportional (P type) controller to maintain ϕ m 30. Also, calculate the closedloop transfer function G CL (s). The block diagram of the control system is shown by Fig. 4.4. Figure 4.4: The feedback control system 4-6

Lecture 5: Introduction of state-space theory, SISO examples 5-1 Control Theory Lecture 5: Introduction of state-space theory, SISO examples In this lecture, we introduce state-space representation and single input single output (SISO) examples. 5.1 State-space representation As we know, a control system can be described through G(s), the system s transfer function. G(s) Y (s) U(s) is derived via the Laplace transformation of the input (u(t)) and output (y(t)) differential equations of the system to model. Nevertheless, there is another way to define a control system. This is the so-called state-space representation of the system. Actually, transfer function G(s) can be transformed to state-space representation, and vice-versa. For SISO (i.e. single input u(t) and single output y(t) are scalars) and LTI (linear time-invariant) systems, the standard state-space representation is given below: ẋ Ax + Bu y Cx + Du (state equation), (output equation), where: ˆ x R n 1 is the state vector that contains all the state variables, (it can be position, velocity, acceleration, angle, voltage, current, etc.); ˆ ẋ R n 1 is the time derivative of the state vector; ˆ u R is the input scalar; ˆ y R is the output scalar (it can be position, velocity, acceleration, angle, voltage, current, etc.); ˆ A R n n is the state matrix; ˆ B R n 1 is the input vector; ˆ C R 1 n is the output vector; ˆ D R is the feedforward constant.

Lecture 5: Introduction of state-space theory, SISO examples 5-2 Figure 5.1: The general block diagram of the state-space representation Definition of state x(t): state of a system at time t 0 is the information by which, together with the control input u(t) (t t 0 ), the response of the system can be determined for all t t 0. 5.1.1 Example A system is given as below: Provide it in state-space representation form. Solution: From equations 5.2,5.3, one knows that So x 1 4x 1 3x 2 + u, x 2 x 1. ÿ 4ẏ 3y + u (5.1) x 1 ẏ (5.2) x 2 y. (5.3) x 1 ÿ x 2 x 1. Thus: [ ] [ ] x1 4 3 x 2 1 0 }{{} y [0 1] }{{} C A [ x1 x 2 ] [ x1 x 2 ] [ ] 1 + u 0 }{{} B

5.1.2 Question If we have a new definition as given below x 1 3y x 2 4ẏ, what is the full state-space representation form, i.e. the matrices A, B, C? 5.1.3 Example Given a Mass-Spring-Damper system in Fig. 5.2, Figure 5.2: Mass-Spring-Damper system provide the state-space representation of the system. Solution: Application of Newton s second law to define the system model: mÿ + kẏ c(u y). After rearranging the equation, we will have ÿ + k mẏ + c m y c m u. By setting x 1 y, x 2 ẏ: x 1 x 2 x 2 ÿ k m x 2 c m x 1 + c m u y x 1. The state-space representation of the system is [ ] [ ] x1 0 1 x 2 c m k m }{{} y [1 0] }{{} C A [ x1 x 2 ] [ x1 x 2 ] [ ] 0 + c u m }{{} B 5-3

Lecture 6: Stability, Controllability, Observability 6-1 Control Theory Lecture 6: Stability, Controllability, Observability In this lecture, we introduce the notions of stability, controllability and observability in the theory of state-space representation. 6.1 Equivalence between state-space representation and system s transfer function State-space description of a system and the system s transfer function can be transformed to each other. In this lecture we will learn how to realize the conversion from state-space model to transfer function. We have the general SISO, LTI state-space form as follows: ẋ(t) Ax(t) + Bu(t), y(t) Cx(t) + Du(t), After applying the Laplace transformation the state-space form becomes: sx(s) AX(s) + BU(s), (6.1) Y (s) CX(s) + DU(s), (6.2) State equation (6.1) can be reformulated: sx(s) AX(s) BU(s) (6.3) (si A) X(s) BU(s) (6.4) X(s) (si A) 1 BU(s) (6.5) When we substitute X(s) to Eq. (6.2), the output equation becomes: Y (s) C(sI A) 1 BU(s) + DU(s) [ C(sI A) 1 B + D ] U(s) So, the transfer function is G(s) Y (s) U(s) C(sI A) 1 B + D (6.6) 6.2 Stability The eigenvalues of system matrix A (which are, on the other hand, equal to the poles of the transfer function: λ i p i ) determine the system s stability.

Lecture 6: Stability, Controllability, Observability 6-2 Stability: A system is stable only if Reλ i (A) < 0, for i (i 1, 2, 3,..., n), where λ i is the eigenvalue of A; Reλ i mean the real part of the eigenvalues. The eigenvalues can be calculated by solving the following equation: det(si A) 0 (6.7) 6.3 Controllability Controllability: A system is controllable if there always exists a control input u(t) (t 0) that transfers the system from an initial state x(t 0 ) to another arbitrary state x(t f ) in finite time such that x(t f ) x(t 0 ). Controllability matrix is: C [B AB A 2 B... A n 1 B] (6.8) A system is controllable if and only if its controllability matrix C has full rank, i.e. if rank(c) n where n is the number of the states variables within the given system. 6.4 Observability Observability: A system is observable if the initial state x(t 0 ), can be determined only based on the knowledge of system input u(t) and system output y(t) over some finite time interval t 0 < t < t f. Observability matrix is: C CA CA 2 O... CA n 1 (6.9) A system is observable if and only if observability matrix O has full rank, i.e. if rank(o) n where n is the number of the state variables. 6.5 Minimality Minimality: A system is minimal if it is both controllable and observable, i.e. rank(c)rank(o) n.

Lecture 6: Stability, Controllability, Observability 6-3 6.6 Examples Example: A system is defined as: A observable? [ λ1 0 0 λ 2 ], B [r 1 r 2 ] T, C [1 1]. Is this system Solution: For easy calculation we use the mathematical rule for the relationship of determinant and rank: if deto 0 ranko n (i.e. matrix has full rank). [ ] [ ] C 1 1 O CA λ 1 λ 2 deto 1 λ 2 1 λ 1 This means that the system is observable for any λ 1 and λ 2 if λ 1 λ 2. On the other hand, with λ 1 λ 2 the system is not observable. [ ] 12 8 Example: A system is defined as: A, B [1 0] 1 0 T, C [3 1.5]. Check the controllability and observability of the system. Solution: For easy calculation we can use the mathematical rule for the relationship of determinant and rank: if detc 0 rankc n (i.e. matrix has full rank). [ ] 1 12 C [B AB] 0 1 So, the system is controllable. detc 1 1 0 ( 12) 1 0 O [ ] C CA [ ] 3 1.5 37.5 24 deto 3 ( 24) ( 1.5) ( 37.5) 0 So, the system is observable as well. Example: A system is defined as: A transfer function G(s) of the system? Solution: From (6.6), we know that [ ] 1 3, B [2 5] 2 4 T, C [1 2], D 0. What is the G(s) C(sI A) 1 B

Lecture 6: Stability, Controllability, Observability 6-4 si A [ s 1 ] 3 2 s + 4 (si A) 1 adj(si A) det(si A) [ ] T s + 4 2 3 s 1 (s 1)(s + 4) 6 [ ] s + 4 3 2 s 1 (s 1)(s + 4) 6 So, [ ] [ ] s + 4 3 2 [1 2] 2 s 1 5 G(s) (s 1)(s + 4) 6 [ ] 2 [s + 8 2s + 1] 5 (s 1)(s + 4) 6 12s + 21 s 2 + 3s 10 3(4s + 7) (s + 5)(s 2) Example: A system is given as: A function? Solution: [ ] 1 0, B 0 2 ([ ]) s + 1 0 det(si A) det 0 s + 2 (s + 1) (s + 2) 0 0 [ ] 1, C [1 1]. What is its transfer 1 [ s + 2 0 adj(si A) 0 s + 1 [ ] s + 2 0 0 s + 1 ] T

[ ] [ ] s + 2 0 1 [1 1] 0 s + 1 1 G(s) (s + 1)(s + 2) [ ] 1 [s + 2 s + 1] 1 (s + 1)(s + 2) 2s + 3 (s + 1)(s + 2) Homework: Check the observability and controllability of the last two examples! 6-5

Lecture 7: Full state feedback control 7-1 Control Theory Lecture 7: Full state feedback control In this lecture, we introduce full state feedback control (pole placement). 7.1 Principle Full state feedback control or pole placement is a method employed in feedback control system theory to place the closed-loop poles of a plant in pre-determined locations in the s-plane. The location of poles corresponds directly to the eigenvalues of the system, which indicate the characteristics of response of the system. By changing the location of poles, one can easily modify the characteristics of the system response. The block diagram of a full-state feedback system is shown by Fig. 7.1. By full state we mean that all state variables are known to the controller at all times. Actually, pole placement method is to design a gain vector, called K, to make the system controllable, stable and the system response faster. If a system can be written in state-space representation, the poles are the eigenvalues of state matrix A. ẋ(t) Ax(t) + Bu(t), (7.1) y(t) Cx(t), (7.2) Figure 7.1: Pole placement design The input u(t) is then u(t) Kx(t) + r, (7.3)

Lecture 7: Full state feedback control 7-2 where r is reference signal. For simplicity, assume r 0, i.e. u(t) Kx(t) (7.4) and substitute (7.4) into state equation (7.1): ẋ(t) Ax(t) + B( Kx(t)). The state-space equations for the closed-loop feedback system are, therefore, ẋ(t) (A } {{ BK } )x(t), A CL y(t) Cx(t), where A CL is the state matrix of the closed-loop controlled system. The stability and time-domain performance of the closed-loop feedback system are determined primarily by the location of the eigenvalues of system matrix A CL A BK, which are equal to the closed-loop poles. By choosing an appropriate state-feedback gain matrix K, we can place these closed-loop poles to any appropriate positions. 7.2 Design method There are three main steps to design a full state feedback control which are: 1. Check controllability, i.e. if rank(c) n is true. Note that only controllable systems can be controlled by the method of pole placement. 2. Design the gain vector K. 3. Analyze the closed-loop system (A CL ). [ ] 1 0 Example: A system is given as: A, B 3 2 feedback controller with both poles at 2. Solution: Firstly, we shall check the controllability of the system. [ ] 1 1 C [B AB] 2 7 So, the system is controllable. Then we design the gain vector K [k 1 k 2 ]. detc 7 + 2 9 0 [ ] 1, C [ 2 4]. Design a full state 2

Thus, the closed-loop controlled system is: [ ] [ ] [ ] 1 0 k1 k A CL A BK 2 1 + k1 k 2 3 2 2k 1 2k 2 3 2k 1 2 2k 2 ā(s) det(si A + BK) [ ] s 1 k1 k det 2 3 + 2k 1 s + 2 + 2k 2 (s 1 k 1 )(s + 2 + 2k 2 ) ( 3 + 2k 1 )( k 2 ) s 2 + (2k 2 k 1 + 1)s + ( 2 2k 1 5k 2 ) The wanted poles are p 1 p 2 2. So ā(s) (s + 2) 2 s + 4s + 4. Now, we get the equation s second and third terms After solving the above equation set, we get: So, the gain matrix results in K [ 3 0]. 2k 2 k 1 + 1 4 2 2k 1 5k 2 4 k 1 3 k 2 0 7-3

Lecture 8: Linear Quadratic (LQ) control 8-1 Control Theory Lecture 8: Linear Quadratic (LQ) control In this lecture, we introduce Linear Quadratic (LQ) optimal control design. 8.1 Principle The theory of optimal control is concerned with operating a dynamic system at minimum cost. The case where the system dynamics is described by a set of linear differential equations and the cost is described by a quadratic function is called the LQ problem. A basic solution of this control problem is provided by the Linear Quadratic (LQ) control, also called Linear Quadratic Regulator (LQR). An LQ controller aims to by minimize a predefined cost function thorough mathematical operation. The weighting factors of this cost function are provided by human engineer. The LQ controller may be typically used to govern a machine or process (e.g. an electric engine or a chemical reactor). For a continuous-time linear system described by state-space representation, a cost function is defined as J(x, u) 1 2 ẋ(t) Ax(t) + Bu(t), y(t) Cx(t), T 0 [ x(t) T Qx(t) + u T (t)ru(t) ] dt, (8.1) where Q Q T 0 (i.e. symmetric positive semidefinite matrix 1 ), R R T 0 (i.e. symmetric positive definite matrix 2 ) are two design parameters. Q is the weighting factor of the states and R is that of the input, respectively. Bigger weights in R imply smaller control input and smaller weights represent bigger control signal. Simply, we use large R if we want to avoid large inputs. Conversely, small R is applied if we need fast response and large control input signals are allowed. It can be seen that the functional (8.1) penalize the total energy of the system together with the control energy. The feedback control law that minimizes the value of the cost (derivation is omitted) is u(t) Kx(t) (8.2) where K is given by K R 1 B T P (8.3) and P is found by solving the Algebraic Riccati Equation (ARE) equation A T P + P A P BR 1 B T P + Q 0, (8.4) 1 A matrix M is positive semidefinite (M 0), if x T Mx 0 for all x 0. 2 A matrix M is positive definite (M 0), if x T Mx > 0 for all x 0.

Lecture 8: Linear Quadratic (LQ) control 8-2 where P 0 and P P T, i.e. P is the symmetric positive definite solution of the ARE. The controlled system is assumed to be controllable. In this case, there is only one stable solution. 8.2 LQR design steps The five main steps to design LQ controller: 1. Check controllability, i.e. if rank(c) n is true. Note that only controllable systems can be controlled by the LQR technique. 2. Design of weighting factors Q and R. Bryson s rule is generally applied, i.e. Q 11 Q 22 Q, where Q 1 ii max(x 2 and i ),... Qii R 11 R 22 R... Rjj, where R jj 1 max(u 2 j ). 3. Solve Riccati equation such that the solution satisfies P 0. 4. Design gain matrix K R 1 B T P. 5. Analyze the closed-loop controlled system (A CL A BK). Example: A system is defined as: ẋ(t) 2.5x(t) + u(t), y(t) x(t), with weightings of R 1 and Q 2.75. Design the feedback gain vector K. Solution: Firstly, check the controllability of the system. Note that A is a one dimensional matrix (scalar), i.e. n dim(a) 1. C B 1 (i.e. also simply a scalar). Thus, the system is controllable as rank(c) n 1.

Lecture 8: Linear Quadratic (LQ) control 8-3 Then, we shall solve the ARE (which will be a scalar equation in our case): A T P + P A P BR 1 B T P + Q 0 2.5p 2.5p p 1 1 1 1 p + 2.75 0 p 2 + 5p 2.75 0 p 1, p 2 5 ± 5 2 4 1 ( 2.75) 2 p 1 0.5 p 2 5.5 But the value of p should be positive (as generally matrix P must be positive definite: P 0). Thus, the only solution is P 0.5. Finally, we design the gain matrix K R 1 B T P 1 1 0.5 0.5. Example: [ A] two dimensional [ ] system [ is ] defined as [ ] 0 1 0 1 0 1 0 A, B, with Q, R. Design the feedback gain vector K. 0 1 1 0 1 0 1 Solution: Firstly, the controllability of the system must be checked: [ ] 0 1 C [B AB] 1 1 So, the system is controllable. Then, we shall solve the Riccati equation: [ 0 0 1 1 ] [ p11 p 12 p 21 p 22 ] [ p11 p 12 p 21 p 22 Simplify the above formula: detc 0 1 1 0 rank n 2 ] [ ] 0 1 0 1 [ p11 p 12 p 21 p 22 ] [ 0 1 A T P + P A P BR 1 B T P + Q 0 ] 1 [ ] [ ] p11 p [0 1] 12 1 0 + 1 p 21 p 22 0 1 [ 0 0 0 0 ] After solving the equation set (8.5), i.e. [ ] p 12 p 21 + 1 p 11 p 12 p 12 p 22 p 11 p 21 p 22 p 21 p 12 2p 22 + p 21 p 2 22 + 1 [ ] 0 0 0 0 (8.5) one gets three solutions: P 1 p 12 p 21 + 1 0, p 11 p 12 p 12 p 22 0, p 11 p 21 p 22 p 21 0, p 12 2p 22 + p 21 p 2 22 + 1 0, [ ] 2 1, P 1 3 2 [ ] 0 1, P 1 1 3 [ ] 2 1 1 1

Now, you have to check which solution satisfies the criteria of positive definiteness, i.e. if P i 0. Note, that in case of symmetric matrix, the eigenvalue test can be applied: it must be checked if the matrix has only positive eigenvalues. For P 1 : For P 2 : For P 3 : ([ ]) s + 2 1 det (si P 1 ) det (s + 2) (s + 3) ( 1 1) 0 1 s + 3 s 2 + 5s + 5 0 λ 1, λ 2 5 ± 25 20 2 5 ± 2.236 2 < 0. ([ ]) s 1 det (si P 2 ) det s (s + 1) 1 1 0 1 s + 1 s 2 + s 1 0 λ 1, λ 2 1 ± 1 + 4 2 1 ± 2.236 2 λ 1 > 0, λ 2 < 0. ([ ]) s 2 1 det (si P 3 ) det (s 2) (s 1) ( 1 1) 0 1 s 1 s 2 3s + 1 0 λ 1, λ 2 3 ± 9 4 2 3 ± 2.236 2 > 0. Only P 3 is a symmetric positive definite matrix from P 1, P 2, P 3 as this is the one having positive eigenvalues solely. P 3 0 will be used in calculating the gain matrix. [ ] K R 1 B T 1 0 [0 ] [ ] 2 1 P 3 1 [1 1] 0 1 1 1 So, the gain matrix is K [1 1] 8-4