Two-Degree-of-Freedom Control Simulator Back
Control Engineering Simulator

Two-Degree-of-Freedom Control — Independent Setpoint and Disturbance Design

Tune PI feedback and a reference pre-filter independently. Compare against the classic 1-DoF response to see how feedforward shaping kills overshoot without weakening disturbance rejection.

Parameters
PI proportional gain K_c
PI integral time T_i
s
Pre-filter time constant τ_F
s
PID derivative gain K_d
Disturbance step d

Process: K_p=2, T_p=5 s. A reference step r=1 is applied at t=0, and a disturbance step d at t=15 s. Setting τ_F=0 reduces to the 1-DoF case.

Results
1-DoF overshoot
2-DoF overshoot
Setpoint settling time
Peak disturbance deviation
Live readouts (during playback)
0.00
time t [s]
1.00
setpoint r
0.00
1-DoF output y
0.00
2-DoF output y
0.00
2-DoF tracking error e
Real-time response animation

Top = output y(t) (red = 1-DoF, blue = 2-DoF, grey dashed = reference r, thin orange = 2-DoF shaped reference r_eff) / Bottom = control input u(t) / vertical dotted line = disturbance at t=15 s / white vertical cursor = current time

30.00 s
1-DoF y(t) 2-DoF y(t) reference r shaped r_eff
Theory & Key Formulas

A 2-DoF control structure designs setpoint and disturbance responses with separate transfer functions. With process $G_p(s) = K_p/(T_p s + 1)$, a PI controller $C(s) = K_c(1 + 1/(T_i s))$ and a pre-filter $F(s)$ are designed independently.

Setpoint response (r to y):

$$T(s) = \frac{F(s)\,C(s)\,G_p(s)}{1 + C(s)\,G_p(s)}$$

Disturbance response (d to y):

$$S_d(s) = \frac{G_p(s)}{1 + C(s)\,G_p(s)}$$

In this simulator the pre-filter is a first-order lag:

$$F(s) = \frac{1}{\tau_F\,s + 1}$$

Because $F$ does not appear in the disturbance response $S_d$, $\tau_F$ shapes only the setpoint side. That is the essence of 2-DoF design. With the 1-DoF case ($F=1$), strengthening $C$ improves disturbance rejection but introduces setpoint overshoot.

What is the 2-DoF Control Simulator

🙋
When I tune a PI loop for setpoint tracking, I always end up trapped: low gain means lazy disturbance rejection, but high gain means setpoint overshoot. Is there a way out of that trade-off?
🎓
That dilemma is the fundamental limit of 1-DoF control. Strengthening the feedback gain $C$ does shrink the disturbance response $G_p/(1+CG_p)$, but the setpoint response $CG_p/(1+CG_p)$ shares the same denominator, so you push the closed-loop poles too fast and overshoot. A single controller $C$ cannot optimize both at once. Try setting τ_F=0 in the simulator above and crank up K_c — the red 1-DoF curve shoots way past the target.
🙋
So that is where 2-DoF comes in. What is actually different?
🎓
Roughly speaking, you just insert a "shaping filter" $F$ in front of the reference. The feedback loop is unchanged — so the disturbance response $G_p/(1+CG_p)$ stays the same. But the setpoint response becomes $F\cdot CG_p/(1+CG_p)$, so a first-order lag for $F$ softens the rise and kills the overshoot. With τ_F=2 in the simulator, the blue 2-DoF curve glides smoothly into the setpoint.
🙋
Yes, I see it. But after the disturbance hits at t=15 s, both the red and blue curves react in exactly the same way.
🎓
Exactly — that is the killer feature of 2-DoF. The disturbance response depends only on $C$, so changing $F$ does nothing to it. You can therefore split the work: push $C$ aggressive for disturbance rejection, then shape the setpoint response separately with $F$. In a real plant, a typical use is in temperature control: kill the brutal overshoot at every setpoint change while keeping fast tracking when the ambient drifts.
🙋
If I crank τ_F up, the rise gets slower and slower. Is there a downside to overdoing it?
🎓
Definitely. Set τ_F to infinity and the overshoot is theoretically zero, but the system takes minutes to climb to the setpoint. In practice, start at 0.5 to 2 times the process time constant T_p and trade off rise time against acceptable overshoot. Watch the "settling time" card while you sweep τ_F — you can grow τ_F by 30% with barely any settling-time penalty, but past some point it suddenly turns sluggish.

Frequently Asked Questions

Yes — most modern commercial PID controllers offer a "2-DoF PID" mode. The classic implementation is "weighted PID", where the proportional term is weighted by β and the derivative term by γ for the setpoint. β=γ=1 reduces to classical 1-DoF PID, while β=γ=0 fully removes the proportional and derivative kicks. Yokogawa, Honeywell and ABB DCS systems all ship this as a standard feature.
A pre-filter F shapes the reference signal r and reaches the input u only indirectly through C. Feedforward compensation, in contrast, adds a measurable disturbance d_meas directly to u so the loop reacts pre-emptively before the disturbance affects the output. They are complementary: F for setpoint shaping, feedforward for known disturbances, and the C feedback loop for unknown disturbances — a three-layer stack that is the modern standard.
Yes, but it works best with a Smith predictor or model predictive control (MPC). Large dead time L makes pure PI feedback prone to instability and limits how high K_c can go. A Smith predictor compensates the dead time, and on top of that you can build a 2-DoF structure that independently designs setpoint and disturbance responses. This combination is standard in chemical-plant composition control.
Yes — designs that specify the desired closed-loop transfer T_des(s) directly are well known. Solving $F = T_\text{des}(1+CG_p)/(CG_p)$ lets you target Bessel, Butterworth or any other shape. The catch is that F can become high-order, and its zeros may try to cancel non-minimum-phase plant zeros, which causes trouble. The first-order lag in this simulator is an intentionally simple compromise.

