Control Lab
같은 플랜트, 같은 센서 노이즈 위에서 두 개의 이산 PID(A, B)가 동시에 돌아갑니다. 플랜트는 RK4로 적분하는 비선형 모델이고, 제어기는 실제 구현처럼 샘플링·포화·안티와인드업·미분 필터를 갖습니다. 게인을 움직이면 스텝·외란 응답 지표와 함께 이산 루프의 Bode·Nyquist·폐루프 극점이 즉시 바뀝니다. 와인드업, 미분 킥, 센서 지연, 튜닝 규칙 차이를 프리셋으로 재현하고, 게인 맵에서 IAE가 가장 작은 지점을 찾아보세요.
| Metric | A | B | A vs B |
|---|---|---|---|
| Rise time 10–90 % tr | — | — | — |
| Overshoot Mp | — | — | — |
| Settling time ts | — | — | — |
| IAE · step ∫|e|dt | — | — | — |
| ITAE · step ∫t|e|dt | — | — | — |
| Disturbance peak |e|max | — | — | — |
| Disturbance recovery trec | — | — | — |
| IAE · disturbance ∫|e|dt | — | — | — |
| Control RMS urms | — | — | — |
| Control activity Σ|Δu|/T | — | — | — |
| Saturated samples share | — | — | — |
Metrics use the true output, not the noisy measurement.
Full nonlinear runs of this scenario, with the edited controller's Kd, N, b and anti-windup. Click a cell to load its gains. Hatched: the run failed.
L di/dt = V − R i − Ke ω
J dω/dt = Kt i − b ω − τc tanh(ω/ωs) − τL
R = 1 Ω, L = 1.5 mH, Kt = Ke = 0.06, J = Jm(1 + JL/Jm), Jm = 10−4 kg·m², Coulomb friction 8 mN·m, |V| ≤ 24 V. Electrical (τe = L/R) and mechanical poles both appear in the loop.
m v̇ = min(F, Pmax/v) − ½ρCdA v² − Crr m g − m g sin θg
τ Ḟ = Fcmd − F
½ρCdA = 0.39 kg/m, Crr = 0.012, Pmax = 110 kW, powertrain lag τ = 0.5 s, −8 kN ≤ Fcmd ≤ 5 kN. Aerodynamic drag makes the linear model depend on the operating speed.
(M+m) ẍ − m l cos θ θ̈ + m l sin θ θ̇² = F − b ẋ
(I + m l²) θ̈ − m l cos θ ẍ − m g l sin θ = −c θ̇ + τd
M = 0.6 kg, m = 0.25 kg uniform rod (I = m l²/3), belt drive lag 20 ms, |F| ≤ 15 N. One open-loop pole sits in the right half plane. The loop sees only θ, so cart position is left free; it shows up as a slow drift mode.
m z̈ = kT ω² − m g − c1 ż − c2 ż|ż| − Fd
τm ω̇ = √(Tcmd/kT) − ω
Four rotors lumped, τm = 60 ms, 0 ≤ Tcmd ≤ 24 N, hover feedforward m0g with m0 = 1.2 kg: any other take-off mass is a load the integrator has to find. Ground contact; landing faster than 2.2 m/s is a crash.
vk = uff + Kp(b rk − yk) + Ik + Dk, uk = sat(vk)
Dk = [Tf Dk−1 + Kd Δ(c r − y)k] / (Tf + Ts), c ∈ {0, 1}
Ik+1 = Ik + KiTsek + (Ts/Tt)(uk − vk)
The back-calculation term is shown; Clamp instead stops integrating while the error drives further into saturation. The measurement is y(tk − ndTs) + σνk, with the same noise sequence for A and B. The input is held between samples (ZOH) while RK4 integrates the plant.
GZOH(z) = C(zI − Φ)−1Γ, Φ = eATs
Ms = maxω |1 / (1 + L(ejωTs))|
Ku ≈ 4d / (π√(a² − ε²))
(A, B, C) is the numerical Jacobian of the nonlinear plant at the operating point. Margins are read on the unit circle up to the Nyquist frequency π/Ts; poles are the roots of zndDcDg + NcNg, drawn as s = ln z / Ts. The relay test runs on the nonlinear plant, so its describing-function estimate can differ from the model's ultimate point.
시뮬레이션과 해석이 같은 루프를 봅니다
DC 모터는 전기·기계 두 개의 극점과 쿨롱 마찰을, 차량은 공기저항·구름저항·출력 한계(110 kW)·파워트레인 지연을, 카트-폴은 완전한 비선형 운동방정식과 벨트 구동 지연을, 쿼드로터는 회전수-추력의 제곱 관계와 모터 지연, 지면 접촉을 포함합니다. 해석 패널은 이 비선형 모델을 운전점에서 수치적으로 선형화한 뒤 행렬 지수함수로 ZOH 이산화하고, 시뮬레이션 코드와 똑같은 이산 PID 전달함수와 지연을 곱해 L(z)를 만듭니다. 그래서 위상 여유가 0이 되는 지연과 실제 발진이 시작되는 지연이 일치합니다.
단순화한 부분
여유·극점은 운전점 근처의 선형 모델에서 계산하므로 포화, 큰 진폭, 노이즈의 영향은 담지 않습니다. 샘플 사이의 거동(에일리어싱)도 보지 않습니다. 카트-폴은 각도만 되먹임하므로 카트 위치는 잡지 못하고, 느린 드리프트 모드로 따로 표시합니다. 실제로 레일 위에 세우려면 상태 되먹임이나 캐스케이드 루프가 필요합니다. 릴레이 테스트는 비선형 플랜트에서 기술함수 근사로 Ku를 추정하므로 모델 값과 다를 수 있고, 두 값을 나란히 보여줍니다. 파라미터는 실제 부품 수준의 값이지만 특정 제품을 식별한 모델은 아닙니다.