当前位置:首页 >> 信息与通信 >>

Inverted pendulum倒立摆的matlab建模


ECE451 Controll Engineering

Inverted pendulum

09/29/2013

Introduction:
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 accelerationg=9.8m/s^2 and linearize the nonlinear model around the operating point.

1.Mathematic Modling

M mass of the car 0.5 kg m mass of the pendulum 0.2 kg b coefficient of friction for cart 0.1 N/m/sec l length to pendulum center of mass 0.3 m I mass moment of inertia of the pendulum 0.006 kg.m^2 F force applied to the cart x coordinate of cart position θ pendulum angle from vertical (down) N and F are the force from horizontal and vertical direction. N = m dt 2 (x + l sin θ) Force analysis Consider the horizontal direction cart force, we get the equation: Mx = F ? bx ? N Consider the horizontal direction pendulum force, we get the equation: N = mx + mlθcosθ ? mlθ2 sinθ To get rid of P and N, we get this equation:
d2

?Pl sin θ ? Nl cos θ = Iθ Merge these two equations, about to PAnd N, to obtain a second motion equation: l + ml2 θ + mgl sin θ = ?mlx cos θ u to represent the controlled object with the input force F, linearized two motion equations

Apply Laplace transform to the equation above

The transfer function of angle and position

Let v = x

put the equation above into the second equation

We get the transfer function

State space equation:

Solve the algebraic equation, obtain solution as follows:

Finally we get the system state space equations.

2. PID Controller Design
We 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

G ?s ? y ?s ? ? F ?s ? ? 1 ? kD?s ?G ?s ? ?

? num?denPID F ?s ? ?denPID??den? ? ?num PID ??num?

num den F ?s ? ? ?? num PID num? 1? ?denPID??den?

num—the numerator of the object den —the denominator of the object numPID – the numerator of the PID controller transfer function denPID – the denominator of the PID controller transfer function The object transfer function is

ml 2 s ??s ? num q ? ? 2 U ?s ? den b I ? m l 3 ?m ? M ?m gl 2 bm gl s4 ? s ? s ? s q q q ,

?

?

2 in which q ? ? ?m ? M ? I ? ml ? ?ml?

?

?

2

?.

PID Controller Transfer Function is
2 KI KDs ? K ps ? KI KD?s ? ? K D s ? K P ? ? s s2

Now, we add the car ’s 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 car ’s position is

num2 G2 ?s ? den2 X ?s ? ? F ?s ? ? F ?s ? ?num PID ??num1 ? 1 ? KD?s ?G1 ?s ? 1? ?denPID??den1 ?
in which, num1,den1,num2,den2 are separately mean the controlled object 1 and object 2 and PID controller‘s numerators and denominators.
? I ? ml 2 g? X ?s ? ? ? ? 2 ? ? ?s ? s ? ? ml From , we could get that I ? m l2 2 bm gl s ? s X ?s ? q q G2 ?s ? ? ? b I ? m l2 3 ?m ? M ?m gl 2 bm gl U ?s ? s4 ? s ? s ? s q q q

?

?

?

?

?

?

2 In which, q ? ? ?m ? M ? I ? ml ? ?ml?

?

?

2

?.

We can easily simplified the equation as

X ?s ? ?

?num2 ??denPID? F ?s ? ?denPID??den ? ? k ?numPID ??num1 ?

3. Matlab Simulation
In design, the cart's 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 vertical When 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 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: 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 0

The results:

Matlab codes

M=0.5; m=0.2; b=0.1; I=0.006; g=9.8; l=0.3; q=(M+m)*(I+m*l^2)/q-(m*l)^2; num1=[m*l/q 0 0]; den1=[1 b*(I+m*l^2)/q-(M+m)*m*g*l/q-b*m*g*l/q 0]; num2=[-(I+m*l^2)/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*l^2)/q-(m*l)^2; num1=[m*l/q 0 0]; den1=[1 b*(I+m*l^2)/q-(M+m)*m*g*l/q-b*m*g*l/q 0]; num2=[-(I+m*l^2)/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.3 After 20s simulation, we see the response as follow

The response is very much like what have been done in Matlab codes.


相关文章:
基于一阶倒立摆的matlab仿真实验
成都理工大学工程技术学院 基于一阶倒立摆的 matlab ...inverted pendulum control problem, and its ...(1)线性理论控制方法 将倒立摆系统的非线性模型进行...
基于MATLAB(矩阵实验室)的倒立摆控制系统仿真
Inverted pendulum controlling system simulationbased on the MATLAB ABSTRACT ...这类方法对于一、二级倒立摆(线性 化误差较小、模型较简单)控制时,可以解决常规...
倒立摆matlab
inverted pendulum 这是一个新臂型倒立摆 的新的仿真程序 % by lgr input on...倒立摆杆与小车系统matl... 4页 免费 倒立摆MATLAB建模 13页 1下载券喜欢...
倒立摆系统的建模(拉格朗日方程)
inverted pendulum system 2 系统主要组成部分简介直线一级倒立摆装置如图 2.2 ...而 Simulink 是 MATLAB 最重要的组件之一,它提供一个动态系统建模、仿 真和...
单级倒立摆控制系统设计及MATLAB中的仿真
建模, 设计了该模型的模糊控制系统, 并利用 Matlab\simulink软件工具 对倒立摆的...Keywords: Inverted pendulum; Simulation; Fuzzy control; Motion; modeling; ...
基于ADAMS与MATLAB联合仿真的倒立摆设计毕业论文
本文先分别用 MATLAB 和 ADAMS 两种 软件对倒立摆系统进行建模仿真,然后将两者...Control methods of inverted pendulum are widely used in military, aerospace,...
Control of an Inverted Pendulum(倒立摆的控制)-外文翻译
Control of an Inverted Pendulum(倒立摆的控制)-...最优状态反馈控制器是一个以正常位置周围的线性模型...利用 Matlab/ Simulink 来实现控制和数据分析。倒立摆...
基于adams和matlab的一级倒立摆联合仿真
倒立摆三维建模 四、基于 ADAMS 的一级倒立摆模型设计 五、ADAMS 和 MATLAB/...plant export New controls plant 一栏中填入 inverted_pendulum,file prefix 同...
基于MATLAB的直线一级倒立摆仿真系统研究
运用 MATLAB 中的 Simulink 仿真工具,建立起直线一级倒立摆系统的仿真模型,并对...The simulation model of the inverted inverted pendulum is established by ...
基于matlab的一级倒立摆控制器设计与仿真毕业论文
基于matlab的一级倒立摆控制器设计与仿真毕业论文_工...倒立摆系统的结构并详细推导了一级倒立摆的数学模型。...Inverted pendulum is a typical multi-variable, ...
更多相关标签: