I finally got a nozzle Z endstop setup on one of my own printers to test the auto Z module compatibility. As you described, it had some odd movements. Here’s my solution which prevents the repeated attach/detaches during the switch body and build plate probing moves:
protoloft:master
← cloakedcode:master
opened 12:05AM - 09 Aug 23 UTC
In many places related to probes, in the main Klipper code base, the 'multi_prob… e_begin()'/'multi_probe_end()' methods are used to tell the probe several samples are going to be taken.
For example, during bed mesh creation, a helper class is used to run the mesh probing.[1] This helper class uses the multi probe methods.[2]
This signalling to the probe that multiple probes are coming is important for modules that implement Klicky/dockable probe support. For example, this signalling can prevent mutliple attach/detach cycles.[3]
A similar result could be accomplished through the 'before_switch_gcode' config option but this commit removes the need for the user to do additional configuration and brings the behavior/implementation more in line with upstream Klipper probe handling.
[1]: https://github.com/Klipper3d/klipper/blob/039daec/klippy/extras/bed_mesh.py#L318
[2]: https://github.com/Klipper3d/klipper/blob/039daec/klippy/extras/probe.py#L437-L444
[3]: https://github.com/Klipper3d/klipper/pull/6247