Skip to content
Tactiverge

Section 07 of 10 · 17 entries

Control systems

Feedback, PID, response shapes and sampling: how a machine follows a target despite the real world.

Entries in Control systems

  1. Closed-loop (feedback) controlClosed-loop control measures the output, compares it with the target and adjusts the command to shrink the difference, over and over.e = r − yinteractive demo
  2. Damping ratioThe damping ratio ζ describes how quickly oscillations die out in a second-order system: below 1 it oscillates, exactly 1 is critically damped, above 1 it creeps to the target without overshoot.m x″ + c x′ + k x = F
  3. Derivative actionDerivative action adds a term proportional to how fast the error (or measurement) is changing, braking the response before it overshoots.D = Kd × de/dtinteractive demo
  4. FeedforwardFeedforward adds a command computed from a model of what the system will need, before any error appears; feedback then corrects whatever the model got wrong.u = u_ff + u_fb
  5. First-order system and time constantA first-order system responds to a step by approaching its new value exponentially; its time constant τ is the time to cover 63.2 % of the change.τ dy/dt + y = K uinteractive demo
  6. Integral actionIntegral action adds a term proportional to the error accumulated over time, so any persistent error keeps growing the command until the error is gone.I = Ki × ∫ e dtinteractive demo
  7. Integrator windupWindup happens when the actuator is saturated but the integral term keeps growing; once the error reverses, the oversized integral causes a large overshoot while it unwinds.if |u| ≥ u_max: freeze integral (conditional integration)interactive demo
  8. Low-pass filter (moving average and EMA)A low-pass filter lets slow changes through and attenuates fast ones. In firmware the simplest are the moving average and the exponential moving average.moving average: y = (x_k + … + x_(k−N+1)) / N
  9. On–off control with hysteresisOn–off control switches the actuator fully on or off; hysteresis uses two thresholds, one to switch on and a different one to switch off, so the output does not chatter around a single value.if y < r − h/2: on
  10. Open-loop controlOpen-loop control sends commands without measuring the result: 'run the motor at 60 % for 2 seconds' and hope it went far enough.output = plant(command) — the command never sees the output
  11. OvershootOvershoot is how far a response goes past its final value, usually given as a percentage of the step size.%OS = (y_peak − y_final) / (y_final − y_initial) × 100interactive demo
  12. PID controllerA PID controller adds proportional, integral and derivative actions: present error, accumulated past error and predicted future error.u = Kp e + Ki ∫ e dt + Kd de/dtinteractive demo
  13. Proportional controlA proportional controller sets the command to a gain times the error: u = Kp × e. Bigger errors get bigger corrections.u = Kp × einteractive demo
  14. Sampling and aliasingSampling measures a signal at regular intervals. Any frequency above half the sample rate, the Nyquist frequency, is indistinguishable from a lower 'alias' frequency.f_Nyquist = f_s / 2interactive demo
  15. Setpoint and errorThe setpoint (or reference) is the value you want; the error is the setpoint minus the measured value. Controllers act on the error.e(t) = r(t) − y(t)
  16. Settling time and rise timeSettling time is how long a response takes to enter and stay within a band, often 2 %, of its final value. Rise time is how long it takes to go from 10 % to 90 % of the step.second-order, 2 % band: t_s ≈ 4 / (ζ ω_n)interactive demo
  17. Steady-state errorSteady-state error is the error that remains after the response has settled and stopped changing.e_ss = r − y(∞)interactive demo