Servo motor feedback control

Modelling a rotary servo from a bump test, then designing PI, PID, lead and cascade controllers in Simulink and running them on the real hardware.

simulation ≠ hardware

filed underMechatronics & control

ProjectServo motor feedback control
CourseControl systems lab
Date2026
TeamLab pair
My partTeam leader
ToolsMATLAB, Simulink, Quanser SRV02
Drawn byA. Valloyas
ScaleNTS
Sheet5 of 16
Hardware step response of the servo speed under lead control, compared with the setpoint
PIDpositionPIspeed≤ 10 Vmotor1 / sθ refωθω−−outer loop: position · inner loop: speedhand-derived → Simulink → Quanser SRV02 hardware
the system at a glance

What it was

A semester of labs on a Quanser SRV02 rotary servo with my lab partner, building from a plant model to a full cascade controller. Every stage followed the same loop: derive the controller by hand, simulate it in Simulink, run it on the real motor, and compare.

1. Modelling the motor

A bump test — a square-wave step in input voltage — gave the motor’s steady-state gain and time constant from the speed response, and a frequency sweep cross-checked the first-order model. Everything after depends on getting this right.

2. Speed control

A PI controller. The proportional gain sets how quickly the motor responds; the integral gain removes steady-state error so it actually reaches the target speed.

3. Position control

Position controllers with gains derived by hand from the target damping ratio and natural frequency, then tuned against peak time, percent overshoot and steady-state error.

4. Lead compensation

Adding phase lead to speed the response up without the overshoot that simply raising the gain causes.

5. Cascade control

An outer PID loop on position feeding speed setpoints to an inner PI loop on speed, with a saturation block keeping the motor under 10 V. We tested it on ramp inputs to see how well it tracked a steadily moving target.

What stood out

Each design was judged against the same specs, and the gap between simulation and hardware was the interesting part. Several designs that met spec in Simulink showed more overshoot or error on the real motor. Tracking down why taught more than the cases that matched: the model is only as good as the bump test behind it.