DC Motor Driving an Inertial LoadSlide 2Slide 3State Space modelMatlabMatlab outputSS to TF or ZPK representationSlide 84 ways to enter system modelSlide 10Liquid Level SystemSlide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22ModelingSlide 24Slide 25Slide 26Slide 27Slide 28Slide 29ExampleSlide 31Slide 32Slide 33DC Motor Driving an Inertial Load• (t): angular rate of the load, output•vapp(t): applied voltage, the input•i(t) armature current•vemf(t) back emf voltage generated by the motor rotation– vemf(t) = constant * motor velocity• (t): mechanical torque generated by the motor– (t) = constant * armature currentState Space modelMatlabR= 2.0; % OhmsL= 0.5; % HenrysKm = .015; % torque constantKb = .015; % emf constantKf = 0.2; % NmsJ= 0.02 % kg.m^2;A = [-R/L -Kb/L; Km/J -Kf/J];B = [1/L; 0];C = [0 1];D = [0];sys_dc = ss(A,B,C,D)Matlab outputa = x1 x2 x1 -4 -0.03 x2 0.75 -10b = u1 x1 2 x2 0c = x1 x2 y1 0 1d = u1 y1 0SS to TF or ZPK representation>> sys_tf = tf(sys_dc)Transfer function: 1.5------------------------s^2 + 14 s + 40.02>> sys_zpk = zpk(sys_dc)Zero/pole/gain: 1.5-------------------------(s+4.004) (s+9.996)•Note The state-space representation is best suited for numerical computations. For highest accuracy, convert to state space prior to combining models and avoid the transfer function and zero/pole/gain representations, except for model specification and inspection.4 ways to enter system modelsys = tf(num,den) % Transfer functionsys = zpk(z,p,k) % Zero/pole/gainsys = ss(a,b,c,d) % State-spacesys = frd(response,frequencies) % Frequency response datas = tf('s');sys_tf = 1.5/(s^2+14*s+40.02)Transfer function: 1.5------------------------ s^2 + 14 s + 40.02sys_tf = tf(1.5,[1 14 40.02])4 ways to enter system modelsys_zpk = zpk([],[-9.996 -4.004], 1.5)Zero/pole/gain: 1.5-------------------------(s+9.996) (s+4.004)Liquid Level SystemQi = input flow rateQo = output flow rateH = liquid level in tankA = cross section of tankV = volume of liquid in tankV = AHConservation of matter:Qo is dependent on the “head” H const. coeff.oioiQQdtdHAQQvdtd HKQo∴This is nonlinear.To find eq. points, set derivative=0∴To linearize: letwhere HKQdtdHAi0 HKQilevel liquid desired isconst ***HHKQioooiiiqQQhHHqQQ******ioQHKQ Substitute into eq on top:usehHKQqdtdhAii**...)0()(0tohxdxdffxfxhHKqhdhhHdKHKQqdtdhAihii*0*0**2 **21)()(2HKAssqshqhHKdtdhAii0Output flow:The quantity = R is the called the resistance of the valve and A is also denoted as C & is called the capacitance of the tank.Then:Note: hHKqhHKHKhHKqQQoooo*****22∴***22)()(2)()(HKAsHKsqshHKsqsqiioKH*21111)()(RCsRCsRsqsqiooioqqdtdhChRq1Two tank system:In eq pt: all flow=same,*iiqQQ ∴1*1qQQ 2*2qQQ *2*11*22*HHKHKQ 1),(12111hhRq 2,111qqdtdhCi32221hRq 42122qqdtdhC Exercise:1)get component block diag form 3, 42)put all four pieces to form block diag.3)get T.F. from qi to q21)(1)()(122211222112sCRCRCRsCRCRsqsqiNote: ip1=0, v∴p1=vo=vA & vB=vp2=0Let vC1 & vC2 be s.v., vo output.KCL at A:oiCCvCRvCRvCRdtdv11111121111011211dtdvCRvRvvCCoivo is not s.v. nor input, use vo=vC2211111121111CiCCvCRvCRvCRdtdvKCL at B:02231dtdvCRvvCBo023CRiivo1 not s.v. nor input, vo1=vA+vC1=vn1+vC1 =vp1+vC1=vo+vC1 =vC2+vC1223123211CCCvCRvCRdtdv∴12321oCvCRdtdv0iCCCCvCRvvCRCRCRCRvvdtd01111111212323111221Output eq:iCCoovvvvv001110211Modeling•Types of systems electric mechanical electromechanical•Types of models I/O o.d.e. models state space modelsI/O o.d.e. model: a d.e. involving input/output only.linear:where u: input y: outputubudtdbudtdbyaydtdaydtdaydtdmmmnnnnn0101111State space model:linear:or in some text: where: u: input y: output x: state vectorA,B,C,D, or F,G,H,J are const matrices ),( :eqOutput ),( :eq StateuxhyuxfxDuCxyBuAxxJuHxyGuFxxOther types of models:Transfer function model (This is I/O model) from I/O o.d.e. model, take Laplace transform: ),()( sYty L)()( ssYtydtdL),()(222sYstydtdL ),()( sUtu L)()( ssUtudtdLThen I/O model in L.T. domain becomes:This is the T.F. model of the system.∴T.F. or i.e. output L.T. is eq. to input L.T. with gain H(s))()()()()()()(010111sUbssUbsUsbsYassYasYsasYsmmnnn011101)()(asasasbsbsbsUsYnnnmmdenote)(or )( sGsH)()()(or )(sUsYsGsH )()(or )()()( sUsGsUsHsY State space model to T.F. / block diagram:s.s.Take L.T. :From sX(s)-AX(s)=BU(s) sIX(s)-AX(s)=BU(s) (sI-A)X(s)=BU(s) X(s)=(sI-A)-1BU(s)DuCxyBuAxx)()()()()()(sDUsCXsYsBUsAXssX121into : Y(s)=C(sI-A)-1BU(s)+DU(s) Y(s)=[C(sI-A)-1B+D] U(s)H(s)= D+C(sI-A)-1Bis the T.F. from u to yfrom ))()((1)( sBUsAXssX 2 1Example xyuxx31103210 10,3210 31,0BACD 23132)3(131312)3(112)3(131102132)3(13110321311032101001310)()(2111sssssssssssssssssssBAsICDsH•In Matlab:>> A=[0 1;-2 -3];>> B=[0;1];>> C=[1 3];>> D=[0];>> [n,d]=ss2tf(A,B,C,D)n = 0 3.0000 1.0000d = 1 3 2>> n=[1 2 3];d=[1 4 5 6];>> [A,B,C,D]=tf2ss(n,d)A = -4 -5 -6 1 0 0 0 1
View Full Document