Wokwi with CNC GCODE for multiple coordinated steppers

I've programmed some of MarginallyClever's CNC demo code into some Wokwi simulations.

4 Axis XYZE on Uno with Protoneer CNC Shield

image
https://wokwi.com/projects/381581240931217409

6 axis on Arduino Mega with Rumba-like pin assigments

image
https://wokwi.com/projects/327981866411885138

6 axis on Arduino Mega, Rumba pins, using Timer1 code

image
https://wokwi.com/projects/382433130635978753

6 axis CNC on ESP32

image https://wokwi.com/projects/383243895939013633

Code

The source of the codes are several of the programs in this repository:

The code from the Github site is a bit rough, since MarginallyClever moved on to a fork of Marlin for his Makelangelo wall-drawing robot.

However, the relatively simple programs (as compared to GRBL) behind these demos show interesting methods of coordinating motion among steppers using the Bresenham line-drawing algorithm, parsing GCODE, etc..

If you need to move a few steppers with coordinated motion, you could use some buttons or code to feed some canned or computed GCODE into the parsers and get some quick results.

There are no warranties on this code, since I copied it from Marginally Clever's github. I copied it to implement stepper motion in the Wokwi simulator, to research feasibility of hacking on GCODE without trying to debug GRBL, and to experiment with an Uno, shield and steppers.

MarginallyClever's Code for 4 axis CNC demo on Uno with CNCShield V3

There's some documentation if the internet archive;

Hat tip to the Protoneer folks who designed the CNC Shield V3 :

Lots of people cloned it and undercut them, but the Protoneer folks are the originators.

Notes

I did try GRBL on a Wokwi Uno with the shield, and it compiles and runs a bit, but crashes because of an edge case with how GRBL cleverly uses the timers that is unsupported by Wokwi.

Other implementations:

Link Notes
Wokwi - Online ESP32, STM32, Arduino Simulator 2 axis, no drivers mega
Wokwi - Online ESP32, STM32, Arduino Simulator 6 axis Rumba code, no hardware
Wokwi - Online ESP32, STM32, Arduino Simulator 6 axis Rumba, Hardware
Wokwi - Online ESP32, STM32, Arduino Simulator 2 axis direct connect
Wokwi - Online ESP32, STM32, Arduino Simulator 4 axis ramps-like connections
Wokwi - Online ESP32, STM32, Arduino Simulator grbl with 4 axis ramps-like connections, broken on Wokwi
Wokwi - Online ESP32, STM32, Arduino Simulator 2 axis CNC V3
Wokwi - Online ESP32, STM32, Arduino Simulator 4 axis AFS motor shield, broken on Wokwi.
Wokwi - Online ESP32, STM32, Arduino Simulator 6 axis Rumba wiring
Wokwi - Online ESP32, STM32, Arduino Simulator 6 axis rumba with a patch
Wokwi - Online ESP32, STM32, Arduino Simulator 6 axis on an ESP32
Wokwi - Online ESP32, STM32, Arduino Simulator 4 axis V3 Acceleration Experiments
Wokwi - Online ESP32, STM32, Arduino Simulator 6 axis acceleration experiments

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.