Klipper at it’s core relies on strict timing between all sections (Seperate mcus, stepper pulses etc.)
I don’t have an example of specifically where he’s referring to the 10 second limit from as there is a lot of timing related code and checks in various locations.
But 400 Mhz = 2.5ns per clock tick
10 seconds / 2.5 ns = 4 x 10^9
uint32 can hold 4.294967296 × 10^9 values
Hence it would overflow the clock within that 10 seconds expected timing window.
Will there be any problems with 8-bit architects?
No, Because they stay within the timing window specified above.
When the timer hits a max value in the mcus faster than 400 mhz it rolls over to zero and starts again (simplistic view, depends on the mcu, what timer is used etc.)
When Klipper sees discrepancies in the timing sync it throws and error and shuts down.
Is it safe to change this type to 64-bit?
Is there any way we can change this?
What are you trying to do? Keep in mind that everything is Klipper is about driving stepper motors to move things around. That’s what it’s built for, that’s what it does.
As stated in the other post
which is very close to the minimum supported by the trinamic drivers (~103ns)
Of course there is some overhead in the mcu so it isn’t a stepper pulse per clock cycle but some of the faster mcus are already at the limit of the stepper drivers. But if you’re curious you can see the existing processor benchmarks here.
https://www.klipper3d.org/Benchmarks.html#micro-controller-benchmarks
One of the best is the RP2040 and it’s a 133 Mhz processor
rp2040 |
ticks |
1 stepper |
5 |
3 stepper |
22 |
So really, It all comes down to this… What are you trying to do?
A faster mcu isn’t going to result in faster prints because you can’t drive the stepper motors faster than certain step speeds. Your physical printer setup will be a barrier long before the software/processor is any kind of impediment.
Edit: Also see here for more details about the timing. I forgot the code does handle timer roll over (it would have to), and it converts 32 bit timers to 64 bits and vice versa.
https://www.klipper3d.org/Code_Overview.html#time