Yeh, the feed forward was a mistake, it was supposed to be labeled FF not P. So I agree, the feedforward definatly needs to have a separate parameter!!
So the filters have been placed where they are because we need:
- a second order filter on the gyro input to reduce high frequency noise,
- a filter on the request to reduce noise caused by the lower update rate of the rate request,
- a first order filter on the D term only,
- a first order filter on the P term for yaw in multirotors
- a filter on the FF
- a notch on the gyro measurement
So I have combined 1 and 2 by placing the second order filter on the error output. 3 is a separate filter. I have combined 4 and 5 as an output filter and made it first order. 6 is a separate notch filter on the gyro only. This filter is currently a second order notch filter defined by three variables, centre frequency, bandwidth, and depth. So you won't have the problem with the width of the filter changing when you increase or decrease the depth of the filter.
Tridge has replaced the PX4 drivers making them much more efficient and that has let us increase the update rate.
Yes, we don't necessarily need to run the loops as fast for heli. However, there may be advantages in keeping the rate at 1 kHz to let the filters remove noise as well as possible. The problem here is that by reducing the rate the aliasing problem gets worse. I am leaning on the side of running the rate loop at 1 kHz but only outputting at the requested servo update rate.
On the leaky I term. My understanding of this is it is there to limit the I term buildup when landed or landing and taking off. We can probably achieve the same thing by simply reducing the I_Max to a user defined level over a 5 second period. My problem with the leaky I term is it is hard coded and the behaviour changes based on the value of I. I suspect my suggestion would make things more predictable and constant with different tunes.
Happy Christmas and new year!!