Invertedpendulum倒立摆的matlab建模
基于MATLAB的单级旋转倒立摆建模与控制仿真

基于MATLAB的单级旋转倒立摆建模与控制仿真一、分析课题,选择数据源外文数据库多种多样,对于工程应用所研究的课题,通常选取比较常用的数据库为:IEEE Xplore(/Xplore/home.jsp)、Google学术搜索(/)以及SpringerLink(/)。
二、选取检索词单级旋转倒立摆的英文名称为:single rotational inverted pendulum,故以此为检索词进行检索。
三、构造检索式Single (and)rotational inverted pendulum四、实施检索,调整检索策略由于搜索步骤较多,此处只详细给出使用IEEE Xplore数据库的检索过程,另外两个数据库提供大概检索过程及结果截图。
由于搜索结果只有9条,数量较少,故调整检索词,过程如下:Google学术搜索:SpringerLink数据库:五、检索结果1、题目:Analysis of human gait using an Inverted Pendulum Model基于倒立摆模型的人体步态分析Zhe Tang ; Meng Joo Er ; Chien, C.-J. Fuzzy Systems, 2008. FUZZ-IEEE 2008. (IEEE World Congress on Computational Intelligence). IEEE International Conference onAbstract: IPM(Inverted Pendulum Model) has been widely used for modeling of human motion gaits. There is a common condition in most of these models, the reaction force between the floor and the humanoid must go through the CoG (Center of Gravity) of the a humanoid or human being. However, the recent bio-mechanical studies show that there are angular moments around the CoG of a human being during human motion. In other words, the reaction force does not necessarily pass through the CoG. In this paper, the motion of IPM is analyzed by taking into consideration two kinds of rotational moments, namely around the pivot and around the CoG. The human motion has been decomposed into the sagittal plane and front plane in the double support phase and single support phase. The motions of the IPM in these four different phases are derived by solving four differential equations with boundary conditions. Simulation results show that a stable human gait is synthesized by using our proposed IPM.摘要:IPM(倒立摆模型)已被广泛用于人体运动步态建模。
matlab仿真毕设--倒立摆现代控制理论研究

