Automatic XYZ-offset calibration

Hi,

I would like to have a fully automated XYZ-offset calibration macro for my IDEX printer. I want each nozzle to touch a cylinder. The nozzle is grounded and the cylinder is connected to an input, like a limit switch.
The macro should move to a predefined position. There it should first touch off z. Then it should touch the cylinder from different sides. With some calculations I should be able to calculate the center of the pin and then the offsets.

My question is, how do I move an axis until this “limit switch” changes state?
And what is the correct way to configure this limit switch?

Basically a homing motion with a different limit switch and defined directions.

General idea:

# Starting
...
# Touching off from left side
G91
G1 X-5 # Moving to the left side
G1 Z-2 # lowering nozzle
# Moving in X+ till limit swich triggers
G1 X5 F600
  {% if printer['sensor test'].detected %}
      ABORT
  {% endif %}
# limit swich triggerd

#Saving position and doing calculations
...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.