This document describes the proposed architecture for the MiniFab project, a multi-function machine that supports milling, 3D printing, and pen plotting through a toolhead-swapping system.
minifab/ # Project root directory
β
βββ src/ # Main source code
β βββ config/ # Configuration files
β β βββ main_printer.cfg # Main configuration containing: machine size, steppers, etc.
β β β
β β βββ system/ # System services configuration
β β β βββ moonraker.conf # Moonraker API server configuration
β β β βββ crowsnest.conf # Webcam configuration
β β β βββ sonar.conf # WiFi keepalive configuration
β β β βββ timelapse.cfg # Timelapse configuration
β β β βββ mainsail.cfg # Mainsail interface configuration
β β β βββ octoeverywhere.conf # OctoEverywhere configuration
β β β βββ octoeverywhere-system.cfg # OctoEverywhere system configuration
β β β βββ print_area_bed_mesh.cfg # Print area bed mesh configuration
β β β
β β βββ common/ # Configurations common to all modes
β β β βββ board_pins.cfg # Pins configuration
β β β βββ change.cfg # Tool change mechanism configuration
β β β βββ stepper.cfg # Common stepper motor configuration
β β β βββ spindle.cfg # Spindle configuration
β β β β
β β β βββ b_axis/ # B-axis configuration
β β β βββ main.cfg # Main B-axis configuration
β β β βββ macro.cfg # B-axis macros
β β β βββ stepper.cfg # B-axis stepper configuration
β β β
β β βββ toolhead/ # Toolhead configurations
β β βββ mill/ # Mill toolhead specific configuration
β β β βββ machine.cfg # Mill-specific parameters
β β β βββ macros.cfg # G-code macros for milling
β β β βββ KlipperScreen.conf # KlipperScreen configuration for mill mode
β β β
β β βββ print/ # Print toolhead specific configuration
β β β βββ machine.cfg # Printer-specific parameters
β β β βββ fan.cfg # Fan configuration
β β β βββ probe.cfg # Probe configuration
β β β βββ macros.cfg # G-code macros for printing
β β β βββ KlipperScreen.conf # KlipperScreen configuration for print mode
β β β
β β βββ penplt/ # Pen plotter toolhead specific configuration
β β β βββ machine.cfg # Plotter-specific parameters
β β β βββ macros.cfg # G-code macros for plotting
β β β βββ KlipperScreen.conf # KlipperScreen configuration for plotter mode
β β β
β β βββ idle/ # Idle mode
β β βββ machine.cfg # Idle mode specific parameters
β β βββ printer.cfg # Idle mode printer configuration
β β βββ KlipperScreen.conf # KlipperScreen configuration for idle mode
β β
β βββ scripts/ # Scripts
β βββ autofirmware.py # Toolhead detection and management
β βββ confswap.py # Configuration management
β βββ setup.py # Installation and initial setup
β βββ startup.py # Web server and daemon startup
β β
β βββ static/ # Static files for web interface
β β βββ mill.svg
β β βββ print.svg
β β βββ ...
β β
β βββ templates/ # Web interface templates
β βββ index.html
β βββ logs.html
β
βββ docs/ # Documentation
βββ ...
The configuration system is organized into three main categories:
-
Root Configuration
main_printer.cfg: Contains the base machine configuration including dimensions, steppers, and other shared settings.
-
System Configuration
- Contains configurations for services and utilities that support the operation of the machine.
- Includes web interfaces, camera systems, remote access, and other supporting services.
-
Common Configuration
- Contains configurations that are shared across multiple toolheads.
- Includes pin definitions, stepper configurations, spindle control, and the B-axis rotation system.
-
Toolhead Configuration
- Contains specific configurations for each mode of operation (mill, print, pen plotter, idle).
- Each toolhead includes its own specialized machine configuration, macros, and UI settings.
The scripts directory contains the Python scripts that manage the operation of the MiniFab system:
autofirmware.py: Handles automatic detection of connected toolheads and firmware switching.confswap.py: Manages the swapping between different configuration files.setup.py: Handles initial installation and setup of the system.startup.py: Controls the web interface and daemon startup process.
The system uses symbolic links to swap between different configurations. When a toolhead is changed, the appropriate configuration files are linked from the toolhead directory to the Klipper configuration directory.
Toolheads are detected via CAN bus UUIDs. The autofirmware.py script monitors the CAN bus and identifies connected toolheads based on their unique identifiers.
The MiniFab includes a web interface for monitoring and control, with status pages, logs, and toolhead management.
- The "idle" mode is included in the toolhead directory for consistency, even though it represents a state rather than a physical toolhead.
- The B-axis configuration is considered common as it may be used by multiple toolheads.
- System services configurations are grouped separately as they are independent of the specific toolhead in use.