Ardupilot : V4.0.3
Image : the latest (did an update last week)
Problem : The GPS is detected in Ardupuilot, the position is right (approx 2-5m of random slow deviation) while on ground with 10 sats. But there is a “unhealthy GPS” message in ardupilot and, while flying, LOITER and POSHOLD go everywhere.
This last issue was in part due to the GPS and was mainly due to the Extended Kalman Filter. The GPS vertical velocity was wrong, so I disactivated this measurement in the EKF to make AltHold work. I’ve been struggling with the GPS for quite a while without noticing it was the GPS.
Now the GPS is still wrong and I can’t use it in any of Ardupilot modes. It seems to come from some Navio2, ardupilot and u-center’s settings.
I’m aware of this one. But no clear solution came out of it. Plus, I don’t have the “baudrate” messages in mission planner.
It is said that it was a bug from Ardu 4.0.3 as stated in the changelog, but nothing is written about GPSs in said changelog. Also, it has been 4 months since and there is no new update of Ardupilot for Navio if all navio’s GPS stopped working the update would be here.
On ground behavior
While disarmed, with any number of satellites, mission planner displays “unhealth GPS signal”. The GPS is “enabled” and “present” but keeps switching from “Ok” to “bad” in mission planner when opening the CtrL+F menu. The position of the copter on the map is not perfect, it slowly drifts in a 3-5m radius.
I’m pretty sure it does not come from interferences. When powering the board with an external battery the error message is also here. Plus this is my setup:
the GPS (and its cable) is far from the powerlines, above everything and the esc is really far (beside the white tape at the far right)
I’ve tried Loiter and PosHold, with 2D gps velocity and without. Neither of those work.
Here is a video of a “good” flight (at least it’s not going in a straight line) : https://youtu.be/mwm1F3GWNhQ
here are several logs with different settings : https://drive.google.com/drive/folders/1BbkUHXdomawUMbq8Sp3r7iXRVKOQ1Day?usp=sharing
number 1 is the video.
Number 0 is with default settings. So let us look at this one. The main problem is that
NKF1/VN (speed north) and the slope of NKF1/PN (position north) are vastly different. Something is throwing the EKF (kalman filter) off and I strongly think it’s the GPS (I have very low vibrations BTW).
The Loiter algorithm works by controlling NKF1/VN (speed north) depending on the desired NKF1/PN (position north) value. If the copter is 1m to the north, a -1m/s is sent to the north speed controller. If speed and position are not linked the control does not work and that’s what’s happening here.
(TPX is the desired position and TVX desired speed).
This discrepancy between speed and position happens in all 3 dimensions when using GPS.
There is a huge amount of innovation in the kalman filter’s (EKF) position and speed:
In the end this either come from a bad EKF or a bad GPS. Because we’ve an error on the GPS and disabling it on the height already solved a problem I think it comes from the GPS.
A previous discussion that I cannot find, found that the rate of the GPS did not correspond to what Ardupilot wants. Ardupilot wants at least 5Hz. But it happens that the GPS is too slow as on this log:
This was because too many constellations were used at once. Navio’s GPS can achieve 5Hz with only one or two, but if you enable everything it becomes 1Hz.
Now I’m only using GPS (no GLONASS, GALILEO, SBAS …) and it looks like 5Hz, though it’s hard to tell:
sometime the rate is slower, here between 03 and 04 there is only 3 samples, and 8 samples in the next second.
here it’s 3 sample/s, i.e. 3Hz:
The sample rate could be the reason behind the unhealthy GPS. But I’m not sure.
This could explain why this keeps changing in the CtrL+F menu, when the rate is too slow it switches to “bad”:
Also I don’t know how to properly setup u-center. I’ve disabled Ardupilot Auto Config for the gps, so I can manually set it up in u-center at 5Hz, but I’m not 100% sure of how to use u-center. The logs 1-2-3-4 where with my settings inside u-center, or I think so. Log 0 was with Ardupilot auto config. Either way it doesn’t solve the problem
I don’t know where exactly is the problem (it could be the rate but I’m not sure), I have no idea of what to try next to find the issue and fix it.
I would gladly receive some help. If you want me to do some test flights with video, logs, and other settings I’ll gladly do so.
Edit : clarity and typos