1 简介

旋翼类无人机相对于固定翼无人机具有能够垂直起降,空中悬停等优点,而四旋翼无人机作为其中一个典型的代表,不仅结构简单还具有良好的带载能力,也易于操控,在军事领域,民用领域,都有着广泛的应用,常见的包括航天拍摄,灾害救援,物资运输等.飞行控制系统是四旋翼飞行器的关键,其中,如何控制飞行器的姿态,是整个飞行控制的核心问题.要保证四旋翼无人机在各种飞行环境下都具有良好的飞行状态,飞行控制算法极为重要.本文借助Matlab/Simulink仿真平台上,使用了PID控制系统对四旋翼无人机进行了仿真.

2 部分代码

  1. %%%%%%%%%%%%%%% desired position %%%%%%%%%%%%%%%%%%%%%%
  2. xdes = 10;
  3. ydes = 18;
  4. zdes = -20;
  5. %%%%%%%%%%%%%%%structural parameters %%%%%%%%%%%%%%%%%%%
  6. m = 0.5;
  7. g = 9.8;
  8. Ixx =0.114;
  9. Iyy = 0.114;
  10. Izz = 0.158;
  11. yaw = 3/57.3;
  12. L = 0.2;
  13. %%%%%%%%%%%%%%%%%% save PID for x %%%%%%%%%%%%%%%%%%%%
  14. kpx = 0.8;
  15. kix = 1e-4;
  16. kdx = 1.3;
  17. %%%%%%%%%%%%%%%%%% save PID for y %%%%%%%%%%%%%%%%%%%%
  18. kpy = 0.8;
  19. kiy = 3e-4;
  20. kdy = 1.3;
  21. %%%%%%%%%%%%%%%%%% save PID for z %%%%%%%%%%%%%%%%%%%%
  22. kpz = 1.2;
  23. kiz = 1e-6;
  24. kdz = 2;
  25. %%%%%%%%%%%%%%%%%% save PD for phi %%%%%%%%%%%%%%%%%%%
  26. kpphi = 2000;
  27. kdphi = 4000;
  28. %%%%%%%%%%%%%%%%%% save PD for theta %%%%%%%%%%%%%%%%%
  29. kptheta = 2000;
  30. kdtheta = 4000;
  31. %%%%%%%%%%%%%%%%%% save PD for psi %%%%%%%%%%%%%%%%%%%
  32. kppsi = 800;
  33. kdpsi = 4000;
  34. %%%%%%%%%%%%%%%%%%% save tsim %%%%%%%%%%%%%%%%%%%%%%%%%%
  35. tsim = 20;
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.

3 仿真结果

Matlab模拟四旋翼飞行器PID控制仿真_控制系统

Matlab模拟四旋翼飞行器PID控制仿真_控制系统_02

4 参考文献

[1]魏家辉, 姜春波, 陈浩,等. 基于Matlab的四旋翼无人机控制仿真[J]. 数码世界, 2018.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

Matlab模拟四旋翼飞行器PID控制仿真_matlab代码_03