-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IIR filter coefficients set incorrectly #854
Comments
iir_coefficients is out of date w.r.t. recent changes in |
Is there any chance you could release a temporary fix for this coefficient sign issue while presumably a more general rewrite lands? |
Further to the above, I think the PID coefficients are also returned with the wrong sign, and the b0 coefficient of the high-pass filter is wrong (it has an extra factor of f0_bar in the numerator). Furthermore, I'd like to get the PID setpoint (the x offset) working, which it seem to me is not implemented in the this python file - I wonder if there is any description somewhere regarding how that could be done? |
Some background on PID/IIRs is here: https://hackmd.io/IACbwcOTSt6Adj3_F9bKuw |
Thanks very much! I've already read the PID primer which was very useful. I'm less familiar with Rust, hence the need for the python interface. |
Hello,
Thanks for keeping up the development of the stabilizer. I've just tried to set a low-pass filter using your script at https://github.com/quartiq/stabilizer/blob/main/py/stabilizer/iir_coefficients.py, but I think the IIR BA coefficients are returned with the wrong sign. Specifically, lines 59-61 say
However, in line 144, it's actually +a1, not -a1 being returned. Therefore, this implements the wrong filter.
It seems to me that this is a problem for all filters (+a_i returned instead of -a_i), but it seems OK for the PID (I haven't tested yet).
I'm not a 100% sure why -a_i needs to be sent to the stabilizer, but when I change a1 to -a1 in line 144 I do get the expected, correct behaviour - so it's probably just a matter of updating the Python script.
The text was updated successfully, but these errors were encountered: