Mark. What you're saying about filter lag is correct. But gyro_main_lpf_hz does far more for INAV than just stabilization. Planes with out off balance props or motors, can introduce huge vibrations. But if your fixedwing is relatively free of vibrations, then increasing the cutoff isn't a problem. Although, if its a little noisy. Increasing the cutoff frequency above 40Hz or even changing the filter type, will mess-up the AHRS... Effectively leading to Attitude and Heading drift. The gyro is also used in AHRS computations.
I would say that in either case, you want to lean on the Matrix filter much more. It is dynamic, more effective in crushing peaks as a notch, and has less delay when it goes low.
This video needs to be seen by all fixed wing INAV pilots. My eyes have been opened as to how crappy the INAV defaults are, especially around filters. Can confirm that these changes can yield massive results. One of the key elements to tuning these planes is also setting up the in-flight adjustments, so you can update PI and D live. That's been the best way I've found to get them dialed in. Sure, a plane will fly with the crappy defaults, but its night and day with what it can do. Thanks again for all of these insights, they are invaluable!
Here is the list off all commands to set the parameters according to the video: set gyro_main_lpf_hz = 125 set gyro_main_lpf_type = PT1 set dterm_lpf_hz = 100 set gyro_anti_aliasing_lpf_hz = 0 set setpoint_kalman_enabled = OFF save
I've never flown with a fc before, been using a byme a gyro for about a year and now a confident still learning flyer, Anyways I got the speedybee f405 & setup to all these settings exactly in a phoenix 2400 - I was nervous about using the fc & it flew great thank you, next to do now is some tuning - not that it seemed to need it, flew nearly as good as the byme A straight off the bat. cheers.
Very cool - Good work - @12:51 switching PID profiles whilst airborne with a switch; the iNav documentation example is deprecated now for 7.1.2 - there is no SUB (first line of DOC example). How to video please?
With the reduced filtering have you noticed any increase in artificial horizon drift in stabilized modes? Noisy aircraft used to have some bad artificial horizon drift prior to INav 6.
realy usefull and unique video in a world with so little info on this topic. Specialy the filters. Since i moved to inav on at least half of my fleet and all of my wings i have been dying for some solid info on actual pid and filter tuning for wings/planes and not just the standard autotune videos (which always stop at the pid part) . Only remember one nice seminar with mrD and a german guy going deep on pid controllers for inav but then without d as aparently only recently introduced. Before , and all videos, just talked piff. Will most def play with these these when we finaly get sone good weather overhere. Top stuff man !!
Nothing in the video showed Hz values since the spectrum plot labeling in INAV BBE is not working right. But anything around 30 to 60hz is mothion of the wing. A very fast motion like a flutter of the control surfaces because the PIDs are too high.
Spent many try & errors on the PID tab but I had a feeling that the delay time PID is too much for some reasons, I kept thinking that perhaps, my servos aren't fast enough to handle the wind turbulence. Thank you very much for your insight.
This video raises two further questions for me. 1) Is there any point with a servo refresh rate greater than 50hz? I run digital servos at 160hz, but is there actually any benefit to flight characteristics? ... and 2) A gyro setting you didn't talk about is 'gyro_hardware_lpf', which some people say should be set to 20 or 42 Hz (not the 256 Hz default), particularly on smaller planes. If you have any tests and thoughts on these, that would be excellent.
1) refresh rate and filter latency are two different things. Filter lag THE ENTIRE SIGNAL. Then you servo refreshs it position based on that 50 times a second; which you should turn up with digital servos. 2) Yeah, that is crazy low. Why would you set the LDPF in the gryo that low? Not necessary to have that much delay in the signal going to the firmware.
Hello, did you fly the Nano Talon as original? First thing i did was adding 2 servos in the wings for aileron. The original was so bad and had lot of play in the aileron movement.
Hey Mark, I was hoping you may help me dig into the INAV servo_lpf_hz filter. It appears to be a biquad filter set at 20hz by default. From what I've read, this could be contributing around 24ms of delay in fixed wings. Obviously the servos themselves contribute some delay already, but I feel like this is WAY over-filtered, especially for 330hz digital servos. Would really love your opinion about this. Unfortunately this is the only way I know to contact you.
I remember words of a certain fpv university about 5 years ago “set gyro lowpass to 20hz. It will be fine” Do you think the suggested filtering changes will be okay on a larger plane that uses a 13” prop? I know vibrations get pretty low once you get up in prop size above about 10” Fyi the FF in inav on fixed wing pretty much just sets the differential between stabilised modes and manual mode, the rates and mixer amounts are what dictate maximum throws.
if a nitro plane, I would keep it at 20hz. Otherwise, if foam and have no reason to believe you have excessive vibes to the FC, you should be able to go higher. You can log in to check. On the bench, set FF to 0 and check out your throws. Then set to 200.
@@uavtech unfortunately I dont have a possibility to run blackbox logging on that specific plane as I'd have to give up GPS (for a couple of flights) and first of all buy that logging device. Then once again my question even if I run a higher servos refresh rate of 100Hz instead of 50Hz in this video I'm totally fine with leaving main gyro lpf at 125Hz, right? As for now I cant take a look where the noice starts
@@uavtech Hi, one other question as I tried today to tune my plane first without blackbox and experienced when rolling left and right that my nose would pitch down after. In general one would increase pitch_i right? I went into the 20s on the i term and even then have experienced this behavior (also increased pitch_p into the 20s after didn't help either). After autotune the measured rates for r/p/y are 250/70/50 means the tiny vtail can't do much on pitch what it seems to me and could just be a limitation of the craft overall or is my assumption wrong? Any ideas to try out which come to your mind?
OK so I made some actual testing today with the T1 Ranger, the most reactive plane that I have with the biggest and sharpest authority. And I also wrote you back on Discord. I tried first to fly and P/D Tune with the default filters and then with your filter settings applied. The Gyro Raw to Filtered delay was down from 15 to 7ms that's true. But the result was... nearly non existent. After the filter change I was able to change my P tune from 10 up to 12 before I started to get overshoots. This makes absolutely no difference in actual stabilization. If I go higher, no matter what the D-Term does (without smoking servos) it overshoots after snap rolls. Why? Not because the gyro filter latency or the Servo signal. But because the servos are just not moving fast enough. the minimum delay from signal output to the servo until the first gyro change is 45-55ms. It makes no noticeable difference if you shove off a few MS from that. Turbulent air is impossible to properly stabilize with 50Hz standard emax class servos. But feel free to check my text I sent you on Discord with some data :)
hey . I'm building my first quadcopter 5 inch using inav 7.1.2 and speedy bee f405 v4, my main issue is when i activate GPS there is oscillations (pitch and roll) . im stuck there and trying to fix it for 2 month and no luck. any idea how to fix it ? thankyou
do below one step at a time to see if fixes: 1. Do an Auto Tune to set Rates and Feedforward setting. 2. Cut i-Gain in helf for Stability PIDs. 3. Cut i-gain in half for GPS PIDs. Hit up my discord with a log and dvr of it for more help.
The stabilization in fixed wing is not coded properly. The devs think that acro should be manual with some P term for wind gusts. Instead, it should be a rate mode. Up the I term windup, and use the I term instead of P term. I term will in fact stabilize the aircraft. I run 0 to 5 on P, 30ish on I, and no D. The self leveling mode uses I term as well, which is a no no. You should use the accel output as the set point, and let a true rate controller do the rest. But hey, it's free, and with some tweaks, works well. I can go from 30mph to 150mph with no change in trim, rates, or need to use dual rates. Thanks for the tips on filters. I have not messed with those much. Fixed wing doesn't need a lot of filtering.
@MrD No, it's not. Rate holds attitude and controls rate. Acro mode in inav does none of those things. If you change windup to 500, change I term stick position and up the I term a lot do you get anything close to a rate controller. You can't use MR control logic to control servos in an airplane.
@MrD Once again, no it does not. It can't with default pids. Manual with some P term on top is not a rate mode. FF can't compensate for differing roll/pitch rates due to turbulence. With I term crippled, there is no way for the FC to maintain a constant rate.
Mark. What you're saying about filter lag is correct. But gyro_main_lpf_hz does far more for INAV than just stabilization.
Planes with out off balance props or motors, can introduce huge vibrations.
But if your fixedwing is relatively free of vibrations, then increasing the cutoff isn't a problem.
Although, if its a little noisy. Increasing the cutoff frequency above 40Hz or even changing the filter type, will mess-up the AHRS... Effectively leading to Attitude and Heading drift.
The gyro is also used in AHRS computations.
I would say that in either case, you want to lean on the Matrix filter much more. It is dynamic, more effective in crushing peaks as a notch, and has less delay when it goes low.
This video needs to be seen by all fixed wing INAV pilots. My eyes have been opened as to how crappy the INAV defaults are, especially around filters. Can confirm that these changes can yield massive results. One of the key elements to tuning these planes is also setting up the in-flight adjustments, so you can update PI and D live. That's been the best way I've found to get them dialed in. Sure, a plane will fly with the crappy defaults, but its night and day with what it can do. Thanks again for all of these insights, they are invaluable!
Here is the list off all commands to set the parameters according to the video:
set gyro_main_lpf_hz = 125
set gyro_main_lpf_type = PT1
set dterm_lpf_hz = 100
set gyro_anti_aliasing_lpf_hz = 0
set setpoint_kalman_enabled = OFF
save
Interesting stuff about the filters. I need to give that a try.
Hello Darren, what are your findings? Cheers
I've never flown with a fc before, been using a byme a gyro for about a year and now a confident still learning flyer, Anyways I got the speedybee f405 & setup to all these settings exactly in a phoenix 2400 - I was nervous about using the fc & it flew great thank you, next to do now is some tuning - not that it seemed to need it, flew nearly as good as the byme A straight off the bat. cheers.
Two INAV videos today? Noice 😁
Hell yea dude I been getting into fixed wing more and more and leaving my quads at home this is just the video I wanted to see
Just a note. The PID defaults for with tail and without tail are not the same. 0:44
Very cool - Good work - @12:51 switching PID profiles whilst airborne with a switch; the iNav documentation example is deprecated now for 7.1.2 - there is no SUB (first line of DOC example). How to video please?
Great discussion; particularly concerning sensor processing and filters vs. servo update processing.
With the reduced filtering have you noticed any increase in artificial horizon drift in stabilized modes? Noisy aircraft used to have some bad artificial horizon drift prior to INav 6.
no, that is the Accelerometer and has a different filter. ACC_Lpf Aat 15hz. BiQUAD
Awesome Mark! Finally a video that is hands-on reality. Appreciate this
realy usefull and unique video in a world with so little info on this topic. Specialy the filters. Since i moved to inav on at least half of my fleet and all of my wings i have been dying for some solid info on actual pid and filter tuning for wings/planes and not just the standard autotune videos (which always stop at the pid part) . Only remember one nice seminar with mrD and a german guy going deep on pid controllers for inav but then without d as aparently only recently introduced. Before , and all videos, just talked piff. Will most def play with these these when we finaly get sone good weather overhere. Top stuff man !!
Great Inav videos Thank you for making them.
At around 3:00, what causes the very large spike below about 40 hz or so? A couple of people have asked on Facebook and on the Discord.
Nothing in the video showed Hz values since the spectrum plot labeling in INAV BBE is not working right.
But anything around 30 to 60hz is mothion of the wing. A very fast motion like a flutter of the control surfaces because the PIDs are too high.
Spent many try & errors on the PID tab but I had a feeling that the delay time PID is too much for some reasons, I kept thinking that perhaps, my servos aren't fast enough to handle the wind turbulence. Thank you very much for your insight.
the filter can kill performance for sure.
This video raises two further questions for me. 1) Is there any point with a servo refresh rate greater than 50hz? I run digital servos at 160hz, but is there actually any benefit to flight characteristics? ... and 2) A gyro setting you didn't talk about is 'gyro_hardware_lpf', which some people say should be set to 20 or 42 Hz (not the 256 Hz default), particularly on smaller planes. If you have any tests and thoughts on these, that would be excellent.
1) refresh rate and filter latency are two different things. Filter lag THE ENTIRE SIGNAL. Then you servo refreshs it position based on that 50 times a second; which you should turn up with digital servos.
2) Yeah, that is crazy low. Why would you set the LDPF in the gryo that low? Not necessary to have that much delay in the signal going to the firmware.
Hello,
did you fly the Nano Talon as original? First thing i did was adding 2 servos in the wings for aileron.
The original was so bad and had lot of play in the aileron movement.
Hey Mark, I was hoping you may help me dig into the INAV servo_lpf_hz filter. It appears to be a biquad filter set at 20hz by default. From what I've read, this could be contributing around 24ms of delay in fixed wings. Obviously the servos themselves contribute some delay already, but I feel like this is WAY over-filtered, especially for 330hz digital servos. Would really love your opinion about this. Unfortunately this is the only way I know to contact you.
I remember words of a certain fpv university about 5 years ago “set gyro lowpass to 20hz. It will be fine”
Do you think the suggested filtering changes will be okay on a larger plane that uses a 13” prop? I know vibrations get pretty low once you get up in prop size above about 10”
Fyi the FF in inav on fixed wing pretty much just sets the differential between stabilised modes and manual mode, the rates and mixer amounts are what dictate maximum throws.
if a nitro plane, I would keep it at 20hz. Otherwise, if foam and have no reason to believe you have excessive vibes to the FC, you should be able to go higher. You can log in to check.
On the bench, set FF to 0 and check out your throws. Then set to 200.
nice... and please make video of betaflight fixed wing. limon did the sneakpeak a bit of it..
If the servos support a higher refresh rate like 100Hz whats then the appropriate gyro lpf cut off frequency?
as high as you can go. Depends on gyro noice. but on an electric foam plane, should be minimal. So 150hz+ should be fine.
@@uavtech unfortunately I dont have a possibility to run blackbox logging on that specific plane as I'd have to give up GPS (for a couple of flights) and first of all buy that logging device.
Then once again my question even if I run a higher servos refresh rate of 100Hz instead of 50Hz in this video I'm totally fine with leaving main gyro lpf at 125Hz, right? As for now I cant take a look where the noice starts
@sarcasticfpv3862 yup
@@uavtech Hi, one other question as I tried today to tune my plane first without blackbox and experienced when rolling left and right that my nose would pitch down after. In general one would increase pitch_i right? I went into the 20s on the i term and even then have experienced this behavior (also increased pitch_p into the 20s after didn't help either). After autotune the measured rates for r/p/y are 250/70/50 means the tiny vtail can't do much on pitch what it seems to me and could just be a limitation of the craft overall or is my assumption wrong? Any ideas to try out which come to your mind?
OK so I made some actual testing today with the T1 Ranger, the most reactive plane that I have with the biggest and sharpest authority. And I also wrote you back on Discord.
I tried first to fly and P/D Tune with the default filters and then with your filter settings applied. The Gyro Raw to Filtered delay was down from 15 to 7ms that's true. But the result was... nearly non existent. After the filter change I was able to change my P tune from 10 up to 12 before I started to get overshoots. This makes absolutely no difference in actual stabilization. If I go higher, no matter what the D-Term does (without smoking servos) it overshoots after snap rolls. Why? Not because the gyro filter latency or the Servo signal. But because the servos are just not moving fast enough. the minimum delay from signal output to the servo until the first gyro change is 45-55ms. It makes no noticeable difference if you shove off a few MS from that. Turbulent air is impossible to properly stabilize with 50Hz standard emax class servos.
But feel free to check my text I sent you on Discord with some data :)
i-term windup is probably your big killer for bounceback. Where the MS can help is wind response.
@@uavtech I tested this on the 8.0 build with the new I-term lock. There is no windup.
hey . I'm building my first quadcopter 5 inch using inav 7.1.2 and speedy bee f405 v4, my main issue is when i activate GPS there is oscillations (pitch and roll) . im stuck there and trying to fix it for 2 month and no luck. any idea how to fix it ? thankyou
do below one step at a time to see if fixes:
1. Do an Auto Tune to set Rates and Feedforward setting.
2. Cut i-Gain in helf for Stability PIDs.
3. Cut i-gain in half for GPS PIDs.
Hit up my discord with a log and dvr of it for more help.
@uavtech thank you so much i will try that and let you know, have a nice day.
How can i contact you in discord? I need your help please.
The stabilization in fixed wing is not coded properly. The devs think that acro should be manual with some P term for wind gusts. Instead, it should be a rate mode. Up the I term windup, and use the I term instead of P term. I term will in fact stabilize the aircraft. I run 0 to 5 on P, 30ish on I, and no D. The self leveling mode uses I term as well, which is a no no. You should use the accel output as the set point, and let a true rate controller do the rest. But hey, it's free, and with some tweaks, works well. I can go from 30mph to 150mph with no change in trim, rates, or need to use dual rates. Thanks for the tips on filters. I have not messed with those much. Fixed wing doesn't need a lot of filtering.
Acro IS rate mode. It is completely different to manual. Manual doesn’t use the PID loop at all.
Will try higher I-gains to see how that looks too, but of course it will not be as sharp as P to counter a gust of wind.
@MrD No, it's not. Rate holds attitude and controls rate. Acro mode in inav does none of those things. If you change windup to 500, change I term stick position and up the I term a lot do you get anything close to a rate controller. You can't use MR control logic to control servos in an airplane.
@@scottyh72rate mode means that the sticks set a desired rotational rate target. This is what acro does. It is rate mode.
@MrD Once again, no it does not. It can't with default pids. Manual with some P term on top is not a rate mode. FF can't compensate for differing roll/pitch rates due to turbulence. With I term crippled, there is no way for the FC to maintain a constant rate.
It does not tune the PIDs. It tunes the rates
agreed. Shpuld be call AutoRate.
You started talking about quads and that did nothing but confuse me