Timer too close after moving to X out of range

Basic Information:

Printer Model: Kingroon KP3S Pro V2
MCU / Printerboard: mcu: stm32f103xe / THR mcu rp2040
Host / SBC Armbian-unofficial 24.2.0-trunk Jammy
klippy.log
Firmware version: v0.12.0-111-g4f00f219 without modifications.

klippy.log (53.2 KB)

Describe your issue:

When I send a command G1 X2222 it moves printer head to the max X position and writes the message “Move out of range” and it is ok.
But when I send a command G1 X222222 it moves printer head to the max X position after that it throws the error “Timer too close” and shutting down the printer. During that python process klippy is loading CPU up to 100%.
In case of Y axis there is no this error.

You’ve truncated your klippy.log, Please upload the entire log.
If it’s too large you can zip it.

Also, Why are you trying to move to X222222? You have a 222 meter bed?

3 Likes

I’ve truncated it for your comfortable reading. Before that error it just printing Stats.
I have 200x200 printing area but accidentally found this error.

klippy.log (1.0 MB)
Full log from turning on of the printer to the error attached.
Of course in real life this error will not occur as printing head will never be sent to 222222 position. But i have no this error with Y axis. And as it looks like cpu overloading who can predict under what circumstances the error may appear.
Clarification: This error occurs only if bed mesh loaded. Otherwise printer head is not moving and throws the error “Move out of range”.

In case of Y axis for example if i send g1 y222222222 it loads cpu and do nothing for a long time but the error “Timer too close” doesn’t occur.


During this klippy is not printing Stats in its log file.

Looks like check of coordinates correctness in case of loaded mesh follows after z correction calculation. As this topic has no answers there is no error and everything is ok.
I think if error exists it should be fixed. This error on this printer is really often. I can’t tell what causes it but it is often.

On the Timer Too Close “error” and a fix on it:

In this case this error occurs without any load it’s a code bug. To get it just send head to X/Y/Z to high coordinates with bed mesh loaded.

You might be right, but how often are people going to try to move their printer head to unrealistically high coordinates? At worst it just rams the printer head into one of the axis.

This is a community driven project so takes people to debug on personal time, In this situation I think the easiest solution is simply “Don’t do that”.

Yes, you are right. Nobody will send print head to coordinates which doesn’t exist except me. I am uniqum.
But the main logic is broken.
When bed mesh is not loaded print head will not go to this coordinates with error “Move out of range”
But when bed mesh loaded it will go. Who can predict how this can affect.
I am just a singer who is singing what he observe.
Can you pls point me to files in klipper code where I can try to remove this behaviour.
BTW: opensource is a great thing because people are working with highest motivation ever. This motivation is interest. All replies in this topic looks like you are tired of this motivation :wink:

Not tired of the open source, It’s just there is plenty to work on outside of edge cases on a situation that someone is having on one printer.

If this is a problem on EVERY printer or a lot of printers and repeatable then that’s a different story.

It’s like that old story of the guy who goes to the doctor and says “Doctor, It hurts if I poke here.” and the Doctor replies “Well, Don’t poke there”.

If I INTENTIONALLY try to do things outside of the normal operation of my printer, I bet I will find all kinds of things that break. The idea is that people WON’T try to do things outside of the normal operation of their printer.

You simply CANNOT program around ALL possible fault scenarios because your codebase will be huge, you’ll spend your entire life doing that, and even when you think you’re done someone WILL find another way to break things.

That’s why most warranties have a clause about:

As for your question about where it’s at:

Is the first place I’d check. All movements eventually go through here though…

1 Like

This report seems strange to me:

  1. Unmodified Klipper does not move at all if the command exceeds the limits as stated in the printer.cfg
  2. I cannot reproduce the behavior, neither with a mesh loaded or without

I asked a guy to check and his printer head is not moving but when he sent x2222222 klipper process load cpu to 100% and throw the error “Move out of range” after some time. And this time increased by higher X coordinate.

I understood why Timer too close is thrown. When i send X2222222 the klipper loads CPU to 100%. But head is moving and klipper logic decide that system is overloaded. When i send this command to printer and its head is already located in X200 “Timer too close” is not thrown because no needs to move head it is already there.
So this error with CPU overload is reproducible. Axis moving can be platform specific issue for example.

Clarification:
When bed is at highest Y200 then if i send x222 it moves to X50
If bed is in Y100 then X is not moving and throw the error Move out of range.
When Y is in 0 then if X222 X is moving to 185 sometimes 190 and throw the error (move out of range).

I added logging into methods


First three strings when bed mesh is not loaded. Other strings when it is loaded. Toolhead is moving by segments which was calculated with probe_count values.
Maybe my configuration is bad? But as i can see the logic is differ when bed_mesh loaded and it should be reproduced on other cartesian printers.

Very strange behavior.
When Y is 100 it throws error without movement. But when Y is 120 it throws error with to segments.

As I can see on the last screen amount of segments is calculated based on bed curvature. When Y100 in this area difference between probes is about 0.05 mm
-0.387500, -0.377500, -0.367500, -0.355000, -0.347500, -0.335000
In this case two segments is enough
But when Y0 difference is bigger.
-0.045000, -0.107500, -0.152500, -0.195000, -0.247500, -0.305000
in this case we need more segments.
If ones have aligned bed than it can be only one segment and error will not reproduce because Move out of range throws without movement.

Am I right?

This config came from producer of the printer. And I checked it as accurately as I can.
Do you mean homing_retract_dist should be configured to zero only for X axis but not for Y?
But how it can lead to the described error?
Can you please answer on my previous post. Timer too close after moving to X out of range - #16 by Lebensgefahr

Because it’s most likely overloading the move queue with step movements that can’t be physically completed and it just keeps constantly trying.

Please just follow the guide and it should fix your issue.

Many of the printer makers just adopt Klipper without fully understanding it’s usage.

I can’t understand. I asked about homing_retract_dist. Is it should be in configuration for stepper x and stepper y? As i can read configuration guide yes it is. Printer has two sensorless axis X and Y.
At the time I understood that printer was made with many errors in OS, some errors in configurations I completely reinstall OS, check everything in the printer config especially including all options about sensorless homing.
Of course i can make a mistake, but at this moment i can’t find it.
I wrote this guide for other kp3s pro v2 users:

In addition i’ve made this test to confirm my idea.
I made a bed mesh by hand like this

## points =
#
# -0.045000, -0.045000, -0.045000, -0.045000, -0.045000, -0.045000
## -0.157500, -0.210000, -0.235000, -0.267500, -0.307500, -0.342500
#
# -0.285000, -0.305000, -0.322500, -0.337500, -0.350000, -0.357500
## -0.387500, -0.377500, -0.367500, -0.355000, -0.347500, -0.335000
#
# -0.430000, -0.397500, -0.377500, -0.370000, -0.370000, -0.332500
#*# -0.345000, -0.315000, -0.302500, -0.310000, -0.310000, -0.305000

Look at the first string. I wrote all points equal so there is no needs to interpolate points for Y0. And now tool head is not moving at all.
This is the proof that this error occurs only if bed is not straight.
And now it is obvious that there is no such error which can cause this behavior. This is the error in klipper code. There is no checks of the target coordinate before it starts interpolation.

About Doctor story. There is a lot of vulnerabilities in software. We can just ask attackers do not use it. This error causes firmware to stop working properly until it will be restarted.