内蒙古科技大学本科生毕业设计说明书(毕业论文)题目:倒立摆现代控制理论研究倒立摆现代控制理论研究摘要倒立摆系统是一个复杂的非线性、强耦合、多变量和自不稳定系统。
在控制工程中,它能有效地反映诸如可镇定性、鲁棒性、随动性以及跟踪性等许多控制中的关键问题,是检验各种控制方法的理想工具。
理论是工程的先导,它对倒立摆系统的控制研究具有重要的工程背景,单级倒立摆与火箭的飞行有关,二级倒立摆与双足机器人的行走有相似性,日常生活中的任何重心在上,支点在下的问题都与倒立摆的控制有极大的相似性,所以对倒立摆的稳定控制有重大的现实意义。
迄今,人们已经利用古典控制理论、现代控制理论及多重智能控制理论实现了多种倒立摆系统的稳定控制[5]。
倒立摆的控制方法有很多,如状态反馈控制,经典PID控制,神经网络控制,遗传算法控制,自适应控制,模糊控制等。
其控制方法已经在军工、航天、机器人和一般工业过程等领域得到了应用。
因此对倒立摆系统的控制研究具有重要的理论和现实意义,成为控制领域中经久不衰的研究课题。
本文是应用线性系统理论中的极点配置、线性二次型最优(LQR)和状态观测器等知识,设计了倒立摆系统线性化模型的控制器,通过MA TLAB仿真,研究其正确性和有效性。
通过分析仿真结果,我们知道了,状态反馈控制可以使倒立摆系统很好的控制在稳定状态,并具有良好的鲁棒性。
关键词:倒立摆;现代控制;Matlab仿真;Modern Control Theory Of Inverted PendulumAbstractInverted pendulum system is a complex nonlinear and strongly coupled,multi-variable and unstable system since.In control engineering,it can effectively reflect such stabilization,robustness,with the mobility of control and tracking,and many other key issue,It is the test ideal for a variety of control methods.Theory is the project leader,inverted pendulum control system also has important engineering research background,inverted pendulum with single-stage related torocket for the flight,Inverted pendulum and biped walking robot similar nature in any life in the center of gravity,the fulcrum in the next issue with the inverted pendulum control has a great similarity,so the stability control of inverted pendulum significant practical significance.So far,it has been the use of classical control theory,modern control theory and control theory of multiple intelligence to achieve a variety of inverted pendulum system stability control[5].Inverted pendulum control methods there are many,such as the state feedback control,the classic PID control,neural network control,genetic algorithm control,adaptive control,fuzzy control.The control method has been in military,aerospace,robotics and general industrial processes and other areas have been intended use.Therefore,the control of inverted pendulum system research has important theoretical and practical significance,of becoming enduring research topics in the field.This is the application of the theory of linear systems pole placement,linear quadratic optimal (LQR) and the state observer of such knowledge,the design of the linear inverted pendulum model of the controller,through simulation to study the correctness and effective sex.By analyzing the results of MATLAB simulation,state feedback control can make a goodcontrol of inverted pendulum system in a stable state,and has good robustness,stability control features.Key words: Inverted pendulum;Modern control;Matlab simulation;目录摘要 (I)Abstract (II)第一章绪论 (1)1.1倒立摆系统模型简介 (1)1.2倒立摆研究的背景与意义 (2)1.3国内外研究现状、水平和发展趋势 (3)1.3.1倒立摆和控制理论的发展 (3)1.3.2倒立摆的控制方法 (4)1.3.3倒立摆的发展趋势 (5)1.4本论文的主要工作介绍 (6)第二章一级倒立摆的数学模型建立及其性能分析 (7)2.1 系统的组成 (7)2.2 一级倒立摆数学模型的建立 (8)2.2.1 数学模型的建立 (8)2.2.2 系统的结构参数 (9)2.2.3 用牛顿力学方法来建立系统的数学模型 (9)2.2.4 一级倒立摆的性能分析[7] (13)2.3 本章小结 (15)第三章现代控制理论在倒立摆控制中的应用 (16)3.1 自动控制理论的发展历程 (16)3.2 经典控制理论 (18)3.2.1 PID控制现状 (18)3.2.2 PID控制的基本原理 (18)3.2.3 常用PID数字控制系统 (20)3.3 现代控制理论 (21)3.3.1 极点配置[11] (22)3.3.2 线性二次型最优的控制理论[7,8] (24)3.3.3 加权矩阵的选取 (26)3.3.4 状态观测器[7] (26)3.4 本章小结 (29)第四章MA TLAB仿真技术 (30)4.1 仿真软件——Matlab简介 (30)4.1.1 MA TLAB的优势 (30)4.2 Simulink简介 (32)4.3 S-函数简介 (33)4.3.1 用M文件创建S-函数 (34)4.4 倒立摆仿真模块的建立 (36)4.5 本章小结 (37)第五章一级倒立摆线性模型系统的仿真 (38)5.1 倒立摆控制器结构选择 (38)5.2 一级倒立摆线性模型系统仿真 (38)5.2.1 Simulink仿真 (42)5.3 本章小结 (46)结束语 (48)参考文献 (49)附录A (51)致谢 (53)第一章绪论1.1倒立摆系统模型简介倒立摆控制系统是一个复杂的、不稳定的、非线性的系统,是进行控制理论教学及开展各种控制实验的理想实验平台,但它并不是我们想象的那样抽象,其实在我们日常生活中就有很多这样的例子。
科研训练-基于MATLAB的直线一级倒立摆仿真系统研究

