Electronics 117: PID Control & Motion Stability
A practical, intuition-first guide to PID control: what Proportional, Integral, and Derivative control really do, why systems oscillate or feel “sluggish”, and how to tune PID loops for stable, responsive motion in robotics, servos, CNC, and automation.
1) What is PID control?
PID control is a feedback control method that continuously adjusts an output based on the difference between a desired value (setpoint) and a measured value (feedback).
2) The control loop explained
A closed-loop control system operates continuously:
- Measure current state (encoder, sensor)
- Calculate error (setpoint - measurement)
- Compute control output (PID)
- Apply output to actuator (motor, valve)
- Repeat at a fixed rate
3) Proportional control (P)
The proportional term applies force proportional to the current error.
Output_P = Kp × Error
- Higher Kp ? stronger response
- Too low ? sluggish system
- Too high ? oscillation
4) Integral control (I)
The integral term accumulates error over time and eliminates steady-state error.
Output_I = Ki × ? Error dt
- Corrects bias and friction
- Removes steady offset
- Can cause slow oscillation
5) Derivative control (D)
The derivative term reacts to how fast the error is changing.
Output_D = Kd × d(Error)/dt
- Predicts future error
- Adds damping
- Reduces overshoot
6) How P, I, and D work together
| Term | Main Effect | Too Much Causes |
|---|---|---|
| P | Responsiveness | Oscillation |
| I | Accuracy | Slow instability |
| D | Damping | Noise amplification |
7) Stability, damping & oscillation
A stable system returns to the setpoint without oscillation.
- Underdamped: Oscillates
- Critically damped: Fast, no overshoot
- Overdamped: Slow but stable
8) Sampling rate & loop timing
PID calculations assume a fixed loop interval.
- Loop too slow ? instability
- Loop too fast ? noise dominance
- Variable timing ? unpredictable behavior
9) Practical PID tuning methods
Manual tuning (recommended)
- Set I = 0, D = 0
- Increase P until oscillation starts
- Back off P by ~20%
- Add I slowly to remove steady error
- Add D to reduce overshoot
Ziegler–Nichols (use with caution)
Fast but often aggressive. Good starting point, rarely final values.
10) Real-world non-idealities
- Friction and backlash
- Sensor noise
- Actuator limits
- Quantization (encoder resolution)
- Delays in power electronics
11) Common PID mistakes
- Cranking up I to fix everything
- Ignoring loop timing
- Tuning with no load
- Using D with noisy sensors
- No output limiting or anti-windup
12) Design rules for stable systems
- Fix mechanics first
- Ensure clean, stable power
- Limit control output
- Implement integral anti-windup
- Test under worst-case load