Post for MPCNC with Marlin firmware

Here's the place for discussion related to CAM/CNC and the development of the Path module.
victordamasceno
Posts: 12
Joined: Sat Mar 30, 2019 2:14 am

Re: Post for MPCNC with Marlin firmware

Postby victordamasceno » Tue Sep 03, 2019 12:30 am

I've got a MPCNC up and running (with Marlin) as well. The issue I run into with the post processor is related to G2 commands. My MPCNC runs off the Rambo board with dual end stops - I think there may be some issue with the gcode translation between the two steppers in each axis, but this is just a guess. Other than that, using grbl as the output processor works like a charm!

I'd be curious to hear what others with similar setup have experienced.

With all that being said, the workaround for the G2/G3 commands seems to be to segment the arcs into several smaller G1 moves - now for my question: Is there an option in Freecad to issue G1 segments in lieu of a G2/G3 arcs?

Thanks!
mlampert
Posts: 1301
Joined: Fri Sep 16, 2016 9:28 pm

Re: Post for MPCNC with Marlin firmware

Postby mlampert » Tue Sep 03, 2019 3:29 am

victordamasceno wrote:
Tue Sep 03, 2019 12:30 am
With all that being said, the workaround for the G2/G3 commands seems to be to segment the arcs into several smaller G1 moves - now for my question: Is there an option in Freecad to issue G1 segments in lieu of a G2/G3 arcs?
There currently is not. The idea is that such customisations are performed in the post processor since they are highly controller specific. I would recommend starting off with the grbl post processor and adapt it to segmentise the arc commands.
chrisb
Posts: 17993
Joined: Tue Mar 17, 2015 9:14 am

Re: Post for MPCNC with Marlin firmware

Postby chrisb » Tue Sep 03, 2019 6:20 am

There are different flavors of G2/G3. E.g. the center can be relative or absolute. Do you have a working example of something containing an arc or a description of the machine? If you have access to another program generating G-codes try something like this and post the corresponding G-codes:
Attachments
Snip macro screenshot-6a5cd9.png
Snip macro screenshot-6a5cd9.png (3.09 KiB) Viewed 198 times
victordamasceno
Posts: 12
Joined: Sat Mar 30, 2019 2:14 am

Re: Post for MPCNC with Marlin firmware

Postby victordamasceno » Tue Sep 03, 2019 3:38 pm

Looks like the grbl post-processor in Freecad defaults to relative, which is what my gcode shows. This gcode worked fine on my cheap 3018 CNC. I think the issue is with the MPCNC configuration and the posted workaround is to convert G2 commands to segmented G1 movements.

I have some additional tests to run before being able to confirm the above.

To be clear, I don't have any issues with the G2/G3 commands generated from Freecad and grbl post-processor, I'm just looking for an easy way to implement the workaround above, specific to my MPCNC machine.
chrisb
Posts: 17993
Joined: Tue Mar 17, 2015 9:14 am

Re: Post for MPCNC with Marlin firmware

Postby chrisb » Tue Sep 03, 2019 3:59 pm

There is no very good reason why your machine should not be able to process some form of G2/G3. That's - besides G1 - all what the whole G-code stuff is about.
There is no tesselation in any post processor, so going that way is by far not an easy one. To me it seems easier to find some documentation of your machine or a manufacturer recommended program which can produce real G-code for the model shown above.
chrisb
Posts: 17993
Joined: Tue Mar 17, 2015 9:14 am

Re: Post for MPCNC with Marlin firmware

Postby chrisb » Tue Sep 03, 2019 4:14 pm

See http://marlinfw.org/docs/gcode/G002-G003.html.
There are different flavors of G2/G3. My machine has similar options and giving the center of the circle sometimes resulted in rejection of the program because the machine was unable to recognize this correctly, probably due to precision issues. Switching to the radius form improved things a lot.
I would recommend to handcode some radius stuff and try it on the machine. Perhaps you can update the firmware on the machine as well.
victordamasceno
Posts: 12
Joined: Sat Mar 30, 2019 2:14 am

Re: Post for MPCNC with Marlin firmware

Postby victordamasceno » Fri Sep 20, 2019 2:26 pm

chrisb wrote:
Tue Sep 03, 2019 3:59 pm
There is no very good reason why your machine should not be able to process some form of G2/G3. That's - besides G1 - all what the whole G-code stuff is about.
There is no tesselation in any post processor, so going that way is by far not an easy one. To me it seems easier to find some documentation of your machine or a manufacturer recommended program which can produce real G-code for the model shown above.
This problem has been resolved - the issue was with the soft and hard stops that I had set which threw off some of the arcs - nothing to do with the gcode itself.
chrisb
Posts: 17993
Joined: Tue Mar 17, 2015 9:14 am

Re: Post for MPCNC with Marlin firmware

Postby chrisb » Fri Sep 20, 2019 3:44 pm

Thanks for reporting back.