05 Control System

一、PID控制器

1.1 控制原理

下图来自 Sun Feb 08, 2015

Crazyflie控制系统
控制循环
  • ESPlane有两个PID控制回路,Rate控制和Attitude控制,其中Rate主要使用陀螺仪数据(角速度)作为输入量,控制频率为500hz;Attitude控制使用拟合后的角度为输入量,控制频率为100hz.

  • 注意在工程中,并不是所有的自由度都使用两级PID控制,默认pitch和roll自由度使用Attitude控制,yaw使用Rate控制.

1.2 实现代码

参数调整大致思路 PID coefficients can be optimized using Particle Swarm Optimization, or many other algorithms. This is called automatic tuning, and is my second goal for the refactoring I'm trying to do. For manual tuning, tune the Kp gain first, with Ki and Kd at 0. The Kp tuning will give you the majority of the stabilization. If you want smooth motion, a smaller Kp is the goal. For aerobatic maneuvers you'll want a higher Kp to force a faster return to the setpoint. After finding a stable Kp (Too high and you'll have marginal stability or oscillations), tune the Ki to help prevent drift and hold your heading. Finally tune the Kd to adjust the snappiness of returning to the setpoint. By snappiness, I mean how quickly it eliminates overshoot from the adjustment. 链接

二、Mellinger控制器

/* This controller is based on the following publication: Daniel Mellinger, Vijay Kumar: Minimum snap trajectory generation and control for quadrotors. IEEE International Conference on Robotics and Automation (ICRA), 2011.

Crazyflie project added the following:

  • Integral terms (compensates for: battery voltage drop over time, unbalanced center of mass due to asymmmetries, and uneven wear on propellers and motors)

  • D-term for angular velocityer

  • Support to use this controller as an attitude-only controller for manual flight

    */

最后更新于

这有帮助吗?