One robot joint under P / PD / PID control: experiment bench
One robot joint under P / PD / PID control
A single joint with inertia, viscous damping, a torque limit and an optional load, stepped to a new angle by a PID controller.
- 1. Ask
- 2. Hypothesise
- 3. Set up
- 4. Run
- 5. Record
- 6. Change one variable
- 7. Compare
- 8. Interpret
- 9. Limitations & save
If I change …, then … will …, because …
3 · Set up the parameters
Integral action removes steady-state error under load.
2 more controls appear at higher levels; until then they stay at the default value.
The seed fixes any random noise. Same parameters + same seed = exactly the same result, every time, on every computer.
6 · Change one variable
Your first run is the baseline. After it, change one thing at a time.
7 · Compare on a graph
5 · Run log
No runs yet.
Equations
The controller pushes harder the further the joint is from the target.
Assumptions (always true in this model)
- One decoupled joint: no gravity coupling to other links.
- Ideal motor: delivers any torque within ±τ_max instantly.
- Viscous damping only (no stiction or Coulomb friction).
- Ideal angle and speed sensing; controller sampled every 1 ms with zero-order hold, plant integrated with RK4.
- Derivative on measurement (no kick on the step); conditional anti-windup on the integral.
Text description of what the chart shows
A single robot joint stepping from 0 to the target angle. The first plot shows the joint angle over time, rising and possibly overshooting before settling; the second shows the motor torque, which may sit at its limit early in the move. Metrics give overshoot, settling time, steady-state error and peak torque.
Did the result support your hypothesis? Use the numbers from the comparison table and link them to an equation.
Which assumptions could change your answer in the real world?
Export and save
Exports use the ticked runs (or every run if none are ticked). Your draft saves automatically in this browser only. The Journal is private to you.
Valid parameter ranges
| Parameter | Range | Default |
|---|---|---|
| Inertia I | 0.005 to 0.5 kg·m² | 0.05 |
| Damping b | 0 to 2 N·m·s/rad | 0.1 |
| Kp | 0 to 20 N·m/rad | 2 |
| Ki | 0 to 20 N·m/(rad·s) | 0 |
| Kd | 0 to 3 N·m·s/rad | 0.3 |
| Torque limit (0 = none) | 0 to 10 N·m | 2 |
| Load torque | -2 to 2 N·m | 0 |
| Step target | 0.1 to 3 rad | 1 |
| Duration | 1 to 10 s | 4 |
Independent reference checks
underdamped PD, no limit
Closed-form second-order step: ζ = 0.2/(2√0.1) = 0.316, ωₙ = √40; overshoot exp(−πζ/√(1−ζ²)) = 35.09 %, tₚ = π/(ωₙ√(1−ζ²)) = 0.5236 s.
P control under load
Static balance Kp·e = τ_load ⇒ e = 0.5/4 = 0.125 rad.
PID removes load error
Final-value theorem: with integral action the steady-state error to a constant load is zero.
Checked automatically on every change to the code. Educational model, not engineering-grade.