As Shakespeare said, "some are born great, some achieve greatness and some have greatness thrust upon them."
We plead the fifth.
The first thing that we did with controls was to make a simulator in Matlab with Dr. Beards help. To do this he had us make a file that had the dynamics of the quadrotor in such way that it could be understood by Matlab. This file is called quadrotor_dynamics.m in the directory Final Control Sim. The part of this file that Dr. Beard had us fill out is the part that computes the system dynamics starting around line 150. Once this was done we took the code that we had used on the autopilot previously and tried it in the simulator placing it in autopilot.m. When it didn't work very well, we changed the autopilot code so that it would work properly.
After we had done that we implemented the revised coupling strategy that we were told to do by Dr. Beard. This is found in lines 63 and 75 of the autopilot.m code. These equations take into account the effect of yaw and pitch on altitude.
The next thing that we did was to add feedforward to our roll, yaw and pitch commands. Feedforward is when the acceleration of the target is taken into account. Three things are needed, the acceleration in the x direction, the y direction and the yaw acceleration. These are computed in lines 46 and 47 for x and y and line 84 for yaw. They are then added to the position and heading hold PID outputs in lines 60, 72 and 84. After implementing these feedforward terms, our simulated quadrotor was able to follow a target going in excess of 2, where 0.3 was the original speed of the target. The PID gains that we used are found in the param.m file.
After the simulator was working how we wanted it to, we then started to implement the autopilot.m code on the Rabbit processor. This code can be found in KA_QUADROTOR.LIB in the directory Jared's Code\QuadRotor_MA8.2\KA_LIB. We were given code from the TA that worked from joystick inputs to start with. All the PID loops for stabilization have been implemented, but the PID loops for heading and position holds have been implemented but commented out.
Adaptive Controller
Overview
The inherently unstable nature of quadrotors presents new and interesting design challenges. Stabilizing controllers must demonstrate immunity to a large number of complex, unknown flight dynamics, including prop wash, unknown moments and products of inertia, and even variations in motor thrust due to battery voltage levels. We developed an adaptive state feedback controller to provide guaranteed performance even in the midst of unknown flight dynamics. Simulations have verified that the adaptive control law is a viable control method; unfortunately, time constraints prevented us from implementing the new controller on the actual quadrotor. In the absence of the more robust adaptive controller, a simple PID control law was implemented.
Here is a link to our rigorous computation. Though the time invested was not sufficient to the completion of the project, we do have the following paper on our effort. At the time of this posting, it was being considered to be presented at a symposium by one of our team members:



