thank you @andyp1per, I was having same issue!
@Leonardthall Were can I move NotchFilter::apply()
to test it?
thank you @andyp1per, I was having same issue!
@Leonardthall Were can I move NotchFilter::apply()
to test it?
Sorry @guglie, it isn’t that simple. I will chat to Tridge and Randy tomorrow and see what we can do.
I have put up a potential fix https://github.com/andyp1per/ardupilot/commit/44451f545594ec7044921a3f387242b468acd636
I have created a pull request for master https://github.com/ArduPilot/ardupilot/pull/11371
It seems to work pretty well. I can see the clearly defined notch in the logs and am able to set the notch frequency above 200Hz. Not had enough time or good weather to really bash on it, but was able to hover my miniquad inside, so the control can’t be too messed up
I’ve now had a chance to bash on this and the results are pretty encouraging - everything works well and I’m getting crisper control from the copter as I can push P higher. A few things to note:
ATC_RAT_PIT_FILT=100
and INS_GYRO_FILTER=90
) it’s pretty easy to let a lot of noise into D and if D is set too high the motors can get really hot. I wasn’t really monitoring this before, but once wise to it I reduced D and everything was fine. I am running the main loop at 800Hz.ATC_RAT_PIT_P=0.200
where the autotune value was 0.083ATC_RAT_PIT_P
) looks like a single pass filter as well, whereas the betaflight crew seem to think this can benefit from more aggressive two-pass filtering. See the log here
If anyone is interested here are the two builds I used. FMUv4 only - so Pixracer or equivalent, use at your own risk! Based on 3.6.9rc2:
Great work! I’m not set up for compiling, but if you want to make a copy for the omnibus nano, I’d run it to test it. (I’m not expecting you to or anything, though).
When you say you decreased D, what is yours set to now?
I can’t wait until this is in Master so I can try it :).
Thanks!!! I was really waiting for this to happen and I cannot resist to test on the sub 190g . Please keep on with this USEFULL works, I believe ,as you, we could be inspired by betaflight improving the small copter segment here
I’ve built the two versions for the OmnibusNanov6. This is against 3.6.9rc2. No testing at all so if you do try please be really careful!
On D I was up to 0.002, but dropped that to 0.001 when I discovered the heat problem - probably orthogonal to the notch, but interesting that there was no visible sign of issues, the copter flew really well, it’s just the motor’s were roasting. At 0.001 the motors were cool again. I had to drop it more when I started trying GF4053x3’s (0.0004)
Thanks a lot! But, I’m running master and have a few things configured that are not in 3.6…
I can still test it, but it will be a few days, since it won’t just be a quick install… Maybe Wednesday I’ll have time to get things working in 3.6.
My master branch is messed up. If I get some time to fix it I’ll do a build for you.
I posted builds from master from my mac. Never flown with anything built with this machine, so caveat emptor
Tested today on multiple flights, it works like a charm!
The post filter logging is wonderful! (I’ve set INS_LOG_BAT_OPT to 2 to enable it)
Looking forward to put more than one notch on my single IMU…
- With D lower and the notch enabled I was able to push P pretty high
ATC_RAT_PIT_P=0.200
where the autotune value was 0.083
Was the autotune run before or after the filter was applied. I’d be interested to know if autotune might get a more aggressive tune (or autotune_aggr
set higher) with a filter applied.
Also, what’s the size of your copter?
Also again, do you know what the effect of the filter might be on accelerometer clipping? If the accelerometer is saturating its readings are essentially junk, but if they’re being attenuated by a filter, would that improve handling of clipped readings? Maybe that’s a better question for Leonard.
Autotune was before applying the filter
QAV180
No idea on the clipping
Can the notch be applied also on accelerometer?
Is it a good idea?
By the way with the notch I’ve been able to raise the low pass filter to 100hz, it flies very well now
I don’t think you are really using the accelerometer for control much (at all in ACRO or much in STAB) and the EKF doesn’t filter the gyros or accelerometer at all because it uses delta angles and delta velocity. So I don’t think it will have any affect on anything you care about.
Notch on the D-term is a different matter I am working on that…
I think it has impact on ALT_HOLD and LOITER, but please let me know if I’m wrong!
Sure, but this is about improving latency and response which are hardly concerns in ALT_HOLD and LOITER
Actually I’m using GUIDED and I’m trying to have fast response and control
Today I was able to test the increase in the notch filtering a lot, also opening up bandwidth, and I have almost cancelled the first resonance frequency and the cluster around, is almost flat now, all thanks to your post filtering option.
In the last test I’ve disabled the low pass filter setting it to 0. Not only I was able to fly very well, but also I didn’t notice almost any change in the log, even if here is clearly logged with the LPF…
So I think I’ve found a possible bug in the notch filtering skipping low pass filter, commented on you pull.