• Pietro Fezzardi's avatar
    standard servo: store accumulator in scaled nsecs · 67258e3b
    Pietro Fezzardi authored
    The integral accumulator of the PI servo is now a 64bit integer.
    The stored values are bit shifted by 10, so we have a finer
    granularity on the control.
    With the previous implementation the integral part stopped working
    when ofm was under the value of OPTS(ppi)->ai. This problem has
    been solved with this changes.
    I had to use __div64_32() from lib/div64.c, because dividing for
    a long long is not allowed in arch-wrpc (it takes too much RAM).
    67258e3b
pp-instance.h 6.03 KB