Compare PI and constrained predictive control
Plan bounded commands, expose infeasibility, and compare computation with performance.
When does planning ahead justify the extra controller complexity?
Use a normalised process x[k+1]=0.8*x[k]+0.2*u[k]+d[k] at Ts=0.1 s, with command in [0,1] and desired state range [0,0.7]. The CSV supplies reference, disturbance, and bounds, not measured plant output. Compare an anti-windup PI baseline with a three-step finite-set predictive controller using actions [0,0.5,1].
Build it, step by step
- 01
Load the scenario, begin at x=0, and plot reference and disturbance schedules. Set common tracking, constraint, and computation metrics before tuning.
- 02
Build the PI baseline with command limits and conditional anti-windup. Record IAE, command variation, and any state-bound violations.
- 03
Enumerate three-step command sequences with cost sum((x_next-r)^2+0.05*u^2). Hold the current reference across the horizon and assume no future disturbance knowledge. Reject predicted states outside [0,0.7].
- 04
Apply only the first action, replan each sample, and return a visible feasibility flag. Use zero command as the declared simulation fallback when all sequences fail.
- 05
Compare horizons 1,3,5 and actual coefficient 0.9 versus nominal 0.8. Measure solve time and test x0=2 for infeasibility. Explain why this finite action set is not a general continuous MPC solver.
Your project checklist
- Identical scenarios and metrics for both controllers.
- Explicit state and input constraints with a tested fallback.
- Performance, feasibility, and computation-time tables.
- A model-mismatch experiment and clear limits on stability claims.
Free, open and run by a nonprofit.
This page is part of Control Engineering, a free course of 20 modules and 60 lessons in the engineering.fit( ) Learning Lab. The Learning Lab is built and run by engineering.fit( ), a nonprofit founded by Abdullateef Opeyemi Bakare that helps African engineering students gain research experience. You do not need an account or pay a fee to learn.