Closed andrewmarles closed 9 months ago
I think a possible work around in the controller would be that probe protection would not assert if a movement is begun with the probe asserted, only if it happens while in motion. I do think that is somewhat perilous, but it would resolve this particular issue.
Ok, thanks to some sleuthing we found how they are doing it in LinuxCNC. They are just looking for a rising edge on the probe signal during moves, we can do that quite easily and this should preserve compatibility with existing probing macros:
In the law of unintended consequences, the new probe protection plugin is not compatible with the IOSender probing macros.
As an example:
Above probes to the workpiece and stops on contact. The problem is the G0 move to the latch distance. That move is initiated with the probe still in contact with the workpiece, so it triggers the probe protection because it is a non-probing move executed with the probe in the asserted state. With the probe protection, the macro would need to be as follows:
Here the probe is first taken off the workpiece with G38.5 so that the probe de-asserts, and then the rapid move can be used to finish the action.
I do apologize, I am not really set up to build IOSender and create a PR, but I had a look at the code. I think that to fix this in the sender would need the addition of a "ProbeRemoveContact" command to the ProbingViewModel.cs as well as small modifications to the various routines to insert the G38.5 moves to first pull the probe off the workpiece before executing the rapid moves.
Alternatively, I'm very happy to try to address this in the plugin, but I am not completely clear how to do that. The protection function is working as intended, it just isn't working the way that people expect when used with IOSender. I could look at trying to add something to specifically disable the protection during what are obviously pull-off moves, but I think that logic would get very complicated in the controller and be problematic.
Thanks for your attention as always.