Skip to content

Latest commit

Β 

History

History
127 lines (104 loc) Β· 6.48 KB

File metadata and controls

127 lines (104 loc) Β· 6.48 KB

MiniFab Architecture Documentation

Overview

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.

Directory Structure

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
    └── ...

Main Components

Configuration Structure

The configuration system is organized into three main categories:

  1. Root Configuration

    • main_printer.cfg: Contains the base machine configuration including dimensions, steppers, and other shared settings.
  2. 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.
  3. Common Configuration

    • Contains configurations that are shared across multiple toolheads.
    • Includes pin definitions, stepper configurations, spindle control, and the B-axis rotation system.
  4. 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.

Scripts

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.

Implementation Considerations

Configuration Symlinks

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.

Toolhead Detection

Toolheads are detected via CAN bus UUIDs. The autofirmware.py script monitors the CAN bus and identifies connected toolheads based on their unique identifiers.

Web Interface

The MiniFab includes a web interface for monitoring and control, with status pages, logs, and toolhead management.

Notes

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