Well, I think I can reproduce this. I see microstep drift across some of the z steppers. The first z stepper never seems to drift. But the other steppers have some drift.
klipper log: test_microstep_drift.log (688.0 KB)
console log: test_microstep_drift.console.log (17.9 KB)
Keep in mind that this is NOT stock klipper, so you could dismiss this as just a bug in the load cell code. Its using custom endstop code, however what I’ve done doesn’t alter homing.py, kinematics or itersolve. Nothing I’ve done should impact the microstep position of an individual stepper. It also uses trigger_count=1
so this might not be the same issue. It could be something to do with the multi-stepper implementation.
I disabled the z-axis thermal compensation and tried not doing a QGL at machine startup but these didnt make a difference. I put some M400’s in the macro as it seems that GET_POSITION might run before the step queue drains and give an in flight position.
# Before
// mcu: stepper_x:6410 stepper_y:249602 stepper_z:248 stepper_z1:260 stepper_z2:6407 stepper_z3:263
// stepper: stepper_x:275.000000 stepper_y:225.000000 stepper_z:4.999982 stepper_z1:4.999982 stepper_z2:4.999982 stepper_z3:4.999982
// kinematic: X:250.000000 Y:25.000000 Z:4.999982
# After
// mcu: stepper_x:6410 stepper_y:249602 stepper_z:248 stepper_z1:262 stepper_z2:6409 stepper_z3:266
// stepper: stepper_x:275.000000 stepper_y:225.000000 stepper_z:4.999982 stepper_z1:4.999982 stepper_z2:4.999982 stepper_z3:4.999982
// kinematic: X:250.000000 Y:25.000000 Z:4.999982
# Before
12:44:49 // MSCNT: 000000dc mscnt=220
12:44:49 // MSCNT: 00000252 mscnt=594
12:44:49 // MSCNT: 000001df mscnt=479
12:44:50 // MSCNT: 000000e1 mscnt=225
# After
12:49:12 // MSCNT: 000000dc mscnt=220 # 0 microsteps
12:49:12 // MSCNT: 00000250 mscnt=592 # -2 microsteps
12:49:12 // MSCNT: 000001e1 mscnt=481 # -2 microsteps
12:49:13 // MSCNT: 000000de mscnt=222 # -3 microsteps
Test macro, for a Voron 2.4 with 4 steppers:
[gcode_macro TEST_MICROSTEP_DRIFT]
gcode:
G1 Z5
M400
G1 Z5
M400
GET_POSITION
DUMP_TMC STEPPER=stepper_z
DUMP_TMC STEPPER=stepper_z1
DUMP_TMC STEPPER=stepper_z2
DUMP_TMC STEPPER=stepper_z3
PROBE_ACCURACY SAMPLES=100
G1 Z5
M400
G1 Z5
M400
GET_POSITION
DUMP_TMC STEPPER=stepper_z
DUMP_TMC STEPPER=stepper_z1
DUMP_TMC STEPPER=stepper_z2
DUMP_TMC STEPPER=stepper_z3
M112
edit: switched to PROBE_ACCURACY