Invertedpendulum倒立擺的matlab建模_第1頁(yè)
Invertedpendulum倒立擺的matlab建模_第2頁(yè)
Invertedpendulum倒立擺的matlab建模_第3頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余11頁(yè)可下載查看

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、ECE451 Controll EngineeringInverted pendulum09/29/2013Introduction:Inverted pendulum is a typical fast, multi-varaibles, nonlinear, unstable system, it has significant meaning. We choose the PID controller to fot the inverted pendulum.Assume the in put is a step sig nal , the gravitati onal accelera

2、ti on g=9.8m/sA2 and lin earize the non li near model around the operati ng point.I. Mathematic Modli ngMmass of the car0.5kgmmass of the pen dulum0.2kgbcoefficie nt of frictio n for cart0.1N/m/secllen gth to pen dulum cen ter of mass0.3 mImass mome nt of in ertia of the pen dulum 0.006 kg.mA2F forc

3、e applied to the cartxcoord in ate of cart positi on0pen dulum an gle from vertical (dow n)N and F are the force from horiz on tal and vertical direct ion.d2N = m 花(x + l sin 0)Force an alysisCon sider the horiz on tal directi on cart force, we get the equatio n:Mx?= F- bx? NCon sider the horiz on t

4、al directi on pen dulum force, we get the equati on:N = mx?+ ml Ocos 0 ml 0sin 0To get rid of P and N, we get this equati on:-Pl sin 0- Nlcos 0= I 0 Merge these two equatio ns, about to P And N, to obta in a sec ond moti on equati on:(l + ml2) 0+ mgl sin 0 = -mix?cos 0 u to represe nt the con trolle

5、d object with the in put force F, li nearized two moti on equati ons(/ + 1711 )5 一宮I $ = 7/7 Av (A f -h-I- AA* ml iff ="Apply Laplace tran sform to the equati on abovef(7 + jnl2bs)s2 rngl(s) = jiiIX(s)s2 (3f+川)工=L(s)2)=先1-予恥)uih2The tran sfer fun cti on of an gle and positi on <1心)X(s)+ m廠)J

6、 川刃Let v = x?/(小(Z + /2)52 - ?nglput the equati on above into the sec ond equatio n鬥 * g ml s2U1J “ks= J7(s)We get the tran sfer function($)二qU(5:). b(I tn/2) ,(A/ -h7 btnfs h$j空一島State space equati on:X = AX 十 Buv = CY 十 DuSolve the algebraic equation, obtain solution as follows:j = x-(Z + n/2)d(/

7、+加X(jué) = Y -4+ U/(Af + ¥AJ?nP 1M + 川)+ Mml2I(M + 川)4 Mvil'0 二 0x二卄呃amZ(A/ + m) + Mini1 J(Af + 切 + Mml2 7(3/ + rif)十 JW2ml-in lby 3bXl 0 0 0_X+o00 l 00A0UHriB01001r i0Y譏卩A&wlXuI(M +川)+伽尸/(Af十冊(cè))卿廠urI + M/itl2石0001Q0ttt/b+ W)0UmlLr JJ (A/ + w) + Mnti2Z(jW十卿i 士 右心LCI(M 1礎(chǔ))+ ilfiif/*Fin ally we

8、 get the system state space equati ons.tt2. PID Con troller Desig nWe now design a PID controller for the inverted pendulum system. KD(s) is the transfer function of the controller. E(s)Contycl】:tA、LPlanty b)I切s)*iJf ts)FG(s) is the tran sfer fun cti on of the con trolled car.Con sideri ng that the

9、in put r(s) =0, the block diagram can be tran sformed as: The output of the system isGS Fs1 kD s G snumden num PID numdenPID dennum denPID_F s denPID den num PID numnum the nu merator of the objectden the denomin ator of the objectnu mPID the nu merator of the PID con troller tran sfer fun ctio n de

10、nPID - the denominator of the PID controller transfer function The object tran sfer fun cti on isml 2ssqnumU s4 b I ml23mM mgl 2bmgldenssssqqq22in which qm M 1mlmlPID Con troller Tran sfer Fun cti on isKIKdS2KpS KiKD s KDs KP2in which G1 is the tran sfer fun cti on of the pen dulum, G2 is the tran s

11、fer fun cti on of the car.The output of the car ' s position isssG2 sKD sG! snum2 dertnumPID numi 1 -denPID denin which, nu m1,de n1,nu m2,de n2 are separately mea n the con trolled object 1 and object 2 and PID con trollerI ml2ml's nu merators and denomin ators.X sFromG2 sX sUsIn which, qWe

12、 can easily simplified the equation ass,we could get thatI ml2 s2 bmgl sq qb I ml23sqml2 ml 2m M mgl 2 qbmglqnum? denPIDF s denPID denk numPID num.3. Matlab SimulationIn design, the cart's position will be ignored. Under these conditions, the design criteria are:1) settling time is less than 5 s

13、econds2) pendulum should not move more than 0.05 radians away from the verticalWhen kd=1,k=1,ki=1:二1.8182 0 44.54550, den c2=1 4.7273-26.6364 0.0909 02061-XPosiic fi&101214162Time (sec)o8 6 4Then we tried many times to adjust the parameter to satisfy the requireme nts: Ts <=5 s and overshoot

14、M<0.05.We find the optimal parameters of kd,k,ki which is the second situation.2. When kd=20,k=300,ki=1:Numc仁 4.5455 0 0 0, dene仁The results:1012 M 161820Time (sec"Epnl空Pas to r10 12Tine (sec)202 10o oMatlab codesM=0.5;m=0.2;b=0.1;I=0.006;g=9.8;l=0.3;q=(M+m)*(l+m*L2)/q -(m*l)A2;num1=m*l/q 0

15、0;den1=1 b*(l+m*lA2)/q -(M+m)*m*g*l/q -b*m*g*l/q 0; num2=-(l+m*lA2)/q 0 m*g*l/q;den2=den1;kd=1;k=1;ki=1;numPlD=kd k ki;denPlD=1 0; numci=conv (num1 denPlD); denc1=polyadd(conv(denPlD,den1),conv(numPlD,num1); t=0:0.1:20;figure(1) impulse(numc1,denc1,t) title(Angle ')figure(2)impulse(numc2,denc2,t

16、)title( Position ')M=0.5;m=0.2;b=0.1;l=0.006;g=9.8;l=0.3;q=(M+m)*(l+m*lA2)/q -(m*l)A2; num1=m*l/q 0 0;den1=1 b*(l+m*lA2)/q -(M+m)*m*g*l/q -b*m*g*l/q 0; num2=-(l+m*lA2)/q 0 m*g*l/q;den2=den1;kd=20;k=300;ki=1;numPlD=kd k ki; denPlD=1 0;numci=conv (num1 denPlD);den c仁polyadd(c onv (de nPID,de n1),c onv(nu mPID ,nu ml); t=0:0.1:20;figure(1)impulse( nu mc1,de nc1,t)title( Angle ')figure(2)impulse( nu mc2,de nc2,t)title( Position ')Simulatio n:We will build a closed-loop model with refere nee in put of pen dulum positi on and a disturba nee force applied t

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論