Topic #7 16.31 Feedback Control State-Space Systems What are state-space models? Why should we use them? and how do we develop a state-space mode( &ased in classical control design How are they related to the transfer functions What are the basic properties of a state-space model, and how do we analyze these? Copyright [2001 by JOnathan dHow. O
Topic #7 16.31 Feedback Control State-Space Systems • What are state-space models? • Why should we use them? • How are they related to the transfer functions used in classical control design and how do we develop a state-space model? • What are the basic properties of a state-space model, and how do we analyze these? Copyright 2001 by Jonathan How. 1
Fall 2001 16.317-1 troduction State space model: a representation of the dynamics of an Nth order system as a first order differential equation in an N-vector, which is called the state Convert the Mtn order differential equation that governs the dy- namics into N first-order differential equations Classic example: second order mass-spring system mp+ cp+kp= F Let 1=p, then 2=p=1, and (F kn p-kp)/m (F-ca2-ka1)/m Lp k/m-c/m]p][1/ Let u= f and introduce the state →i=Ax+Bu If the measured output of the system is the position, then we have that
Fall 2001 16.31 7—1 Introduction • State space model: a representation of the dynamics of an Nth order system as a first order differential equation in an N-vector, which is called the state. — Convert the Nth order differential equation that governs the dynamics into N first-order differential equations • Classic example: second order mass-spring system mp¨ + cp˙ + kp = F — Let x1 = p, then x2 = p˙ = x˙ 1, and x¨2 = ¨p = (F − cp˙ − kp)/m = (F − cx2 − kx1)/m ⇒ p˙ p¨ = 0 1 −k/m −c/m p p˙ + 0 1/m u — Let u = F and introduce the state x = x1 x2 = p p˙ ⇒ x˙ = Ax + Bu — If the measured output of the system is the position, then we have that y = p = ∙ 1 0 ¸ p p˙ = ∙ 1 0 ¸ x1 x2 = cx
Fall 2001 16.317-2 The most general continuous-time linear dynamical system has form (t)=A(t)x(t)+B(t+)(t) y(t)=C(t)ac(t)+D(tu( where t∈ R denotes time a(tER is the state(vector) u(t Rm is the input or control y(t)∈ RP is the output A(t)ERnxn is the dynamics matrix B(t)∈R n×m is the input matrIx C(t)ERPXn is the output or sensor matrix D(t)E RPxm is the feedthrough matrix Note that the plant dynamics can be time-varying e Also note that this is a mimo system We will typically deal with the time-invariant case Linear Time-Invariant(LTI) state dynamics )= Ax(t)+B y(t)= Ca(t)+ Du(t) so that now A, B, C, D are constant and do not depend on t
Fall 2001 16.31 7—2 • The most general continuous-time linear dynamical system has form x˙(t) = A(t)x(t) + B(t)u(t) y(t) = C(t)x(t) + D(t)u(t) where: — t ∈ R denotes time — x(t) ∈ Rn is the state (vector) — u(t) ∈ Rm is the input or control — y(t) ∈ Rp is the output — A(t) ∈ Rn×n is the dynamics matrix — B(t) ∈ Rn×m is the input matrix — C(t) ∈ Rp×n is the output or sensor matrix — D(t) ∈ Rp×m is the feedthrough matrix • Note that the plant dynamics can be time-varying. • Also note that this is a MIMO system. • We will typically deal with the time-invariant case ⇒ Linear Time-Invariant (LTI) state dynamics x˙(t) = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) so that now A, B, C, D are constant and do not depend on t
Fall 2001 16.317-3 Basic definitions Linearity- What is a linear dynamical system? A system g is linear with respect to its inputs and output y if superposition holds: G(a11+a22)=a1Gu1+a2G So if y1 Is th he response o of g to u1(91 Gul), and y2 is the response of G to u2(92=Gu2), then the response to a11+a202 IS a191+ a292 A system is said to be time-invariant if the relationship between the input and output is independent of time. So if the response to (t) is yt) then th response to u(t-to is y(t- to (t)is called the state of the system at t because Future output depends only on current state and future input Future output depends on past input only through current state State summarizes effect of past inputs on future output-like the memory of the system Example: Rechargeable fashlight- the state is the current state oj charge of the battery. If you know that state, then you do not need to know how that level of charge was achieved (assuming a perfect battery)to predict the future performance of the fashlight
Fall 2001 16.31 7—3 Basic Definitions • Linearity — What is a linear dynamical system? A system G is linear with respect to its inputs and output u(t) → G(s) → y(t) if superposition holds: G(α1u1 + α2u2) = α1Gu1 + α2Gu2 So if y1 is the response of G to u1 (y1 = Gu1), and y2 is the response of G to u2 (y2 = Gu2), then the response to α1u1 + α2u2 is α1y1 + α2y2 • A system is said to be time-invariant if the relationship between the input and output is independent of time. So if the response to u(t) is y(t), then the response to u(t − t0) is y(t − t0) • x(t) is called the state of the system at t because: — Future output depends only on current state and future input — Future output depends on past input only through current state — State summarizes effect of past inputs on future output — like the memory of the system • Example: Rechargeable flashlight — the state is the current state of charge of the battery. If you know that state, then you do not need to know how that level of charge was achieved (assuming a perfect battery) to predict the future performance of the flashlight
Fall 2001 16.317-4 Creating Linear State-Space Models o most easily created from Ntn order differential equations that de- scribe the dynamics This was the case done before Only issue is which set of states to use -there are many choices Can be developed from transfer function model as well Much more on this later e Problem is that we have restricted ourselves here to linear state space models, and almost all systems are nonlinear in real-life Can develop linear models from nonlinear system dynamics
Fall 2001 16.31 7—4 Creating Linear State-Space Models • Most easily created from Nth order differential equations that describe the dynamics — This was the case done before. — Only issue is which set of states to use — there are many choices. • Can be developed from transfer function model as well. — Much more on this later • Problem is that we have restricted ourselves here to linear state space models, and almost all systems are nonlinear in real-life. — Can develop linear models from nonlinear system dynamics
Fall 2001 16.317-5 Linearization Often have a nonlinear set of dynamics given by f(a, u) where a is once gain the state vector, u is the vector of inputs, and f(, is a nonlinear vector function that describes the dynamics Example: simple spring. With a mass at the end of a linear spring (rate k) we have the dynamics but with a "leaf spring,"as is used on car suspensions, we have a nonlinear spring- the more it deflects, the stiffer it gets. Good model now is kla+k 2T which is a cubic sprin Restoring force depends on the deflection a in a nonlinear way. Figure 1: Response to linear k and nonlinear(k1=0, k2= k)springs(code at the end
Fall 2001 16.31 7—5 Linearization • Often have a nonlinear set of dynamics given by x˙ = f(x, u) where x is once gain the state vector, u is the vector of inputs, and f(·, ·) is a nonlinear vector function that describes the dynamics • Example: simple spring. With a mass at the end of a linear spring (rate k) we have the dynamics mx¨ = kx but with a “leaf spring” as is used on car suspensions, we have a nonlinear spring — the more it deflects, the stiffer it gets. Good model now is mx¨ = (k1x + k2x3 ) which is a “cubic spring”. — Restoring force depends on the deflection x in a nonlinear way. 0 2 4 6 8 10 12 −2 −1 0 1 2 X Time Nonlinear Linear 0 2 4 6 8 10 12 −3 −2 −1 0 1 2 3 V Time Nonlinear Linear Figure 1: Response to linear k and nonlinear (k1 = 0, k2 = k) springs (code at the end)
Fall 2001 16.317-6 Typically assume that the system is operating about some nominal state solution a(t)(possibly requires a nominal input u(t)) Then write the actual state as a(t=a(t)+dx(t and the actual inputs as u(t)=u(t)+Su(t) The "8"is included to denote the fact that we expect the varia- tions about the nominal to be small Can then develop the linearized equations by using the Taylor series expansion of f(, about a (t) and a () Recall the vector equation i=f(a, u), each equation of which 正z=f(x,u) can be expanded as 0 dt )=f(x0+6x,b+) f(x0,)+ afi afi Su du where 0f「af;Of ax a and o means that we should evaluate the function at the nominal values of o and 2o The meaning of "small"deviations now clear-the variations in dc and Su must be small enough that we can ignore the higher order terms in the Taylor expansion of f(a, a
Fall 2001 16.31 7—6 • Typically assume that the system is operating about some nominal state solution x0(t) (possibly requires a nominal input u0(t)) — Then write the actual state as x(t) = x0(t) + δx(t) and the actual inputs as u(t) = u0(t) + δu(t) — The “δ” is included to denote the fact that we expect the variations about the nominal to be “small” • Can then develop the linearized equations by using the Taylor series expansion of f(·, ·) about x0(t) and u0(t). • Recall the vector equation x˙ = f(x, u), each equation of which x˙ i = fi(x, u) can be expanded as d dt(x0 i + δxi) = fi(x0 + δx, u0 + δu) ≈ fi(x0 , u0 ) + ∂fi ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 δx + ∂fi ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 δu where ∂fi ∂x = ∂fi ∂x1 ··· ∂fi ∂xn and ·|0 means that we should evaluate the function at the nominal values of x0 and u0. • The meaning of “small” deviations now clear — the variations in δx and δu must be small enough that we can ignore the higher order terms in the Taylor expansion of f(x, u)
Fall 2001 6.317-7 Since d ad=fi(z,u), we thus have that afi 6x+ afi x;)≈ dt 0 Combining for all n state equations, gives(note that we also set 0f1 0f1 0f2 af2 d 6x+ dt af A(tdc+b(tsu where afi af., afi. ax1 dx af? f A(t) 器 an afn ax and au ou afi af af af2 B(t) afn. afn afn
Fall 2001 16.31 7—7 • Since d dtx0 i = fi(x0, u0), we thus have that d dt(δxi) ≈ ∂fi ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 δx + ∂fi ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 δu • Combining for all n state equations, gives (note that we also set “≈” → “=”) that d dtδx = ∂f1 ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 ∂f2 ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 . . . ∂fn ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 δx + ∂f1 ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 ∂f2 ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 . . . ∂fn ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 δu = A(t)δx + B(t)δu where A(t) ≡ ∂f1 ∂x1 ∂f1 ∂x2 ··· ∂f1 ∂xn ∂f2 ∂x1 ∂f2 ∂x2 ··· ∂f2 ∂xn . . . ∂fn ∂x1 ∂fn ∂x2 ··· ∂fn ∂xn 0 and B(t) ≡ ∂f1 ∂u1 ∂f1 ∂u2 ··· ∂f1 ∂um ∂f2 ∂u1 ∂f2 ∂u2 ··· ∂f2 ∂um . . . ∂fn ∂u1 ∂fn ∂u2 ··· ∂fn ∂um 0
Fall 2001 16.317-8 Similarly, if the nonlinear measurement equation is y=g(a, u),can show that, if y(t)=yo+8y,then ag1 ax lo 0 ag2 y 00u gp C(t)8.c+D(t)s Typically think of these nominal conditions u ,u as"set points or"operating points" for the nonlinear system. The equations O C=A(t)dx+b(to dy=c(tSx +d(tdu then give us a linearized model of the system dynamic behavior about these operating/set points Note that if ao, u are constants, then the partial fractions in the expressions for A-D are all constant -> LTI linearized model One particularly important set of operating points are the equilib- rium points of the system. Defined as the states control input combinations for which provides n algebraic equations to find the equilibrium points
Fall 2001 16.31 7—8 • Similarly, if the nonlinear measurement equation is y = g(x, u), can show that, if y(t) = y0 + δy, then δy = ∂g1 ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 ∂g2 ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 . . . ∂gp ∂x ¯ ¯ ¯ ¯ ¯ ¯ 0 δx + ∂g1 ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 ∂g2 ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 . . . ∂gp ∂u ¯ ¯ ¯ ¯ ¯ ¯ 0 δu = C(t)δx + D(t)δu • Typically think of these nominal conditions x0 , u0 as “set points” or “operating points” for the nonlinear system. The equations d dtδx = A(t)δx + B(t)δu δy = C(t)δx + D(t)δu then give us a linearized model of the system dynamic behavior about these operating/set points. • Note that if x0 , u0 are constants, then the partial fractions in the expressions for A—D are all constant → LTI linearized model. • One particularly important set of operating points are the equilibrium points of the system. Defined as the states & control input combinations for which x˙ = f(x0 , u0 ) ≡ 0 provides n algebraic equations to find the equilibrium points
Fall 2001 6.317-9 Example Consider the nonlinear spring with(set m= 1) y=k1y+k2 gives us the nonlinear model (a1=y and 2=y dt k1y+ k2 f(a e Find the equilibrium points and then make a state space mode For the equilibrium points, we must solve f(a) y 0 k1y+k2y' which gives y=0 and k1y+k2(y=0 Second condition corresponds to yo 0=±y-k/k2 which is only real if k1 and k2 are opposite signs For the state space model afi afi 0 A= ax1 a af2 af2 k1+3k1y)20。k1+3k2(y)20 dx1 a and the linearized model is fa= asa
Fall 2001 16.31 7—9 Example • Consider the nonlinear spring with (set m = 1) y¨ = k1y + k2y3 gives us the nonlinear model (x1 = y and x2 = y˙) d dt y y˙ = y˙ k1y + k2y3 ⇒ x˙ = f(x) • Find the equilibrium points and then make a state space model • For the equilibrium points, we must solve f(x) = y˙ k1y + k2y3 = 0 which gives y˙ 0 = 0 and k1y0 + k2(y0 ) 3 = 0 — Second condition corresponds to y0 = 0 or y0 = ± r −k1/k2, which is only real if k1 and k2 are opposite signs. • For the state space model, A = ∂f1 ∂x1 ∂f1 ∂x2 ∂f2 ∂x1 ∂f2 ∂x2 0 = 0 1 k1 + 3k2(y) 2 0 0 = 0 1 k1 + 3k2(y0) 2 0 and the linearized model is ˙ δx = Aδx