机械运动系统设计与实践报告.doc
《机械运动系统设计与实践报告.doc》由会员分享,可在线阅读,更多相关《机械运动系统设计与实践报告.doc(40页珍藏版)》请在沃文网上搜索。
1、机械运动系统设计与实践报告 学 院: 工程学院 专 业: 机械设计及理论 姓 名: 学 号: 指导教师: 2012 年 3 月环形倒立摆Adams与Mat lab联合仿真分析一、实践目的1. 熟悉和理解环形倒立摆的组成部件及运动原理。2. 通过ADAMS软件对环形倒立摆进行建模,熟练该款软件。3. 通过运用ADAMS导出模块与mat lab进行对接处理,熟悉mat lab软件的PID运行控制以及掌握simulink的相关设置。二、实验原理环形倒立摆是通过电机驱动,带动连杆,同时连杆来带动摆杆运动。中间需要测量的物理参数主要有:连杆的角度、连杆的角速度、摆杆的角度、摆杆的角速度。通过两个光电编码
2、器进行反馈。从反馈过程中来调节电机的转速及转向,进而达到摆杆的倒立并保持相对平衡。下图1即为实验室固高环形倒立摆系统组成框架:图1 环形倒立摆组成框架机房中matlab6.5中控制倒立摆的原理图二老师给的程序% this is a new simulation program for new arm-type inverted pendulum % by lgr input on the state of 0 of arm and that of 0 of pendulum% ! CAUTION ,changed base of direction of arm% Suc.clear allc
3、lose all%-Ma=0.21;Mp=0.062;la=0.133;lp=0.068;La=0.25;Lp=0.19;Ja=5E-3;Jp=5.65E-4;Ca=5.52E-3;Cp=1.69E-4;kt=0.0419;g=9.8;%-continuous state equation-ce= 1 0 0 0 ; 0 1 0 0 ; 0 0 Mp*La2+Ja Mp*La*lp ; 0 0 Mp*La*lp Jp ;ca= 0 0 1 0 ; 0 0 0 1 ; -(Mp*la+Mp*La)*g 0 -(Ca+Cp) Cp ; 0 Mp*g*lp Cp -Cp ;cb=0;0;kt;0;C
4、A=inv(ce)*ca;CB=inv(ce)*cb;C=1 0 0 0 ; 0 1 0 0;%-Q=diag(100,10,1,1);R=1;f,s,e=lqr(CA,CB,Q,R);%-dt=0.005;%sampling timeth_a=0.1 %accdd(Initial angle of arm ,0.1);% ! caution,clock di%rection th_p=pi;% =accdd(Initial angle of pendulum ,pi);% ! caution,clock dir%ection +d_th_a =0.0;%d_th_p =0.0;%initia
5、l values of statesdd_th_a =0.0;%dd_th_p =0.0;%u =0.0;z =0.0;energy =0.0;i =1;%- input parameter-alpha =30.0 ; %alpha =accdd(Design Parameter alpha,30.0);energy_d =1.5*Mp*g*lp; %accdd(Desired Energy,1.5*Mp*g*lp);zeta =1 % accdd(Damping Factor,1.0);wc =1 % accdd(Damping Factor,1.0);flag =0;%- starting
6、 loop -for i =1:6.0/dt th_a_0 =th_a;%th_p_0 =th_p;%d_th_a_0 =d_th_a;%d_th_p_0 =d_th_p;%dd_th_a_1 =dd_th_a;%dd_th_p_0 =dd_th_p;% if cos (th_p)=cos(0.2); flag=1;endif flag=0 %- swimping up - dd_th_a = z-(2*zeta*wc*d_th_a+wc2*th_a); ydd_temp = -Mp*La*lp*cos(th_a-th_p)*dd_th_a+Mp*La*lp*d_th_a2*sin(th_a-
7、th_p); dd_th_p =(ydd_temp+Mp*g*lp*sin(th_p)+Cp*d_th_a-Cp*d_th_p)/Jp; d_th_a =d_th_a_0+dd_th_a*dt; d_th_p =d_th_p_0+dd_th_p*dt; th_a =th_a_0+d_th_a_0*dt+dd_th_a*dt2*0.5; th_p =th_p_0+d_th_p_0*dt+dd_th_p*dt2*0.5;else eq_1_1 =-Mp*La*lp*d_th_p2*sin(th_a-th_p)-(Mp*la+Mp*La)*g*sin(th_a); eq_1_2 =-(Ca+Cp)*
8、d_th_a+Cp*d_th_p+kt*u; eq_1_left =eq_1_1+eq_1_2; eq_2_1 =Mp*La*lp*d_th_a2*sin(th_a-th_p)+Mp*lp*g*sin(th_p); eq_2_2 =Cp*d_th_a-Cp*d_th_p; eq_2_left =eq_2_1+eq_2_2;%- calculation of inverse matrix - M11 =Mp*La2+Ja; M12 =Mp*La*lp*cos(th_a-th_p); M21=Mp*La*lp*cos(th_a-th_p); M22=Jp; M=M11 M12;M21 M22; M
9、I=inv(M);%-calculation of parameters- dd_th_a=MI(1,1)*eq_1_left+MI(1,2)*eq_2_left; dd_th_p=MI(2,1)*eq_1_left+MI(2,2)*eq_2_left; d_th_a= d_th_a_0+ dd_th_a*dt; d_th_p= d_th_p_0+ dd_th_p*dt; th_a= th_a_0+ d_th_a_0*dt+ dd_th_a*dt2*0.5; th_p= th_p_0+ d_th_p_0*dt+ dd_th_p*dt2*0.5;endenergy=0.5*Jp*d_th_p2+
10、Mp*g*lp*cos(th_p);%energy of pendulumpotential=Mp*g* lp*cos(th_p);kinetic=0.5*Jp*d_th_p2;%-if flag=0 error=energy-energy_d; u1=(Mp*La2+Ja)*dd_th_a+Mp*La*lp* cos(th_a-th_p)*dd_th_p+(Ca+Cp)*d_th_a; u2=Mp*La*lp*d_th_p2*sin(th_a-th_p)+(Ma*la+Mp*La)*g*sin(th_a)-Cp*d_th_p; u=(u1+u2)/kt; z=alpha*d_th_p*cos
11、(th_p)*error;else u=-f*th_a;th_p;d_th_a;d_th_p;end%-Limit input-if u=4.995 u=4.995;else if u Controls_Plant_1ans =16-Mar-2012 16:59:13% INFO : ADAMS plant actuators names :1 VARIABLE_liju% INFO : ADAMS plant sensors names :1 VARIABLE_3 2 VARIABLE_baiganjiaodu 3 VARIABLE_baiganjiaosudu 4 VARIABLE_lia
12、nganjiaosudu adams_sysWarning: Loading model adams_sys_template generated with a newer version (7.3) ofSimulink. In adams_sys at 86Warning: adams_sys_template.mdl, line 32: block_diagram does not have a parameter namedSampleTimeAnnotations. In adams_sys at 86Warning: adams_sys_template.mdl, line 41:
13、 block_diagram does not have a parameter namedShowSignalResolutionIcons. In adams_sys at 86Warning: adams_sys_template.mdl, line 72: block_diagram does not have a parameter namedCovModelRefEnable. In adams_sys at 86Warning: adams_sys_template.mdl, line 73: block_diagram does not have a parameter nam
14、edCovExternalEMLEnable. In adams_sys at 86Warning: adams_sys_template.mdl, line 131: Value Nonadaptive is incompatible toparameter ZeroCrossAlgorithm. In adams_sys at 86Warning: adams_sys_template.mdl, line 524: block_diagram does not have a parameter namedBlockRotation. In adams_sys at 86Warning: a
15、dams_sys_template.mdl, line 525: block_diagram does not have a parameter namedBlockMirror. In adams_sys at 86Warning: adams_sys_template.mdl, line 821: Adams Plant block (mask) does not have aparameter named MaskPortRotate. In adams_sys at 86Warning: adams_sys_template.mdl, line 964: ToWorkspace blo
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
20 积分
下载 | 加入VIP,下载更划算! |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 机械运动 系统 设计 实践 报告
