【Control】🧩 01. AITL-controller

— An Integrated Three-Layer Control Architecture: PID × FSM × LLM


This article introduces AITL-controller,
a lightweight framework that integrates a three-layer control architecture:

The framework is designed for education and research use,
making advanced control architectures accessible and reproducible.


🧠 What Is AITL-controller?

AITL-controller is a framework that unifies classical control, formal control, and intelligent control
into a single, coherent architecture suitable for learning and experimentation.

The three layers are clearly separated by responsibility:

This separation is intentional and fundamental.


🧱 Three-Layer Architecture (PID × FSM × LLM)

1️⃣ Inner Loop: PID (Real-Time Control)

PID runs at high frequency and handles
millisecond-level real-time behavior,
exactly as in classical control systems.


2️⃣ Middle Loop: FSM (Finite State Machine)

FSM determines:

It acts as an explicit and inspectable control supervisor.


3️⃣ Outer Loop: LLM (Intelligent Control)

Typical roles include:

This layer leverages LLM strengths such as:


❓ Why a Three-Layer Architecture?

Traditional control systems can be built using PID and FSM alone,
but they suffer from inherent limitations:

AITL-controller assigns these responsibilities to the LLM layer,
with the goal of enabling:

Self-improving control systems

at the education and research level.


📦 Repository Structure (Overview)

aitl-controller/
├── core/
│   ├── pid/             # PID modules (stability & performance)
│   ├── fsm/             # FSM modules (state transitions)
│   └── llm/             # LLM modules (redesign & reasoning)
│
├── demo/
│   ├── inverted_pendulum/   # Inverted pendulum demo
│   ├── quadrotor/           # Quadrotor control example
│   └── simple_robot/        # Small-scale robot systems
│
├── docs/
│   ├── architecture/        # Three-layer architecture explanation
│   ├── math/                # PID & FSM mathematics
│   ├── llm/                 # Design guidelines for LLM control
│   └── examples/            # Tutorials
│
└── assets/                  # Figures and workflow materials

The framework core resides in core/,
while demo/ provides immediately runnable examples.


🔄 Typical Control Loop Structure

AITL-controller assumes the following control loop:

Sensor → PID → Actuator → Plant
        ↑        ↓
        FSM ← LLM (Outer loop)

Role Summary


🧪 Example: Inverted Pendulum Demo

In the inverted pendulum example, the three layers cooperate as follows:

  1. PID: stabilizes the pendulum angle
  2. FSM: manages states such as
    • Stabilize
    • Recover
    • Fault
  3. LLM:
    • Analyzes the cause of failures
    • Suggests improved PID gains
    • Proposes refinements to state-transition logic

The LLM never directly drives actuators.
Its role is strictly to improve the control structure itself.


🧩 The Role of LLM Control (Design Policy)

In AITL-controller, the LLM layer is assigned three explicit tasks:

1. Monitoring

2. Diagnosis

3. Redesign

All improvements are expressed through
natural language, code generation, or structured design proposals.


⚙ Setup

git clone https://github.com/Samizo-AITL/aitl-controller.git
cd aitl-controller
pip install -r requirements.txt

Full documentation is available on the
official GitHub Pages site.


🎓 Educational and Research Applications

AITL-controller is suitable for:

In education, it naturally supports the progression:

Understanding PID/FSM fundamentals
Improving them using LLMs


📝 Summary

AITL-controller integrates three distinct layers:

Built on classical control principles, it aims to become
an educational and research platform for next-generation control systems
in the age of AI.