note3

note3 - Modeling of Linear Systems SFG for Electric...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Modeling of Linear Systems SFG for Electric Circuits: Branch: V1 I Z V2 s s V I s = V s ,s s = V s , V s = Z Z Z 1 2 1 2 1 V1 Z I 1 V2 Z It is noted that the branch from high voltage node has a 1 1 positive gain Z , and lower voltage has a negative gain of , Z . Moreover the current node is between two voltage nodes. 1 Node: I1 V I2 V s = Z s I s , I s = Z sI s , Z sI s = 1 2 1 2 I1 Z V I2 Z It is noted that the current owing into the voltage node has a positive gain, and the other has a negative sign. Moreover the voltage node is between two current nodes. 2 Modi cation: I1 V1 I2 V2 V , V = Z I , I = ZI , ZI V = V + ZI , ZI : 1 2 1 1 2 1 2 2 1 2 V2 1 I1 Z V1 Z I2 The di erence is the addition of node V2 with gain of 1. 3 Example 8: Find SFG for I1 Z1 Ei ~ Z2 Vx I3 Z3 Z4 Vo Answer: We isolate each branch of the circuit to obtain similar simple circuits before. There are four branches listed below: (1) Ei Z1 (2) Vx Z2 I1 (3) Vx Vx Z3 (4) I3 I3 Z4 Vo I3 Vo I1 = Ei 1 Z1 I1 Z2 1 Z1 V x 1 Z3 Z2 I3 Z4 1 Z3 V o 1 V o Q: What if voltage source is replaced by current source? 4 Continuation of Example 8: Find SFG for Z5 I1 Z1 Ei ~ Z2 Vx I3 Z3 Z4 I5 Vo Answer: The only di erence is the addition of branch of Z . 5 Thus we need have di erent SFG for Vo and I5 that changes 4 of the previous page, and add one more as below: I3 Vo Z4 I5 Vo Z5 I5 Ei 1 Z5 1 Z1 Z2 1 Z1 1 Z3 Z2 1 Z5 Z4 = Ei I1 V x I3 Z4 V o I5 1 1 Z3 Vo 5 Computing Gain for Example 7: Forward path: i M = Z Z ; = 1; ZZ Z Z Z ii M = ; = 1 + + Z Z Z 1 2 4 1 4 5 3 1 2 2 2 1 2 3 Single loops: Z Z ,Z ; ,Z ; ,Z ; ,Z : Z Z 2 2 4 4 5 1 3 3 Two-nontouching loops: 2 1 ZZ; ZZ; ZZ ZZ ZZ ZZ 4 2 4 2 3 3 1 5 4 5 Hence the overall gain is: Z2Z4 + Z4 1 + Z2 + Z2 Z1Z3 Z5 Z1 Z3 M = Z2 + Z2 + Z4 + Z4 + Z2Z4 + Z2Z4 + Z2Z4 1 + Z1 Z3 Z3 Z5 Z1Z3 Z1Z5 Z3Z5 = 2 4 5 4 1 3 2 3 1 2 1 2 1 3 2 3 4 5 1 Z Z Z + Z Z Z + Z Z + Z Z Z Z + Z Z + Z Z Z + Z + Z + Z Z Z ZZ = Z Z + Z Z + Z Z + Z Z + Z Z ; if Z ! 1: 2 4 5 2 4 1 2 1 3 2 3 1 4 2 4 5 6 Example 8: Find an SFG for the following circuit with is as input node and vo as the output node. io i1 i s vo Z3 i3 Z2 v2 Z5 Z1 v1 Z4 Answer: We give the following SFG with explanation next page. Z4 v0 Z1 v0 -1 Z2 Z2 1 Z5 Z2 -1 is i0 v2 Z-1 i 3 Z 4 3 Z5 Z4 -1 Z3 v1 Z1 1 7 Discussions: To determine vo, we use Modi cation in page 3 with is ows into io ows out of Z1. To determine io, we use Branch in page 1, as io is the current owing through Z2 with vo higher voltage end, and v2 lower voltage end. To determine v2, we use Node in page 2 with io ows into, and i3 ows out of Z5. To determine i3, we again use Branch in page 1 with v2 higher and v1 lower voltage ends. To determine v1, we notice that v = Z i + i 1 4 1 3 where i1 = is , io. Finally by vo = v2 + Z2io, we obtain output node. 8 Mechanical Systems: We will tackle the modeling of mechanical systems through conversion to electric circuits. Friction motion: By physics, we have y2 b y1 f V1 1 2 R= b i=f 1 V2 With zero initial condition, Laplace transform yields , f = b dy dt y = b , : 1 2 F s = b V s , V s : 1 2 Compared with resistor, we have an equivalence: velocity friction constant force external force voltage, 1 resistance, current, current source. Actually the forces we have in the pictures are external forces. 9 Spring device: y2 f K 2 y1 f = K y , y ! Zt Zt = K d , d : 1 0 1 0 2 Applying Laplace yields 1 The equivalence is: Spring constant Mass in motion: By Newton's law, 2 F s = K V s , V s : s 2 V1 L= K i=f 1 V2 1 inducance. y Applying Laplace yields f = M d y = M d : dt dt 2 M f F s = sMV s: Hence we have an equivalence of Mass V C=M I capacitance: Note that one end of capacitor is always ground. 10 Example 1: External force becomes current source. Spring device becomes inductor. Since one end does not move, it has one ground. Friction now becomes resistor, and has also one end ground. b K y M f . v=y i s= f L= 1 K R 1 C=M b Mass becomes capacitor which always has one end ground. Since we have only reference point y in the mechanical system is moving, the equivalent circuit has only one nonzero voltage. 11 Example 2 Suspension model textbook: page 23 y M2 Ks Vy Ls R= 1 b iC2 C =M2 2 M1 Kw x i Ls 1 Ks Vx Lw 1 iR C1=M1 iLw Road surface r Kw iC1 Vr Analysis: iC1 = iLs + iR , iLw , and iC2 = ,iLs , iR. By physics, and equivalent relation, 2 1 1 2 iC1 = C dVx = M d x ; iC2 = C dVy = M d y ; dt dt dt 0 dt 1 iR = Vy , Vx = @ dy , dx A b; R dt dt 1 Z iLw = L t Vx , Vr d = Kwx , r; 2 2 2 2 iLs = L Vy , Vx d = Ksy , x: s 0 1 w Zt 0 = M1x = Ksy , x + by , x , Kw x , r; _ _ M2y = ,Ksy , x , by , x: _ _ 12 Example 3 Find equivalent circuit: External force = current source with one end of current source always ground. K2 b2 Mass M1 = capacitor C1 which is parallel to the current source. Spring K1 = inductor L,1 which 1 is between V1 = y1 and V2 = y2. _ _ , Friction b1 = resistor R1 1 which again between V1 = y1 and V2 = y2. _ _ K1 M2 y2 b1 M1 y1 f Mass M2 = capacitor C2 which is between V2 and ground. Spring K2 = inductor L,1 between V2 and ground. 2 , Friction b2 = resistor R2 1 again between V2 and ground. V1 1 1 Is = f L1= K C1= M1 C 2=M2 1 R1= b1 V2 L2 = K 2 1 R2 1 b2 13 Example 4 Find an equivalent circuit for K1 b1 y1 y2 y3 b2 M1 K2 M2 Between y3 and ground, there is a capacitor C2 = M2. Between y3 and y2, there is an inductor L2 = 1=K2. Between y2 and y1, there is a resistor R2 = 1=b2. Between y1 and ground, there are a capacitor C1 = M1, inductor L1 = 1=K1, and resistor R1 = 1=b1. v3 L 2 = 1/K2 C2 = M 2 R2 = 1/b 2 C1 = M 1 L1 = 1/K1 v2 v1 R1 = 1/b 1 14 Modeling Example 1 Inverted pendulum: We consider line movement for simpli cation. This example has applications to the launch of rocket or missiles. We will demonstrate the use of Lagrange mechanics in modeling. vy v m vz L u(t) M y Step 1: Total kinetic energy KE: 1 _ K:E:cart = M y2 no vertical or rotational movement 2 1 2 1 2 2 K:E:ball = mv = m vy + vz 2 2 _ vy = ,y + L cos ; vz = L sin _ _ 2 _ = vy = y2 + L2 cos2 _2 , 2yL cos ; _ _ vz2 = L2 sin2 _2; and thus 1 2 2 _2 _ : K:E:ball = m y + L , 2yL cos _ _ 2 15 Because the total K.E. is the sum of K:E:cart and K:E:ball, we obtain: 1 _ _ _ K:E: = M y2 + m y2 + L2 _2 , 2yL cos _ : 2 Step 2: Total potential energy P.E. is P.E. = mgL cos . Step 3: Form Lagrange of the system: LE = K:E: , P:E: 2 1 2 2 _2 _ , mgL cos ; _ _ _ = M y + m y + L , 2yL cos 2 and then write down equations of motion by using the following general principle: The right hand side consists of generalized forces" or external forces corresponding to each degree of freedom: and y. For y, force = ut; For , force = 0. Thus we have d 2 @LE 3 , 2 @LE 3 = u; 4 5 4 5 dt 2 @ y 3 2 @y 3 _ d 4 @LE 5 , 4 @LE 5 = 0: dt @ _ @ 1 2 @LE = 0; @LE = M + my , mL cos ; _ _ @y @y _ @LE = mL sin y _ + mgL sin ; _ @ @LE = mL _ , mL cos y: _ @ _ 2 16 Next we compute Substituting the above into 1 and 2 gives d 2 @LE 3 = M + my , mL cos + mL sin _ ; 4 5 dt 2 @ y 3 _ d 4 @LE 5 = mL , mL cos y + mL sin _y: _ dt @ _ 2 2 M + my , mL cos = u , mL sin _2; mL2 , mL cos y = mgL sin which can be written into the matrix form: 2 32 3 2 3 _2 7 6 M + m ,mL cos 7 6 y 7 6 u , mL sin 7 6 76 7 = 6 4 54 5 4 5: 2 ,mL cos mL mgL sin The left matrix is called inertial matrix, and its determinant is given by = M + mmL2 , m2L2 cos2 = M + m sin2 mL2: Hence we obtain 2 Hence inverted pendulum model is nonlinear, but time-invariant. mL u , mL sin _ + mg sin cos ; y = mL cos u , mL sin cos _ + M + mg sin : = 2 2 17 Linearization Revisited: A nonlinear model can often often be described by 2 6 6 6 6 6 x=6 _ 6 6 6 6 6 4 .. .. xn _ fnx1; x2; ; xn; u The vector x is called state-variable. An equilibrium is the solution of f xe; ue = 0 where xe is a constant vector, and ue a constant number. Linearization near the equilibrium xe; ue can be computed according to 2 6 6 6 6 6 6 A=6 6 6 6 6 4 @f1 @x1 @f2 @x1 x _ x _ 1 2 3 2 7 6 7 6 7 6 7 6 7 6 7=6 7 6 7 6 7 6 7 6 7 6 5 4 f x ; x ; ; xn; u f x ; x ; ; xn; u 1 1 2 2 2 1 3 7 7 7 7 7 7 = f x; u: 7 7 7 7 7 5 @fn @fn @x1 @x2 .. . . . . . . @f1 @x2 @f2 @x2 that gives approximate model: 3 7 7 7 7 7 7 ; 7 ... 7 7 7 7 @fn 5 @xn x=xe;u=ue @f1 @xn @f2 @xn B 2 6 6 6 6 6 6 =6 6 6 6 6 4 3 7 7 7 7 7 7 7 .. 7 7 7 7 @fn 5 @u x=xe ;u=ue @f1 @u @f2 @u x=A x+B u _ where x = x , xe and u = u , ue. Hence Ai;k , the i-kth element of A, and Bi, the ith element of B are given by @f Ai;k = @xi kx = xe;u= @fi 3 ; Bi = @u 5 x ue 18 = xe ;u=ue : Continuation of Example 1: We may take x1 = , x2 = _2. Then x = f x ; ; xn; u = x ; x = f x ; ; xn; u = : _ _ 1 1 1 2 2 2 1 By the earlier derivation, we have that 2 1 1 where = M + m sin2x1mL2. We may take x3 = y, x4 = y. _ Then, mL cosx u , mL sinx cosx x + M + mg sinx ; f = 1 2 2 1 x = f x ; ; xn; u = x ; x = f x ; ; xn; u = y: _ _ 3 3 1 4 4 4 1 Again by the earlier derivation, we have that 2 4 1 2 2 An obvious equilibrium point is xe = 0 and ue = 0. That is mL u , mL sinx x + mg sinx cosx : f = 1 1 = _ = 0; y = y_ = 0; u = 0: @f @f A ; = @x = 0; A ; = @x = 1; @f @f A ; = @x = 0; A ; = @x = 0; B = @f = 0: @u by f = x . For simplicity the subscriptions of x = xe; u = ue 11 1 1 12 1 2 13 1 14 1 1 1 3 4 1 2 19 We now calculate linearization around xe; ue = 0; 0: are omitted. Continuation for Linearization: By the expression of f2, we have @f +m @f @f A2;1 = @x2 = MML g ; A2;2 = @x2 = 0; A2;3 = @x2 = 0; 1 2 3 A2;4 = @f2 = 0; B2 = @f2 = 1 : 4 3 4 3 3 @x @u ML Since f = x , we have that @f @f A ; = @x = 0; A ; = @x = 0; @f @f A ; = @x = 0; A ; = @x = 1; B = @f = 0: @u Finaly by the expression of f we have @f @f A ; = @x = mg ; A ; = @x = 0; M @f @f 1 A ; = @x = 0; A ; = @x = 0; B = @f = M : @u 31 1 32 2 33 3 3 34 3 4 3 1 4 41 1 1 42 2 2 43 2 44 2 4 2 3 4 Hence the linearized system is described by 2 6 x1 6 _ 6 6x 6 _2 6 6 6 6 x3 6 _ 6 4 3 2 7 6 0 7 6 7 6 M +mg 7 6 7 6 ML 7=6 7 6 7 6 7 6 0 7 6 7 6 5 4 mg M x _ 4 1 0 0 0 0 0 0 0 0 32 0 7 6 x1 76 76 76 0 7 6 x2 76 76 76 1 7 6 x3 76 76 54 x 4 3 2 3 7 607 7 6 7 7 6 1 7 7 6 7 u 7 6L7 7+6 7 : 7 6 7 7 6 7M 7 607 7 6 7 7 6 7 5 4 5 1 20 Linearization of Example 1: Rewrite equations gives Z 1 2 1 2 The above gives the following SFG: u 1 ML 1 M +m 1 x = x ; x = x d ; x = MML g x + ML u; _ Z 1 x = x ; x = x d ; x = mg x + M u: _ _ M 2 1 3 4 3 4 4 1 x2 . 1 s (M+m) g ML x1 x2 . 1 s =x1 mg M 1 . x 1 4 s Thus we have that . x 3= x 4 s x 3=y Tu; s = Tu;y s = = 1 s2ML = 2 1 , M2+mg s ML , M s ML 1 0 1 mg 1 @ + Tu; A 2 s M M 0 1 B mg @1 + 2 2 1 + mg 1 C: A ; The system has one strictly unstable pole. sM s ML , M + mg 21 Modeling Example 2 Hanging Crane in page 30: x u mt mp (2) P N .. l .. x (1) u N P x . bx (friction) We adopt free body analysis. For 1, Newton's law implies u , N , bx = mtx _ where P and N are reaction force due to inverted pendulum. The translational movement of pendulum along x-direction satis es N = mpx + mpl cos , mpl _ sin : 2 The term l _2 is called centripetal acceleration along the axial direction which is present whenever velocity direction changes. 22 Eleminate N in the two equations give u , bx , mpx + mpl cos , mpl _ sin = mtx _ or mp + mtx + bx + mpl cos , mpl _ sin = u 3 _ 2 2 However the above equations involve two unknowns: and x. We thus examine translational movement perpendicular to pendulum: N cos + P sin , mpg sin P = mpl + mpx cos due to cos , = sin , N 2 and rotational movement: ,Pl sin , Nl cos = I , or l .. mpl P sin + N cos = ,I =l .. mpx Adding the above equations to m p g sin mp g eliminate P sin + N cos gives The above can be rewritten as , I = mpg sin + mpl + mpx cos : l I + mpl2 + mpgl sin + mplx cos = 0: 4 Equations 3 and 4 determine the model of hanging crane. Linearization around = can be found in the textbook. 23 Modeling Example 3 DC Motor: Newton's law: X (t) (t) For rotational movement, it becomes X d x : acceleration: force = Ma; a = dt 2 2 torques = J ; d : angular acceleration: = dt 2 2 Torsional spring one end xed: t = K t. If both ends are free: t = K 1t , 2t. Compare with f = K x1 , x2. Viscous friction: d t = B = B!t. dt Compare with f = b t. Consider the right hand side: t = K t + B _t + J t: (t) ~ ~ 2 (t) (t) 1 (t) ~ ~ K J , B 24 Continuation of DC Motor: Dynamic equations: L dia + Raia + e = va dt e = Ke _m, = Ktia. va ~ = Jm m + b _m. Applying Laplace transform gives ia Ra La e m E s = sKems , Ke m0; Vas = LasIas , Laia0 + RaIas + E s; = + Ias = Vas , E ssL Laia0 Ra + a V , sKem + Laia0 + Ke m0 ; = a Ra + sLa KtIa = ssJm + bm , Jms + b m0 , Jm _m0; KtIa + Jms + b m0 + Jm _m0 : or m = ssJ + b m ia (0) La Ke 1 + sL a Ra m(0) Jm s+b s(sJm +b) 1 m Jm s(sJm +b) Va 1 Ra + sL a Kt s(sJ m +b) Ia sK e Ra + sL a m . m(0) 25 D.C. Motor Model of Example 3: To compute transfer function from va to m, set ia0 = 0, m0, and _0 = 0. Thus we obtain: Kt ms s T s = V s = 1 +Ra+sLaKtsJm+b Ke a sJm +bRa +sLa = There are two time constants: e= ssJm + bRa + sLa + KtKe Kt JmLa = b + Ra s + bRa KtKe : s s + Jm La JmLa 2 + Kt By neglecting e, or La = 0, we have a second order model: La ; electrical time constant; Ra Jm ; mechanical time constant: m= b T s ssJ + bKt + K K : Ra m t e 26 DC Motor of P2.20: Jm Bm ia m L ~ ~ Since the shaft is not rigid, JL BL Applying Laplace transform with zero initial condition = sLa + RaIa + sKems; or Vas , sKems ; sLa + Ra KtIas = s2Jm + sBmms + TLs; or Tm , TL = KtIa , TL ; ssJm + Bm ssJm + Bm KLm , L = ssJL + BLLs; or 1 ssJL + BL TLs: Hence we have SFG: = = = = = = 1 va = La dia + iaRa + e; e = Ke d m ; dt dt d d = Ktia = Jm m + Bm m + TL; m dt dt TL = KL m , L = JL ddt L + BL d L : dt 2 2 2 2 Vas Ias Tms ms TLs Ls Va sLa +Ra Ia Kt s(sJm+Bm) m KL 1 1 TL s( sJL+B ) L KL L sK e sLa +Ra s(sJm+B ) m 27 MATLAB Tutorial: for-end" command: if some commands are repeatedly used which can be indexed each time they are used, this command will be useful. Example: Compute values of 2 F s = s + 2s + 2 at s = j! with 100 samples of ! 2 0:1; 10 in logrithm scale. 2 Answer: Take !k +1 = 0:1 k for k = 0; 1; ; 99. Then 99 = 100. Hence 99 log = log100 = Our MATLAB commands are: = elog100=99 = 1:0476: s1 = 0:1 sqrt,1; for k = 1 : 100, sk + 1 = sk 1:0476; tf k = 2=sk + 2 sk + 1; 2 end 28 while-end" command: if some commands are repeatedly used, but termination is dependent on some computed results, rather on the index, then this command will be useful. Example: Compute roots of f x = x , e,x within an error no larger than 0:001. Answer: Because f 0x = 1 + e,x 0, and 1 f 0 = ,1 0; f 1 = 1 , e, 0; there is a unique root between 0 and 1. We use bisection method: Step 1: Set x = 0, and y = 1. Step 2: If jy , xj 0:001, then stop; Otherwise go to the next step. Step 3: Set z = x + y=2. If f z 0, set x = z ; If f z 0, set y = z. Go back to Step 2. 29 A MATLAB program to implement this algorithm can be: x=0; y=1; tol=0.001; while absy , x tol, z = x + y=2; f = z , exp,z; if f 0, x = z; else y = z; end end root= z After running the above program gives the root: 0:5674 with a guaranteed error smaller than 0:001. if-elseif-end" command: this is a commonly used command which is already used in the previous example. 30 m-File for MATLAB: m- le: a set of MATLAB commands can be written together to form an m- le with name lename.m. The command lename" excutes each of the MATLAB command in lename.m one by one. function m- le: an m- le can be in the form of function: y1, y2, , yn =funcx1, x2, , xm computes output variable y1yn with input variable x1xm. Comment: If it is not in function form, then no input output variables are required. For example, we may save any set of MATLAB commands into a le called lename.m". This is so called m- le. Then in MATLAB environment, we may type lename" to execute this program. If it is in function form, then it becomes a subroutine which can be used as existing MATLAB command such as zp2tf" whose m- le is listed on next page: 31 Examples: 1. Write an m- le to plot step response for Gs = s2 + 21 + 1 ; = 0:1 + 0:1k; s on the same picture for k = 0; 1; 2; ; 8: num=1; den= 1 2*0.1 1 ; stepnum,den hold on for k=1:8 den= 1 2*0.1+k 10 1 ; stepnum,den end 2. MATLAB command zp2tf": 32 function num,den = zp2tfz,p,k ZP2TF Zero-pole to transfer function conversion. NUM,DEN = ZP2TFZ,P,K forms the transfer function: nums Hs = || dens given a set of zero locations in vector Z, a set of pole locations in vector P, and a gain in scalar K. Vectors num and den are returned with numerator and denominator coe cients in descending powers of s. See also TF2ZP. J.N. Little 7-17-85 Revised 6-27-88 Copyright c 1984-98 by The MathWorks, Inc. $Revision: 1.12 $ $Date: 1997 11 21 23:41:24 $ 33 Note: the following will not work if p or z have elements not in complex pairs. den = realpolyp:; md,nd = sizeden; k = k:; mk,nk = sizek; if isemptyz, num = zerosmk,nd-1,k ; return; end m,n = sizez; if mk = n if m == 1 error'Z and P must be column vectors.'; end error'K must have as many elements as Z has columns.'; end for j=1:n zj = z:,j; pj = realpolyzj*kj; numj,: = zeros1,nd-lengthpj pj ; end 34 ...
View Full Document

Ask a homework question - tutors are online