GRBL vs. Marlin for milling

Hi.

I’m wondering why everybody here is using Marlin even for milling. I build a 3d printer about 3 years ago that runs wonderfully with Marlin. I have never tried it for my MPCNC, but I don’t see the appeal of using it to run a CNC mill. Am I missing something? I’m using GRBL on an Arduino UNO with a CNC shield to drive my MPCNC. It’s a wonderful machine (Thanks Ryan) and I couldn’t be happier with the ease and flexibility that GRBL has to offer.

Marlin Pros:

  • Can be used to change the MPCNC into a 3d printer without changing the electronics
  • Autonomous printing possible via SD card.
Grbl Pros (some points depend an a capable Gcode sender like bCNC):
  • Support for several coordinate systems (machine coordinates, workpiece coordinates) with origin changeable on the fly
  • Supports "scanning" the work area. Load a Gcode file in bCNC, hit scan and the machine will move in a square motion to indicate the maximum travel (only X and Y of course) of this file. You can then check that it will fit on your stock material and that you won't have any problems with your clamps.
  • Supports autoleveling uneven surfaces (perfect for PCBs which can be rather uneven, but Z needs to be really precise. bCNC scans a grid pattern (e.g. every 5mm), probes for contact at maybe hundreds of points and then adjusts the Gcode so the Z coordinates are always relative to the local height at that point. This is very different from what Marlin does as it always assumes a perfect plane and just calculates how this plane is tilted.)
  • Semi-autonomous printing if driven via a Raspberry Pi or other SoC board (either from a computer in the network via VNC or with an attached monitor, keyboard and mouse)
  • Use an inexpensive separate keypad (preferably wireless) as a remote control to jog the machine
  • Supports semi-automatic tool change (on tool change command it drives the machine to a fixed tool change position, waits for manual tool change and waits until it is unpaused, moves to a fixed position with a touch plate, probes for contact and then set the TLO (tool length offset), drives back to the tool change position and resumes working from there. Perfect Z every time with minimal effort.)
  • Configurable on the fly without any firmware flashing.
  • Support for hardware buttons for start/resume, feed hold, reset/abort (just connect a simple push button to the appropriate pins)
  • Limit switches can be set to "soft" so electrical noise generated by the spindle is not a problem. This means that the switches are "just" used for homing (with the spindle turned off) and any triggers afterwards (e.g. by electrical noise) will be ignored. But GRBL will still stop moves by software from going outside of the machine workspace for safety.
  • bCNC also supports to fix a small cheap webcam near the endmill for precise positioning to existing features (e.g. place the end mill directly over an existing hole without guessing).
  • Laser mode that adjusts the laser output to the current speed for even cuts (I have no experience with this as I don't have a laser.)
Some of this obviously requires limit switches and a touch plate. But both are cheap and relatively easy to install. And having a configurable origin has some benefits anyway. You don't need to know where you want to fix your stock material beforehand. And you can move it if there are some imperfections in the material. A couple of days ago I milled a sign out of wood that had some ugly spots on it. So I fixed the wood to the table, set an approximate origin and then moved the endmill over the ugly parts. In the bCNC window I see the planned moves and the current position of the end mill so I can see where this imperfection will be relative to the finished piece. So I adjust the origin accordingly and the spot is just outside of the sign I want to mill. How would I do this with Marlin?

(For the touch plate to work the endmill needs to be grounded, but this should be possible with a bit of effort even if it is not grounded by default. On my last spindle I used a servo to automatically make a ground contact when the spindle was not running an retract the contact as soon as the spindle started. A manual ground via a clip to the end mill is possible as well, of course. Just don’t forget to remove it after probing. :-))

So, what does Marlin has to offer that everybody is using it even if they are just using it as a CNC mill (and not as a printer)? I’m no CNC expert. I just build the MPCNC about a year ago and never tried Marlin to control it, so I really have no idea if I’m missing something.

1 Like

