Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This document gives a very brief overview of the desired functionality of the PID controllers inside ZeroPilot 3.5’s Attitude Manager.

Understanding PID’s

Hopefully, PID’s make sense to you, but if they don’t, check out the following guides:

Within Attitude Manager, we run PID’s on each axis exclusively. Since the axis are (mostly) decoupled from each other, we can do this to great success in both quadcopters and fixed-wing aircraft. The output from each PID essentially decides how much to “drive” actuators in that axis to move our current angle / rate to the desired angle / rate. For quadcopters, multiple-axis PID’s are combined on different motors. In a fixed-wing, most actuators only correspond with one PID - and that axis' PID will deal with secondary effects such as adverse yaw.

The PID Class

Typically, PID exists as a class which is then implemented per-axis. This means that each axis has a singular output, so it’s necessary to determine Positive and Negative orientations, as certain actuators may need to reverse the PID output depending on their orientation. See the ZP3.0 architecture for our drone reference frame ZeroPilot 3.0 Architecture - Embedded Flight Software - WARG (atlassian.net)

Although the inputs may be angles or rates, the output of a PID should be a motor % that can be understood by each actuator.

Implementation

A new PID will be will be designed to solve the issues with the previous iteration and saved in the PID.cpp file. The goal is to have multiple PID controllers at the same time each with their own integral & derivative terms being calculated independently, also the PID’s should update at the same fixed frequency, so that derivative and integral calculations work properly. The structure of the PID and its methods are below:

  • No labels