The main goal for this project was to design a trajectory controller to maneuver the quadrotor through paths that have been derived to minimise snap. The process of generating trajectories exactly follows the algorithm described in Project 2. For any feedback controller the information of the current state of system is required, in this case we assume that the position vector P , the orientation R and their derivatives linear and angular velocity are given (for example in the real world through a motion capture system). To calculate the desired paths we only derive trajectories for x, y, z and the yaw component of the orientation ψ. This is possible since these are the flat outputs of the quadrotor which means that all other desired states in R and their derivatives can be calculated.
Now we can assume that if the quadrotor was fully actuated we could use a simple PID controller based on the error between states to control the quadrotor. However since quadrotors are underactuated systems we need to project the thrust on to the z axis i.e b3 of the quadrotor. We do this by using:
The control input u1 is then multiplied by the desired orientation (Rdes) and b3.
to derive the desired trajectory we use the flat output (ψ) from the generated trajectories. using yaw rotation and the assumption:
We can use the generic formula for zxy rotations (Tate-Brian), the rotation matrix and yaw value to derive for the desired values of pitch and roll.
At this point we can derive a controller (u2) to control the orientation. This controller will use the error in orientation (eR) and the error in the angular velocities (ew) to correct for the orientation error. and compensate for the inertial dynamics
since all error terms eR, ew, ev and er 3 dimensional vectors as a result the gains KR Kw Kv Kp are diagonal 3 by 3 matrices. Which means over all there will be 12 gain parameters to adjust for.
The effects of u1 and u2 on the dynamics of quadrotor from a motor perspective can be described by using the equation for the approximated force and moments generated as function of its angular velocity:
This is the reason for dividing the control inputs into two components; u1 as the net body force working component of gravity normal to axis b. And u2 as the body moments. Therefore assuming a RH coordinate system, the combined input can be written as;
To summarise the derevation process:
The result from the simulations
Generated trajectories for x, y, z and yaw
Quadrotor path following trajectory