Marlin is more flexible, because of the 3D printing. If you’re starting, or you’re not sure, it’s a good default because you can get a lot of things done with it. When you get through a ton of it and want to do more, then you can run grbl.

I run grbl too, but a lot of those features are available in Marlin too. You can change settings in eeprom without flashing. The tool changes are just gcode scripts. The coordinates in grbl are nice, but Marlin’s coordinates are just the workspace coords, there are no machine coordinates. The gcodes for probing work in Marlin, although I’m not sure bCNC will work with it. Octoprint can semi automate cuts, and can be jogged with a keypad.

Like most things, grbl is more specific, and therefore is simpler for some things, and had more advanced features for milling. Marlin offers 3D printing, and since the MPCNC is printed, a lot of people are already 3D printer enthusiasts, so these tools are familiar with them.

But, there’s no mutual exclusion. I enjoy reading about tips and techniques in grbl or machine kit, or whatever. Feel free to post your settings, or pics of your setup or steps to do some of this stuff or whatever else might be helpful to others.

The MPCNC’s strength is it’s mechanical effectiveness and flexibility. It’s a great platform for any firmware or almost any tool. But when someone is just starting, I encourage them to try it the Marlin way. Because there are guides, tons of forum info and plenty of regulars here to answer questions. When people get a bit more into it, they can try things like grbl easily.

2 Likes

Thanks guys. I agree with you both.

I made this machine to be non-firmware specific (heck pretty much non hardware specific as well). I have both marlin and grbl configurations. For people using multiple functions and printing, Marlin is the better choice and a vast majority of the users do this so I focus my time here. I could easily save a ton of money and lower my kit prices and use a really small feature lacking cnc shield board but I am more focused on a multi function capable machine. The users here vary from the gurus, to people that can not attach a picture to there troubleshooting emails to people that can’t really email and I actually have to help them over the phone.

You guys are smart as heck and have no issues using the other systems out there and I love reading the shared knowledge as you find things out. I learn something everyday, most days I feel like I have no business giving advice as most of you have a much better understanding of some of these things. When I find something that works I share it and am careful to never say this is the best way unless I truly feel it is so.

6 Likes

I used GRBL on my first little test machine I built a few years back out of some DVD/CD drive components. My biggest complaint were the various gcode senders all seemed flaky and unreliable. Though that was a few years ago and I didn’t find bCNC so things may have improved on that front.

That said, the reasons I run Marlin on my MPCNC are:

  1. I love being able to run off SD. Not having to dedicate a computer (even a pi) to the machine is a huge plus for me. I don't have room for a keyboard and monitor near my machine and wouldn't really want to work from the ones that are in the same room since I'd have to have my back to the machine. I've also never trusted the reliability of a USB connection, and the sender/sending computer not to crash mid-process.
  2. I do plan on using my machine for 3D printing at some point...or at least I keep saying I want to try it due to it's HUGE bed. But...only have one print I want to do that won't fit on my dedicated printer and the other 3 parts of that project have yet to print successfully so it's a low priority right now.
  3. Familiarity. I'd rather not spend time having to deal with two separate sets of firmware for my two (soon to be three) different machines.
But bottom line is for the stuff I do on my MPCNC Marlin works and is an easy path of least resistance. I've considered trying GRBL or ESTLCAM's firmwares on it...but heck I'm still on an out of date flaky build of Marlin and haven't even updated to a better more recent version because right now it gets the job done and I enjoy using it so much I don't want to have any downtime tweaking it :D

If I was doing more traditional milling work then I’d probably swap over to GRBL or something else. But one of the big appeals of the MPCNC to me is it’s flexibility and in that respect Marlin has a lot going for it.

For grbl gcode sending, I recommend CNC.js. I run grbl on a piCNC board from prontoneer, and it’s pretty slick. It’s a nice web preview, and it’s pretty customizable. The author is pretty responsive to issues as well.

1 Like

Thanks for the replies. So I guess I didn’t miss any of the advantages for Marlin in my list above.

