Internal error on command:"ENDSTOP_PHASE_CALIBRATE"

I have a CoreXY printer with two Z motors: stepper_z and stepper_z1

[tmc2208 stepper_z]

[tmc2208 stepper_z1]

I also have enabled endstop_phase:

[endstop_phase stepper_z]

[endstop_phase stepper_z1]

And it used to work.
Now however when I run the commands I get an error for the second stepper:

ENDSTOP_PHASE_CALIBRATE STEPPER=stepper_z
stepper_z: trigger_phase=386/512 (range 379 to 388)

ENDSTOP_PHASE_CALIBRATE STEPPER=stepper_z1
Klipper state: Shutdown
Internal error on command:"ENDSTOP_PHASE_CALIBRATE"

In klippy.log I found:

Internal error on command:"ENDSTOP_PHASE_CALIBRATE"
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/gcode.py", line 198, in _process_commands
    handler(gcmd)
  File "/home/pi/klipper/klippy/gcode.py", line 135, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
  File "/home/pi/klipper/klippy/extras/endstop_phase.py", line 179, in cmd_ENDSTOP_PHASE_CALIBRATE
    endstop_phase, phases = self.generate_stats(stepper_name, phase_calc)
  File "/home/pi/klipper/klippy/extras/endstop_phase.py", line 206, in generate_stats
    lo, hi = found[0] % phases, found[-1] % phases
IndexError: list index out of range
Transition to shutdown state: Internal error on command:"ENDSTOP_PHASE_CALIBRATE"

I can run the generic command:

ENDSTOP_PHASE_CALIBRATE
stepper_x: trigger_phase=256/512 (range 213 to 469)
stepper_y: trigger_phase=474/512 (range 474 to 474)
stepper_z: trigger_phase=382/512 (range 382 to 382)

Where is the mistake? I haven’t changed anything (as far as I remember) since last time, except updating several versions of klipper.

Am I the only one having the issue? if so, is anyone able to spot any configuration mistake?

Thanks.

Please follow the instructions given when you opened the post.

1 Like

I thought I was helping by isolating the errors from the klippy, I will post everything as requested as soon as I can.