Real-World Applications

Process-industry temperature and flow control: Continuous chemical and steel plants frequently change setpoints while constantly absorbing disturbances such as feed-temperature drift and ambient changes. A 2-DoF PID kills the dramatic overshoot at every grade change (which would create off-spec product) while preserving aggressive disturbance rejection. Yokogawa CENTUM and similar DCS systems ship "I-PD" and "PI-D" variants as built-in options.

Servo positioning: Machine tools, semiconductor steppers and robotic arms must reach a target position quickly while rejecting cutting forces and other disturbances. The standard recipe is a 2-DoF servo: feedforward injects acceleration and velocity profiles for the reference, while feedback rejects residuals and disturbances. Higher-order shaping filters are added to suppress jerk and resonant modes.

Automotive cruise control and ADAS: Setpoint changes must feel smooth to passengers (gentle acceleration), while road-grade changes need quick correction. The 2-DoF structure delivers both: a pre-filter limits the rate of the target speed, and a PI feedback loop handles deviations from grade and rolling resistance. Adaptive cruise control (ACC) extends this to a three-layer scheme by adding radar-based feedforward.

HVAC and building control: In large air-conditioning systems, chiller-outlet temperature and VAV flow control suffer overshoot at mode transitions, hurting both comfort and energy use. A 2-DoF PID makes setpoint changes ride a soft ramp while feedback handles outdoor-temperature and load disturbances, helping to balance energy savings against comfort.

Common Misconceptions and Cautions

The most common misconception is to think that "with 2-DoF, you can crank feedback gain to infinity". The pre-filter F only shapes the setpoint response, so yes, setpoint overshoot can be eliminated. But stability itself is determined by the closed-loop characteristic equation $1+CG_p=0$, which is independent of F. Push K_c too high and the setpoint response may be clean while the disturbance and noise responses oscillate, or worse, the loop becomes unstable. Set K_c=10 in the simulator and you can see the disturbance response (t>15s) start to ring. F is not a stability fix — it is purely a shaping tool.

Next, raising the order of F too aggressively complicates implementation. In theory, any desired response T_des can be matched by a high-order F, but high-order filters are sensitive to discretization error and computational delay, and demand careful sampling-rate selection. In practice a first- or second-order lag is usually enough, which is why this simulator sticks to a single first-order filter. The pragmatic rule is: get 70% of the benefit from a simple filter and tune the rest — that is the field-engineer way.

Finally, choosing τ_F without considering how often the setpoint changes causes operational problems. Setting τ_F to three times T_p gives the cleanest response, but if the setpoint changes every 30 s, the filter output never reaches steady state before the next change, and the loop never tracks. In real plants you choose τ_F so that the "minimum setpoint-change interval" and the "filter settling time" are compatible. Imagine running this simulator with τ_F=10 s while changing the setpoint every few seconds — the rise is so slow the loop is useless. Always design for the operating scenario as well.

How to Use

  1. Set proportional gain Kc (range 0.5–5.0) and integral time Ti (0.1–10 s) for the feedback PI controller using slKc and slTi sliders.
  2. Adjust the reference pre-filter time constant TauF (0.05–2.0 s) via slTauF to shape setpoint response independently of disturbance rejection.
  3. Apply a step disturbance magnitude (0–2.0 units) with slDStep and compare 1-DoF overshoot versus 2-DoF overshoot metrics in real time.
  4. Observe settling time and peak deviation; iterate Kc/Ti for load rejection while TauF smooths reference tracking without sacrificing robustness.

Worked Example

Using this tool's plant (K_p=2, T_p=5 s) with the default "2-DoF (tracking + rejection)" preset (Kc=3, Ti=2 s, τ_F=2 s, disturbance step d=1): the 1-DoF design (τ_F=0, same C) overshoots the setpoint by about 8.9%, whereas the 2-DoF design keeps the identical feedback gains but cuts the overshoot to about 0.1%, with a ±5% setpoint settling time of about 5.1 s. The disturbance response (applied at t=15 s) does not depend on τ_F — it is fixed by C alone — so the peak deviation is about +0.20 for both 1-DoF and 2-DoF. That is the decoupling: feedback (disturbance rejection) and pre-filter (tracking shaping) are designed independently. You can confirm it visually: as the animation cursor crosses t=15 s, the red (1-DoF) and blue (2-DoF) traces overlap exactly.

Practical Notes

  1. Increase TauF (e.g., 1.5–2.0 s) for slow setpoint ramps in pharmaceutical batch processes to eliminate aggressive integral windup during mode transitions.
  2. Keep Kc moderate (1.0–2.0) in systems with dead time >0.5 s; excess gain in 1-DoF causes ringing; 2-DoF pre-filter decouples feedback aggressiveness from setpoint smoothness.
  3. Tune Ti first for disturbance rejection, then adjust TauF to meet overshoot constraint; reverse tuning often introduces instability in nonlinear regions.
  4. Monitor peak disturbance deviation for valve saturation risk; if >1.5 units on a ±10 V output, reduce Kc incrementally rather than raising Ti.