Disturbance Observer (DOB) Simulator Back
Control Systems Simulator

Disturbance Observer (DOB) Simulator — DOB+PI vs. PI Alone

Visualize how a disturbance observer estimates an input disturbance from the nominal model and a Q filter, then cancels it. Compare DOB+PI with PI alone and see the effect of the Q filter and model mismatch.

Parameters
True plant gain K_p
PI proportional gain K_c
DOB filter time constant tau_Q
s
Input disturbance d

Plant time constant T_p = 5 s, nominal model K_n = 2 / T_n = 5 s, PI integral time T_i = 5 s, sample time dt = 0.05 s, simulation time T_sim = 20 s. A setpoint step r = 1 is applied at t = 0 and a disturbance step d is applied at t = 10 s.

Results
PI alone peak deviation
DOB+PI peak deviation
Deviation reduction
Estimator settling (~4 tau_Q)
Output y(t), disturbance d(t) and d-hat(t), control input u(t)

Top = output y (red = PI alone, blue = DOB+PI, gray = setpoint r) / Middle = disturbance d (black) and DOB estimate d-hat (green) / Bottom = control input u (red = PI, blue = DOB+PI)

Theory & Key Formulas

For a first-order plant $G_p(s) = K_p/(T_p s + 1)$ subject to an input disturbance $d$, a DOB uses a nominal model $G_n(s) = K_n/(T_n s + 1)$ to estimate the disturbance.

Disturbance estimate (ideal form and Q-filtered form):

$$\hat{d}_{\text{raw}} = G_n^{-1}(s)\, y - u, \qquad \hat{d} = Q(s)\,\hat{d}_{\text{raw}}$$

$G_n^{-1}$ is improper, so the low-pass Q filter $Q(s) = 1/(\tau_Q s + 1)$ makes the implementation realizable.

Final control input (DOB+PI):

$$u = u_c - \hat{d}, \qquad u_c = K_c\, e + \frac{K_c}{T_i} \int e\, dt$$

Discrete update: $\hat{d}[k] = (1-\alpha)\,\hat{d}[k-1] + \alpha\,\hat{d}_{\text{raw}}[k]$, with $\alpha = dt/(\tau_Q + dt)$.

What is the Disturbance Observer (DOB) Simulator

🙋
A PI controller will eventually drive the disturbance error to zero on its own, right? Why bother adding something called a "disturbance observer"?
🎓
Roughly speaking, PI is a reactive scheme — it only acts after the output error appears. When a disturbance hits, the output deviates first, then the integral term slowly ramps up to push it back. Look at the "PI alone peak deviation" card with the default settings: about 0.5. That delay is unavoidable because PI has nothing to look at except the error itself.
🙋
Got it. So what does the DOB look at to act earlier?
🎓
It compares the actual output $y$ with what a nominal model $G_n(s)$ would have produced from the same input $u$. If the plant follows the model, the two match. If they differ, the DOB attributes the gap to an unknown input disturbance. Formally, $\hat{d} = Q(s)(G_n^{-1}(s)\,y - u)$. Inject $-\hat{d}$ at the input and the disturbance is cancelled almost as soon as it appears.
🙋
The "DOB+PI peak deviation" card shows about 0.09 — really, almost an order of magnitude smaller! But the effect drops when I increase tau_Q.
🎓
$Q(s) = 1/(\tau_Q s + 1)$ is a low-pass filter on the estimate. The bigger tau_Q is, the slower the estimator reacts and the longer the disturbance is allowed to act before being cancelled. Could you just push tau_Q to zero? In simulation yes, but on real hardware the Q filter passband would also amplify sensor noise and unmodeled high-order dynamics, leading to oscillation. The "speed vs. robustness" trade-off is the heart of Q filter design.
🙋
Even when I change the true gain K_p while the nominal K_n stays at 2, the DOB still works.
🎓
That is exactly the point. Sweep K_p from 1 to 5 and the DOB+PI peak is always smaller than PI alone. The DOB lumps any "model versus reality" gap into the equivalent disturbance and compensates it. That is why the DOB is the textbook example of robust control. Servo motor load torque compensation in machine tools and robots is built on exactly this idea.

Frequently Asked Questions

