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:There are 2 motors per prop on the drone, a yaw servo motor and a roll BLDC (brushless DC) motor. Thus, a wrapper class will be designed for the PIDs so that all the yaw PIDs can be accessed/updated together and same for the roll PIDs.

Fixed Time Frequency Updating:

To ensure the different The goal, is have all the 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 motoran axis update at the same frequency, all axis do not necessarily have to update at the same frequency but the PID controllers of the same axis should. This will be implemented using freeRTOS where, the wrapper class will have an update method in which it uses the vTaskDelayUntil function from freeRTOS to ensure that the roll or yaw PIDs update at the same frequency.