Cascaded PD and infinite-horizon LQR controllers with polynomial trajectory generation, achieving stable sim-to-real transfer on a physical CrazyFlie 2.0 drone.
This project implements a full control stack — from simulation to physical flight — for the CrazyFlie 2.0 nano-quadrotor. The objective was to design controllers capable of stable hover and accurate trajectory tracking, then validate the sim-to-real transfer on the physical platform.
Controller Design: A cascaded architecture was used with an outer position loop and inner attitude loop. Two controllers were designed and compared: a classical PD controller tuned through gain sweep, and an infinite-horizon LQR controller derived from the linearized quadrotor dynamics.
Trajectory Generation: A polynomial-based trajectory planner generates smooth position, velocity, and acceleration profiles between waypoints. The planner enforces continuity constraints at segment boundaries to avoid actuator saturation.
Sim-to-Real Transfer: Controllers were first validated in simulation with the full nonlinear model. The same parameter set was then deployed to the physical CrazyFlie 2.0 with only minor gain adjustments to account for unmodeled rotor dynamics.
The LQR controller achieved under 3mm trajectory tracking error in simulation. On the physical platform, the system maintained under 7mm RMSE during aggressive trajectory tracking tests, demonstrating successful sim-to-real transfer with minimal re-tuning.