Although I’m a bit surprised that so many people are using their MPCNC for 3d printing. Would have thought this was more of a niche as most people probably already have a 3d printer which they mostly printed their CNC with. :slight_smile:

Just a couple of points:

That’s exactly why I don’t know how semi-automatic tool changes could be possible with Marlin. As Marlin has no idea where it actually is in the MCS (machine coordinate system) as it just knows about the WCS I don’t see how it can move to fixed position (relative to MCS) for an installed touch plate. Setting the TLO could probably emulated by using G92, but this doesn’t help if it cannot find the touch plate.

I’m pretty sure Marlin will not work with GRBL. GRBL has a two-way realtime channel over the serial link that bypasses the GCode buffer in the Arduino for instant feed, spindle and emergency stop control and to send status updates (current coordinates, switch triggers) back to the controller. I think the protocol is GRBL specific and bCNC is expecting it to control the machine.

Thanks. I didn’t know that about keypad support in Octoprint. Have to look into that as I’m running my printer via Octoprint.

Maybe I will document my next PCB. This should show off most of the tweaks and shows why semi-automated tool changes are necessary if you don’t want to lose your mind :-). Although it make some time until that happens as I’m a bit busy at the moment, have never done this before and my 500W spindle broke and I just replaced it with an (enormous) 1.5kW water cooled spindle. I couldn’t believe how big and heavy this thing is when I unpacked it… But so far the MPCNC is holding up great, but I still have to tweak some things until I’m confident enough that I can mill as delicately with this monster as needed for a proper PCB.

I completely agree with the flexibility. I just didn’t realize that really so many people actually use it for 3d printing. And although I think a laser cutter and maybe a drag knife would be interesting, I think I wouldn’t use it much as changing the tools is such a big hassle. (This might be related to the F-version as the nut traps at the back of the tool mount (or anywhere else for that matter) don’t work. Replacing the spindle holder for the new spindle took me about two hours I think and I don’t really feel like repeating this delightful process.)

I was just surprised to see absolutely no mention of GRBL on this site and in my opinion it has so much going for it if one is not using the machine as a 3d printer.

Here is a picture of this little beauty after my first little project with it. I replaced the lower Z-mount with a version with an attached clamp because it is so huge and stability was not so great with only the two lower clamps.

You can also see the very minimalistic midspan supports. Just two screws with a nyloc nut and a little printed part (actually two as I can remove one part so the head is free and I can pull it out sideways if I space for bigger parts). The nuts are not yet fastened to counter the flex. Haven’t come around to that yet. But it’s relatively easy to do as you know the pitch, can measure the flex offset with a Z probe and calculate how much you need to rotate the nut.

At the lower clamp you can also see the camera mount with the magnetic limit switch on top (and the corresponding magnet just above it). The free pin header there was for my old spindle to drive a servo motor to ground the end mill while turned off.

@Jeffeb3: You also wrote about machine kit. Do you have any experience with that?

I don’t have experience with machine kit, but there was an article in digital machinist about using the MPCNC as a machine kit platform. There is a forum post about the article and there is a forum post with his progress.

I’m currently building a 2nd controller, with a Arduino and a Protoneer CNC shield. The primary reason to start this was to be able to hook up the a laser, control this with Laser Web 4. This will allow me to keep my laser workflow the same as with my previous GRBL based laser engraver. While saving the space of having 2 big machines in my attic.

I use aviation connectors for my XYZ connections and adapter terminals for the end stops. Which helps me switch controllers quickly.

However this setup will also enable me to either CNC with the ESTL CAM / Marlin workflow which is well documented here, and experiment with GBRL if time permits :-).

Maybe I will document my next PCB. This should show off most of the tweaks and shows why semi-automated tool changes are necessary if you don’t want to lose your mind :-).
I'd look forward to any GRBL CNC experience I can learn from. For now I'll concentrate getting my Laser up and running :-).
1 Like

Looks like Marlin is going to be getting multiple coordinate systems:

There’s still the queuing to contend with…but that’s one of the big things Marlin lacks for Milling now coming into play. So that’s nice to see.