科研训练结题报告名称:基于MATLAB的直线一级倒立摆仿真系统研究小组成员:指导教师:1.直线一级倒立摆问题简介 (6)1.1背景简介【1】 (6)1.2软件特性 (6)1.3设计要求分析 (6)2. 数学模型的建立 (7)2.1 倒立摆受力分析 (7)2.2 微分方程的推导 (8)3.Simulink仿真模型 (9)3.1 Simulink仿真简介【2】 (9)3.2 初次模型搭建 (10)3.3 二次模型搭建 (11)3.4 二次模型优化 (12)3.5最终仿真模型及仿真结果 (13)4.封装子系统 (19)4.1 封装子系统简介 (19)4.2 封装子系统设置 (20)5. PID控制 (20)5.1 PID控制理论 (20)5.2 基于SIMULINK的PID控制器设计 (22)5.3 PID参数的确定 (24)6. 成果汇总与分析 (31)7. 经验总结与心得体会 (32)参考文献 (32)1.直线一级倒立摆问题简介1.1背景简介【1】倒立摆控制系统是一个复杂的、不稳定的、非线性系统,是进行控制理论教学及开展各种控制实验的理想实验平台。
对倒立摆系统的研究能有效的反映控制中的许多典型问题:如非线性问题、鲁棒性问题、镇定问题、随动问题以及跟踪问题等。
通过对倒立摆的控制,用来检验新的控制方法是否有较强的处理非线性和不稳定性问题的能力。
倒立摆的控制问题就是使摆杆尽快地达到一个平衡位置,并且使之没有大的振荡和过大的角度和速度。
当摆杆到达期望的位置后,系统能克服随机扰动而保持稳定的位置。
倒立摆是机器人技术、控制理论、计算机控制等多个领域、多种技术的有机结合,其被控系统本身又是一个绝对不稳定、高阶次、多变量、强耦合的非线性系统,可以作为一个典型的控制对象对其进行研究。
倒立摆系统作为控制理论研究中的一种比较理想的实验手段,为自动控制理论的教学、实验和科研构建一个良好的实验平台,以用来检验某种控制理论或方法的典型方案,促进了控制系统新理论、新思想的发展。
倒立摆系统的建模(拉格朗日方程)

系统的建模及性能分析倒立摆系统的构成及其参数1倒立摆系统的基本结构本设计所用到的倒立摆模型直线一级倒立摆系统。
整个系统是由6大部分所组成的一个闭环系统,包括计算机、数据采集卡、电源及功率放大器、直流伺服电机、倒立摆本体和两个光电编码器等模块。
如图2.1所示:图2.1 倒立摆系统的结构组成示意图Fig 2.1 Structure of the linear single inverted pendulum system2系统主要组成部分简介直线一级倒立摆装置如图2.2所示[13]:图2.2直线一级倒立摆装置Fig 2.2 Straight linear 1-stage inverted pendulum deviceQuanser倒立摆系统包含倒立摆本体、数据采集电控模块以及控制平台等三大部分,其中控制平台是由装有Quanser专用实时控制软件的通用PC机组成。
1.直线倒立摆主体倒立摆主体是由Quanser直线运动控制伺服单元IP02与直线一级摆杆组成,并配有专用的小车直线轨道。
这里主要介绍下Quanser直线运动控制伺服单元IP02(即倒立摆运动小车)及导轨的组成:图2.3伺服单元IP02的组成Fig 2.3 Servo unit IP02 parts编号名称英文(01)IP02小车IP02 Cart(02)不锈钢滑轨Stainless Steel Shaft(03)齿轮导轨Rack(04)小车位移齿轮Cart Position Pinion(05)小车电机传动齿轮Cart Motor Pinion(06)小车电机传动齿轮轴Cart Motor Pinion Shaft(07)摆杆传动轴Pendulum Axis(08)IP02小车位移编码器IP02 Cart Encoder(09)IP02摆杆角度编码器IP02 Pendulum Encoder(10)IP02小车位移编码器接口IP02 Cart Encoder Connector(11)IP02摆杆角度编码器接口IP02 Pendulum Encoder Connector(12)电机接口Motor Connector(13)直流伺服电机DC Motor(14)变速器Planetary Gearbox(15)直线滑轨支撑轴Linear Bearing图2.4系统导轨结构图Fig 2.4 System guide rail structure直线一级倒立摆系统的倒立摆的摆杆连接在IP02小车的摆杆连接套上,IP02小车由电机通过齿轮传动机构在导轨上来回运动,保持摆杆平衡。
基于PID的倒立摆控制系统设计

