Factory Orchestrator is a mission-critical robotic control architecture designed to decouple high-level mission logic from hardware-specific drivers. It utilizes a Finite State Machine (FSM) and the Adapter Pattern to achieve 100% deterministic execution and vendor agnosticism for industrial Raspberry Pi 5 deployments.
Visual verification of the PACE logic core and the autonomous state machine transitions.
| Standard Mission Loop | PACE Hardening Suite | Logic Core Verification |
|---|---|---|
![]() |
![]() |
![]() |
| Status: ✅ Cycle Complete | Status: ✅ Recovery Verified | Status: ✅ 10/10 Passing |
To prevent catastrophic hardware damage, the system implements a self-healing PACE plan that escalates through four levels of intervention:
| Level | Name | Trigger | System Requirement |
|---|---|---|---|
| 1 | Primary | First Fault | Retry: Resets context state to IDLE for immediate re-attempt. |
| 2 | Alternate | Second Fault | Retreat: Moves arm to safe HOME_COORDINATES to prevent collision. |
| 3 | Contingency | Third Fault | Reboot: Executes soft-reboot of Vision and Safety software layers. |
| 4 | Emergency | Fourth Fault | Kill: Triggers hardware E-Stop and forces OS-level process exit. |
Note: A successful mission cycle automatically triggers the _handle_verification state, resetting the fault_counter to 0 (Self-Healing).
The system is divided into three distinct layers to maximize testability and safety:
- File:
src/factory_orchestrator.py - Responsibility: Manages the State Machine, enforces Safety Gates, and executes the PACE plan.
- Responsibility: Abstract Base Classes (Python
Protocol) defining the "Contract" between the brain and the body. - Components:
SafetyProtocol,VisionProtocol,DriverProtocol.
- File:
src/hardware_adapters.py - Responsibility: Translates system commands into messy, proprietary vendor SDK calls (e.g., Fanuc, Kuka, or Raspberry Pi GPIO).
To run the logic core against Mock Interfaces (Hardware-in-the-Loop simulation):
# Run the core orchestrator with Mock drivers
python src/factory_orchestrator.py
To run the system with real hardware adapters enabled:
# Initialize real hardware and enter autonomous loop
python src/main.py
The system includes test_hardening_factory_orchestrator.py, covering:
- Self-Healing Logic: Verifying fault counter resets after mission success.
- Death Spiral Prevention: Ensuring failed reboots escalate to Emergency Stop.
- Intermittent Glitch Handling: Testing resilience against flapping signals.
python -m unittest discover tests -v
Factory_Orchestrator/
│
├── .github/workflows/
│ └── ci_pipeline.yml # Automated Build & Test Badge
│
├── src/
│ ├── __init__.py # Package marker
│ ├── factory_orchestrator.py # The "Brain" (FSM & PACE Logic)
│ ├── hardware_adapters.py # The "Body" (Hardware Abstraction Layer)
│ └── main.py # Production Entry Point
│
├── tests/
│ ├── __init__.py # Package marker
│ ├── test_factory_orchestrator.py
│ ├── test_hardening_factory_orchestrator.py
│ ├── basic_set.png # Telemetry Asset
│ ├── hardening_set.png # Telemetry Asset
│ └── the_mission_loop.png # Telemetry Asset
│
└── requirements.txt # System Dependencies
Author: Charles Austin II (Principal Solutions Architect)
Focus: Robotics Architecture, Fault-Tolerant Systems, and Industrial HAL Design.


