资源预览内容
第1页 / 共14页
第2页 / 共14页
第3页 / 共14页
第4页 / 共14页
第5页 / 共14页
第6页 / 共14页
第7页 / 共14页
第8页 / 共14页
第9页 / 共14页
第10页 / 共14页
亲,该文档总共14页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
wordECE451 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.)Force analysisConsider the horizontal direction cart force, we get the equation:Consider the horizontal direction pendulum force, we get the equation:To get rid of P and N, we get this equation:Merge these two equations, about to PAnd N, to obtain a second motion equation:u 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 = put 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 numthe 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-loop system. The physical parameters are set as follows.M=0.5, m=0.2, b=0.1, I=0.006, g=9.8, l=0.3After 20s simulation, we see the response as followThe response is very much like what have been done in Matlab codes. /
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号