Acrobatic control of a 2D quadrotor refers to the ability of the quadrotor to perform complex, dynamic maneuvers such as flips and turns. In this project, we designed and implemented two controllers for a 2D quadrotor to enable it to perform acrobatic maneuvers: a Linear-Quadratic Regulator (LQR) controller and an iterative LQR (iLQR) controller with added line search. The LQR controller was designed to maintain a predefined position and follow a predefined trajectory, while the iLQR controller was developed to perform acrobatic maneuvers and avoid local minima.
![]() |
![]() |
---|---|
Following Trajectory using LQR | Doing Full Flip using iLQR |
For the Linearized Quadratic controller, we must compute the value of A and B at each stage of the trajectory as it is dependent on the state of the system.
To make quadrotor follow a trajectory first system dynamics have to be linearized around the desired states and desired controls are different time steps.
Linearized system dynamics can be written as -
Cost function for controller can be written as -
To make quadrotor follow a circle desired state at different time steps
$$x_n^\star = \begin{bmatrix}\cos{\frac{2\pi1000}{n}} \ 0\ \sin{\frac{2\pi1000}{n}} \ 0\ 0\ 0\end{bmatrix}$$
desired control was taken to as -
![]() |
![]() |
---|---|
without perturbations | with perturbations |
![]() |
![]() |
---|---|
without perturbations | with perturbations |
The cost function computes the total cost of trajectory
The equation of time-varying cost function is given by :
The function can be found in the ipynb file with the following name:
compute_cost(z, u, horizon_length):
The quadratic approximation is used to find the value of Q, q, R, and r.
Q and R are the hessian while q and r are the jacobians of cost function J.
Where,
The function can be found in the ipynb file with the following name:
get_quadratic_approximation_cost(z, u, horizon_length):
The function for iLQR algorithm can be found in the ipynb file with the following name:
solve_iLQR(A, B, Q, R, q, r, N):
![]() |
![]() |
---|---|
States | Controls |