Skip to content
Tech Interview Prep
Technical interview guide

Control Systems & PID

The feedback loop that keeps a robot at a target state: proportional, integral, and derivative control, and why all three matter.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: Current MathWorks, NI, Rockwell Automation, Arduino PID, python-control, SciPy, NIST SP 800-82 Rev. 3, IEC functional-safety, and OSHA guidance reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Control Systems & PID

In one line

PID is a feedback loop that compares a setpoint with a measurement and drives an actuator to close the gap. Reach for it when a plant must hold a target against disturbances and model error, and first check that dead time, actuator saturation and sensor quality let a PID structure work.

Key definitions

  • Error: setpoint minus measurement, the signal all three terms act on.
  • Proportional (P): output proportional to current error. Reduces error but leaves offset under sustained load on a process with no integrating action.
  • Integral (I): output proportional to accumulated error. Removes persistent offset, at the cost of phase lag and windup risk.
  • Derivative (D): output proportional to rate of change of the measurement. Adds damping, amplifies sensor noise unless filtered.
  • Windup: integrator growth while the actuator is saturated, followed by overshoot after the error reverses.
  • Bumpless transfer: switching between auto and manual without an output jump, by initializing the integral state to the actual output.

Formulas and complexity

Parallel form:

u(t)=Kp e(t)+Ki∫0te(τ) dτ+Kddedtu(t)=K_p\,e(t)+K_i\int_0^t e(\tau)\,d\tau+K_d\frac{de}{dt}

With K_d = K_c T_d, an unfiltered derivative acting on sinusoidal measurement noise of amplitude A at angular frequency \omega adds a peak of about K_d \omega A to the output.

Hypothetical worked example: K_c = 1, T_d = 3 s, so K_d = 3 s. A 15 Hz ripple of 0.2 % of span gives a peak derivative contribution of about 3 \times 2\pi \times 15 \times 0.2 \approx 57 output percent, before any filtering.

With a derivative filter set at N times the derivative time, the high-frequency gain of the D term is capped at about K_c N. State N in the tuning record.

The integral term accumulates: a constant error e held for time t adds K_i e t to the output.

How it works

Each scan the controller reads the measurement, forms the error, computes P, I and D, sums them, applies output limits and a rate limit, and writes the actuator. The integrator and derivative state carry history between scans, which is where windup, derivative kick and timing errors come from.

Setpoint Error P term I term Measurement D term on measurement Sum Output limits and rate limit Actuator Process

When to use and when not to

SituationUse PIDConsider alternatives
Single loop, dead time small against the dominant time constantYesNo
Dead time large (rule of thumb: a fifth of the dominant time constant or more)Only with a delay compensation schemeSmith predictor or model-predictive control
Several interacting inputs with hard constraintsNo, as the only structureMultivariable or model-predictive control
Large nonlinear operating rangePer operating regionGain scheduling with bumpless interpolation
Very noisy sensorLow or no D, filtered DFilter the measurement first
Discrete sequencing (start, stop, batch steps)NoState machine, not a controller

Traps interviewers probe

  • Expecting P to remove offset. P shrinks error as gain rises until the loop becomes unstable, but under sustained load it leaves offset. Fix: add I, sized from the observed settling time.
  • Integrating while saturated. The integrator winds up and overshoots long after the disturbance has gone. Fix: clamp the integrator, integrate conditionally, or use back-calculation, and say which direction integration is allowed.
  • Derivative on error causing a kick. A setpoint step produces a spike in output. Fix: apply D to the measurement and low-pass filter it.
  • Cutting gain to fix overshoot after a setpoint change. This also slows disturbance recovery. Fix: a setpoint prefilter or two-degree-of-freedom weighting changes the setpoint response and leaves the feedback gains alone.
  • Unit mismatch between tuning table and firmware. Integral gain per second and reset time in minutes differ by a factor of sixty. Fix: write the units down and check them against the code.

Interview tips

Open by naming the loop, not the gains: the setpoint, the measurement, the actuator, and what P, I and D each correct. Then name the failure you are addressing.

Expected follow-ups:

  • Overshoot after a large step: windup or too much I, then the anti-windup scheme.
  • Actuator chatter at steady state: D amplifying noise, then filter D or move it to the measurement.
  • Less overshoot without slower load response: prefilter, 2-DOF weighting or feedforward.
  • Sign and direction commissioning: test at low energy with limits and protective functions active.
  • Mode transfer: bumpless initialization of the integral state to the actual output.
  • What you would log: setpoint, measurement, error, P, I and D, output before and after limits, mode, gains and version, timing, saturation and sensor quality.

30-second answer outline: the loop and its three terms in one sentence; the failure each term addresses; the measurement that identifies the problem; the standard fix; the validation you would run (rise time, overshoot, settling time, steady-state error across operating points).

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.