A practical control systems course covering mathematical modelling, PID control, and Model Predictive Control (MPC), applied to real engineering systems. Each part builds on the previous one from basic feedback control to advanced constrained optimisation on nonlinear vehicles.
This material was developed as part of an applied control systems curriculum in Mechanical Engineering. Both Python and MATLAB implementations are provided for every part.
applied-control-systems/
├── part1_pid_control/ # P and PID controllers on simulated systems
├── part2_mpc_car/ # MPC on an autonomous car (full 2D trajectory)
├── part3_mpc_drone/ # LPV-MPC on a UAV drone (3D, constrained)
└── README.md
The foundation. You model physical systems from first principles, derive their equations of motion and design proportional and PID controllers to drive them to a desired state. 2 systems: a set of water tanks with a proportional controller, and a magnetic train on an inclined rail with a full PID controller catching randomly falling objects.
The step up from PID to MPC. The car now has two inputs (steering + longitudinal force) and must follow any 2D trajectory either circles, S-curves or figure-eights. MPC solves a constrained quadratic programming problem at every timestep to find the optimal inputs over a prediction horizon. State-dependent constraints are enforced in real time.
The most advanced part. A quadrotor drone is modelled with full 6-degree-of-freedom nonlinear dynamics. A dual-loop control architecture is used: an outer position controller computes the required thrust and attitude angles, and an inner LPV-MPC attitude controller tracks them at a higher rate. Two versions: without constraints and with hard attitude constraints enforced via QP.
- Python 3.x or MATLAB R2019b+
See each part's README for specific library requirements.