Regulate a DC motor speed
Identify a motor model, tune PI, and test changing loads and voltage limits.
Can a speed controller meet its target without exceeding the available voltage?
Use a synthetic motor with gain 20 (rad/s)/V and time constant 0.4 s. The CSV contains time_s, voltage_v, and speed_rad_s from a held-voltage test with a small deterministic sensor ripple. Build a speed controller for a 60 rad/s target with a voltage range of 0 to 6 V. Treat a load as an additive speed disturbance inside tau*speed_dot=-speed+20*voltage+load. No physical motor is required.
Build it, step by step
- 01
Plot the open-loop record, check units, and estimate gain and time constant from a settled step.
- 02
Create a simulation function with an explicit time step, voltage cap, and load input. Compare P and PI on the same 60 rad/s target.
- 03
Aim for final error below 1 rad/s, overshoot below 10%, and settling within 2 s to a 2% reference band. Report failed or infeasible criteria honestly.
- 04
Apply a load of -15 rad/s at t=4 s, then test an unreachable 140 rad/s target followed by recovery to 60. Compare anti-windup on and off.
- 05
Repeat at gains 16 and 24 and time constants 0.3 and 0.6 s. Save output, voltage, and error metrics for every case.
Your project checklist
- A fitted model with units and a separate validation response.
- Output and voltage plots with target and actuator limits.
- Nominal, load, saturation-recovery, and uncertainty results.
- A reproducible notebook explaining tuning choices and limitations.
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.