Hi, I thought I would share some information on setting up and using a servo deployed Z probe as I ran into a an issue with Klipper generating a “Failed to home z: Timeout during homing” error.
I built my own probe using a photo interrupter and a SG90 servo to deploy the probe. When retracted the optical end stop is triggered. The issue occurs when the servo is instructed to move to the deployed position and Z homing starts. The Z axis would raise up a bit then started down before timing out after a few seconds. Some of you might already guess the issue but it took me quite a while to figure out. I couldn’t find any solution when searching for the problem, hence this post for anyone else going down the same rabbit hole.
Anyway, the issue is the servo takes a few tenths of a second to deploy during which the Z stop is still triggered. The Z homing doesn’t seem to wait for the completion of the SET_SERVO command so it immediately thinks it has found the print bed. It lifts up a bit then starts down looking for the bed again. Of course, the bed isn’t there and the time out occurs after a couple of seconds.
The solution is pretty simple, once you know what is happening, you just need to add a G4 P500 following the SET_SERVO to give the probe time to deploy.
I will post a printer.cfg for my printer in the config section, but the relevant bit is,
[servo tower_pro] # SG90
pin: PA1
maximum_servo_angle: 180
minimum_pulse_width: 0.0005
maximum_pulse_width: 0.0024
initial_angle: 50 # retracted
[probe]
pin: PC14
deactivate_on_each_sample: False # keep deployed as it is too slow to retract and deploy each time
x_offset: -63.0
y_offset: -5.0
z_offset: -2.35
samples: 1
activate_gcode:
SET_SERVO SERVO=tower_pro ANGLE=93 ENABLE=1 # deploy probe
G4 P500 # allow time for probe to deploy before homing Z
deactivate_gcode:
SET_SERVO SERVO=tower_pro ANGLE=50 # retract probe
SET_SERVO SERVO=tower_pro ANGLE=50 ENABLE=0
Note that this printer is using a BTT SKR Mini E3 V2.0.
Cheers,
David.