Quadrotor Control and Trajectory Optimization

Tracking complex trajectories of Quadrotors using PID and optimal controllers like LQR and MPC

This project focuses on developing a controller for a quadrotor tasked with navigating restricted airspace while following a target position or trajectory. The quadrotor system consists of a frame with four propellers that generate lift and moments about the center of mass, allowing for precise position and orientation control.

Github Link to the Project - GitHub Repo

Quadrotor navigating in the airspace following a target position/trajectory

The state of the system is defined by its position, velocity, and orientation (roll, pitch, yaw), with dynamics described using Newton-Euler equations as mentioned here. The objective of the controllers that are implemented is to follow two predefined trajectories in the 3D airspace, a diamond and a circular trajectory. Given the dynamics, the trajectories are tracked using two different controllers, the PD controller and an optimal controller (LQR), which are further explained next.

PD Controller

To implement the PD controller, the property of differential flatness of the quadrotor system is used so as to make the control of the system easier. Through this property, we observe that even though the system has 12 state variables, we can simplify the control by only controlling the flat outputs of the system, which are $[x,y,z,\phi]^T$, the 3D position of the quadrotor and the yaw angle respectively. Using this, the controller can be simplified as shown:

Overview of the PD controller

The results of tracking using the PD controller are as follows. The Mean Square Error of the trajectories tracked are $0.012m^2$ and $0.027m^2$ for the diamond and the circle trajectories respectively.

Tracking the Diamond and Circle Trajectories using PD controller
Tracking Performance of the PD controller for the diamond trajectory (Left) and the circle trajectory (Right)

LQR Controller

To implement the LQR, we first convert the system dynamics into a control affine form, after which the optimal control problem can be defined and solved. Similar to the PD controller, the LQR controller could track the trajectories effectively and the results are as follows:

Tracking the Diamond and Circle Trajectories using LQR controller

In the case fo the LQR controller, the Mean Square Error of the trajectories tracked are $0.035m^2$ and $0.064m^2$ for the diamond and the circle trajectories respectively.

Tracking Performance of the LQR controller for the diamond trajectory (Left) and the circle trajectory (Right)