[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,116 +2,177 @@
|
||||
id: wiki-2026-0508-control-systems-engineering
|
||||
title: Control Systems Engineering
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: []
|
||||
aliases: [control-systems, feedback-control, PID-control]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.92
|
||||
tags: [auto-consolidated, technical-documentation]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [control-systems, pid, mpc, feedback]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-08
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: python
|
||||
framework: do-mpc/control
|
||||
---
|
||||
|
||||
# Control[[_system|system]]s Engineering (제어 시스템 공학)
|
||||
# Control Systems Engineering
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "원하는 목표 상태에 도달하도록 시스템을 설계하고 동적으로 수정하라" — 물리적 장치나 가상 에이전트가 외부 교란([[Noise|Noise]])에도 불구하고 목표 수치(Set-point)를 안정적으로 유지하게 만드는 공학적 프레임워크.
|
||||
## 매 한 줄
|
||||
> **"매 control 의 매 measure → compare → actuate 의 closed loop"**. 매 PID (1922 Minorsky) 가 매 95% industrial loops, 매 MPC (Model Predictive Control) 가 매 multivariable + constrained problems 의 dominant. 2026 의 매 RL-augmented control + neural ODEs 가 매 emerging — 매 Boston Dynamics, Tesla Autopilot, NVIDIA GR00T 가 hybrid.
|
||||
|
||||
---
|
||||
## 매 핵심
|
||||
|
||||
> "의도한 대로의 상태 유지: 복잡한 외부의 방해 속에서도, 시스템의 현재 상태를 목표치(Set-point)로 일정하게 유지하거나 정확한 경로로 유도하기 위해 끊임없이 '수정 명령'을 내리는 기술적 중추."
|
||||
### 매 building blocks
|
||||
- **Plant** — 매 controlled system (motor, reactor, drone).
|
||||
- **Sensor** — 매 measurement (encoder, IMU, thermocouple).
|
||||
- **Controller** — 매 algorithm (PID, MPC, LQR).
|
||||
- **Actuator** — 매 output (PWM, valve, voltage).
|
||||
- **Reference / setpoint** — 매 desired state.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **추출된 패턴:** 시스템의 출력을 입력으로 다시 되먹여(Feedback) 오차를 줄여나가는 '폐쇄 루프 제어(Closed-loop Control)' 패턴.
|
||||
- **세부 내용:**
|
||||
- **Open-loop vs Closed-loop:** 피드백 존재 여부에 따라 단순 명령 실행과 상태 기반 자동 수정을 구분.
|
||||
- **PID Control:** 비례(P), 적분(I), 미분(D) 항을 조합하여 오차를 빠르고 안정적으로 수렴시키는 범용 알고리즘.
|
||||
- **Stability [[Analysis|Analysis]]:** 시스템이 발산하지 않고 평형 상태를 유지할 수 있는지 수학적으로 검증.
|
||||
- **[[State-Space|State-Space]] Representation:** 복잡한 시스템의 상태를 행렬로 표현하여 다변수 제어를 가능하게 함.
|
||||
### 매 stability
|
||||
- **Open-loop**: 매 simple, 매 no feedback — 매 disturbance 에 fragile.
|
||||
- **Closed-loop**: 매 feedback — 매 disturbance reject + setpoint track.
|
||||
- **Stability criteria**: Routh-Hurwitz, Nyquist, Bode (gain margin > 6 dB, phase margin > 45°).
|
||||
|
||||
---
|
||||
### 매 controller spectrum
|
||||
1. **Bang-bang** — 매 thermostat.
|
||||
2. **PID** — 매 95% loops.
|
||||
3. **State-space (LQR / pole placement)** — MIMO linear.
|
||||
4. **MPC** — 매 constrained, predictive.
|
||||
5. **Adaptive / gain scheduling** — 매 nonlinear plants.
|
||||
6. **RL / learned policy** — 매 high-dim, 매 simulation 의 train.
|
||||
7. **Robust H∞** — 매 worst-case guarantees.
|
||||
|
||||
제어 시스템 공학(Control-Systems-Engineering)은 동적 시스템의 거동을 제어하고 원하는 동작을 이끌어내기 위한 공학적 원리와 분석 방법을 다룹니다.
|
||||
## 💻 패턴
|
||||
|
||||
1. **핵심 구조 (Feedback Loop)**:
|
||||
* **Sensor**: 현재 상태(Output) 측정.
|
||||
* **Comparator**: 목표값과 현재값의 차이(Error) 계산.
|
||||
* **Controller**: 오차를 줄이기 위한 제어값 계산 (예: PID 제어).
|
||||
* **Actuator**: 시스템에 물리적/논리적 변화 가함.
|
||||
2. **왜 중요한가?**:
|
||||
* 자율주행차의 조향부터 원자로의 온도 조절, 로봇의 균형 잡기까지 현대 문명의 모든 '자동화'가 이 이론 위에 서 있기 때문임. (Automation와 연결)
|
||||
### Discrete PID with anti-windup
|
||||
```python
|
||||
class PID:
|
||||
def __init__(self, kp, ki, kd, dt, u_min, u_max):
|
||||
self.kp, self.ki, self.kd, self.dt = kp, ki, kd, dt
|
||||
self.u_min, self.u_max = u_min, u_max
|
||||
self.i, self.prev_e = 0.0, 0.0
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 전통적인 고전 제어(루프 베이스)에서 현대의 AI 기반 지능형 제어(강화학습 베이스)로 패러다임이 융합되고 있음.
|
||||
- **정책 변화:** Antigravity 에이전트의 '목표 추적 루프' 설계 시, PID 제어의 감쇠(Damping) 원리를 적용하여 급격한 상태 변화를 억제함.
|
||||
|
||||
---
|
||||
|
||||
- **과거 데이터와의 충돌**: 과거에는 시스템의 모든 수학적 모델 정책을 완벽히 알아야 한다는 고전 제어(Classic Control) 정책이 주류였으나, 현대 정책은 모델을 몰라도 데이터로 배우는 '모델 프리 강화학습 정책(Model-free RL)'과 결합하여 훨씬 복합적인 제어 정책을 수행함(RL Update). ([[Reinforcement Learning (RL)|Reinforcement Learning (RL)]]와 연결)
|
||||
- **정책 변화(RL Update)**: 이제는 단순 물리 시스템 제어 정책을 넘어, 거대 AI 모델의 답변 정책([[Alignment|Alignment]])을 제어하거나 사회적 시스템의 변동성 정책을 제어하는 광의의 제어 정책으로 확장 중임.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- **Parent:** 10_Wiki/💡 Topics/AI
|
||||
- **Related:** [[Feedback-Control-Systems|Feedback-Control-Systems]], [[Robotics|Robotics]], System-Dynamics
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Control Systems Engineering.md
|
||||
|
||||
---
|
||||
|
||||
- Automation, [[Reinforcement Learning (RL)|Reinforcement Learning (RL)]], [[System-Theory|System-Theory]], [[Robotics|Robotics]], [[Efficiency|Efficiency]]
|
||||
- **Key Algorithms**: PID Control, Kalman Filter, Model Predictive Control (MPC).
|
||||
---
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
def step(self, setpoint, measurement):
|
||||
e = setpoint - measurement
|
||||
self.i += e * self.dt
|
||||
d = (e - self.prev_e) / self.dt
|
||||
u = self.kp*e + self.ki*self.i + self.kd*d
|
||||
u_clamped = max(self.u_min, min(self.u_max, u))
|
||||
# 매 anti-windup: 매 saturate 시 integrator 의 back-calc
|
||||
if u != u_clamped:
|
||||
self.i -= (u - u_clamped) / self.ki if self.ki else 0
|
||||
self.prev_e = e
|
||||
return u_clamped
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Ziegler-Nichols 의 tune
|
||||
```python
|
||||
def ziegler_nichols(Ku, Tu, kind='PID'):
|
||||
if kind == 'PID':
|
||||
return dict(kp=0.6*Ku, ki=1.2*Ku/Tu, kd=0.075*Ku*Tu)
|
||||
if kind == 'PI':
|
||||
return dict(kp=0.45*Ku, ki=0.54*Ku/Tu, kd=0)
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### State-space LQR (CartPole)
|
||||
```python
|
||||
import numpy as np
|
||||
from scipy.linalg import solve_continuous_are
|
||||
A = np.array([[0,1,0,0],[0,0,-mp*g/M,0],[0,0,0,1],[0,0,(M+mp)*g/(M*l),0]])
|
||||
B = np.array([[0],[1/M],[0],[-1/(M*l)]])
|
||||
Q = np.diag([1, 1, 10, 10]); R = np.array([[0.1]])
|
||||
P = solve_continuous_are(A, B, Q, R)
|
||||
K = np.linalg.inv(R) @ B.T @ P
|
||||
u = -K @ x # state feedback
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### MPC with do-mpc
|
||||
```python
|
||||
import do_mpc
|
||||
model = do_mpc.model.Model('continuous')
|
||||
x = model.set_variable('_x', 'x', shape=(2,1))
|
||||
u = model.set_variable('_u', 'u')
|
||||
model.set_rhs('x', np.array([[x[1]],[u - 0.1*x[1]]]))
|
||||
model.setup()
|
||||
mpc = do_mpc.controller.MPC(model)
|
||||
mpc.set_param(n_horizon=20, t_step=0.1)
|
||||
mpc.set_objective(mterm=x[0]**2, lterm=x[0]**2 + 0.01*u**2)
|
||||
mpc.bounds['lower','_u','u'] = -5; mpc.bounds['upper','_u','u'] = 5
|
||||
mpc.setup()
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### Kalman filter (state estimation)
|
||||
```python
|
||||
def kalman_step(x, P, u, z, A, B, H, Q, R):
|
||||
x_pred = A @ x + B @ u
|
||||
P_pred = A @ P @ A.T + Q
|
||||
K = P_pred @ H.T @ np.linalg.inv(H @ P_pred @ H.T + R)
|
||||
x = x_pred + K @ (z - H @ x_pred)
|
||||
P = (np.eye(len(x)) - K @ H) @ P_pred
|
||||
return x, P
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### RL policy (PPO via stable-baselines3)
|
||||
```python
|
||||
from stable_baselines3 import PPO
|
||||
import gymnasium as gym
|
||||
env = gym.make("Pendulum-v1")
|
||||
model = PPO("MlpPolicy", env, verbose=1)
|
||||
model.learn(total_timesteps=200_000)
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### Real-time loop (Linux PREEMPT_RT)
|
||||
```python
|
||||
import time, os
|
||||
os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(80))
|
||||
T = 0.001 # 1 kHz
|
||||
while True:
|
||||
t0 = time.perf_counter()
|
||||
u = pid.step(setpoint, sensor.read())
|
||||
actuator.write(u)
|
||||
while time.perf_counter() - t0 < T: pass
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| 매 SISO + linear | PID |
|
||||
| 매 MIMO + linear | LQR / state-space |
|
||||
| Constrained + slow plant | MPC |
|
||||
| Nonlinear + simulator 가능 | RL (PPO, SAC) |
|
||||
| Safety-critical + uncertain | Robust H∞ / sliding mode |
|
||||
| 매 very fast (>10 kHz) | Hardware PID (FPGA) |
|
||||
|
||||
**기본값**: PID with proper tuning + anti-windup; escalate to MPC if multivariable or constrained.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Cyber-Physical-Systems]] · [[Robotics]]
|
||||
- 변형: [[PID]] · [[LQR]] · [[MPC]] · [[Adaptive-Control]]
|
||||
- 응용: [[Digital-Twin]] · [[Autopilot]] · [[Process-Control]]
|
||||
- Adjacent: [[Kalman-Filter]] · [[State-Estimation]] · [[Reinforcement-Learning]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 controller derivation explanation, 매 transfer function manipulation, 매 tuning suggestion based on step response, 매 simulation script generation.
|
||||
**언제 X**: 매 actual real-time loop (deterministic 코드 / FPGA). 매 safety certification (formal verification 필요).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **No anti-windup**: 매 actuator saturate 시 integral runaway → overshoot.
|
||||
- **Derivative on error (vs measurement)**: 매 setpoint step 시 derivative kick — derivative-on-PV 사용.
|
||||
- **Tune via trial-and-error only**: 매 system identification 의 사용 (Ziegler-Nichols, FOPDT fit).
|
||||
- **MPC without warm-start**: 매 solve time 의 explode — previous solution 의 reuse.
|
||||
- **No filter on derivative**: 매 measurement noise 가 D term 의 amplify.
|
||||
- **RL on real hardware first**: 매 sim-to-real 의 가야 — safe exploration.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Åström & Murray "Feedback Systems", Skogestad MIMO control, do-mpc docs, IEEE control textbooks).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — control engineering: PID, LQR, MPC, RL, Kalman |
|
||||
|
||||
Reference in New Issue
Block a user