A New, Fully Modular CNC Controller

Overview

The blog post details a new CNC controller I designed. I have probably designed 40-50 different controllers over the years, but this one has me really excited. My past controllers were generally application specific. My recent controllers have all been for the Grbl_ESP32 firmware. The I/O on the ESP32 is very flexible, but somewhat limited in pin count. There have always been enough pins to control the machine, but not enough to make a general purpose CNC controller that can target any machine.

Recently, support for I2S shift register chips has been added to the firmware. The shift register scheme supports high-speed (125 kHz step rate), jitter-free stepping with up to 32 output pins (28 on this board due to connector limitations). To show off this new capability I designed the universal controller I always wanted. A universal CNC controller covers a huge variety of options so I quickly realized I would have to add some modularity to the design. This would allow you to pick the features you wanted and not have to pay for the ones you don’t need. It would also allow for some amount of future proofing. As new requirements are identified, new modules could be added

Here is the board I came up with. Along the bottom edge are (6) stepper motor modules. Along the top and right sides are (5) CNC I/O modules. On the left side is a micro SD card slot. There are (2) fan connectors. There is even a JTAG interface. With a $10 Esp-prog interface board you can do some real debugging. The size is 134mm wide and 132mm tall.

Stepper Motors

The six stepper channels can use either common “Pololu modules” or external drivers.  The terminal blocks are pluggable and can be plugged in horizontally or vertically.

The modules support:

  • Basic step and direction modules like A4988 and DRV8225
  • Trinamic modules in standard or SPI mode – with sensorless stall detection
  • Individual per-motor enable signals

For external drivers, you can replace the stepper module with a simple/low-cost jumper module that routes the step/dir/enable signals to the external connectors:

  • External drivers are driven from shift register chips that can drive optocouplers directly at 5V (jumper selectable) and 25mA, thus getting around the problem that ESP32 GPIOs are out-of-spec for directly driving many optocouplers.
  • The jumper modules can be configured for either common low or common high.
  • In addition to the 6 stepper modules, there are some uncommitted shift register outputs that could be used to drive even more motors.  It would be possible, with some re-purposing of pins, to drive 14 external-driver motors!

The Grbl_Esp32 firmware lets you use the motors very flexibly.  You could have a 6 axis machine, or gang two motors on any axes with squaring. With external drivers, you could have a 6-axis machine with dual motors per axis

CNC I/O Modules

The (5) sockets are for use with CNC I/O Modules. CNC I/O Modules are designed to interface with your machine. Each module socket has 4 independent I/O pins and 4 bused pins. The bused pins could be used for an I2C, SPI, etc. The primary input (motor) voltage, 5V and ground also go to the module. The voltages are only for powering the basic electronics. If you want to make a high current DC spindle speed controller, for example, you should add a separate power connector for that.

There is a spec for these modules. By following some basic pin usage rules, we hope even I/O limited controllers can support a lot of modules. The modules are open source. This could help people create their own modules.

We currently have (5) types of modules available. Note: Not not all of them have the final terminal blocks. They will match the main board.

There are some limitations on the use on modules, due to a few pins being input only and some being output only, but in general you are free to select what you want and double up on some like multiple inputs or multiple relays.

4x Switch Input Module

This module is designed to be very robust against noise and voltage spikes on (4) switch inputs. The signal enters through an optocoupler, goes  through a little filtering and then through a Schmitt trigger. It has 3 terminals per switch (Signal, 5V and Gnd). This can be used with basic 2 terminal switches, 3 wire reprap style switches, 3 wire optical vane type switches and 3 wire, 5v, proximity switches.

Relay Module

This could be used to control a spindle, coolant/vacuum, valve, etc. It has a 3 position terminal block and an LED to indicate when the coil is on.

RS485 Modus

This is designed for use with VFD Spindle controllers. Currently the Huanyang types are supported, but others could be added in the future.

0-10V

This outputs a 0-10V signal for spindle speed control. The module also has 2 opto isolated output for controlling the direction signals that some VFDs require.

4x 5V Buffered Output module.

