1 简介
旋翼类无人机相对于固定翼无人机具有能够垂直起降,空中悬停等优点,而四旋翼无人机作为其中一个典型的代表,不仅结构简单还具有良好的带载能力,也易于操控,在军事领域,民用领域,都有着广泛的应用,常见的包括航天拍摄,灾害救援,物资运输等.飞行控制系统是四旋翼飞行器的关键,其中,如何控制飞行器的姿态,是整个飞行控制的核心问题.要保证四旋翼无人机在各种飞行环境下都具有良好的飞行状态,飞行控制算法极为重要.本文借助Matlab/Simulink仿真平台上,使用了PID控制系统对四旋翼无人机进行了仿真.
2 部分代码
%%%%%%%%%%%%%%% desired position %%%%%%%%%%%%%%%%%%%%%%
xdes = 10;
ydes = 18;
zdes = -20;
%%%%%%%%%%%%%%%structural parameters %%%%%%%%%%%%%%%%%%%
m = 0.5;
g = 9.8;
Ixx =0.114;
Iyy = 0.114;
Izz = 0.158;
yaw = 3/57.3;
L = 0.2;
%%%%%%%%%%%%%%%%%% save PID for x %%%%%%%%%%%%%%%%%%%%
kpx = 0.8;
kix = 1e-4;
kdx = 1.3;
%%%%%%%%%%%%%%%%%% save PID for y %%%%%%%%%%%%%%%%%%%%
kpy = 0.8;
kiy = 3e-4;
kdy = 1.3;
%%%%%%%%%%%%%%%%%% save PID for z %%%%%%%%%%%%%%%%%%%%
kpz = 1.2;
kiz = 1e-6;
kdz = 2;
%%%%%%%%%%%%%%%%%% save PD for phi %%%%%%%%%%%%%%%%%%%
kpphi = 2000;
kdphi = 4000;
%%%%%%%%%%%%%%%%%% save PD for theta %%%%%%%%%%%%%%%%%
kptheta = 2000;
kdtheta = 4000;
%%%%%%%%%%%%%%%%%% save PD for psi %%%%%%%%%%%%%%%%%%%
kppsi = 800;
kdpsi = 4000;
%%%%%%%%%%%%%%%%%%% save tsim %%%%%%%%%%%%%%%%%%%%%%%%%%
tsim = 20;
3 仿真结果
4 参考文献
[1]魏家辉, 姜春波, 陈浩,等. 基于Matlab的四旋翼无人机控制仿真[J]. 数码世界, 2018.