✅作者简介:热爱科研的Matlab仿真开发者,擅长数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。
🍎 往期回顾关注个人主页:Matlab科研工作室
👇 关注我领取海量matlab电子书和数学建模资料
🍊个人信条:格物致知,完整Matlab代码获取及仿真咨询内容私信。
🔥 内容介绍
随着自动驾驶车辆在社会中的普及,性能评估及其方法受到越来越多的关注。其中,多旋翼飞行器因其在摄影、精准农业、三维重建、监测等领域的应用而备受瞩目,例如医学运输等潜在用途也正在研究中。为此,需要建立多旋翼飞行器的基线轨迹,以评估飞行机动的可能性及新型多旋翼设计的飞行性能。这促使我们推导出多旋翼飞行的时间最优输入与状态轨迹。本文以简化侧向飞行为例进行分析,将多旋翼动力学简化为双旋翼动力学模型。此外,本文将[1]中提出的优化算法与附录代码中更通用的轨迹优化算法进行对比。本文结构如下:第2节介绍不考虑旋转动力学的多旋翼侧向飞行动力学;第3节阐述基于庞特里亚金最优性条件的时间最优输入与状态轨迹推导过程,包括优化问题的建模及最优性必要条件的最小化原则;同时提供[1]中解决该优化问题的算法方案。第四节展示了将第三节提出的优化问题应用于第二节系统动力学模型时获得的数值结果。第五节通过欧拉离散化方法对非线性动力学进行离散化处理,将时间最优轨迹规划问题转化为非线性规划(NLP)模型,优化过程采用用户自定义的时间步长,并将时间间隔设为优化变量。第六节呈现了第五节提出的NLP模型求解结果,并将所得轨迹与第四节结果进行对比分析。第七节将旋转动力学引入第二节所述的多旋翼横向飞行动力学模型。第八节展示了将第五节提出的NLP模型应用于第七节系统动力学时获得的数值结果。最后,第九节简要总结了研究结论。
Image
Image
Image
Image
Image
⛳️ 运行结果
Image
Image
Image
Image
📣 部分代码
clear all
clc
rot_dyn = 1; % 0: Dynamics do not consider rotational dynamics, 1: Dynamics consider rotational dynamics
scenario = 2; % 1: Scenario 1, 2: Scenario 2
if rot_dyn == 0
if scenario == 1
load('Multicopter_vertical_motion_and_flip.mat')
elseif scenario == 2
load('Multicopter_horizontal_motion_and_flip.mat')
end
else
if scenario == 1
load('Multicopter_w_Rot_Dyn_vertical_motion_and_flip.mat')
elseif scenario == 2
load('Multicopter_w_Rot_Dyn_horizontal_motion_and_flip.mat')
end
end
figure(1)
set(gcf, 'color', [1 1 1])
plot(tt, px,'linewidth',2);
hold on
plot(tt, vx,'linewidth',2);
plot(tt, pz,'linewidth',2);
plot(tt, vz,'linewidth',2);
plot(tt, theta,'linewidth',2);
if rot_dyn == 1
plot(tt, thetadot,'linewidth',2);
end
hold off
ax = gca;
ax.FontSize = 18;
set(gca,'TickLabelInterpreter','latex')
grid on
box on
xlabel('$t$ (s)','Interpreter','latex','Fontsize',17);
ylabel('Optimal State Trajectories','fontsize',17,'interpreter','latex');
if rot_dyn == 0
legend({'$x^*$','$\dot{x}^*$','$z^*$','$\dot{z}^*$','$\theta^*$'},...
'Location','NorthWest','Interpreter','latex','Fontsize',15);
x_min = min([px pz vx vz theta]);
x_max = max([px pz vx vz theta]);
elseif rot_dyn == 1
legend({'$x^*$','$\dot{x}^*$','$z^*$','$\dot{z}^*$','$\theta^*$','$\dot{\theta}^*$'},...
'Location','NorthWest','Interpreter','latex','Fontsize',15);
x_min = min([px pz vx vz theta thetadot]);
x_max = max([px pz vx vz theta thetadot]);
end
axis([0,max(tt),x_min-0.1(x_max-x_min),x_max+0.1(x_max-x_min)]);
figure(2)
set(gcf, 'color', [1 1 1])
plot(tt, uT,'linewidth',2);
hold on
plot(tt, uR,'linewidth',2);
hold off
ax = gca;
ax.FontSize = 18;
set(gca,'TickLabelInterpreter','latex')
grid on
box on
xlabel('$t$ (s)','Interpreter','latex','Fontsize',15);
ylabel('Optimal Input Trajectories','fontsize',17,'interpreter','latex');
legend({'$u{\rm T}^*$','$u{\rm R}^*$'},...
'Location','NorthWest','Interpreter','latex','Fontsize',15);
u_min = min([uT uR]);
u_max = max([uT uR]);
axis([0,max(tt),u_min-0.1(u_max-u_min),u_max+0.1(u_max-u_min)]);
🔗 参考文献
Image
图片
🏆团队擅长辅导定制多种科研领域MATLAB仿真,助力科研梦: