EKF unhappy with GPS

We use GPS for yaw and have the compass enabled but not used. I have modified the ublox driver to print out any issues with the RTK baseline, and is currently correctly configured to emit the yaw message. I don’t know enough about diagnosing other EKF issues, but I highly suspect that some other GPS issue is making the EKF unhappy but I am not sure what. There’s a high sat count, and we achieve RTK Fixed solution, so I’m not sure what is wrong. The driver is happy with the RTK baseline, all those checks in the driver are passing.

Below is the log

Thank you in advance for any help

Too many sats may cause the output latency to increase beyond 200ms.
So reduce the number of constellations to avoid that.

1 Like

Your log shows a date from 1980 which is not a actuell time, can this be the problem that your FC has not a valid time.
Just a thought

We have the time problem on systems that work fine, it does bug me but I don’t know how to fix it. I assume that the log name is made before the FC has gps time. Although now that I think about it, the raw files in MAVFTP have no timestamp, so I’m not sure what is responsible for regenerating the names and where it gets the data from

Would that show up as “Unhealthy GPS”? For the majority of the time that this issue was present, I didn’t see that message. I’m wondering if the FC will report GPS message frequency, or if there’s some other GPS condition that would cause the messages to be thrown out but the EKF?

Try:

GPS_GNSS_MODE,5

The log files get their time from the GPS position. If there isn’t a satisfactory GPS lock (EKF) then the log files have those default times.

1 Like

holy smokes that’s bad

New log Where I’ve used the gps auto config to reduce the number of constellations in use. EKF still isn’t happy and I’m not sure why. I am currently downloading another log where I enabled log_replay as well as log disarm. It was only recording for less than a minute (the gps was not restarted so I didn’t need to wait for that) but it still takes forever to download for some reason.

I think I’m actually seeing a problem where the EKF is unhappy until a mag cal is performed. We have COMPASS_USE set to 0 due to too much magnetic interference in this platform. It seems that we still have to go through a magnetometer calibration at boot in order to make the EKF happy even if we later “disuse” the compass for flight.

The overall issue we’re chasing is that we sometimes can’t get the craft to use GPS for yaw and ignore the compass. The symptom is that, at boot, the craft will report a heading of 0 degrees, and its heading will drift as if the EKF doesn’t have access to an absolute heading source, regardless of the state of the GPS. In different platforms running the same firmware, the reported heading will initialize to 0 and drift until an RTK fixed solution is achieved, and then the heading will snap to the gps heading. At first I thought that we were having a configuration problem with our GPS where it wasn’t reporting a heading even though it had obtained an RTK Fixed solution. When I investigated the ublox driver I saw several data validity checks that I suspected of preventing us from using the heading message from the ublox for yaw. Some of those checks are simple configuration sanity checks, like is the reported baseline close enough to the vector of the configured gps antenna positions, as well as the various settings under GPS_ that result in configuration changes being sent to the ublox. In our case we disabled GPS_AUTO_CONFIG, but the driver still checks the ublox configuration against GPS_* configuration in order to consider the gps yaw solution to be usable. I relaxed all of those checks and was still having the issue described above, this time I had printouts to tell me if the ublox driver was rejecting the yaw message or not.

After learning here that the EKF has its own gps data health checks, one of the logs I provided showed that I was not configured correctly to allow for the ublox to send gps state at an appropriate rate, which I corrected. However, the problem persisted.

I now believe that in this version of firmware the EKF does a health check that is currently failing at boot, but is cleared by using the mag cal process. For now, it seems like I can get away with using the large vehicle mag cal process since gps heading is reliable, but I don’t understand the blockers here and while the EKF was reporting bad status, it isn’t clear exactly what it’s unhappy about.

In 4.0, support for compass-free operation isn’t available yet, so I suspect I’m running into issues related to this

@rfriedman, this system is also a Planck system. Does any of this sound like it’s related to Planck’s changes? Ostensibly, this firmware has another yaw input that is fed through the EKF and I wonder if there are more checks added that I’m not aware of

Please send me an email at ryan.friedman@avinc.com.

1 Like

Solved! This system had EK3_MAG_CAL set to 3, when it needs to be 5 (external compass) so that the EKF code ignores the compass health.