⚙️ 第02章:PID制御器の設計と応答チューニング

Chapter 02: PID Controller Design & Response Tuning

要旨 / Abstract
本章では、AITL-Hにおける理性層(Reason Layer)としてのPID制御設計方針を解説します。
This chapter explains the PID control design policy for the Reason Layer in AITL-H.
Within the PoC, the FSM outputs target values (e.g., speed, angle), and the PID compensates for errors to produce actual control signals (PWM, etc.).


📐 1. PID制御とは / What is PID Control?

PID制御は、以下の制御式に基づき目標値と現在値の差(誤差)を補正します:
PID control adjusts the error between the target value and the current value according to the following formula:

\[u(t) = K_p \cdot e(t) + K_i \int e(t) \, dt + K_d \frac{de(t)}{dt}\]

🧮 2. ゲイン設計の基本戦略 / Basic Gain Tuning Strategy

ゲイン / Gain 役割 / Role 高くすると / If Increased 低くすると / If Decreased
$K_p$ 即時反応 / Immediate response 応答が速くなるが不安定に / Faster but less stable 鈍くなるが安定 / Slower but stable
$K_i$ 累積誤差解消 / Cumulative error correction 定常誤差が減るが振動しやすく / Less steady-state error but oscillation risk 定常誤差が残る / Steady-state error remains
$K_d$ 変化抑制 / Change suppression オーバーシュート抑制 / Suppresses overshoot 遅れが増す / Slower reaction

📊 3. ステップ応答と安定性評価 / Step Response & Stability Evaluation

target_speed = 5.0
measured_speed = sensor.get_distance()
pwm = pid.compute(target_speed, measured_speed)

🧩 4. AITL-H PoCにおけるPID制御器 / PID Controller in AITL-H PoC

PoC内の pid_controller.py の骨格は以下の通りです:
The pid_controller.py in the PoC has the following structure:

class PIDController:
    def __init__(self, kp, ki, kd):
        ...

    def compute(self, target, measured):
        error = target - measured
        # 比例・積分・微分項を加算してPWM値を返す
        return pwm

データフロー / Data Flow:


🔄 5. 将来的展開:自己最適化へ / Toward Self-Optimization


🔚 6. まとめ / Summary

PID制御は、FSMが定義した目標行動を物理的制御信号に変換する理性の実装です。
It is the Reason Layer implementation that transforms FSM-defined goals into actionable control outputs.
本章で示した設計方針と調整方法は、次章のFSM設計に接続されます。


🖼 図2-1:PID制御ループ構成図 / Figure 2-1: PID Control Loop

flowchart TD
    A["Target Value r(t)"] -->|"e(t)"| B["PID Controller"]
    B -->|"u(t)"| C["PWM Signal"]
    C --> D["Actuator / Motor"]
    D --> E["Sensor Feedback y(t)"]
    E -->|"Feedback"| B

📝 ライセンス / License


🔗 ナビゲーション / Navigation

📄 READMEに戻る / Back to README
🏠 AITL-Hトップ / AITL-H Top