SunnyCNC - Custom CNC Machine with CircuitPython Control

A custom-built CNC machine featuring CircuitPython control, ROS integration, and modular design. Currently undergoing redesign to address gantry stability issues.

Project Overview

SunnyCNC is a custom-built CNC machine designed to run on CircuitPython or PyCNC with ROS (Robot Operating System) integration. The project represents an ambitious attempt to create a fully open-source CNC solution with modern control systems, combining the flexibility of Python-based control with the reliability of established CNC firmware.

The machine features a modular design with 3D-printed components, NEMA stepper motors, and a Proxxon Micromot 50 spindle. The control system is built around a Raspberry Pi 3B+ for high-level control and an Arduino Mega 2560 with RAMPS shield for motor control, providing a hybrid approach that leverages the strengths of both platforms.

Note: This project is currently in active development and redesign. The initial gantry design proved to be too massive, causing significant kickback and oscillations with the Dremel tool. A revised design with improved structural rigidity and reduced mass is in progress.

System Architecture

SunnyCNC Machine Overview

SunnyCNC machine showing the overall structure and component layout

Control System Design

The SunnyCNC employs a dual-processor architecture for optimal performance:

  • Raspberry Pi 3B+ - High-level control, G-code processing, and potential OctoPrint integration
  • Arduino Mega 2560 - Real-time motor control and motion planning
  • RAMPS Shield - Motor driver interface and power distribution
  • CircuitPython/PyCNC - Flexible control software with ROS compatibility

Mechanical Design

The machine uses a Cartesian coordinate system with the following components:

  • X-Axis - Dual NEMA-17 stepper motors for gantry movement
  • Y-Axis - Single NEMA-17 stepper motor for bed movement
  • Z-Axis - Single NEMA-17 stepper motor for vertical positioning
  • Spindle - Proxxon Micromot 50 with custom mounting system
  • Frame - 3D-printed components with aluminum extrusion support

Component Selection

Electronics

  • Raspberry Pi 3B+ - Main control computer
  • Arduino Mega 2560 - Motor control processor
  • RAMPS 1.4 Shield - Motor driver interface
  • 4x NEMA-17 Stepper Motors - Motion control
  • A4988 Stepper Drivers - Motor control

Mechanical

  • Proxxon Micromot 50 - Spindle motor
  • Linear Bearings - Smooth motion
  • Lead Screws - Precision positioning
  • Aluminum Extrusions - Frame structure
  • 3D-Printed Components - Custom parts

Power System

Power Distribution
12V Rail:
- Proxxon Micromot 50 spindle
- NEMA-17 stepper motors
- RAMPS shield electronics

5V Rail:
- Raspberry Pi 3B+
- Arduino Mega 2560
- Control electronics

Note: Custom power supply design to avoid 
proprietary Proxxon power supply costs

Software Implementation

Control Software Stack

The SunnyCNC uses a sophisticated software architecture:

  • CircuitPython/PyCNC - High-level control and G-code interpretation
  • ROS Integration - Robot Operating System for advanced control algorithms
  • Marlin Firmware - Modified for CNC operations on Arduino
  • OctoPrint Compatibility - Web interface for machine control (planned)

Firmware Modifications

The project includes custom modifications to Marlin firmware:

  • G-code Compatibility - Full support for standard CNC G-code commands
  • Spindle Control - PWM control for variable speed operation
  • Safety Features - Emergency stop and limit switch integration
  • Communication Protocol - Serial communication with Raspberry Pi

Python Control Scripts

Custom Python scripts provide flexible control:

  • G-code Parser - Converts G-code to motor commands
  • Motion Planning - Optimizes tool paths for smooth operation
  • ROS Nodes - Integration with Robot Operating System
  • Web Interface - Browser-based control panel

Design Issues & Lessons Learned

Current Design Problems:

  • Gantry Mass - The current gantry design is too massive, causing significant kickback during operation
  • Oscillations - The heavy gantry creates unwanted vibrations that affect cutting quality
  • Structural Rigidity - Insufficient stiffness in the frame leads to deflection under load
  • Tool Stability - Dremel tool mounting system needs improvement for better stability

