Versions Compared

Key

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

...

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. Each motor has 3 instances of the PID class, one for pitch, roll, yaw. The structure of the PID and its methods are below:

Fixed Time Frequency Updating:

To ensure the different PID controllers for pitch, roll, yaw are updating together, a wrapper class will be designed to hold the 3 PID controllers for the motor and update them at the same time. Using the chrono library the wrapper class will ensure that updates occur at a fixed frequency for all the sub-controllers for each motor.