Skip to the content.

🚀 Launch the Interactive Simulator

This simulator provides an accurate representation of the Maslow CNC machine’s calibration process. Unlike the previous simulation at https://github.com/BarbourSmith/Calibration-Simulation/, this implementation exactly mimics how data flows between the machine firmware and the browser-side computation.

Key Features

Accurate Machine Simulation

Browser-Side Computation

Real-Time Visualization

How It Works

Calibration Process Flow

  1. Grid Generation (Machine Side)
    • Generates a calibration grid based on frame size and grid density
    • Creates waypoints in a spiral pattern starting from center
    • Defines recompute points where computation should be triggered
  2. Measurement Collection (Machine Side)
    • Moves to each waypoint in sequence
    • Takes measurements of belt lengths to all four anchors
    • Projects measurements to XY plane (accounting for Z-height)
    • Adds configurable measurement error
  3. Data Transmission (Machine → Browser)
    • Sends measurement chunks via CLBM: format messages
    • Triggered at specific waypoints (recomputePoints)
    • Mimics the actual serial communication protocol
  4. Anchor Computation (Browser Side)
    • Receives measurement chunk
    • Runs iterative optimization to find best anchor positions
    • Uses “line walking” algorithm to minimize endpoint distances
    • Updates anchor position estimates
  5. Multi-Stage Refinement
    • Process repeats for each stage (typically 4-5 stages)
    • Each stage uses more measurements for better accuracy
    • Final stage uses all measurements for best fit

Usage

Opening the Simulator

Simply open index.html in a modern web browser. No server or build process is required.

Configuration Options

Machine Configuration:

Simulation Settings:

Running a Simulation

  1. Configure the machine parameters to match your setup
  2. Adjust simulation settings as desired
  3. Click “Start Calibration Simulation”
  4. Watch the visualization as calibration progresses
  5. Review the log for detailed progress information
  6. Check final error measurements when complete

Understanding the Output

Machine Visualization (Left Panel)

Computation Progress (Right Panel)

Log Output

Technical Details

Key Differences from Original Simulation

The original simulation (https://github.com/BarbourSmith/Calibration-Simulation/) processes all measurements at once. This simulation accurately models:

  1. Staged Computation: Anchor positions are recomputed multiple times as more data arrives
  2. Data Chunking: Measurements sent in groups matching firmware behavior
  3. Iterative Refinement: Each stage builds on previous results
  4. Protocol Accuracy: Uses actual CLBM: message format

Algorithm Overview

The calibration algorithm works by:

  1. Drawing “lines” from each anchor point with length equal to measured belt length
  2. Adjusting line angles to make all four lines meet at a single point
  3. Finding anchor positions that minimize the distance between line endpoints
  4. Using an iterative “hill climbing” approach to optimize positions

This “magnetically attracted lines” approach is robust to measurement errors and works well even with poor initial guesses.

Performance Characteristics

Use Cases

Development and Testing

Education and Demonstration

Quality Assurance

Files

Limitations

This simulation does not model:

These factors exist in the real machine but don’t significantly affect the calibration algorithm’s behavior.

Frame Imperfections

The simulator now includes realistic frame imperfections to better match real-world conditions:

Future Enhancements

Potential improvements:

License

This simulation is part of the Maslow CNC project and follows the same open-source license as the main repository.