2 Likes

If we get a G0 and G1 will we also be in good shape!

On the use of GRBL I am building a lowrider and am considering GRBL because I can then use Carbide Motion v4 as a controller running on an 8" Win10 tablet. Will the GRBL running on a Ramps and Arduino allow for the dual Endstops on Y and Z for auto squaring?

1 Like

I can’t help with that, I am not even sure you can run GRBL on a ramps yet. Are you sure you can’t just output regular gcode and not use GRBL?

Maybe we have some pros that would know different.

1 Like

You either run grbl or Marlin, not both. Marlin has the dual endstops. I don’t know anything about carbide motion but if it’s grbl compatible, it probably won’t work for Marlin. It might, but the motion feedback in grbl is totally different. That’s just a guess.

If you want to control Marlin from a tablet, run octopi on a raspberry pi.

Hi Ryan, in your post above you mentioned that you have configurations for both Marlin and GRBL, could you point me in the direction of the GRBL configuration, have looked on the site but could not find a link. I am currently trying to get accurate milling of PCB’s and came across an application “OpenCNCPilot” that interests me, it only runs on GRBL v1.1.

Thanks in advance

Rob

What I have is in the “Firmware” page. It is very basic but should get you started.

1 Like

I know this is an older discussion but for what it’s worth I agree with your position Ryan. The CNC world is full of choices. Arguably too many choices and newbies can be paralyzed by indecision or purchase something that is unsuited for their needs. That’s why Costco has limited selection - it helps the consumer make choices.

You present a reasonably robust, relatively inexpensive, very versatile, cleverly designed machine. Marlin suits the choices and comprises you had to make. Rambo boards are straightforward and similarly versatile. A Newbie like me can be up and running in a couple of days If we Read and Follow your instructions. Thanks for your decisions…

Before May this year I had no clue as to what I wanted for sure but was very pleased to find your product. It’s a steep learning curve for the majority of us so Lots of reading and questions ensue. I think the few who are fairly familiar with the CNC world forget how little they knew at one time so pick at your choices from an experienced position but not necessarily with the newbie or budget conscious person in mind. Kinda like pro golfers unhappy with the cut of a rough or green in a community golf course.

Keep up the great work and patient problem assistance. Cheers

 

4 Likes

That was a very nice post, thank you!

1 Like

 

I too am a newbie, I am also a retired engineer who struggles with all the options available, especially in the world of software.

I am certainly not a CNC expert, I merely requested some information on GRBL as I understand from various sources that this is the best option for bed levelling of PCB’s with GRBL application. I want to try this for myself and see where I go, by the way, the additional hardware to run GRBL is $20-$30, would hardly break even my pension!

 

So, I’ve started building my own CNC router before MPCNC showed up, and I just finished it last month (kids in between with little to no time to invest heavily time on hobbies…).

Anyway, I installed the MPCNC marlin software for the dual endstops, and tinkered it a bit because I’m only using 1 XX axis.

I tried ESTLCAM for a couple of tests and exported with the GRBL post processor. Both writing and styrofoam machining went great, using the SD card in an Arduino Mega2560 with RAMPS1.4!

Suddenly I start hearing about using Marlin instead of GRBL and don’t really know why. I went back to estlcam and exported with the Marlin post processor, and the main difference is in the beginning of the file. The rest is exactly the same. But I haven’t tried the Marlin code.

By the way, I don’t really know that much about CNC, I’m just an enthusiast that really likes to follow DIY stuff, besides owning a 3D printer for 7 years now.

So my question is, does it really make that much of a difference of exporting the file with the Marlin post processor instead of the GRBL?!!!

This is the beginning of each code:

GRBL:

(Required tools:)
(Flat 3mm)
G21
G90
G94
M03 S16000
G00 Z5.0000

(No. 1: Hole 17)
G00 X13.8783 Y12.7243…

MARLIN:

G90
M03 S16000
G00 Z5.0000

;No. 1: Hole 17
G00 X13.8783 Y12.7243