This has up to 4 5V signals. This could be used for a speed controller with enable and direction signals. It would also work great with a laser engrave power supply. It has an LED for each channel to indicate when it is on.

Future

We have a lot of ideas for future modules

  • Display
  • Pendant
  • Additional stepper motors
  • Hobby servos
  • Solid State Relays
  • Closed loop motor controllers
  • I/O expansion. One module could act as a host for additional modules.
  • Support for 3D printer items like heaters, etc could be added, but right now Grbl_ESP32 has no support for 3D printing. The module concept could also be used with 3D printer firmwares like Marlin, etc.

If You Want One…

The design is open source. The files are on Github. You can build one yourself or I will be selling them via my Tindie store soon.

The design has been fully tested on hand assembled prototype hardware. I have a small prototype production run of controllers and modules on order to make sure that goes smoothly and then I will order larger batches.

The Future

This was designed as a universal controller, but hopefully the CNC I/O module concept takes off and other controllers are designed to use them. Very robust, well tested and supported application specific controllers could be quickly created. You don’t have to plan for every spindle, because you can just swap out a module.

Credits.

Many of the ideas for this controller came from discussions on the Slack we use to develop Grbl_ESP32. Special thanks goes to @odaki for theI2S shift register support and @MitchBradley for hardware and firmware design. 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks

16 Responses to “A New, Fully Modular CNC Controller”


  1. Craig Hollabaugh

    Yeah, you did it right!! Congrats Bart.

  2. Ken Cummins

    OK, I’ve been pondering what to eventually replace my current Chineseium RAMPs stack with (whose 5V regulator blew before I even had it hooked up to any stepper motors). I think I’ve found it. Now I just have to wait…

  3. Andrew Wingate

    Wow Bart!! This is great! Now I see why we haven’t seen a post in a while. Great work. Maybe I’ll see you when nerp is back someday.

  4. Wayne

    Looks good 🙂 What would be great would be plug-gable signal breakout boards for step/dir and fault vs using the driver boards. Im hooked on Clearpath servos but their cable management is lacking in my opinion. Ive taken to making hybrid cables using RJ45 and Molex Mini connectors. I may whip up some breakout RJ45 pcbs w jumpering to select pin to conductor orientations for your board.
    Great job 🙂

  5. atomd

    Hi,
    I’ve build multi purpose 4 axis CNC machine (mostly for RC foam cutting). I’d be more then happy to beta-test your controller.
    If you want me to help feel free to ping my email: michal.elektryk@hotmail.com

  6. Colin Gearon

    A great product. I have your ESP32 Development Controller and use it regularly. Your design skills are superb.
    Colin.

  7. Chadd Van Komen

    This is great, have been looking for something just like this for so long. Do you have an idea yet on the store price you will set? Ball park is okay for me. Thanks.

  8. bdring

    I am not sure about the price yet. Maybe about $40-$50 for the motherboard and $10-$20 per module, depending on complexity.

  9. Paul Driver

    Nice, very nice, will be looking to order from you.

  10. Jerome Wenzel

    I love the modular design. Is this primarily designed to process gcode off a memory card or will it be able to act as a hardware interface for LinuxCNC?

  11. bdring

    If can process streamed gcode over serial, Bluetooth or Wifi or use the SD card. The modular concept is not specific to any controller or firmware, but this motherboard is ESP32 only.

  12. Pierre Schippers

    Is this new bord already to order ? i like to order one

  13. bdring

    They will be available in about 1 month. Follow this blog to see the announcement.

  14. Hans Puijk

    Hi nice work,
    Unfortunately the 5V regulator has been discontinued. True, parts are a nightmare.

    Regards, Hans.

  15. bdring

    I noticed that, but am able to find enough parts for now. I have a test board with the Diodes Inc AP64350SP-13 on order. That looks like a good substitute and gives me a higher upper voltage.

  16. Chadd Van Komen

    I am eagerly refreshing your store page every morning and have held back from bothering you… until now. How is the production/sales timeline looking for August? I understand world events may make things difficult. No pressure 🙂

*