"매 error = setpoint - measurement 에 P/I/D 항을 적용해 actuator 를 제어". 1922 Minorsky ship steering 에서 시작, 매 산업 control 의 80%+ 사용. 매 2026 의 AI hybrid 사용: drone attitude (PX4), robot joint, LLM token-budget control, RLHF KL-coefficient tuning, training schedules.
매 핵심
매 PID 공식
u(t) = Kp·e(t) + Ki·∫e(τ)dτ + Kd·de/dt.
P (Proportional): 매 현재 error 에 비례 — 매 fast response, 매 steady-state error 남김.
I (Integral): 매 누적 error — 매 steady-state error 제거, 매 windup 위험.
D (Derivative): 매 변화율 — 매 overshoot 감소, 매 noise 증폭.
매 tuning methods
Ziegler-Nichols: 매 Ku, Tu (oscillation) 측정 후 공식 적용.
Cohen-Coon: 매 process reaction curve 기반.
AutoTuning: 매 relay feedback (Åström-Hägglund).
Bayesian optimization: 매 simulation rollout + GP.
RL-based: 매 PPO/SAC 으로 Kp, Ki, Kd 학습.
매 응용
Drone attitude (PX4, ArduPilot).
Robot joint position control (ROS 2).
Cruise control, HVAC, 3D printer extruder.
LLM serving — token-rate controller (vLLM 의 batch sizing).
RLHF KL-coefficient adaptive tuning.
Training: gradient norm clipping with adaptive coefficient.
classPIDAntiWindup(PID):def__init__(self,*args,kt=0.5,**kw):super().__init__(*args,**kw)self.kt=kt# back-calc gaindef__call__(self,setpoint,measurement):error=setpoint-measurementderivative=(error-self.prev_error)/self.dtu_unsat=self.kp*error+self.ki*self.integral+self.kd*derivativeu_sat=max(self.lo,min(self.hi,u_unsat))# back-calculation: discount integral when saturatedself.integral+=self.dt*(error+self.kt*(u_sat-u_unsat))self.prev_error=errorreturnu_sat
Derivative on measurement (D-kick 회피)
classPIDDerivOnMeas(PID):def__init__(self,*args,**kw):super().__init__(*args,**kw)self.prev_meas=Nonedef__call__(self,setpoint,measurement):error=setpoint-measurementifself.prev_measisNone:d=0else:d=-(measurement-self.prev_meas)/self.dt# 매 setpoint step → spike 없음self.integral+=error*self.dtout=self.kp*error+self.ki*self.integral+self.kd*dself.prev_meas=measurementreturnmax(self.lo,min(self.hi,out))
defadaptive_kl_pid(kl_observed,kl_target=0.02,state=None):"""β ↑ when KL too large; β ↓ when too small. PI controller on log(β)."""ifstateisNone:state={"integral":0.0,"log_beta":0.0}error=kl_observed-kl_targetstate["integral"]+=errorstate["log_beta"]+=0.1*error+0.01*state["integral"]returnfloat(np.exp(state["log_beta"])),state
LLM token-rate controller (server batch)
defbatch_size_pid(target_tps,current_tps,pid_state):"""Maintain target tokens/sec by adjusting batch size."""delta=target_tps-current_tpspid_state["integral"]+=deltaadj=0.05*delta+0.001*pid_state["integral"]returnmax(1,int(pid_state["batch"]+adj))
언제: 매 inference server batch sizing, 매 RLHF KL coefficient, 매 lr schedule under loss target.
언제 X: 매 highly nonlinear delays — MPC. 매 strong constraints — RL/MPC.
❌ 안티패턴
No anti-windup with saturation: 매 integral 폭주 → overshoot.
D term on noisy raw signal: 매 noise 증폭 → 매 LPF (low-pass filter) 필수.
Derivative on setpoint (D-kick): 매 setpoint step → spike. 매 D-on-measurement 사용.
One-size-fits-all gains across operating regions: 매 nonlinear 시스템 — gain scheduling 필요.
Tuning by 임의 가이드: 매 system 마다 다름 — Ziegler-Nichols 또는 simulation 사용.
🧪 검증 / 중복
Verified (Åström & Hägglund, PID Controllers; Franklin et al. Feedback Control of Dynamic Systems; ArduPilot/PX4 firmware).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — PID FULL with anti-windup, D-on-meas, RLHF/serving applications