Inverted pendulum倒立摆的matlab建模.docx_第1页
Inverted pendulum倒立摆的matlab建模.docx_第2页
Inverted pendulum倒立摆的matlab建模.docx_第3页
Inverted pendulum倒立摆的matlab建模.docx_第4页
Inverted pendulum倒立摆的matlab建模.docx_第5页
已阅读5页,还剩6页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ECE451 Controll Engineering Inverted 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 input is a step signal , the gravitational acceleration g=9.8m/s2 and linearize the nonlinear model around the operating point.1.Mathematic ModlingMmass of the car0.5 kgmmass of the pendulum0.2 kgbcoefficient of friction for cart0.1 N/m/secllength to pendulum center of mass0.3 mImass moment of inertia of the pendulum 0.006 kg.m2Fforce applied to the cartxcoordinate of cart positionpendulum angle from vertical (down)N and F are the force from horizontal and vertical direction.N=md2dt2(x+lsin)Force analysisConsider the horizontal direction cart force, we get the equation:Mx=F-bx-NConsider the horizontal direction pendulum force, we get the equation:N=mx+mlcos-ml2sinTo get rid of P and N, we get this equation:-Plsin-Nlcos=IMerge these two equations, about to P And N, to obtain a second motion equation:l+ml2+mglsin=-mlxcosu to represent the controlled object with the input force F, linearized two motion equationsApply Laplace transform to the equation aboveThe transfer function of angle and positionLet v = xput the equation above into the second equationWe get the transfer functionState space equation:Solve the algebraic equation, obtain solution as follows:Finally we get the system state space equations.2. PID Controller DesignWe now design a PID controller for the inverted pendulum system.KD(s) is the transfer function of the controller.G(s) is the transfer function of the controlled car.Considering that the input r(s) =0, the block diagram can be transformed as:The output of the system is num the numerator of the objectden the denominator of the objectnumPID the numerator of the PID controller transfer functiondenPID the denominator of the PID controller transfer functionThe object transfer function is ,in which .PID Controller Transfer Function is Now, we add the cars position as another output, we get in which G1 is the transfer function of the pendulum, G2 is the transfer function of the car.The output of the cars position is in which, num1,den1,num2,den2 are separately mean the controlled object 1 and object 2 and PID controllers numerators and denominators.From , we could get thatIn which, .We can easily simplified the equation as3. Matlab SimulationIn design, the carts position will be ignored. Under these conditions, the design criteria are: 1) settling time is less than 5 seconds 2) pendulum should not move more than 0.05 radians away from the verticalWhen kd=1,k=1,ki=1:numc1=4.5455 0 0 0, denc1=1 4.7273 -26.6364 0.0909 0 0, num2= -1.8182 0 44.5455 0, denc2=1 4.7273 -26.6364 0.0909 0 Then we tried many times to adjust the parameter to satisfy the requirements: Ts =5 s and overshoot M0.05.We find the optimal parameters of kd,k,ki which is the second situation.2. When kd=20,k=300,ki=1:Numc1= 4.5455 0 0 0, denc1=0.001 0.09111.3325 0.0001 0 0, numc2= -1.8182 0 44.5455 0, denc2=0.001 0.09111.3325 0.0001 0 0The results: Matlab codesM=0.5;m=0.2;b=0.1;I=0.006;g=9.8;l=0.3;q=(M+m)*(I+m*l2)/q-(m*l)2;num1=m*l/q 0 0;den1=1 b*(I+m*l2)/q-(M+m)*m*g*l/q-b*m*g*l/q 0;num2=-(I+m*l2)/q 0 m*g*l/q;den2=den1;kd=1;k=1;ki=1;numPID=kd k ki;denPID=1 0;numci=conv (num1 denPID);denc1=polyadd(conv(denPID,den1),conv(numPID,num1);t=0:0.1:20;figure(1)impulse(numc1,denc1,t)title(Angle)figure(2)impulse(numc2,denc2,t)title(Position)M=0.5;m=0.2;b=0.1;I=0.006;g=9.8;l=0.3;q=(M+m)*(I+m*l2)/q-(m*l)2;num1=m*l/q 0 0;den1=1 b*(I+m*l2)/q-(M+m)*m*g*l/q-b*m*g*l/q 0;num2=-(I+m*l2)/q 0 m*g*l/q;den2=den1;kd=20;k=300;ki=1;numPID=kd k ki;denPID=1 0;numci=conv (num1 denPID);denc1=polyadd(conv(denPID,den1),conv(numPID,num1);t=0:0.1:20;figure(1)impulse(numc1,denc1,t)title(Angle)figure(2)impulse(numc2,denc2,t)title(Position)Simulation:We will build a closed-loop model with reference input of pendulum position and a disturbance force applied to the cart.We now begin to simulate the closed-loo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论