基于PID的倒立摆控制系统设计摘要:倒立摆(Inverted Pendulum)控制系统设计是控制理论教学中的一种典型的实验对象,具有很高的教学和科研价值。
本文基于PID控制算法,设计一个倒立摆控制系统,对倒立摆进行控制。
首先介绍了倒立摆系统模型和其动力学方程,然后详细介绍PID控制算法的原理和设计方法,并将其应用于倒立摆系统中,进行控制器的设计。
最后,通过MATLAB/Simulink软件进行系统仿真,并对仿真结果进行分析和讨论。
研究结果表明,PID控制算法能够有效地控制倒立摆系统,并且具有良好的控制性能和稳定性。
一、引言倒立摆控制系统是一种实验教学中常见的控制对象,其模型简单、控制复杂度适中,具有很高的教学和科研价值。
倒立摆系统被广泛应用于控制理论教学、控制算法研究以及控制系统设计等领域。
PID控制是一种常用的控制算法,具有简单、易实现、稳定性好等特点。
因此,本文将基于PID控制算法设计一个倒立摆控制系统,对倒立摆进行控制。
二、倒立摆系统模型和动力学方程倒立摆系统由一个竖直放置的杆和一个可沿杆轴线做直线运动的摆组成。
根据杆的位置和速度,可以得到倒立摆的状态变量,进而得到系统的动力学方程。
本文采用小角度近似,假设杆的运动范围很小,可以将其近似为线性系统,动力学方程可以表示为:$$(M+m)l\ddot{\theta}-ml\ddot{x}\cos(\theta)+m\sin(\theta)g=0$$$$\ddot{x}-\ddot{\theta}l=0$$其中,M为杆的质量,m为摆的质量,l为杆的长度,g为重力加速度,x为摆的位置,$\theta$为杆的倾斜角度。
三、PID控制算法原理和设计方法PID控制算法是一种基于误差信号的反馈控制算法,由比例控制、积分控制和微分控制三部分组成。
比例控制根据当前误差的大小进行控制;积分控制用于消除系统的稳态误差;微分控制用于预测误差的变化趋势,提高系统的响应速度和稳定性。
Inverted pendulum倒立摆的matlab建模

