《非线性大作业-二阶机械臂.doc》由会员分享,可在线阅读,更多相关《非线性大作业-二阶机械臂.doc(14页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上南京航空航天大学非线性系统控制大作业二阶机械臂的非线性反馈设计姓 名: XXX学 号: XXX专 业: XXX2011年6月10日专心-专注-专业实验对象:二阶机械臂的非线性反馈设计一 二阶机械臂的动力学控制模型图1 模型在垂直平面内的投影机械臂操作端的位置方程为(1)(2)上述方程的Jacobian矩阵为机械臂的动力学方程为(3)其中,为总的驱动力矩矢量,为转动角度矢量;为转动惯量矩阵,为Coriolis离心转矩,为重力矢量。、的数学表达式如下:(4)(5)(6)其中定义状态变量(7)设(8)则机械臂模型的状态方程可以写成(9)系统输出方程为(10)二 二阶机械臂模
2、型线性化1)计算式(4)、(5)、(6)中各参数的值:,、。2)计算系统相对阶:有上面的表达式可知,的后两列全为0,的前两行全为0(),因此同理,对输出,有矩阵非奇异,故系统在某个的邻域内,系统的相对阶为。3)选择变换坐标为(11)4)将系统转换为标准型(12)输出为(13)5)利用状态反馈阵使系统成为一个完全可控的线性系统,令其中通过反馈和坐标映射,系统可变为Brunovsky标准型即(14)记三 二阶机械臂的最优控制是Brunovsky标准型线性系统中的控制输入,拟运用LQR方法进行求解,确定最优控制律,使系统实际输出尽可能逼近理想输出。该问题属于无限时间、定常输出跟踪问题。首先定义性能指
3、标(15)式中,为、为的正定对称常数矩阵,为误差输出向量,是期望输出。根据二次型最优控制理论,可以知道当性能指标最小时,输入应为其中,为常值伴随向量,为正定矩阵,满足如下Riccati方程(16)最优控制信号依赖于状态变量和Riccati方程的解,在静态状态变量下假设时,可使系统的状态趋近于0,是=0时的常值矩阵,在此种情况下,Riccati方程被简化为上式被称作Riccati Algebraic方程。取利用Matlab工具求解Riccati方程得则正定,满足Riccati方程。利用Matlab进行LQR求解,得而与求解Riccati方程所得结果一致。四 控制对象的MATLAB仿真在Simul
4、ink仿真环境下搭建完整控制系统,如Error! Reference source not found.所示:图2 Simulink仿真框图选择期望输入信号为输入信号给定的理想输出轨迹线设定为长半轴为0.7,短半轴为0.3,焦点在轴上的椭圆形轨迹。利用上面搭建的Simulink仿真图运行程序,可得到给定轨迹曲线、跟踪轨迹曲线、误差轨迹曲线。图3 轨迹跟踪曲线图4 跟踪误差曲线图3中青色粗线为期望轨迹,红色带方块虚线为机械臂实际运动轨迹;图4中红色实线为方向跟踪误差,蓝色点划线为方向跟踪误差。由图3、图4的轨迹跟踪曲线和跟踪误差曲线可以看出,实际输出很接近理想输出,而且在响应速度上也很快。跟踪误
5、差曲线的幅值很小(平稳运行阶段),能够满足性能指标要求。因此,应用上述控制方法可以达到很好的控制效果。五 实验感想实际生活生产中,所面临的系统极少会是纯粹的线性系统,可以肯定地说,任何投入实际生产运行的系统都会或多或少地具有非线性因素。所谓的线性系统只是为了研究对象的控制问题所作的合理简化。因此,对非线性系统理论的了解和学习,有助于培养正确的认识观,同时掌握一些实际有效的处理非线性问题的方法。在本次大作业中,控制对象是具有很强非线性的二阶机械臂。实验利用坐标变换阵和非线性反馈阵,结合LQR最优控制理论,实现了多输入-多输入系统的精确线性化,完成了对系统很好的控制效果,达到了最初的设定目标。通过
6、本课程的学习,对非线性系统有了进一步深入的认识和理解,掌握了反馈线性化、自适应观测器设计等内容,能够对简单的非线性系统进行实际分析和控制律设计。这对我们以后课题的研究具有很大的促进作用。另外,本课程为双语教学,在学习过程中,通过上课和查阅了相关英文文献,使自己的专业英语水平和专业知识都得到了提高。在课程教学中,姜老师除了讲授课件知识,还为我们拓展了很多很实用的知识,比如对控制领域内的重要学术会议、国内外核心期刊和国内外知名院士的介绍,使学生的学术科研和文献查阅有了更强的目标性,获益良多。【仿真程序见附件】附件/*alphax.m*/function a_out = a(u)x1=u(1); x
7、2=u(2); x3=u(3); x4=u(4);a_x1 = -125/*(74217*cos(x1)+*cos(x1)*cos(x2)-*cos(x1+x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2)*(-54/125*cos(x1)-54/125*cos(x1+x2)*x3-54/125*cos(x1+x2)*x4)*x3+(-54/125*cos(x1+x2)*x3-54/125*cos(x1+x2)*x4)*x4+(-54/125*sin(x1)-54/125*sin(x1+x2)*(-/(-+*cos(x2)+*cos(x2)2)*(55663
8、/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)+40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2)-54/125*sin(x1+x2)*(40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2
9、)-*(54044+55663*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2)-125/*(74217*sin(x1)+*sin(x1)*cos(x2)-*sin(x1+x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2)*(-54/125*sin(x1)-54/125*sin(x1+x2)*x3-54/125*sin(x1+x2)*x4)*x3+(-54/125*sin(x1+x2)*x3-54/125*sin(x1+x2)*x4)*x4+(54/12
10、5*cos(x1)+54/125*cos(x1+x2)*(-/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)+40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2)+54/125*cos(x1+x2)*(40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(55663/85248*s
11、in(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)-*(54044+55663*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2);a_x2 = 125/*(-74217*cos(x1)+*cos(x1+x2)*cos(x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2)*(-54/125*cos(x1)-54/125*cos(x1+x2)*x3-54/125*cos(x1+x2)*x4
12、)*x3+(-54/125*cos(x1+x2)*x3-54/125*cos(x1+x2)*x4)*x4+(-54/125*sin(x1)-54/125*sin(x1+x2)*(-/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)+40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2)-54/125*sin(x1+x2)*
13、(40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)-*(54044+55663*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2)+125/*(-74217*sin(x1)+*sin(x1+x2)*cos(x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2)*(-54/
14、125*sin(x1)-54/125*sin(x1+x2)*x3-54/125*sin(x1+x2)*x4)*x3+(-54/125*sin(x1+x2)*x3-54/125*sin(x1+x2)*x4)*x4+(54/125*cos(x1)+54/125*cos(x1+x2)*(-/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)+40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496
15、*sin(x2)*x12-88305/664*cos(x1+x2)+54/125*cos(x1+x2)*(40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)-*(54044+55663*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2);a_out = a_x1;a_x2;/*betax.m*/funct
16、ion b_out = b(u)x1=u(1); x2=u(2);bx1=125/*(74217*cos(x1)+*cos(x1)*cos(x2)-*cos(x1+x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2) ;bx2=125/*(74217*sin(x1)+*sin(x1)*cos(x2)-*sin(x1+x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2);bx3=-125/*(-74217*cos(x1)+*cos(x1+x2)*cos(x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x
17、1+x2);bx4=-125/*(-74217*sin(x1)+*sin(x1+x2)*cos(x2)/(-sin(x1+x2)*cos(x1)+sin(x1)*cos(x1+x2);b_out = bx1 ,bx2;bx3, bx4;/*hx.m*/function h_out = h(u)x1=u(1); x2=u(2);h_x = 54/125*cos(x1)+54/125*cos(x1+x2); 54/125*sin(x1)+54/125*sin(x1+x2);h_out = h_x;/*Gx.m*/function g_out = g(u)x2=u(2);g_x31= -/(-+*c
18、os(x2)+*cos(x2)2) ;g_x32=40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2);g_x41=40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2);g_x42= -*(54044+55663*cos(x2)/(-+*cos(x2)+*cos(x2)2);g_out = 0 0; 0 0; g_x31 g_x32; g_x41 g_x42 ;/*Fx.m*/function f_out = f(u)x1=u(1); x2=u(2); x3=u(3); x4=u(4);f_x = x3; x4; -/(-
19、+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*cos(x1+x2)+40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2); 40992*(74217+*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(55663/85248*sin(x2)*(x3*x4+1/2*x42)-77017/416*cos(x1)-88305/664*
20、cos(x1+x2)-*(54044+55663*cos(x2)/(-+*cos(x2)+*cos(x2)2)*(-55663/70496*sin(x2)*x12-88305/664*cos(x1+x2);f_out = f_x;/*fai_out.m*/function fai_out = fai(u)x1=u(1); x2=u(2); x3=u(3); x4=u(4);fai_x = 54/125*cos(x1)+54/125*cos(x1+x2); (-54/125*sin(x1)-54/125*sin(x1+x2)*x3-54/125*sin(x1+x2)*x4; 54/125*sin
21、(x1)+54/125*sin(x1+x2); (54/125*cos(x1)+54/125*cos(x1+x2)*x3+54/125*cos(x1+x2)*x4 ;fai_out = fai_x;%系统线性化/*linearization.m*/M1=15.19; M2=11.36; L1=0.432; L2=0.432; g=9.81;syms x1 ; syms x2 ; syms x3 ; syms x4;a1=(1/3)*M1*L12+(1/3)*M2*L22+M2*L12;a2=M2*L1*L2;a3=(1/3)*M2*L22;a4=0.5*M1*g*L1+M2*g*L2;a5=0
22、.5*M2*g*L2;M_x= a1+a2*cos(x2) a3+a2*cos(x2); a3+a2*cos(x2) a3 ;N_x= -(a2*sin(x2)*(x3*x4+x42/2); (a2*sin(x2)*x12/2 ;G_x=a4*cos(x1)+a5*cos(x1+x2); a5*cos(x1+x2) ;D_x = M_x;E_x = -( N_x +G_x );D_xni = inv(D_x);f_x = x3; x4; D_xni*E_x;g_x = 0 0; 0 0; D_xni;h1_x = L1*cos(x1)+L2*cos(x1+x2);h2_x = L1*sin(x
23、1)+L2*sin(x1+x2);h_x =h1_x; h2_x;Lgh1_x = diff(h1_x,x1) diff(h1_x,x2) diff(h1_x,x3) diff(h1_x,x4) *g_x;Lgh2_x = diff(h2_x,x1) diff(h2_x,x2) diff(h2_x,x3) diff(h2_x,x4) *g_x;Lfh1_x = diff(h1_x,x1) diff(h1_x,x2) diff(h1_x,x3) diff(h1_x,x4) *f_x;Lfh2_x = diff(h2_x,x1) diff(h2_x,x2) diff(h2_x,x3) diff(h
24、2_x,x4) *f_x;diffLfh1_x = diff(Lfh1_x,x1) diff(Lfh1_x,x2) diff(Lfh1_x,x3) diff(Lfh1_x,x4) ;diffLfh2_x = diff(Lfh2_x,x1) diff(Lfh2_x,x2) diff(Lfh2_x,x3) diff(Lfh2_x,x4) ;Lf2h1_x = diffLfh1_x*f_x;Lf2h2_x = diffLfh2_x*f_x;LgLfh1_x = diff(Lfh1_x,x1) diff(Lfh1_x,x2) diff(Lfh1_x,x3) diff(Lfh1_x,x4) *g_x;LgLfh2_x = diff(Lfh2_x,x1) diff(Lfh2_x,x2) diff(Lfh2_x,x3) diff(Lfh2_x,x4) *g_x;Lf2h_x = Lf2h1_x; Lf2h2_x;LgLfh_x = LgLfh1_x; LgLfh2_x;a_x = -inv(LgLfh_x)*Lf2h_xb_x = inv(LgLfh_x)fai_x = h1_x; Lfh1_x; h2_x; Lfh2_x