【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.