CNC controller with ESP32

By on February 13, 2019
Pin It

In the DIY world, GRBL (a CNC controller based on Arduino) has now taken over MACH3’s place, at least in its simplest forms.
Of course, it can’t provide the complete functionality and the power of a controller such as MACH3, but in many cases, it is more than sufficient for general purposes, because the post-processor’s CAD can take over the tasks that the controller can’t perform.

The problem is that, although GRBL is popular and well-functioning, it’s taken over all the resources available on the Arduino processor, thus marking the end of the development on that platform. The porting made by Bart Dring on the ESP32 platform by Espressif caught Lorenzo’s attention exactly because it can solve this problem.
With a dual-core 32-bit processor at 240MHz and many more resources than Arduino, this is a platform worth investing time on.

You can find all info about Lorenzo’s project in his site.

 

Main goals for the CNC controller with ESP32

  • Having fun while working on the project
  • Using low-cost hardware resources
  • Having a versatile board that can easily be adapted to the various types of self-built CNCs
  • Implementing basic adaptations to the logical levels and filtering the I/O signals
  • Providing direct connection to high-power servo controllers through various connectors
  • Providing good compatibility with the various already-existing servo controller boards of amateur CNCs that are still using MACH3 LPT-like ports
  • Embedding direct small stepper drivers like those normally used in 3D printers
  • Generating a square wave signal for the “charge-pump ENABLE” signal used by those driver boards (typically MACH3) that need it
  • Supporting dual-mode spindle speed control, both via PWM and via an analog signal for those spindles whose speed regulation is done by a reference voltage (0-5V or 0-10V)
  • Providing wiring diagrams and documentation that can be accessible to other people who want to make new software/hardware variations on the board.

Features

In addition to the basic features of Bart Dring’s project, Lorenzo added two functions that find very important for safer use of CNCs:

  • A potentiometer for real-time MASTER override of the cutting feed speed (basic, but essential)
  • A potentiometer for real-time MASTER override of the spindle feed speed (very useful, but not essential)

The first one in particular is essential to safely verify that, when starting a new job, there are no catastrophic errors, which can range from simple damage and tool crashes to serious injuries to the user caused by stray parts that can hit like bullets. CNCs are dangerous machines, and errors ALWAYS have consequences; in the most unfortunate cases, the consequence may be the price of one’s LIFE!

Having a controller with hardware overrides was essential to me. Given the availability of analog inputs on the ESP32 chipset, Lorenzo set up the hardware and modified the source code to implement this function.

The latest change he made to the original project, in anticipation of future developments, was adding an expansion with 14 I/O digital lines and providing access to the I2C bus, in order to implement other future features such as adding MPGs, adding the vacuum pumps on/off function, etc.).

Follow this project on https://www.cnc4fun.com/en/

 

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.

Leave a Reply

Your email address will not be published. Required fields are marked *