Build a position servo with an observer
Estimate velocity from noisy position and compare pole placement with LQR.
Can estimated state feedback track position while respecting force limits?
A 2 kg carriage has viscous damping 0.4 N s/m and force input limited to [-4,4] N. States are position and velocity; only position is measured during control. The CSV includes true velocity for offline evaluation only. Design a 1 m position servo using state feedback and an observer, then compare with an LQR design.
Build it, step by step
- 01
Build A=[[0,1],[0,-0.2]], B=[[0],[0.5]], C=[[1,0]], D=0. Check controllability and observability.
- 02
Place controller poles at [-1,-2] and observer poles at [-4,-5]. Add the reference gain using a linear solve.
- 03
Use dt=0.01 s and sensor noise with standard deviation 0.002 m and seed 42. The observer must use measured position and the applied force only.
- 04
Target final error below 0.02 m, settling within 8 s to a 2% reference band, and force within its cap. Measure estimation RMSE after the first second.
- 05
Compare with Q=diag(4,1), R=[[1]] LQR. Repeat with mass 1.6 and 2.4 kg and a constant 0.5 N load. Explain any residual tracking error.
Your project checklist
- Matrix definitions, ranks, gains, and closed-loop poles.
- No true velocity leaked into the observer or control law.
- Position, estimated velocity, and applied force plots.
- A noise, saturation, and uncertainty scorecard.
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.