Overview
A Klipper firmware module that integrates Anycubic ACE Pro units into a unified multi-material printing system. Supports 4 to 16 filament gates through daisy-chaining multiple ACE devices, enabling complex multi-color and multi-material prints.
Architecture
The system uses a 5-layer modular design:
- Protocol Layer: Isolated packet encoding/decoding for JSON-RPC over serial
- Device Layer: Hardware abstraction with multi-device pooling and hot-plug support
- Sensors Layer: Dual-sensor filament detection (extruder + toolhead) with runout logic
- Commands Layer: G-code command handlers organized by category (tool, config, status)
- Controller Layer: Orchestration and business logic for tool changes and filament management
Constraints
- Automatic USB device detection with persistent mapping
- Device failure isolation (one unit failing doesn't affect others)
- Adaptive polling to minimize CPU usage during idle periods
- Compatible with Mainsail, Fluidd, and KlipperScreen interfaces
Stack
- Core: Python 3, Klipper firmware extension
- Integration: Moonraker REST API, WebSocket for real-time updates
- Communication: PySerial, JSON-RPC protocol over USB
Outcomes
The refactored architecture reduced the largest source file by 88% (4,642 lines to modular components). Moonraker API integration enables remote monitoring and control through standard web interfaces, with endless spool mode supporting unattended long-running prints.