Both eliminate steady-state disturbance error, but the mechanism is different. Integral action accumulates the error in time, so the steady value goes to zero but the transient peak can be large. The DOB estimates the disturbance itself and cancels it directly, shrinking the peak deviation by nearly an order of magnitude. In practice the two are combined: PI handles steady-state tracking, the DOB handles disturbance rejection. They are complementary, not competitive.
The architecture is the same, but the order of $Q(s)$ must match the relative degree of $G_n^{-1}$. For an $n$-th order plant, use $Q(s) = 1/(\tau_Q s + 1)^n$ to make the inverse model proper. Higher order means more design parameters and more careful stability margin assessment. In digital implementations, derivative noise sensitivity becomes an issue, and DOBs are often combined with state-space observers or unknown disturbance estimators (UDE) for better noise behavior.
Yes. The classical destabilizers are (1) unmodeled high-order dynamics or time delays falling inside the Q filter passband, (2) non-minimum-phase plants (right-half-plane zeros), and (3) sensor noise driving the derivative term into oscillation. The simulator uses an idealized model so it stays stable even at tau_Q = 0.05, but on hardware the Q passband should typically be a third to a fifth of the plant bandwidth, and stability margins must always be verified on a bench.
It is widely deployed in hydraulic actuators (friction and leakage compensation), chemical processes (unmeasured disturbance compensation), automotive active vibration control, power converter load disturbance rejection, and UAV wind disturbance rejection. The common thread is "frequent unmodeled disturbances combined with a demand for fast response", where reactive PI control falls short. Recent work also combines DOBs with model predictive control and reinforcement learning.

Real-World Applications

Servo motor drives: The flagship application of the DOB is high-precision servo systems in machine tools, robots and semiconductor lithography stages. Load torque variation, friction and cogging torque are estimated from the encoder position and the nominal model, and cancelled. Tracking accuracy improves by an order of magnitude or more, which is why the DOB has become a standard building block for sub-micrometre machining and nanometre stage positioning.

Hard disk and optical disk head positioning: In a hard disk drive head servo, the DOB suppresses disk vibration, external shock and air-flow disturbances. Above the servo sample rate it provides disturbance rejection that linear PID cannot reach. The same idea drives focus and tracking servos in optical pickups.

Electric power steering (EPS) and motorized actuators: In automotive EPS, road reaction forces and steering shaft friction act as disturbances. The DOB estimates and compensates them so the driver feels a clean, natural steering torque. Collaborative robot joints use the same DOB-based external force estimation to detect contact with humans and enforce safety stops.

Process control and chemical plants: In reactors with hard-to-measure exothermic or feed-composition disturbances, the DOB augments PI control. It is common in temperature and concentration loops to absorb time-varying gains and time constants as equivalent disturbances. DOB designs are typically integrated into the IMC (internal model control) framework so that they remain compatible with classical PID tuning recipes.

Common Misconceptions and Cautions

The most common misconception is to assume that "if you have a DOB you can be sloppy with the PI tuning". The DOB handles disturbance rejection, but setpoint tracking and steady-state error elimination still belong to the PI loop, especially the integral action. Drop K_c to 0.1 in the simulator: even with the DOB enabled the rise is sluggish and settling takes longer. The DOB and PI are role-divided, not competing, and both must be designed properly.

The next pitfall is to think that smaller tau_Q is always better. In simulation tau_Q = 0.05 gives the smallest deviation, but on a real machine the Q filter passband would also amplify measurement noise and unmodeled dynamics, causing oscillation or chatter. A practical rule of thumb is to start with tau_Q at one tenth to one thirtieth of the dominant plant time constant (or two to three times the target servo bandwidth), then refine on a bench while observing both step responses and random disturbance responses.

Finally, remember that the DOB does not really know what the disturbance is. What it estimates is "the equivalent input disturbance as seen by the nominal model $G_n$", not the true physical load torque. Change the model gain or time constant and the estimated value changes too. When you set K_p $\ne$ K_n in the simulator, the d-hat trace deviates from the true d for exactly this reason. The goal is not "to identify the true disturbance" but "to produce an estimate that cancels the deviation effectively"; the DOB is a robust-control technique, nothing more and nothing less.