✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
为了对小型无人机全过程飞行仿真进行研究,根据无人机飞行控制回路和制导回路,搭建了模块化的系统仿真结构,将Matlab/Simulink和Stateflow有机结合起来,建立了易于维护和扩展的仿真环境.利用仿真环境对无人机的控制规律和制导规律进行了仿真,结果表明了控制规律和制导规律的合理性,以及全过程仿真环境的实用性.
⛄ 部分代码
close all;clear;
close all
addpath 'data'
addpath 'uavA1'
% addpath 'uavShow'
% If you want to use other planning 5 trajectories files
% You should change as followws:
% 1. getWpp.m load '5jia.mat'
% 2. para_chap1.m load '5jia.mat'
% Change the name of '5jia.mat'
% And the simulink time also needs to adjusted if too long or long short
%----------------
uavW = 1;
save('uavW.mat','uavW');
sim('New_mavsim_chap12');
ii = 1;
eval(['x' num2str(ii) '= x;'])
eval(['path' num2str(ii) '= path;'])
eval(['waypoints' num2str(ii) '= waypoints;'])
save('x1.mat','x1','path1','waypoints1');
%----------------
clear;
uavW = 2;
uavi = uavW;
save('uavW.mat','uavW');
sim('New_mavsim_chap12');
ii = 2;
eval(['x' num2str(ii) '= x;'])
eval(['path' num2str(ii) '= path;'])
eval(['waypoints' num2str(ii) '= waypoints;'])
save('x2.mat','x2','path2','waypoints2');
%----------------
clear;
uavW = 3;
save('uavW.mat','uavW');
sim('New_mavsim_chap12');
ii = 3;
eval(['x' num2str(ii) '= x;'])
eval(['path' num2str(ii) '= path;'])
eval(['waypoints' num2str(ii) '= waypoints;'])
save('x3.mat','x3','path3','waypoints3');
%----------------
clear;
uavW = 4;
save('uavW.mat','uavW');
sim('New_mavsim_chap12');
ii = 4;
eval(['x' num2str(ii) '= x;'])
eval(['path' num2str(ii) '= path;'])
eval(['waypoints' num2str(ii) '= waypoints;'])
save('x4.mat','x4','path4','waypoints4');
%----------------
clear;
uavW = 5;
save('uavW.mat','uavW');
sim('New_mavsim_chap12');
ii = 5;
eval(['x' num2str(ii) '= x;'])
eval(['path' num2str(ii) '= path;'])
eval(['waypoints' num2str(ii) '= waypoints;'])
save('x5.mat','x5','path5','waypoints5');
% Show part
%----------------
close all;clear;
load 'x1'
load 'x2'
load 'x3'
load 'x4'
load 'x5'
addpath 'uavShow'
sim('mavsim_show');
⛄ 运行结果
⛄ 参考文献
[1] 鲍泳林. 某无人机飞控系统地面半实物仿真平台设计[J]. 太赫兹科学与电子信息学报, 2005, 13(6).
[2] 郑忠培, 徐海航. 基于Matlab的高性能无人机飞行控制系统仿真[C]// 第14届中国系统仿真技术及其应用学术年会. 0.
[3] 张宁. 面向无人机航电仿真系统的多模态控制逻辑设计与实现[D]. 电子科技大学.