Setting up Marlin for your Root CNC

Hi,

I’ve just finished the Marlin set up of my Root 3 CNC, and since I did it from scratch and learned a lot of things about it, I wanted to share this process with you.

Marlin firmware is mostly used for 3D printers, but they also made is CNC ready, and very flexible to allow you to do a lot of modifications to suit your needs.

There is a Marlin Firmware fork made by Pete on Github, but I wanted to understand what modifications are to be made to make it work with the Root CNC.

So I’ve downladed the latest version of Marlin, and did the following modifications :

In Configuration.h :

#define EXTRUDERS 0

This is a very important step. You have to define that no extruder is used on the board, so that the extuder stepper moto slot can be used to power the second motor on your Y axis.

#define USE_XMIN_PLUG
#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
#define USE_XMAX_PLUG
#define USE_YMAX_PLUG
#define USE_ZMAX_PLUG

The way of using the endstops is up to you. I’ll just say here that I’m using a touching plate for the Z min, and that I’ll show you how to set up the double endstop for the Y axis.

Since you are here, you can fine tune your machine by modifying the junction deviation factor, or add the S curve acceleration.

#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

Again, this is to allow you to use the touching plate for homing the Z axis.

In Configuration_adv.h :

#define Y_DUAL_STEPPER_DRIVERS
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#define INVERT_Y2_VS_Y_DIR true // Set ‘true’ if Y motors should rotate in opposite directions
#define Y_DUAL_ENDSTOPS
#if ENABLED(Y_DUAL_ENDSTOPS)
#define Y2_USE_ENDSTOP YMAX
#define Y2_ENDSTOP_ADJUSTMENT 0
#endif
#endif

This is where the magic happens. Since you’re delared 0 extruder, and defined Y dual stepper drivers, the extruder slot will be used to power your second motor on your Y axis. So no need to re-map any pins on your board.

And this is it ! Don’t forget to fien tune your machine by calibrating the stemps per mm, the bed size, the accelerations/feed rate, and maybe the skew factor, and you are good to go.

I haven’t hooked up the spindle on the board directly yet, but if I do so, I’ll complete this topic with the method I’ve used.

Happy CNCing !

1 Like

Great post!

thank you for sharing.

I think I’ve made these changes on the main branch to help others.

Thank you all for the valuable information! I’m about 99% complete with my build, and I’m doing some testing with the X,Y,Z Axis’s movement. I’m glad to report that all seems to be working well… with the exception of the endstops… I’m using normally open end stop switches, and after issuing a M119 command, I had to make some changes to have the switches report back as “open” rather than triggered (changed value to true from false):
#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.

If I depress one of the end stop switches, the m119 returns “triggered”.

I hope this isn’t a stupid question, but if I’m doing a manual control should those switches prevent the axis from moving, or should it disable the motors from advancing? In my case the switches do not really do anything… the motors will keep moving. Is this because I’m issuing a manual movement (via pronterface or repetier host), or are the end stops not working the way they should?

ok… I figured it out…in the configuration_adv.h file I uncommented:

#define ENDSTOPS_ALWAYS_ON_DEFAULT

and that fixed the issue. Onward. :slight_smile:

Glad to hear you’ve sorted it!

Would you mind uploading you changes to the GitHub page so other can get your settings?