It would be nice to have a command to move until some specific sensor triggers and then stops at that position.
As trigger sources I would say, probe, endstops, gcode_buttons and even runout sensors should be usable (if possible).
I see a few different use cases for this.
- offset calibration on tool changers. Using a Sexbolt sensor or something similar, this could allow to move the nozzle from all different directions onto the sensor and calculate the offset inside macros.
- probe and gcode_button as trigger could be used for automated z offset calibration.
- the runout sensors could be used in some MMU scenario to unload the filament and stop at a known spot.
- this would even allow to have multiple probes implemented using macros
- you could even use it to detect and correct layer shifts if you move to the endstop after every layer and verify if the position is plausible.
I am aware that move of this can be done with macros using for loops. I have done it multiple times. It works, but the constant query commands spam the console even though they are not useful for the user. (something to hide the query command output when not needed could help in those situations too)