Hi @tjfenwick, my pedal is working now and I've made some changes to your code as described below:
position values from 16bit to 32bit, as I had overflow before and pedal was suddenly jumping into min endstop.
precompute pedal stiffness in setup to save runtime
obtain current position from stepper. Before it was assumed that stepper finished movement within one cycle, resulting in wrong position. Can be easily verified by comparing the "Position_Next" and "currentPosition" after "currentPosition" is read.
modified loadcell offset compensation to subtract the estimated offset.
@ChrGri @tjfenwick You are heroes🏅 . I'd love to contribute but this is not exactly my forte. Is there a way I could at least buy you a beer/coffee? :)
Hi @tjfenwick, my pedal is working now and I've made some changes to your code as described below: