Smoothing Velocity calculations

Try increasing sensor.min_elapsed_time.

But it may be a hopeless proposition since stepper motors do tend to be steppy, so the real velocity is expected to spike at each step and slow down inbetween. The velocity PID may be exacerbating the problem by trying to correct it, but responding too slowly so it’s applying extra torque as it jumps and then reverse torque after the jump is over.

See my post here for some info on a different approach, using closed loop angle mode and stepping the target by your desired velocity similarly to how open loop velocity mode works. I’m not sure how well it would work with a 12-bit encoder, but might be worth a try. Even with 14-bit it sounded weird when moving on my CNC machine, but I didn’t get to play with it much before I gave up and went back to open loop (sporadic triggering of step interrupts was the straw that broke the camel’s back after a long series of other problems).