MEM 55 Introduction to Control Systems: Modeling & analyzing systems Harry G. Kwatny Department of Mechanical Engineering & Mechanics Drexel University
Outline The Pendulum Micro-machined capacitive accelerometer Differential equation model Static (equilibrium) behavior Dynamic behavior Linearizing Nonlinear Models Transfer Functions Using MATLAB numerics for solving odes Using MATLAB to compute the transfer function
Pendulum x 3 θ 1 1-7.5-5 -.5.5 5 7.5 1 x1 m θ = mg sinθ cθ + T t x θ, x 1 x m = x 1 θ -1 - -3 ( ) ( / sin / 1/ ) () x = g x c m x + m T t 1 (, ) x = f x u
Micro-machined Capacitive Accelerometer From James Doscher, Analog Devices
Accelerometer Model a k m v = x f Electrical viewpoint c x E R i = q e v = x f Mechanical viewpoint x
Governing Equations ( + ) = = ( Forces on m) m x a f kx cx mx f kx cx ma q E = Ri+ e Rq + = E ( + x) C( x) ( Voltages around loop) q dc x d 1 dc x 1 f =, C( x) = C = C x x = v () dx d + x C x dx Cd q 1 k c v = x v a t mcd m m q q d = + RC d 1 E R First order system of ODEs independent variable: t states: x, v, q (dependent variables) input: a(t) parameters: m, c, k, d, R, C, E
Remarks on Capacitor Electric power supplied to capacitor: ei Mechanical power supplied to capacitor: fv Total work on capacitor: W = eidt+ fvdt = edq+ f dx Constitutive relation (electrically linear): q = C x e The electric energy stored in capacitor is defined by e (, ) de q x = e dq + f dx E e q q = dq= C x q C( x) E q E e= = = = e e, f q C x x dx q C( x) dc x
Analyzing Ordinary Differential Equations State vector Input Initial condition ( ) system of first order odes: x = f xu, t, x t = x Steady-state (equilibrium) behavior Set input equal to a constant Set state time derivative (velocity) equal to zero Dynamic behavior Time response to initial conditions Time response to inputs
Equilibrium Behavior = v q = kx ma q 1 k c Cd = x v a mcd m m q( d + x) = + E q( d + x) 1 Cd = + E RC d R kx ma = CE ( + x d ) d 1 / eliminate q
Equilibrium Behavior CE y = d 1 / ( + x d ) unstable E = 1, C =.1, d =.1, k = stable: x=.561, q=.1595 unstable: x=.748, q=.38473 stable y = kx ma
Dynamic Behavior.15 Transient response from the origin: x =, v =, q = R= 1, c= 1, m= 1, a=.1.5 q -.5 v -.1 x -.15 1 3 4 5 6 7 8 9 1
Dynamic Behavior.15.1.5 Transient response from the origin: x =, v =, q = R= 1, c= 1, m= 1, a=.1sin t/ 3 q -.5 -.1 -.15 -. 5 1 15 5 3 v x
Solving ODEs function dy = accel(t,y) dy = zeros(3,1); % a column vector a=; dy(1) = y(); dy() = -y(3)^/.-1*y(1)-1*y()-a; dy(3) = -y(3) * (.1+y(1))/.1+1; Write a function that defines the differential equations >> options = odeset('reltol',1e-4,'abstol',[1e-4 1e-4 1e-5]); >> [T,Y] = ode45(@accel,[ 1],[ ],options); >> plot(t,y(:,1),t,y(:,),t,y(:,3))
General Model of Nonlinear System state input u( t ) xt output y( t) System x = f x, u state equation y = h x, u output equation x R, u R, y R n m q
Linearization 1 In general models derived from physical principles involve sets of first and second order differential equations. These are reduced to first order standard form, involving the state vector x, input vector u, and output vector y. x = f x, u state equations y = h x, u output equations A set of values ( x, u, y ) is called and equilibrium point if they satisfy: ( x u) (, ) = f, y = h x u We are interested in motions that remain close to the equilibrium point.
Linearization () = + δ = + δ = + δ δx = f ( x + δx() t, u + δu() t ) y + δ y() t = h x + δx() t, u + δu() t Define: x t x x t, u t u u t, y t y y t The equations become: Now, construct a Taylor series for f, h (, ) (, ) f x u f x u ( + δ, + δ ) = (, ) + δ + δ + x u h( x, u) h( x, u) h( x + δx, u + δu) = h( x, u ) + δx+ δu+ hot x u Notice that f x, u = and h x, u = y, so f x x u u f x u x u hot (, ) (, ) f x u f x u δ = δ + δ x u h( x, u ) h( x, u ) δ = δ + δ x u x x u y x u δx = Aδx+ Bδu δ y = Cδx+ Dδu
Linear System Models: state space & transfer function The diffrential equation or 'state space' model is x t Ax t Bu t y t Cx t Du t x () = () + () state equation () = () + () output equation = x initial condition () y() t. The 'transfer function' model is = G( s) U( s) Y( s) U( s) G( s) The state space model describes how the input u t and the initial condition affect the state x t and the output Y s where, are the Laplace transforms of the output and input and is the transfer function. The transfer function model describes how the input affects the output. state input u( t ) xt output y ( t) System ()
Solving ODEs via the Laplace Transform x = Ax+ Bu, y = Cx+ Du ( ) 1 1 = [ ] + [ ] [ ] [ ] L x = AL x + BL u sx s x = AX s + BU s L y = CL x + DL u Y s = CX s + DU s X s si A x si A BU s { } 1 1 Y s = C si A x + C si A B+ D U s Initial condition response Transfer function: [ ] Input response 1 G s = C si A B+ D
Example: Accelerometer x = v ( + x) = + ( + x) q 1 k c q d v = x v a() t e= mcd m m Cd q q d RC d 1 E R ( d + x ) δx = δv δ e= δ q q 1 k c Cd δv = δq δx δv δa() t m Cd m m q δ x ( d + x) q Cd q = δq δx RC d RC d
Example: Accelerometer 1 δx δx k c q 1 δ δ 1 = δ m m m Cd + δq δq q ( d + x ) RCd RCd v v a δ x q ( d + x ) δ = δ + δ [ ] e v a Cd Cd δ q T state: x= [ δx, δv, δq] input: u= δ a (acceleration) [ ] [ δ e] output: y = (capacitor voltage)
Accelerometer Transfer Function >> A=[ 1 ;-1 -.1 -(.1595)/(.1*.1);- (.1595)/(.1*.1) -(.1+.561)/(.1*.1)]; >> B=[;-1;]; >> C=[-(.1595)/(.1*.1) -(.1+.561)/(.1*.1)]; >> Gss=ss(A,B,C,); >> G=tf(Gss) Transfer function: 1.6 s + 3.367e-13 --------------------------------- s^3 + 15.7 s^ +.56 s + 943.9 >> zpk(g) Zero/pole/gain: 1.595 s ---------------------------------- (s+15.6) (s^ +.111s + 8.938)
Reduction to State Space Form k m c y r( t) Try the usual: An alternative: 1 my = k y r c y r x = x + α r x 1 = x x1 = y k c k c x = x 1 = y x = x1 x + r+ r m m m m x1 = y α1r y = x1+ α1r x = x α r y = x + α r + α r 1 k c x + α 1r + αr = ( x1+ α1r) x + α1r m m 1 ( α ) c c c α1 = and α = α1+ α1 =, α = m m m c x 1 = x + r m k c c k x = x1 x + + r m m m m k c + r + r+ r m m
Computing Transfer Functions From original equation: = ( ) ( ) [ ] = [ ] [ ] = [ ] = [ ] y = = + + my k y r c y r Use L y sl y y L y sl y y s L y sy y with y = and ms Y s ky s csy s kr s csr s cs + k cs + k Y( s) = R( s) G( s) = + + + + From state space ms cs k ms cs k d x1 1 x1 cm x1 = dt x km cm r, y [ 1 ] [ ] r x + = x + cm + km 1 1 s 1 cm cs + k G( s) = C[ si A] B+ D= [ 1 ] km s cm = + ( cm) + km ms + cs + k
Quarter-Car Suspension m m y = k y y k y r c y y c y r 1 1 1 1 1 1 1 1 my = k y y + c y y 1 1 k c m 1 Verticle motion, y 1, y measured from rest with r= k 1 c 1 r Using Laplace Transform, derive a relationship ( 17.333/1.367) between R s and Y s (data from Franklin et al) s Y ( s) = R s 4 3 s + 49s + 4467.5s + 15761s+ 1.8899
Quarter-Car State Space Model 1 m 1 1 ( k1 k) c1 c k c x + + 1 c1 k1 1 m v1 ( c1 c) 1 m1 m1 m 1 = + 1 1 1 x 1 m m m m m1 () = [ 1 ] 1 x d v + + m m r t dt x v k c k c v cc y t x1 v 1 x v c ()
Summary Accelerometer model Start with physical principles Nonlinear ordinary differential equations First order form: standard form or state varaiable form State space and transfer functions Solving ODEs / Transfer Functions Linear systems are described by state space and transfer function models Linear systems of ODEs can be solved using Laplace transforms The transfer function is used to describe the input-output response Using MATLAB to solve odes Using MATLAB to compute transfer functions