Goal: Create angle command controller with zero overshoot + robustness and disturbance resistance
Plant: Rigid axis with damping (viscous, against applied torque)
Parameters: I=0.05 kg·m², b=0.002 N·m·s. Actuator max: max_tau
Controller
- PD tune for near-critical damping, next add a small integral gain to reject bias
- Preset gains used in figures:
Kp=2.4, Kd=1.35, Ki=0(PD controller) - Disturbance demo presets:
Ki=0.03with anti-windup (back-calculation)
Tuning method I used: construct closed loop using dynamics + control eqns, match to second-order target, solve for gains.
Dynamics:
Control:
Closed loop (PD)
Match to second-order target (approx. critical damping,
So gains are:
I picked
Note d/dt(
- Open
attitude_pd.slx - Edit Model Workspace parameters:
My values: I=0.05, b=0.002, Kp=2.4, Kd=1.35, Ki=0, theta_step=deg2rad(30), max_tau=0.02 - Run
- Robustness check: Set
Ito desired values (I chose 0.045, 0.055) and rerun - Disturbance check: connect
tau_dist(disturbance torque) step at desired time and value (e.g.0.018 N·m, t = 4 s)
Note: use either the internal output limiter or external saturation block (not both). Limits: ±max_tau
- Without disturbance torque, a PD controller works well (0 overshoot, Ki = 0)
- With disturbance torque, select nonzero Ki (PID), and enable back calculation anti windup for no overshoot
- Block setup:

- Theta vs. commanded theta:

- Commanded torque:
. - Robustness (±10% moment of inertia):
. - Disturbance Torque Applied: PD (notice offset) and PID+AW (no more offset):

Tested with Simulink R2025A
License: MIT