Recently, we had a situation where our GPS rebooted in the middle of a flight. Of course, this shouldn’t happen. However, after looking at the dataflash log, we are puzzled by the way the EKF behaved.
Indeed, looking at the graph below, we can see that the GPS status went from 3D_FIX to NO_GPS at time 615s. Then, the communication was established again at time 622s (NO_FIX status) and we finally had the 3D_FIX again at time 626s.
The problem is that once the communication was established again with the GPS (NO_GPS -> NO_FIX), then the Kalman filter integrated the measurement of the GPS, which was (0,0).
This led to a position jump of about 3 600 000 meters.
So, how can the EKF integrate such a bad measurement, especially when the status is NO_FIX? Maybe this is related to some logic when a new GPS backend is detected, which is what happened in this case because it rebooted.
ArduCopter Version: 3.5.4
Log file available here.
@Phil007 can you post a link to the ArduPilot branch you were flying? It looks like you had some custom changes to the code
@tridge thank you for taking time to look at the log. I’m really sorry for the late reply.
So I just pushed my branch Copter-3.5-ireq ‘as-is’ on github.
There are many commits, so let me describe briefly what are the main modifications:
Add support for dual-antenna GPS for heading measurement
I removed the dependency to the magnetometer by adding support for a dual-antenna GPS which provide heading measurement through NMEA THS sentence. Until we have support for such measurement in the Kalman filter, I added a new AP_GPS_Compass which only forward heading measurement from GPS. We use the roll/pitch estimation from the Kalman filter to calculate an equivalent magnetic field based on the heading measurement. The math is not trivial, because we had to take into account a sensor angle offset around the Z axis. Mathematically, this mean that the heading measurement is not exactly equivalent to the yaw angle according to the 321 Euler convention.
Add GUIDED_ALTHOLD mode
This is basically the same as GUIDED_NOGPS, but that mode didn’t exist when we programmed that.
Modification of GUIDED mode
We made some minor modifications to the GUIDED mode. One of them is to allow control of individual axes.
Did you get the exact reason for the GPS reboot?
I have faced the same issue thrice.
Things I have tried:
a. Changed the GPS module
b. Changed Pixhawk
One of the flight logs:
Still the problem persists and I have not been able to find the exact solution for it
@Shubham_Baranwal We don’t know what happened. The problem did not occur again.
Check your Vcc board voltage in logs. It should be about 5.2 volts and highly stable. It shouldn’t change with battery voltage.