PID Controller

For the quadcopter to be able to maintain a stable hover, a controller is needed to keep it in the proper orientation. The quadcopter uses a PID controller that is implemented on the onboard FPGA board and interacts with the IMU and the information from the bluetooth.

The PID starts with a series of constants that are determined based on the mass and dimensions of the quadcopter. This is changed and created by tuning them using the current code and seeing which way the quad wants to drift, and by using a simple CAD design within MATLAB.

The PID also needs information from the IMU in order to determine the orientation and position. The target position and current position is taken in by bluetooth. From this information the error amount of the current position versus the target position is calculated. The farther it is off, the larger the error it creates. These errors are then used to determine what changes need to be made to the motors. This is calculated within the motor translator.