Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 a PID controller class that can be used by multiple managers (although will be used by attitude manager at first), each object of the class will calculate their own integral & derivative terms being calculated independently, also the PID’s should will update at the same fixed frequency, so that derivative and integral calculations work properly. By having one PID instance per axis rather than one per motor the output will be cleaner and more consistent. The structure of the PID and its methods are below:When the PID does its computations to output, it will calculate it’s own derivative and integral values. The PID will be implemented in the PID.hpp and PID.cpp files in the Attitude Manager Folder, updating/replacing the previous PID controller.

Laslty, the PID will also need to utilize the input-map to be able to convert angles/rates into motor % when outputting. Meaning the PID input and target point will be angles/rates, however it will convert the angle/rate to a motor % before outputting so that the motor can adjust to reach the desired set point.

Fixed Time Frequency Updating:

The goal, is have the PID controller for an axis update at a fixed frequency, all axis do not necessarily have to update at the same frequency. This will be implemented using freeRTOS, where the PID update method will use a task and vTaskDelayUntil from freeRTOS, to ensure that the controller for an axis is updating at a fixed frequency. When an object of the class is instantiated one of the parameters will be the frequency at which the PID should update.