🧠 第00章:PoC設計全体像と三層アーキテクチャの背景

Chapter 00: Overall PoC Design & Three-Layer Architecture

要旨 / Abstract
本章は AITL-H(All-in-Theory Logic - Hybrid)設計思想PoC全体像を示し、三層(FSM / PID / LLM)による決定性 × 連続制御 × 柔軟知性の統合を、実装に繋がる具体仕様まで落とし込みます。
This chapter presents the design philosophy and overall architecture of AITL-H, detailing how the three-layer model (FSM, PID, LLM) integrates deterministic control, continuous regulation, and flexible intelligence, down to practical implementation specifications.

📚 Docs Index
⚖ Hybrid License


🎯 0.1 目的 / Purpose


🧬 0.2 三層アーキテクチャ / Three-Layer Architecture

層 / Layer 機能 / Function 担当モジュール / Module
本能層 Instinct 行動パターン生成 / Behavior pattern generation FSM(有限状態機械 / Finite State Machine)
理性層 Reason 物理量制御・補正 / Physical control & compensation PID(比例・積分・微分制御 / Proportional-Integral-Derivative Control)
知性層 Intelligence 状況判断・自己修復 / Situation assessment & self-healing LLM(大規模言語モデル / Large Language Model)

設計思想 / Design Philosophy: 責務を明確に分離することで、検証容易性移植性を確保。
Clear separation of responsibilities ensures ease of testing and portability.


🧩 0.3 システムブロック / System Block Diagram

flowchart TB
  subgraph LLM[LLM Intelligence Layer]
    U[UART/Host Command] -->|parsed intent| ILLM[Intent Mapper]
  end

  subgraph FSM[Instinct Layer: FSM Engine]
    ILLM -->|goal: target_speed, target_angle| S1[State Machine<br/>IDLE/ALIGN/TRACK]
    S1 -->|goals| OUT1[Goals to PID]
  end

  subgraph PID[Reason Layer: PID Controller]
    OUT1 --> P1[PID - speed]
    P1 --> MUX[Mixer]
    P2 --> MUX
    MUX --> PWM[PWM Driver]
  end

  subgraph IO[Physical I/O]
    PWM --> ACT[Actuator]
    SEN[Sensor Suite] -->|measured speed/angle/dist| PID
    SEN --> FSM
  end

  LOG[Logging/Telemetry] --- FSM
  LOG --- PID
  U <--> LOG

🔌 0.4 インタフェース仕様 / Interfaces

FSM ⇄ PID

PID ⇄ I/O

Host/LLM ⇄ UART

```text
<SOF=0xAA> <VER=0x01> <TYPE> <LEN> <PAYLOAD...> <CRC16>
TYPE:
  0x10: CMD_GOAL   (target_speed, target_angle, mode)
  0x11: CMD_GAIN   (Kp, Ki, Kd, id)
  0x20: GET_TELEM  (subscribe bitmap)
  0x30: HEALTH     (watchdog, heartbeat)
```

⚙️ 0.5 PID設計ガイド(抜粋) / PID Tuning (Excerpt)


🦺 0.6 安全・自己修復 / Safety & Self-Healing


📡 0.7 ログ & テレメトリ / Logging & Telemetry

最低収集項目 / Minimum Set:
fsm_state, goal_speed/angle, meas_speed/angle, u_speed/u_angle, flags,
battery_v, temp, fault_code, latency_ms,
rx_count, rx_crc_err, tx_count

収集周期 / Sampling Rate:


🛣 0.8 今後の展開 / Roadmap


0.9 本章チェックリスト / Readiness Checklist


📎 0.10 付録 / Appendix

データ型例 / Example Data Types: ```c typedef struct { float target_speed; float target_angle; uint8_t mode; } goal_t;

typedef struct {
  float kp, ki, kd;
  float i_min, i_max;
} pid_gain_t;

typedef struct {
  float meas_speed;
  float meas_angle;
  float battery_v;
  uint16_t flags;
} telem_t;
```

PID一周期(擬似コード) / PID Cycle (Pseudocode): pseudo err_s = target_speed - meas_speed I_s = clamp(I_s + err_s*Ts, Imin, Imax) D_s = (N*(err_s - err_s_prev)) / (1 + N*Ts) u_s = kp*err_s + ki*I_s + kd*D_s u_s = saturate(u_s, 0, 1) err_s_prev = err_s


🔚 まとめ / Summary

AITL-H PoCは、決定性(FSM) × 連続制御(PID) × 柔軟知性(LLM)
明確な責務分離検証容易なI/Fで統合する設計です。
本章は後続の実装章への起点となります。


📝 ライセンス / License


🔗 ナビゲーション / Navigation

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