@nefelim4ag As per offline chat, I’ve put together a proof-of-concept stepper shaper code that uses your math to compensate stealthchop lag, but instead of fiddling with stepcompress or MCU code, it just performs compensation in the C kinematics code, so please take a look and give it a try. Please note that I only did some very basic checks (like, just running an added regression test and validating some internally calculated parameters), so exercise caution. It is also possible that I’ve messed up some calculations somewhere, ranging from using the wrong sign somewhere to perhaps computing some offset values incorrectly. But otherwise you should be able to add [stepper_shaper stepper_?]
to your config and run a command like SET_STEPPER_SHAPER STEPPER=<stepper> STEALTHCHOP_COMP=<L/R>
, which would suffice for testing for now, I think.
Edit: the velocity calculation code was added only to some kinematics, but it does cover cartesian, corexy, hybrid_corexy, generic_cartesian, and also IDEX and input shaper, so I hope that suffices for testing for now.