Technical Analysis

The primary issues stem from fundamental mechanical design principles:

  • Mass Distribution - Excessive mass in moving components increases inertia and reduces responsiveness
  • Resonance - The current design has natural frequencies that coincide with operating speeds
  • Damping - Insufficient damping mechanisms to absorb vibrations
  • Material Selection - 3D-printed parts may not provide sufficient rigidity for precision applications

Impact on Performance

These design issues significantly affect machine performance:

  • Cutting Quality - Vibrations create poor surface finish and dimensional inaccuracy
  • Tool Life - Excessive vibrations reduce tool life and cause premature wear
  • Speed Limitations - Machine must operate at reduced speeds to minimize oscillations
  • Precision - Positional accuracy is compromised by structural deflection

Redesign Plans

The SunnyCNC project is currently undergoing a comprehensive redesign to address the identified issues:

Structural Improvements

  • Lightweight Gantry - Redesign with aluminum extrusions and optimized geometry
  • Enhanced Rigidity - Improved frame design with better load distribution
  • Damping Systems - Integration of vibration damping materials and mechanisms
  • Material Optimization - Strategic use of different materials for strength vs. weight

Mechanical Enhancements

  • Linear Rail Systems - Upgrade from basic bearings to precision linear rails
  • Ball Screw Drives - Replace lead screws with ball screws for better precision
  • Improved Spindle Mount - Redesigned mounting system for better tool stability
  • Counterbalance Systems - Implement counterweights or gas springs for Z-axis

Control System Upgrades

  • Advanced Motion Control - Implement adaptive feed rate control
  • Vibration Monitoring - Add sensors to detect and compensate for vibrations
  • Real-time Optimization - Dynamic adjustment of cutting parameters
  • Improved Safety - Enhanced emergency stop and monitoring systems

Project Files & Documentation

3D Models & CAD Files

The project includes comprehensive CAD documentation:

  • OpenSCAD Files - Parametric 3D models for all custom components
  • STL Files - Ready-to-print 3D models
  • Gantry Components - X-axis gantry with support structures
  • Motor Mounts - NEMA-17 and NEMA-8 motor mounting systems
  • Bearing Systems - Linear bearing mounts and guides
  • Spindle Holder - Custom Proxxon Micromot mounting system

Firmware & Software

  • Marlin 2.0.x - Modified Marlin firmware for CNC operations
  • CircuitPython Scripts - Control and communication software
  • Configuration Files - Machine-specific settings and parameters
  • Documentation - Setup guides and troubleshooting information

Bill of Materials

Current BOM
Electronics:
- Raspberry Pi 3B+
- Arduino Mega 2560
- RAMPS 1.4 Shield
- 4x NEMA-17 Stepper Motors
- A4988 Stepper Drivers

Mechanical:
- Proxxon Micromot 50
- Linear Bearings
- Lead Screws
- Aluminum Extrusions
- 3D-Printed Components

Power:
- 12V Power Supply
- Custom Power Distribution

Project Significance

The SunnyCNC project demonstrates several important engineering and development skills:

  • Systems Integration - Combining multiple control platforms and software systems
  • Mechanical Design - Complex mechanical system design with real-world constraints
  • Firmware Development - Custom modifications to open-source firmware
  • Problem Analysis - Systematic identification and analysis of design issues
  • Iterative Development - Continuous improvement based on testing and feedback

This project showcases the ability to tackle complex hardware challenges and demonstrates honest self-assessment when designs don't meet expectations. The willingness to acknowledge issues and plan improvements shows professional engineering maturity.

Future Development

The SunnyCNC project has a clear roadmap for improvement:

  • Redesigned Gantry - Lighter, stiffer design with better vibration characteristics
  • Advanced Control - Implementation of adaptive control algorithms
  • Material Testing - Evaluation of different materials and construction methods
  • Performance Validation - Comprehensive testing of the redesigned system
  • Documentation - Complete build guide and lessons learned

The project represents an ongoing learning experience in CNC machine design and serves as a valuable case study in the importance of proper mechanical design principles.