Stepper too far in past after upgrade

Yesterday i upgraded klipper to the current version (old version was klipper:v0.9.1-647-gbe122411).

My printer is a dual_carriage printer with following specifications (before upgrade):
2 Motors for X
2 Motors for Y
3 Motors for Z
1 Motor for E1
1 Motor for E2

All motors uses microstepping 128
The z-motors are geared and is use for z a belt

The controller boards is a RADDS + extension and an old RAMPS for additional pins.

i use a Raspberry pi 4 (4gb) + cam for klipper.

After the upgrade the error triggers directly when i call “BED_MESH_CALIBRATE” (the bed moves some mm and then stops with the error)
So i tried to reduce the microsteps of the z axe to 32.
This helps for BED_MESH_CALIBRATE but during the print the same error was triggered.

So i tried to add “step_pulse_duration: 0.000000100” to each stepper, but it doesn’t help

Current config:

[mcu]
serial: /dev/serial/by-id/usb-Klipper_sam3x8e_20313253353837382039303230303130-if00


[mcu subboard]
serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0


[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 4000
max_accel_to_decel: 500
square_corner_velocity: 10
max_z_velocity: 50
max_z_accel: 100

[stepper_x]
step_pin: PD6
dir_pin: !PD2
enable_pin: PA7
microsteps: 128
rotation_distance: 40
step_pulse_duration: 0.000000100
endstop_pin: ^PD3
position_endstop: -55
position_min: -55
position_max: 240
homing_speed: 20

#X
[dual_carriage]
axis: x
step_pin: PA15
dir_pin: !PA14
enable_pin: PD1
microsteps: 128
rotation_distance: 40
step_pulse_duration: 0.000000100
endstop_pin: ^PC2
position_endstop: 295.69
position_min: 0
position_max: 296
homing_speed: 20

#Y
[stepper_y]
step_pin: PA12
dir_pin: !PA13
enable_pin: PB26
microsteps: 128
rotation_distance: 40
step_pulse_duration: 0.000000100
endstop_pin: ^PC4
position_endstop: 300
position_max: 300
homing_speed: 20

#E6
[stepper_y1]
step_pin: PB16
dir_pin: PB15
enable_pin: PA1
microsteps: 128
rotation_distance: 40
step_pulse_duration: 0.000000100
endstop_pin: ^PD9

#E3
[stepper_z]
step_pin: PC12
dir_pin: !PB14
enable_pin: PC14
microsteps: 32
rotation_distance: 20
step_pulse_duration: 0.000000100
endstop_pin: probe:z_virtual_endstop
position_min: -10
position_max: 286
homing_speed: 3
gear_ratio: 57:11

#E1
[stepper_z1]
step_pin: PA2
dir_pin: PA3
enable_pin: PB17
microsteps: 32
rotation_distance: 20
step_pulse_duration: 0.000000100
gear_ratio: 57:11



##E2
[stepper_z2]
step_pin: PB19
dir_pin: !PB18
enable_pin: PB20
microsteps: 32
rotation_distance: 20
step_pulse_duration: 0.000000100
gear_ratio: 57:11

[extruder]
step_pin: PB25
dir_pin: PC28
enable_pin: PD5
microsteps: 128
rotation_distance: 8.08233
nozzle_diameter: 0.600
filament_diameter: 1.750
max_extrude_only_distance: 101.0
heater_pin: PB27
#sensor_type: ATC Semitec 104GT-2
#sensor_type: PT1000
adc_voltage: 3.3
sensor_type: temp_ext_1_adc
sensor_pin: PA16
min_temp: 0
max_temp: 330
smooth_time: 5

#E4
[extruder1]
step_pin:           PC3
dir_pin:            PC1
enable_pin:         PC5
microsteps: 128
rotation_distance: 8.03283
nozzle_diameter: 0.600
filament_diameter: 1.750
max_extrude_only_distance: 101.0
heater_pin: PD8
adc_voltage: 3.3
sensor_type: temp_ext_2_adc
sensor_pin: PA24
min_temp: 0
max_temp: 290
smooth_time: 5

klippy.log → klippy.log

Image mcu load:

I don’t know what i can do now.
I hope i give enough information :slight_smile:

That error indicates that too many steps per second were requested of the micro-controller. This is typically resolved by reducing movement speed or reducing the driver microsteps. Anything beyond that would require the full Klipper log file attached here (must be attached here, must be the full unmodified log).

-Kevin

Thanks for the answer.

until version “klipper:v0.9.1-647-gbe122411” it works without problems, with all motors on 128 microsteps.

now i have on z-axe 32 microsteps and the error triggers midprint.

klippy.log (2.2 MB)

i added the log (hopefully the correct log)

Klipper recently made some code changes to optimize for common Trinamic stepper motor drivers. Setups using the older Alegro and/or TI drivers may not be as fast in some setups. You have a few options:

  1. Remain on Klipper v0.10.0 (or earlier).
  2. Reduce movement speeds on XY.
  3. Reduce microsteps on XY.
  4. Convert to TMC drivers configured in UART or SPI mode.
  5. Update to a faster micro-controller for XY drivers (or deploy an additional micro-controller for XY).

-Kevin

Also, if you’re comfortable making code changes, you could modify the src/atsam/Kconfig file, comment out the line that says select HAVE_STEPPER_BOTH_EDGE, run make menuconfig, then make clean, and make flash. The above disables some of the Trinamic stepper motor driver optimizations and reenables some of the optimizations for the older drivers.

-Kevin

Note, also, that if you are using Allegro or TI drivers that you need to be careful with the step_pulse_duration field as a too low value will cause lost steps between mcu and driver. The TI drivers really do need 2us and the Allegro drivers really do need 1us.

-Kevin

So i researched a little and now i’m more confused as before :smiley:

To your options

  1. Remain on Klipper v0.10.0 (or earlier). ← i hope you implement more cool stuff which i will use :smiley:
  2. Reduce movement speeds on XY. ← atm max speed is 200 and i prefer to set it higher
  3. Reduce microsteps on XY. ← mabye possible, i must check the noise on lower steps
  4. Convert to TMC drivers configured in UART or SPI mode. ← this is a problem for XY explanation below
  5. Update to a faster micro-controller for XY drivers (or deploy an additional micro-controller for XY). ← i tought the arduino due is fast

So my questions:
I plan to build a toolchange so i will use JMC closed loop steppers with integrated drivers.
It doesn’t look the drivers are controllable via spi or UART

I have seen it is possible to connect boards with CAN-Bus:
Is this perfromant/stable? (i’m not a fan of USB :smiley: )
How much boards can i connect with CAN-BUS?

Is there a preferred board for the future?

Thanks for your awesome work :wink:

Just a heads up, Klipper doesn’t support closed loop steppers.

i know but with the old setup (without uart or spi) i can connect a pin for direction and one pin for step.

should the same as when i use the raps128.

The closed loop is generated in the motor driver.

But when i now get the error: “Stepper too far in past” i also get it with closed loop steppers which i can not control with UART or SPI.