The bug
At the moment, velocity measurement in CascadeController class is calculeted by the formule velMeasuredValue = (errorVal_p - prevErrorVal) / period, but this indicate the derivate of errorVal_p in period time, not the istant velocity of the motor/encoder.
This problem causes an unpredicable Controller reaction, because of the error calculeted by the secondary controller is based on a wrong reference.
In order to fix it I made a PR #36
The bug
At the moment, velocity measurement in
CascadeControllerclass is calculeted by the formulevelMeasuredValue = (errorVal_p - prevErrorVal) / period, but this indicate the derivate oferrorVal_pinperiodtime, not the istant velocity of the motor/encoder.This problem causes an unpredicable Controller reaction, because of the error calculeted by the
secondarycontroller is based on a wrong reference.In order to fix it I made a PR #36