Close
0%
0%

convert a Mach3 CNC controller to GRBL or FluidNC

simply reuse your old parallel port Mach3 controller with FluidNC or GRBL (USB interface)

Similar projects worth following

14 years ago I built my own CNC machine. At that time, CNC were running with Xp PC using parallel port. Gcode eaten by Mach3 software and sent to steppers controller board using the parallel port pins.

This machine, although dusty and rusty,  still runs on an old PC... but it is time to design something more up to date.

This project is how I reused most of my setup and simply replaced Mach3 (and the old PC) by a modern laptop, controlling a FluidNC (GRBL) board via USB.


CNC parallel port control boards

Mach3, EMC2 and most of CNC softwares were using the parallel port in an (almost) standardized way. They all were outputing step and dir signals to control stepper motors directly on the port using 5v TTL logic.

Typically here is the wiring diagram of one of these control boards:

So all the control signals were sent to the parallel port and configured under Mach3 software.

My control board followed these guidelines and more specifically this wiring scheme:

It is thus a board with the following specifications:

  • able to drive 4 axis steppers (X, Y, Z and A)
  • able to control 4 more outputs (Out1, 2, 3 and 4)
  • able to read 3 home switches (HomeX, Y and Z)
  • able to read one probe

This board should be generic enough to fit most (not to say all) "parrallel port" CNC controllers.


Converting my CNC control board to FluidNC

To design a "pass though" board from FluidNC to my control board I needed to "open" my board to check the logic interface after the parallel port.

Here are the schematics:

You recognize the parallel port (left) followed by 74LS541 chips. These chips are octal buffers and line drivers which are used to "clean" the step, dir and out signals coming from the parallel port. Perfect, if I input 3.3V logic signal instead of 5V one it will work thanks to these drivers!

And the outputs of this board (home signals + probe) are simple switches with a 420 Ohm resistor (named R4).

So nothing complex!


The FluidNC control board

The idea is thus to replace Mach3 software by an ESP32 on which will be flashed FluidNC/GRBL firmware.

Then this board will be connected to the parallel port connector of my old Mach3 controller board. This old board will thus be converted to a modern USB/GRBL/control board. (but could still work using the parallel port as nothing will be modified)

And trust me the new interface board cannot be simpler!

As you can see this board is almost empty! The only added electronics are 4 pull up resistors + capacitors on the "home/probe" lines. 

They form RC filtering to debounce the inputs. And trust me these RC filters are more than useful. See here for details : http://wiki.fluidnc.com/en/support/controller_design_guidelines

So I chose R = 10k and C = 100nF to have a RC time constant close to 10ms.

And that's it, the ESP32 does all the rest with FluidNC.


PCB

The PCB was produced and kindly sponsored by PCBWay. 

Here is a little video to explain everything! 

Follow this log to get more information about how to order your PCB

Eagle files and Bill of Material are available here : eagle files and BoM



FluidNC installation and configuration

Installing FluidNC is fairly easy. Follow this log

Once done and your config.yaml installed you should be able to run your controller. 

But let's have a closer look at this config file:

name: CNC
start:
  must_home: false
axes:
  x:
    steps_per_mm: 80
    max_rate_mm_per_min: 4000
    acceleration_mm_per_sec2: 100
    max_travel_mm: 1000
    motor0:
      limit_all_pin: NO_PIN
      limit_neg_pin: NO_PIN
      limit_pos_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 1
      standard_stepper:
        step_pin: gpio.13:pu
        direction_pin: gpio.15:pu
        disable_pin: NO_PIN
  y:
    steps_per_mm: 80
    max_rate_mm_per_min: 4000
    acceleration_mm_per_sec2: 100
    max_travel_mm: 1000
    motor0:
      limit_all_pin: NO_PIN
      limit_neg_pin: NO_PIN
      limit_pos_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 1
      standard_stepper...
Read more »

UGS_Prefs.zip

UGS preferences (can be imported in Universal File Sender)

Zip Archive - 16.50 kB - 01/17/2024 at 15:23

Download

Zip Archive - 76.16 kB - 01/17/2024 at 13:23

Download

config.yaml

config file for FluidNC CNC controller

yaml - 1.32 kB - 01/16/2024 at 21:08

Download

  • installing FluidNC

    JP Gleyzes01/16/2024 at 21:04 0 comments

    To install FluidNC on a brand new ESP32, connect it to your serial port with USB and into a web browser go to FluidNC web installer.

    click Install and select the proposed Processor

    Then choose the "Wifi" firmware variant

    Now select the file browser and import the config.yaml of my CNC controller

    Now you should enter the credentials of your wifi router into your ESP32.

    Reboot the ESP32 and a hot spot names "Fluidnc" should appear. Connect to this hotspot with password 123456

    then you should see this page :

    Click on the FluidNC tab and enter your wifi credentials

    now  your ESP32 will reboot and can connect to to your internet router.

    So with your PC browser go to this URL : http://fluidnc.local

    And here we are : your "CNC" is accessible from your web browser

  • the controller PCB

    JP Gleyzes01/16/2024 at 08:14 0 comments

    Converting this schematics into a dual sided PCB was a piece of cake! The only "trick" was to use the PCB to support the DB25 connector. The thickness of the PCB is just perfect to fit between the two rows of the connector. One row on top face (red) the second on bottom face (blue).

    This PCB was sponsored by PCBWay (thanks for that!). You can get yours following this link: CNC controller board PCBway

    The quality of this PCB is, as usual, excellent. 

    The only important parameter when ordering is "thickness". Don't change the default value of 1.6mm

    With this value the PCB will fit perfectly into the DB25 connector pins.

    The ESP32 lolin Lite board is mounted in "Mezzanine" above this shield, the result is a very compact device that can be powered by a USB cord connected to the PC. (alternatively I added a 5V connector, but I will probably not use it).

    Here you can find Eagle files and BoM

View all 2 project logs

Enjoy this project?

Share

Discussions

DBQ wrote 01/13/2024 at 08:45 point

Where can I download the control software?

  Are you sure? yes | no

JP Gleyzes wrote 01/15/2024 at 14:04 point

control software is fluidNC : http://wiki.fluidnc.com/

  Are you sure? yes | no

aaaaaa wrote 01/06/2024 at 19:08 point

meybe add normal socket usb A female for flash drive/pen drive for g code and ......

screen , keys (like prusa 3d printer  rotor/knob)

  Are you sure? yes | no

JP Gleyzes wrote 01/07/2024 at 08:50 point

I forgot to say that USB socket is already present on the lolin32 esp board.

I have left 4 pins accessible for future use.

For now this board can be controlled by fluidnc and all features that it offers (serial over USB, wifi, bluetooth)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates