path output Marlin

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
alex::freecad
Posts: 115
Joined: Fri Aug 29, 2014 1:25 pm

path output Marlin

Post by alex::freecad »

Hi all,
tltr:
what would be necessary to add path: output: marlin?
Would anyone provide me some 'get started' hints and some support?

Long version:
I have a mpcnc router, which is open source design, quite popular and can be build below 500 $.
It usually is operated from arduino boards with shields, running on marlin. I have the mega & ramps setup.
Marlin seems odd for a cnc mill. However, as many use the same setup for 3d printing, just changing the spindle for a print head it makes sense.

I like FOSS and try to get some traction on either side (mpcnc and here) to establish an easy to follow route to FOSS software for the mpcnc.
I started a thread https://www.v1engineering.com/forum/top ... ost-100177 with a series of (hopefully) easy to follow video based tutorial for freecad path.
Using grbl on ramps this could be used by some of the mpcnc users.
Using grbl output has been tried and seems to work some things, but there has been a discussion about unsupported commands an possible necessary adaptions https://forum.freecadweb.org/viewtopic. ... in#p306920

Next would be to allow the result to be used by many mpcnc users. And the most direct way (at least this is my conclusion after reading for hours through lots of grbl / linuxcnc etc. related stuff) would be to provide an output option Marlin to freecad.

What do you think - would it be possible?
Where should I start to read?
Any hints?


Whats the background of my conclusion:
Ryan et.al. make a great job on supporting different driver boards, such that everyone can use what he can easily get where he lives.
Besides the different boards, they have firmwares for
- a default setup 3 axis with x and y having 2 steppers wired together
- a dual endstop autosquaring setup which closes x and y to a separately driven stepper each, with each having an endstop including marlin adaptions for autohoming the 2 motor axes using 2 endstops
All this is well maintained and makes a lot of work. So it's no option to replace marlin to anything fitting to freecads outputs (I'm currently checking if I could at least adapt grbl on ramps to support the dual endstop setup).
-> my naive thinking therefore is that a possible solution would be to add marlin output to freecad. marlin is based on grbl; theres already a grbl output; for someone used to post processor development this could be easy. I'm not used to pp development, but, with the help of someone who is, i would try to digg into.
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: path output Marlin

Post by sliptonic »

We've had several people use Path to generate code for MPCNCs. I think Marlin basically uses a subset dialect of the LinuxCNC RS274.

You can certainly customize a post to fit your needs. Are there specific features of Marlin that you want to support or things that don't work using the linuxcnc post?
alex::freecad
Posts: 115
Joined: Fri Aug 29, 2014 1:25 pm

Re: path output Marlin

Post by alex::freecad »

Hi,
thanks for your quick reply.
We had some discussions about that here.
I guess the statement of guffy might make sense to you.
I learned in the meantime - from one of your posts
The list of available posts is built from all the post processors in two places:
1: <install>/Mod/Path/PathScripts/
2: your own macro directory.

You can take a post that's close to what you need, copy it to your macro directory, and then customize it. Give it any name you want as long as it ends in _post.py it will work. Like: myCustom_post.py
So I know where to start.
Should I use the mentioned smoothie pp or the philips, what do you think?
edit:
or start from grbl as some reported that it (almost) works, drop G17 and replace g18 and g19 with g2/g3
edit2:
grbl pp already has SUPPRESS_COMMANDS = [ 'G98', 'G80' ], so G17 can easily be ignored

Thanks
Alex
alex::freecad
Posts: 115
Joined: Fri Aug 29, 2014 1:25 pm

Re: path output Marlin

Post by alex::freecad »

Sorry for the fast updates.
I found:
These codes set the current plane as follows:

G17 : XY (default)
G18 : ZX
G19 : YZ

This mode applies to G2/G3 arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses G2/G3 arcs involving the Z plane.

These commands are supported in Marlin 1.1.4 and later with ARC_SUPPORT and CNC_WORKSPACE_PLANES enabled.
The mpcnc runs on Marlin2, so these should actually not be a problem anymore.
I will check that.
Post Reply