I am trying to understand a certain aspect of the homing process.
When homing/probing, Klipper waits for the trigger from the endstop_state
response. After that trigger has been received, it queries the position of the axis stepper(s).
From what I can understand, Klipper uses two values to calculate the axis position - the stepper trigger position and the stepper halt position.
The halt position is the position of the stepper as reported by stepper_get_position
. The trigger position is a computed position based on the next_clock
value returned by the endstop_state
response.
I am confused on how the triggered position is computed. For a printer with 4 Z steppers, the is what Klipper uses to compute the Z axis position when doing QUAD_GANTRY_LEVEL
:
halt = {'stepper_z': -4002, 'stepper_z1': -4002, 'stepper_z2': -4003, 'stepper_z3': -4004}, trigger = {'stepper_z': -4298, 'stepper_z1': -4298, 'stepper_z2': -4298, 'stepper_z3': -4298}
What I don’t understand is how can the halt position be a smaller value than the trigger position (the Z axis homes towards 0, so lower position means closer to 0)?
The difference between the halt position and the trigger position seems to be any extra steps that the stepper might have done before it was stopped by the TRSync. So, the absolute value of the halt position should always be >= than the absolute value of the trigger position (abs(halt) >= abs(trigger)
).