We find the optimal parameters of kd,k,ki which is the second situation.
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)
M=0.5, m=0.2, b=0.1, I=0.006, g=9.8, l=0.3
After 20s simulation, wesee the response as follow
The response is very much like what have been done in Matlab codes.
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.
den2=den1;
kd=1;
k=1;
ki=1;
numPID=[kd k ki];
Recurdyn与Matlab连结control倒单摆控制分析仿真教程
Recurdyn/control例題:倒單擺控制分析-使用matlab/simulink(part-1)1.選取inverse_pendulum_i.rdyn項目,按開啟按鈕2.選取Axial項目,產生Axial Force(軸向力)在路面(Base)和台車(Car)之間3.選取Body,Body,Point,Point項目,Body選地面、Body選車子、Point :2000,-100,0、Point : -500,-100,0(注意:軸向力方向(向右為正),因為建立軸向力時,方向是由左到右)4.選取Plant Input項目,按一下Add按鈕5.axial_force是系統的輸入廠(由控制迴路所決定),按一下確定按鈕6.選取Plant Output項目,按一下Add按鈕7.按兩下Add按鈕8.選取項目9. base.Marker1和bird.Marker1項目10.選取文字方塊,az(2,1):單擺的角度值,是系統的輸出廠(由RecurDyn計算),name:angle,按一下OK按鈕11.Plant Output List對話方塊開啟了,按一下確定按鈕12.選取axial1項目13.按一下EL按鈕14. 開啟Expression List對話方塊,按一下Create按鈕15. 開啟Expression對話方塊,按一下Add按鈕16. 軸向力內存函數是:pin(1);pin就是:Plant of Input,(1):就是axial_force。
選取文字方塊:pin(1)。
按一下OK按鈕17. 按一下確定按鈕18. 按一下確定按鈕19. 選取Cosim項目20. 選取Simulink項目,由Simulink啟動RecurDyn21. 輸出matlab*.m檔案,選取m-file to create plant block文字方塊,按delete鍵,輸入inverse_pendulum,按一下Export按鈕22. 按一下儲存(s)按鈕23. 按一下套用(A)按鈕,再按一下取消按鈕24. 記得存檔,關閉RecurDyn軟體------------------------------------------------------------------------------------------------------- Recurdyn/control例題:倒單擺控制分析-使用matlab/simulink(part-2)1.載入:inverse_pendulum.m2.鍵入:rdlib,rdlib是recurdyn plant控制,按enter鍵3.recurdyn_plant_7_視窗開啟4.鍵入:simulink,啟動simulink,按enter鍵5.simulink library browser視窗開啟,按一下simulink library browser按鈕6.按一下create a new model按鈕7.untitled視窗開啟8.拉進recurdyn plant,選取選項,建立pid迴路去控制軸向力大小,讓單擺可以動平衡9.選取Gain圖案進來,按ctrl+c鍵10.選取選項continuous\derivative、integrator圖案進來11.選取項目math operations\add圖案進來12.選取項目commonly used blocks\scope圖案進來,按ctrl+v鍵13.按add圖案快按兩下,function block parameters:add視窗開啟了,將++改成---,按一下OK按鈕14.連好線15.按Gain圖案快按兩下,function block parameters:gain視窗開啟,將1改成200,按一下OK按鈕16.按Gain1圖案快按兩下,function block parameters:gain視窗開啟,將1改成1,按一下OK按鈕17.按Gain2圖案快按兩下,function block parameters:gain視窗開啟,將1改成5,按一下OK按鈕18.按一下save(ctrl+s)按鈕19.輸入inverse_pendulum檔名,按Enter按鈕20.快按recurdyn plant block兩下,inverse_pendulum/recurdyn plant block視窗開啟,recurdyn plant圖案(紅色)是recurdyn與simulink之間的控制核心,快按兩下21. [ ]static analysis(事先進行靜力分析,之後再進行動力分析)[X ]recurdyn_show(計算過程可以啟動recurdyn畫面)[X ]recurdyn_animation(計算過程可以顯示動畫)之後按一下cancel按鈕,按一下關閉按鈕22.模擬時間5,按一下Start simulation按鈕23. RecurDyn 6.4視窗開啟,RecurDyn會自動載入模型,且可以看到計算過程中的動畫(很快就結束所以省略)24.快按scope圖案兩下,scope視窗開啟(scope是角度位移變化、scope1是軸向力輸出變化),Finish。
基于MATLAB的旋转倒立摆建模和控制仿真
倒立摆系统作为一个被控对象具有非线性、强耦合、欠驱动、不稳定等典型特点,因此一直被研究者视为研究控制理论的理想平台,其作为控制实验平台具有简单、便于操作、实验效果直观等诸多优点。
倒立摆具有很多形式,如直线倒立摆、旋转倒立摆、轮式移动倒立摆等等。
其中,旋转倒立摆本体结构仅由旋臂和摆杆组成,具有结构简单、空间布置紧凑的优点,非常适合控制方案的研究,因此得到了研究者们广泛的关注[1-2]。
文献[3]介绍了直线一级倒立摆的建模过程,并基于MATLAB 进行了仿真分析;文献[4]通过建立倒立摆的数学模型,采用MATLAB 研究了倒立摆控制算法及仿真。
在倒立摆建模、仿真和研究中大多数研究者常用理论建模方法,也可以利用SimMechanics 搭建三维可视化模型仿真;文献[5]使用SimMechanics 工具箱建立旋转倒立摆物理模型,通过极点配置、PD 控制和基于线性二次型控制实现了倒立摆的平衡控制;文献[6]通过设计的全状态观反馈控制器来实现单极旋转倒立摆SimMechanics 模型控制,表明了SimMechanics 可用于不稳定的非线性系统;文献[7]通过单级倒立摆SimMechanics 仿真,研究了Bang-Bang 控制和LQR 控制对倒立摆的自起摆和平衡控制;文献[8]基于Sim⁃Mechanics 建立了直线六级倒立摆模型,并基于LRQ 设计状态反馈器进行了仿真控制分析。
本文首先采用Lagrange 方法建立了旋转倒立摆的动力学模型,在获得了旋转倒立摆动力学微分方程后建立了s-func⁃tion 仿真模型;然后,本文采用SimMechanics 建立了旋转的可视化动力学模型。
针对两种动力学模型,采用同一个PID 控制器进行了控制,从控制结果可以看出两种模型的响应曲线完全一致,这两种模型相互印证了各自的正确性。
1旋转倒立摆系统的动力学建模旋转倒立摆是由旋臂和摆杆构成的系统,如图1所示,旋臂绕固定中心旋转(角度记为θ)带动摆杆运动,摆杆可以绕旋臂自由转动,角度记为α。
倒立摆系统的建模及MATLAB仿真
(2)
方程 (1) , (2) 是非线性方程 ,由于控制的目的是 保持倒立摆直立 ,在施加合适的外力条件下 ,假定θ 很小 ,接近于零是合理的 。则 sinθ≈θ,co sθ≈1 。在 以上假设条件下 ,对方程线性化处理后 ,得倒立摆系 统的数学模型 :
( M + m) ¨x + mθl¨= f
(3)
Co nference , 1999 :230. [ 2 ] 王沉培 ,周艳红 ,周云飞. 复杂形状刀具磨削运动三维图 形仿真的研究. 中国机械工程 ,1998 ,10 (2) :1232126. [ 3 ] (美) 马尔金 1 S 著. 磨削技术理论与应用 [ M ]1 沈阳 :东 北大学出版社 ,20021
Key words inverted pendulum , model building , simulatio n under t he MA TL AB enviro nment
中图分类号 : TP273 文献标识码 :A
倒立摆系统是 1 个经典的快速 、多变量 、非线 性 、绝对不稳定系统 ,是用来检验某种控制理论或方 法的典型方案 。倒立摆控制理论产生的方法和技术 在半导体及精密仪器加工 、机器人技术 、导弹拦截控 制系统和航空器对接控制技术等方面具有广阔的开 发利用前景 。因此研究倒立摆系统具有重要的实践 意义 ,一直受到国内外学者的广泛关注 。
的稳态响应和瞬态响应特性由矩阵 A - B K 的特征
决定 。如果矩阵 K 选取适当 , 则可使矩阵 A - B K
构成 1 个渐近稳定矩阵 ,并且对所有的 x (0) ≠0 , 当
t 趋于无穷时 ,都可使 x ( t) 趋于 0 。称矩阵 A - B K
的特征值为调节器极点 。如果这些调节器极点均位
一级倒立摆课程设计--倒立摆PID控制及其Matlab仿真
一级倒立摆课程设计--倒立摆PID控制及其Matlab仿真倒立摆PID控制及其Matlab仿真学生姓名:学院:电气信息工程学院专业班级:专业课程:控制系统的MATLAB仿真与设计任课教师:2014 年 6 月 5 日倒立摆PID控制及其Matlab仿真Inverted Pendulum PID Control and ItsMatlab Simulation摘要倒立摆系统是一个典型的快速、多变量、非线性、不稳定系统,对倒立摆的控制研究无论在理论上和方法上都有深远的意义。
本论文以实验室原有的直线一级倒立摆实验装置为平台,重点研究其PID 控制方法,设计出相应的PID控制器,并将控制过程在MATLAB上加以仿真。
本文主要研究内容是:首先概述自动控制的发展和倒立摆系统研究的现状;介绍倒立摆系统硬件组成,对单级倒立摆模型进行建模,并分析其稳定性;研究倒立摆系统的几种控制策略,分别设计了相应的控制器,以MATLAB为基础,做了大量的仿真研究,比较了各种控制方法的效果;借助固高科技MATLAB实时控制软件实验平台;利用设计的控制方法对单级倒立摆系统进行实时控制,通过在线调整参数和突加干扰等,研究其实时性和抗千扰等性能;对本论文进行总结,对下一步研究作一些展望。
关键词:倒立摆;PID控制器;MATLAB仿真设计报告正文1.简述一级倒立摆系统的工作原理;倒立摆是一个数字式的闭环控制系统,其工作原理为:角度、位移信号检测电路获取后,由微分电路获取相应的微分信号。
这些信号经A/D转换器送入计算机,经过计算及内部的控制算法解算后得到相应的控制信号,该信号经过D/A变换、再经功率放大由执行电机带动皮带卷拖动小车在轨道上做往复运动,从而实现小车位移和倒立摆角位移的控制。
2.依据相关物理定理,列写倒立摆系统的运动方程;2lO1小车质量为M ,倒立摆的质量为m ,摆长为2l ,小车的位置为x ,摆的角度为θ,作用在小车水平方向上的力为F ,1O 为摆杆的质心。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
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 input is a step signal , the gravitational acceleration g=9.8m/s^2 and linearize the nonlinear model around the operating point.1.Mathematic ModlingM mass of the car 0.5 kgm mass of the pendulum 0.2 kgb coefficient of friction for cart 0.1 N/m/secl length to pendulum center of mass 0.3 mI mass moment of inertia of the pendulum 0.006 kg.m^2F force applied to the cartx coordinate of cart positionθpendulum angle from vertical (down)N and F are the force from horizontal and vertical direction.(x+l sinθ)N=m d2dtForce analysisConsider the horizontal direction cart force, we get the equation:Mẍ=F−bẋ−NConsider the horizontal direction pendulum force, we get the equation:N=mẍ+mlθcosθ−mlθ2sinθTo get rid of P and N, we get this equation:−Pl sinθ−Nl cosθ=IθMerge these two equations, about to P And N, to obtain a second motion equation:(l+ml2)θ+mgl sinθ=−mlẍcosθ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()()()()()()()()()()()()()()()()s F num numPID den denPID denPID num s F den denPID num numPID den s F s G s kD s G s y +=+=+=11num —the numerator of the object den —the denominator of the objectnumPID – the numerator of the PID controller transfer function denPID – the denominator of the PID controller transfer function The object transfer function is()()()()den num s q bmgl s q mgl M m s qml I b s sqml s U s =-+-++=Φ23242,in which [()()()]22ml ml I M m q -++=.PID Controller Transfer Function is()22s K s K s K s K K s K s KD Ip D I P D ++=++=Now, we add the car ’s position as another output, we getin 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()()()()()()()()()()s F den denPID num numPID den s F s G s KD s G s X 11221211+=+=in which, num1,den1,num2,den2 are separately mean the controlled object 1 andobject 2 and PID controller ‘s numerators and denominators.From ()()()s s g ml ml I s X Φ⎥⎦⎤⎢⎣⎡-+=22, we could get thatIn which,[()()()]22ml ml I M m q -++=.We can easily simplified the equation as()()()()()()()()s F num numPID k den denPID denPID num s X 12+=3. Matlab SimulationIn design, the cart's position will be ignored. Under these conditions, the designcriteria are:1) settling time is less than 5 seconds2) 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()()()()()()sqbmgl s q mgl M m s q ml I b s sq bmgl s q ml I s U s X s G -+-++-+==2324222Then 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 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*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.3After 20s simulation, we see the response as followThe response is very much like what have been done in Matlab codes.。