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.
My work-stepcompress-20220831 branch does have smoother velocity compared to the baseline code. It is not as smooth as Dmitry’s code.
None of the branches seem to improve the jitter picked up by the accelerometer and angle sensors on this machine. It seems that my Voron Zero has an increase in mechanical jitter when moving around 60-80mm/s that is not related to step compression.