Once the AeroQuad software was fully functional on our quadcopter, we began tuning the PID controllers and conducting test flights. We used this website as a guide on how adjust the PID values. This other website also provides an excellent explanation of how to implement PID in Arduino.
We tested the quadcopter using the default PID values in Aeroquad as a starting point. The PID values were determined by a holding test. Keeping a firm grip on the quad copter center while still allowing the copter to adjust itself, we forced the copter to pitch or roll by having another team member push it. If the copter did not correct itself enough, the P value for the corresponding test (roll/pitch/yaw) was adjusted for the gyroscope. Since our quadcopter design is smaller than average, we found that small motor adjustments caused more abrupt copter maneuvers, requiring us to lower the P value. A P value that is too high will cause the copter to oscillate in flight. The following table lists the PID values used for our quadcopter configuration.
|PID Controller||P Value||I Value||D Value|
|Rate Mode – Gyro X-Axis (Roll)||70||0||-300|
|Rate Mode – Gyro Y-Axis (Pitch)||65||0||-300|
|Gyro Z-Axis (Yaw)||275||5||0|
Unfortunately, we did not have enough time before the end of the couse to calibrate the accelerometer, which would have greatly improved the hovering ability. Although the gyroscope attempts to counteract instantaneous force, it does not detect if the copter is level and does not auto level the copter.
Wireless PID Tuning
To avoid physically connecting to the copter to updated PID values after each test flight, we implemented a few simple radio commands to update PID values. By using the Arduino IDE serial monitor to communicate with the remote station, commands could read and update copter PID controller values.
To read the existing PID values, issue the command ‘ra’ without quotes (stands for read all). To update a specific pid value, issue a command of the form p<index>;<p-value>;<i-value>;<d-value>; and confirm with y/n. In order for PID values to be set, the copter must be turned on with the motors disarmed. See the following screenshots for clarity.