CAM postprocessor 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
uwedamm
Posts: 10
Joined: Fri Nov 12, 2021 9:55 am

CAM postprocessor marlin

Post by uwedamm »

In Freecad-daily, I tried using the marlin postprocessor to generate g-code for my self-made mill, which is controlled by MARLIN FW.
All speeds are generated as mm/s, which does not fit to mm/min, which is expected by marlin.
I searched the internet and found some marlin_post.py alternative, but this one was not very useable, e.g. fixed feedrate in the py file:
G0XY_FEEDRATE = 800
"Finally" I modified the grbl_post.py to replace "()" comments by ";" and added "\n" to multi g-code lines.

Works like a charm for me. If someone is interested, see attached.
Attachments
marlin_post.py
(23.7 KiB) Downloaded 89 times
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: CAM postprocessor marlin

Post by Wsk8 »

Or you could simply change the unit settings in: Edit → Preference → General → Units tab's Units settings
uwedamm
Posts: 10
Joined: Fri Nov 12, 2021 9:55 am

Re: CAM postprocessor marlin

Post by uwedamm »

Did I understand that correctly?
I modified Unit System to "Metrics small parts & CNC(mm,mm/min)"
But there is no change in the generated gcode:
G1 X99.967 Y-10.995 Z1.500 F10.000
And Vert. Feed is 600 mm/min

Are there any other differences between marlin_post.py and grbl_post.py (beside () comments and multi gcode lines, I have to consider?
Else I would keep my modified grbl_post.py

(I do not have that much experience with CAM, till now, I wrote all my gcode by hand (scripted)... I usually use only G1,G2/G3, G92 not much more.
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: CAM postprocessor marlin

Post by herbk »

Hi Uwe,
where do you have the code line from? from the exported file or from FC "check gcode" ?

Internal FC Path always calculates with mm/sec. . If you have the setting at "Metrics small parts & CNC(mm,mm/min)" then the code gets translated to mm/min.

Also the Feedrates should be shown as mm/min at the operations data fields...

Did you restart FC after changing the settings ?

And something maore: please post your FC Informations !
Gruß Herbert
uwedamm
Posts: 10
Joined: Fri Nov 12, 2021 9:55 am

Re: CAM postprocessor marlin

Post by uwedamm »

Freecad version: 0.20 (daily)2021/11/13 10:22:00 (I do not update so often)
Downloaded marlin_post.py (2021/11/17) from:
https://raw.githubusercontent.com/FreeC ... in_post.py

I checked the marlin_post.py file and saw:
# * Initial configuration, not changeable
...
UNIT_FEED_FORMAT = 'mm/s'
updated it inside the py-script
UNIT_FEED_FORMAT = 'mm/min'
-> Now it works fine... I will try to experiment with the grbl and marlin version, if they are similar "stable"



Below message only for completeness (This happened, before I updated marlin_post.py),

Inspect G-Code shows:
G1 F10.000000 X99.966543 Y-10.995009 Z1.500000
Path Postprocess shows (same is in the generated gcode file):
G1 X99.967 Y-10.995 Z1.500 F10.000
Tool shows Vert Feed = 600mm/min
In operations data fields I cannot find any feedrate (Btw: I would not expect the values there)

Freecad started today evening, configuration checked
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: CAM postprocessor marlin

Post by sliptonic »

FYI, The 'inspect gcode' tool is showing the contents of the Path Commands. (It really should have its tooltip changed). The Path commands are always shown in freecad units (mm/s) .

Check the gcode from the post processor.
Post Reply