Amme 35 : System Dynamics Control State Space Design Course Outline Week Date Content Assignment Notes 1 1 Mar Introduction 2 8 Mar Frequency Domain Modelling 3 15 Mar Transient Performance and the s-plane 4 22 Mar Block Diagrams Assign 1 Due 5 29 Mar Feedback System Characteristics 6 5 Apr Root Locus Assign 2 Due 7 12 Apr Root Locus 2 8 19 Apr Bode Plots No Tutorials 26 Apr BREAK 9 3 May Bode Plots 2 1 1 May State Space Modeling Assign 3 Due 11 17 May State Space Design Techniques 12 24 May Advanced Control Topics 13 31 May Review Assign 4 Due 14 Spare Dr. Stefan B. Williams Amme 35 : Introduction Slide 2 Higher Order Poles Classical controller designs are based on selecting the location of the dominant second order pole locations Higher order poles are generally not able to be set explicitly Higher Order Poles: Example For the following plant 1 G(s) = s(s + 2)(s +1) Design a PD controller to yield an overshoot of 5% and a settling time of 1s Slide 3 Slide 4
Higher Order Poles: Example Higher Order Poles: Example Consider the design of a PD controller to achieve the required specifications Desired root locations are at s =!4 ± 4.8 j! z "! 1 "! 2 "! 3 = (2k +1)18! z = 134.4 +116.1 + 34.2 "18! z = 14.7 x x x o x x z c = 2.93 With K=44.7 Slide 5 Slide 6 Higher Order Poles As can be seen, the position of the higher order poles can have a significant impact on the actual system behaviour Classical techniques do not easily afford us with a means of choosing the position of higher order poles State Space Modelling Recall that for the state space approach, we represent a system by a set of n firstorder differential equations:!x = Ax + Bu The output of the system is expressed as: y = Cx+[ Du] x - state vector y - output vector u - input vector A - state matrix B - input matrix C - output matrix D - feedthrough or feedforward matrix (often zero) Slide 7 Slide 8
State Space Control State Space Control We can represent a general state space system as a Block Diagram. If we feedback the state variables, we end up with n controllable parameters. State feedback with the control input u=-kx +r. * N.S. Nise (24) Control Systems Engineering Wiley Sons We can then control the pole locations by finding appropriate values for K This allows us to select the position of all the closed loop system roots during our design. There are a number of methods for selecting and designing controllers in state space, including pole placement and optimal control methods via the Linear Quadratic Regulator algorithm. Slide 9 Slide 1 State Space Control Pole Placement Setting u=-kx+r yields x (t) = Ax(t) + B(!Kx(t) + r) y(t) = Cx(t) Rearranging the state equation and taking LT yields sx(s) = ( A! BK)X(s) + BR(s) ( si! ( A! BK) )X(s) = BR(s) X(s) R(s) = ( si! ( A! BK ))!1 B Essentially we select values of K so that the eigenvalues (root locations) of (A-BK) are at a particular location Slide 11 Given a system of the form C = [ c 1 c 2! c n ] We can find the characteristic equation by solving for det(si-(a-bk)) " 1! 1! A = " " "!a!a 1!a 2!!a n!1 % " % B = " 1 Slide 12
Pole Placement Using u=-kx, we can find the system matrix A-BK " 1! % 1! A! BK = " " "!(a + k 1 )!(a 1 + k 2 )!(a 2 + k 3 )!!(a n!1 + k n ) With characteristic equation of the form det(si! (A! BK)) = s n + (a n!1 + k n )s n!1 +! + (a 1 + k 2 )s + (a + k 1 ) = Slide 13 Pole Placement Given a desired pole placement of and equating terms, we find or This will allow us to place all of the closed loop poles where we want them s n + d n!1 s n!1 +! + d 1 s + d = d i = a i + k i +1 i =,1, 2,, n!1 k i +1 = d i! a i Slide 14 Pole Placement Represent the plant in state space via the phase-variable form Feed back each phase variable to the input of the plant through a gain, k i Find the characteristic equation of the closedloop system Decide upon closed-loop pole locations and determine an equivalent characteristic equation Equate like coefficients of the characteristic equations and solve for k i Pole Placement Example For the following plant 1 G(s) = s(s + 2)(s +1) Design a full state feedback controller to yield an overshoot of 5% and a settling time of 1s Slide 15 Slide 16
Pole Placement Example The OL transfer function for the system is G(s) = Convert the transfer function to SS 1 s 3 +12s 2 + 2s ( )! x 1! 1! x 2 = 1 " x 3 % " 2 12% " y = [ 1 ]x x 1 x 2 x 3! + u % " 1% Slide 17 Pole Placement Example Decide on desired root locations From specifications, we require 5% OS and settling time of 1s Select dominant second order roots to be at s =!4 ± 4 j Select third root 5 times to left at s =!2 Desired characteristic equation: s 3 + 28s 2 +192s + 64 Slide 18 Pole Placement Example Feeding back states we find x = Ax + Bu = Ax + B(!Kx + r) = ( A! BK)x + Br " x 1 % (" 1 % " % + " x 2 = * 1! - * - x 3 )!2!12 K 1 K 2 K 3, x 1 x 2 x 3 % " % + r 1 So Pole Placement Example (" 1 % + " % sx = * 1 - * - X + r )!K 1!(2 + K 2 )!(12 + K 3 ), 1 Solve for the characteristic equation s!1 s!1 = K 1 (2 + K 2 ) s + (12 + K 3 ) s 3 + (12 + K 3 )s 2 + (2 + K 2 )s + K 1 = Slide 19 Slide 2
Pole Placement Example Equating like terms we find s 3 + 28s 2 +192s + 64 s 3 + (12 + K 3 )s 2 + (2 + K 2 )s + K 1 So K 1 = 64 K 2 = 172 K 3 = 16 Pole Placement Example Looks like we have met the overshoot and settling time requirements However, steady state error is not addressed here Slide 21 Slide 22 Steady State Error Steady State Error Full state feedback does not directly address the issue of steady state error A common strategy is to feedback the output and add additional state variables * N.S. Nise (24) Control Systems Engineering Wiley Sons Looking at the previous diagram, we find x N = e = r! Cx We can augment the state equations yielding! x " x N % =! A! x "C %" x N % +! B " % u +! " 1 % r! x y = [ C ] " x N % Slide 23 Slide 24
But So Steady State Error We can now choose gains to yield desired pole locations and zero steady state error u =!Kx + K E x N =! K [ K E ]! x " x N % =! A BK BK e! x " C %" x N % +! " 1 % r! x y = [ C ] " x N % " x % x N Slide 25 Steady State Error Example Let s consider the previous example where we wanted the roots at s 3 + 28s 2 +192s + 64 We now have an additional pole which we will place at s=1 so the new desired characteristic equation is s 4 +128s 3 + 2992s 2 +1984s + 64 Slide 26 Steady State Error Example The system is now characterised by BK e (! 1 +! s X * " X N % = 1 -!! X * - *K 1 (2 + K 2 ) (12 + K 3 ) K e - X " N % + r * " 1 - " 1% -C ) %, Finding the eigenvectors of this equation yields s 4 + (12 + K 3 )s 3 + (2 + K 2 )s 2 + K 1 s + K e Steady State Error Example Equating like terms we find s 4 +128s 3 + 2992s 2 +1984s + 64 s 4 + (12 + K 3 )s 3 + (2 + K 2 )s 2 + K 1 s + K e So K 1 = 1984 K 2 = 2972 K 3 = 116 K e = 64 Slide 27 Slide 28
Steady State Error Example We now have a system that meets all of our requirements We haven t considered the required control effort Observer Design The previous development assumes that we have access to all state variables for state feedback In some instances, the state variables may not be available They may be difficult to observe Sensors may be expensive Slide 29 Slide 3 Observer Design Linear Quadratic Regulator Control We may need to design an Observer to estimate the state variables We can compare the estimated output against the measured output to close the loop on our estimate The estimated state is then used as the feedback in the controller * N.S. Nise (24) Control Systems Engineering Wiley Sons Optimal control methods attempt to find optimal gains subject to certain conditions One such algorithm is called the Linear Quadratic Regulator (LQR) algorithm. An objective/cost function can be defined and the appropriate state feedback gain K that minimizes the cost function can be found. Weighting factors/matrices are used to penalize the states and control input. This generally requires a good engineering judgment depending on the control performance requirements. Slide 31 Slide 32
LQR Control Consider a dynamic system in a state space form: x = Ax + Bu We can set a particular objective/cost function which governs the performance of the closedloop system:! J = " ( x T Qx + u T Ru) dt Here, Q and R are the weighting matrices that respectively penalize the states x and control input u (Q!, R>). LQR Control Then, the state feedback gain that minimizes this cost function is: u =!(R!1 B T P)x =!Kx P can be obtained by solving the Riccati equation: A T P + PA! PBR!1 B T P + Q = In Matlab, the feedback gain can be found via [K]=lqr(system,Q,R) Slide 33 Slide 34 An Example System Inverted Pendulum Inverted pendulum video courtesy of Colorado State University Dr. Stefan B. Williams Amme 35 : Introduction Slide 35 Dr. Stefan B. Williams Amme 35 : Introduction Slide 36
Inverted Pendulum We will look at the modelling and control of the inverted pendulum solutions provided by the University of Michigan http:// www.engin.umich.edu /class/ctms/examples/ pend/invpen.htm State Space Systems There are many other aspects of state space systems that we have not touched on here These include accounting for non-linear or digital systems We have also only touched briefly on optimal control methods Slide 37 Slide 38 Conclusions We have looked at techniques for modelling systems using State Space techniques. We have provided a brief introduction to designing controllers using the State Space techniques using pole placement and the LQR algorithm. Further Reading Nise Sections 3.1-3.7 and 12.1-12.8 Franklin Powell Section 2.2 and 7.1-7.6 Slide 39 Slide 4