terjeio / ioSender

A GCode Sender for Grbl and grblHAL written in C# (Windows only).
BSD 3-Clause "New" or "Revised" License
207 stars 65 forks source link

G41/G42 Cutter Compensation #342

Closed gharbarka closed 7 months ago

gharbarka commented 7 months ago

I could not find any reference in the wiki or the discussions pages of ioSender and the grblHAL these 2 commands. I understand these are not implemented.

Is there any intention to implement these? If the answer is in the negative, how are people getting around this issue? Thanks.

andrewmarles commented 7 months ago

I am not speaking for Terje, but in the past there have been discussions about how to implement this in GRBLHAL. It is not completely trivial as the controller does not see the whole gcode program, but since G41 and G42 are only ever applied to simple 2d contour toolpaths I think that the approach would be to implement a motion pre-planner that is activated on G41/42 and then performs the necessary offset on subsequent valid g-code commands and creates a corrected path on the fly that is then passed to the GRBLHAL planner via the existing mc_line, mc_arc functions etc. It is a race to see who will do this (unpaid) work first as it is something that myself and others have been looking at for a while. I know that PRs are always welcome if you have some ideas on moving the implementation forward.

Despite the above, there's no issue to 'get around'. While I do not want to minimize the usefulness of G41 and G42, these commands are mainly useful on large VMC centers where the toolpath generation (CAM) is performed separately (often by another person who is not actually running the machine) from the machining. In that situation an operator might well need to make small adjustments to a part without the ability to simply re-generate the toolpath. Cutter compensation is not a hard requirement to perform precision machining in GRBLHAL. There are 2 main approaches that I've seen people use with success:

1) Simply run the CAM application at the machine. As IOSender is a (relatively) simple Windows application, it is trivial to be standing at the machine with both IOSender and something like Fusion360 CAM open at the same time. You can simply run the contour operation as a g-code file, measure your output and then adjust something like your 'stock to leave' parameter and re-post the toolpath. This is not really any different than changing the compensation value via MDI commands.

2) Generate multiple toolpaths. If you cannot do your CAM at the machine, then you can simply generate a few different versions of your toolpath with + and - tolerances and then use the appropriate one at the machine.

Both of the above approaches will allow you to hit very precise tolerances even on simple hobby machines.

terjeio commented 7 months ago

Is there any intention to implement these?

It is the longer term plan to do so, perhaps in conjunction with adding support for G61 and G64?

gharbarka commented 7 months ago

Thank you both for your contribution.