Hey all. I built the MPCNC (the “burly” I believe, it was a couple years ago), and now I’m trying to get it to work again.
The good news is that in terms of hardware and connectivity, I think I’m good. I have repetier-host, and if I go to the manual control tab, I can move the CNC head around in all dimensions. All good!
My question is about running a gcode program. I made a little example program in FreeCAD (just cutting a shallow pocket out of a 3D rectangle), and selected the grbl postprocessor, and output it.
Then, I go to repetier host, load the file, and hit “print”. It does do something, moves the head up a bit in the Z-direction, but then quickly just stops. It appears to not understand some commands, according to the echos in the logs. Here they are:
I’m not sure why. You can see that my board uses the Marlin firmware (is that the right term?), which is obviously a bit different than grbl. However, I found a thread on the FreeCAD forums (that it won’t currently let me link to…) where the guy had the same exact “unknown command” errors…but it’s not clear what the solution was.
I think I’m almost there, given how much stuff is working… but I just can’t get the final pieces to fit together. Can anyone tell me what I could read or try to figure things out? thanks!
Well, my experience with FreeCAD consists of a couple of rectangles with holes in them, but I believe you may be using the wrong post processor. I’m hazy on the details, but GRBL and Marlin both process GCode, but their control commands and such differ. Is there a Marlin post-processor? If there is I would start there. I’m also pretty sure someone with more experience in the matter will be along shortly.
I guess it’s because I’m a new user, but it won’t let me post this thread from the FreeCAD forums where the guy had the same issue (but if you google “Post for MPCNC with Marlin firmware” it’s the first hit).
The guy seemed to imply that his GRBL postprocessed code, from FreeCAD, still worked with his Marlin firmware…somehow. He said:
so if someone google searches MPCNC and FreeCAD like i did earlier today and finds this post: use GRBL post processor, and check the output gcode. the speeds need to match your needs in mm per minute . you don’t need to set mm/min in FreeCAD unless you want to . the post processor will convert to mm/min for you.
set your feeds in the tool controller, and set your travel speeds in the SetupSheet object.
Hmm, OK, so the lines in your code, like “N15 G1 X1 F2100*48”, is setting a feed rate of 2100 units. If you look at the marlin boot status, it lists the max feed rates of “echo: M203 X120.00 Y120.00 Z30.00 E25.00”. Now the GRBL gcode output is most likely mm/min, when Marlin is expecting the feedrates in mm/sec. Maybe try manually changing those F2100s to F10s, just to be safe, and send that to the machine. That would set your feedrate at 10mm/sec which isn’t very fast and shouldn’t cause to much pain if something goes horribly wrong. Just keep your hand on the E-Stop
ah yeah, I actually found that It does look promising. I’m trying to put it in the location of the other postprocessors on my system (/snap/freecad/16/opt/local/FreeCAD-0.18/Mod/Path/PathScripts/post/ in Ubuntu 20.04), but it’s giving me annoying stuff about copying it…
Okay, quick little update: you can apparently enter a custom postprocessor as a macro, and if it has the “XYZ_post.py” format, it just shows up in the postprocessor list for the job
So I did that and output the file with marlin. However, I’m still getting those errors… so now I think it might be about the feed rate thing you mentioned.
I haven’t ran the test crown, let me give that a try
Here’s the code I was running, after using the marlin_post.py postprocessor in FreeCAD: pocket_test_marlin.gcode (6.2 KB)
(I think it was failing at the same place as when using the GRBL PP, though.)
I think I have a hot lead maybe. It always moves the head (just has a pen attached right now) a few steps, but fails right after the last command in the console output I posted above. It appears to actually do everything I posted there, and shows it in the repetier-host tool path as well.
However, the next command (what I suspect is breaking it) is a G2 command (the first G2 command in the gcode I posted just now). I searched a bit and found this thread: Arcs on Marlin and Dual End Stops - #13 by jamiek
in which it appears a bug was discovered with the G2 code in Marlin! The guy did a PR, I’m not sure if it was accepted, and I’m not sure exactly which Marlin is on my board. But maybe that’s it, if my version is outdated? (it’s at least a year old, maybe more)
Anyway, I’ll try that tomorrow. I should reaaaally get to bed now
Those arc issues were related to slow movements, and they were sort of optimizing them. It shouldn’t just stop completely.
That version of software may be old or new. The bugfix is a moving target. Where did you get it? Ryan also marks his firmware with a number, like 425. 504, etc.
I’m honestly surprised arcs are more commonly a problem. The arc starts at the previous place, goes to the next XY, and has a center of IJ. That seems tricky to define on your own. I wonder if the Z is affecting it.
That bug is specifically when soft-stops are enabled (which is only true for dual-endstops unless you have manually enabled it) and when an arc move hits the edge of the workspace, it would go in a crazy direction instead of doing the ‘natural’ thing and remaining with in the workspace. The PR was accepted so it’s fixed in current versions. Your 302 build would have that bug but I don’t think that’s the reason for what you’re seeing.
Your “pocket test marlin” gcode looks okay to me, and ncviewer shows what looks like a reasonable job.
I guess I was just assuming because the date about the firmware in the console output said it was from 2018, and the post about the G2 was from 2019.
So…about the firmware. I was working on this with a few friends when we first built it, and it was one of them who installed the firmware. It was long enough ago that he definitely doesn’t remember where he got it Is there a way I can talk to the board to find the version?
or, could I just flash new firmware to make sure I’m using the right thing?
I’m honestly surprised arcs are more commonly a problem. The arc starts at the previous place, goes to the next XY, and has a center of IJ. That seems tricky to define on your own. I wonder if the Z is affecting it.
Hmm… I definitely don’t have endstops built in, and I don’t think I put them anywhere in my programs/code… Ahhhh what a mess.
Is there a simple solution here that only requires spending a bit of money?
Since it seems like even if I got this fixed, Marlin is its own hurdle, are there any simple/cheapish boards that would let me use the same motor drivers, but run GRBL instead?
We can probably walk you through flashing the board with newer software. It isn’t rocket surgery. If you want to go that route, post a pic of the board with your stuff connected so we can tell what you have and what features you have wired in.
If you do want to just buy your way out, the boards in the shop come preconfigured and flashed with recent versions of firmware.
Marlin supports a ton of boards (like 50) but it needs to be configured. We have a few common configurations covered (22 right now).
Grbl only officially supports the arduino uno with a grbl shield. There are lots of forks for other boards, but then you are dealing with non mainstream edits.
I know it’s complicated, but there is only so much we can do to make it easy. Ryan sells boards ready to go. We have some common configurations ready to flash. Board manufacturers are always going to try to get their board in your mind as one option.
oh sorry I don’t mean to be entitled or sound ungrateful! I’m incredibly impressed and thankful for the massive amount of work you guys have done for this project, it’s really amazing
I’m cool with flashing the board, I’ve flashed firmware a few times so I think I could figure it out from a guide if there is one.
I guess my main hesitation is that it seems like Marlin may be a bit of a constant stumbling block. I’m not criticizing Ryan’s choice to use it, I’ve read his reasons and they seem totally fair (and again, I don’t want to look a gift horse in the mouth ).
Basically, because FreeCAD and other CAM programs I might use don’t seem to output Marlin gcode, it seems like every time there’s a problem I’ll have to worry that it might be a Marlin vs “other” problem. I got that guy’s marlin_post.py script, which seems to run… but also output a G21 command that the console output said Marlin didn’t recognize… (is that because the Marlin units are always mm or something?)
But, if the simplest and smartest thing to do is just flash the board and use it, I wouldn’t mind. It seems like it’s at least worth a try, since it would be pretty easy and a potentially quick solution. Could you link me to a guide? thanks again!!
Share a pic of your board. I can point you to the firmware that is closest. There are instructions for arduino and platformio in the docs. Platformio is the future. Arduino is limping along with support.
I don’t mind using whatever, as long as it works on Ubuntu
(oh and I have five A4988 drivers on it. They were calibrated a while ago, I think. And I’m guessing that the fact that the manual control seems to work well should mean they’re decent enough?)