EKF red reporting velocity_horiz and pos_horiz_abs off - navigation modes not working

HI! I recently built 8’’ quad running ArduCopter V4.1.0-dev on Matek F405CTR and BN-220 GPS. After boot I often have EKF red, when opening EKF window, I see velocity_horiz and pos_horiz_abs are red and off. I can arm my quad and fly it in stab, but any navigation modes doesn’t work.
I searched this forum, some people are suspecting power unstability or GPS interference, but I haven’t seen not any clean conclusions.
Does anyone have positive experience solving this problem?

Please set LOG_DISARMED and provide a .bin log file when this is happening.
Does the condition clear and EKF is ok?

What are you using for a compass?

Thanks! I’ll try that!

I didn’t mean LOG_DISARMED will fix anything, it’s just a diagnostic tool. People will need to see the log file.
And I was asking if you noticed that the fault went away after a while, or it was there all the time? :slight_smile:

I have QMC5883L on the separate board. I’ll anyway try to improve GPS and compass separation from FC and battery, but quad is quite small so I can’t move it as fas as I have it on the plane :frowning: .

OK, got it. Good plan.

I understand what LOG_DISARMED will do, I just didn’t know about it :slight_smile: .
At first power ON I had EKF red for some 6-8 minutes (GPS fix was already stable 3D). I didn’t fly and rebooted quad.
At second power up I had EKF red for some 3 minutes, then I made short 4 minute flight in STAB but when I attempted to use POSHOLD, it didn’t work. I have a log from this flight.
Then I made third reboot and after a while I got EKF white. Navigation modes were working at this time, but POSHOLD was performing unusually poor. It was some unstable wind about 3 m/s, but quad was drifting to sides in the range of some 2-3 meters, which is not usual on other my quads. Also from this flight I have a log.
Maybe it’s really something with poor GPS reception…???

In that 1st log, you don’t have a good number of Sats and HDOP is always over 1 (bad). When you try Position Hold it is denied.
02:20:07 Mode change failed: POSHOLD requires position

In the 2nd log you had a couple of slightly different issues
02:26:53 GPS Glitch
02:27:49 Battery 1 is low 10.46V used 205 mAh
02:27:49 Battery Failsafe
02:28:19 GPS Glitch cleared
02:28:24 GPS Glitch
02:28:30 GPS Glitch cleared
02:30:51 GPS Glitch
02:30:59 GPS Glitch cleared

Number of Sats and HDOP is slightly better but not by much.

I would set these:
FENCE_ALT_MAX,120 <- set for safety and local laws
FENCE_RADIUS,600 <- set for safety and local laws
This will make you wait until home position can be set before arming.
Also check for a good solid 5volts DC supply to the GPS unit (as well as separation you mentioned before). And try limiting the number constellations the GPS receiver uses, too many and their update rate is slowed - GPS_GNSS_MODE,65 - but experiment with this to suit your region.

Attitude control is OK considering everything looks to be at defaults.
Use this spreadsheet, or ALT A key combination in MissionPlanner to refine some of the initial parameters

Then run Autotune. The Harmonic Notch filter is definitely worth while too, and easy since you have some ESC telemetry there.

Start with these:
and do a hover test in ALTHOLD for about a minute - show us that log file.
Then you’ll probably end up with something like this:
INS_HNTCH_FREQ,80 <- depends a bit on FFT results

Thanks for all ideas!
Main part of the problem was really interference to the GPS (probably from FC). I just placed alluminium sheet under the GPS and “magically” I’m getting now 17+ sattelites instead of <9, EKF is satisfied (white) and navigation modes are working perfectly!
It was a beginners failure from me not to check number of locked sats in the log, sorry!
Other recommendations I may check later, but quad now flies very nice and doesn’t seem to need any advanced tunning.
Is there any easy way how to display actual number of GPS locked satellites on the Mission Planner screen? I have usually laptop with me on the field, so that would help a lot!

I would still recommend following the tuning steps. It may look to be flying ok but in logs it is not quite ideal. You’ll get better battery and wind performance with it tuned correctly. And you’re starting from a known-good configuration in case something does go wrong.

Well, you’re probably right, proper tunning should always help, but I never heard of most of the parameters you mentioned above. It would need a lot of reading and thinking to use them properly :frowning: .
I already tried autotune on one of my other quads and it ended up in totally unfyable configuraton so I’m a bit reluctant to use it again. (It can be affected by construction as both mentioned quads are a clean&dirty concept so motor frame is dampened from the rest of the quad including FC, battery, camera etc and it could maybe confuse autotune algorithm.)
Currently I don’t realize any negative behaviour of my quad. I’m attaching here my log from the last flight after shielding the GPS (now the weather isn’t very good for flying), should you have time, please look at it and tell me what is the most important tune to be done.
Thanks Roman

This can happen if the Initial Tuning parameters are not considered. The pre-conditions for Autotune are setting the Initial parameters and the Notch Filter. The Notch Filter has been in Copter Stable for some time now so it should be considered a normal part of tuning. There really isn’t a lot of “reading and tinkering”. Run the Plug-In and make 2 short flights with adjustments after the 1st. It’s true that more tuning is sometimes needed but as Shawn says it typically provides a good base to work from.

Sorry, haven’t read it all yet, but I don’t know what plugin should I run and how to proceed. Can you please post a link for notch filter tunning guide for dummies? Thanks!

As Shawn posted above you can use the Plug-in in Mission Planner by connecting and hitting Alt>A or you can use his Excel sheet which does the same thing and what the Plug-in was built from. The Wiki for the Notch filter is fairly comprehensive. After running the 1st step you may have some questions about which peaks to pick and how to address them with the available parameters. We can help with that.

Guys, I know it’s not right place for this question, but as you advised me here to use notch filter, I’ll try:
I measured prop vibrations frequency from a log by FFT exactly as described (119Hz on a light 6’’ quad), but now I’m in doubts what value I should I use for MOT_THST_HOVER.
After setting MOT_HOVER_LEARN = 2 and hovering flight I read MOT_THST_HOVER = 0.17.
It seem to be wrong value because my quad is normally reasonably powered and at hovering sends to ESCs servo value around 1420uS. If I interpolate 1420 between 1000uS (0%TH) and 1900uS (100%TH) it’s about 47% of TH, which is reasonable but far from 17% saved in MOT_THST_HOVER. What value should I use? Why is autolearnt throttle so strange?
For reference the log is here .
It’s another quad than we spoke before, but I think this needs notch even more. I hovered indoor (outside is still unflyable weather even is end of May :frowning: )

You’re right it’s not. The other thread you posted in a few minutes before this one is.