Improved stepcompress implementation

I have done some experiments with step compression. This is a new attempt, inspired by Dmitry’s code here, my previous work on step compression, and the MARS algorithm. The code is at: GitHub - KevinOConnor/klipper-dev at work-stepcompress-20220831

This new code reduces the “micro velocity bursts” between queue_step commands with only host code changes. The mcu code and message protocol is unchanged; it is not necessary to reflash the mcu.

The code internally ties upcoming queue_step “interval” parameters to past step intervals - thus effectively forcing velocity to remain continuous between each move segment. The code implements the same absolute step scheduling constraints as the current code. It uses “least squares” to find add1,count1 sequences such that the following add2,count2 sequence has the maximal step “total count”.

This branch is probably only of interest to developers or those experimenting with the low-level kinematics. I’ve run a bunch of unit tests, but have only lightly tested it on real hardware.

I wanted to share some of my results - maybe it will inspire other ideas or implementations.

-Kevin

1 Like