GPS Fix Estimation (Dead Reckoning)
Video Demonstration​
There is possibility to allow plane to estimate it's position when GPS fix is lost. The main purpose is RTH without GPS. It works for fixed wing only.
Plane should have the following sensors:
- acceleromenter, gyroscope
- barometer
- GPS
- magnetometer (optional, highly recommended)
- pitot (optional)
By befault, all navigation modes are disabled when GPS fix is lost. If RC signal is lost also, plane will not be able to enable RTH. Plane will switch to LANDING instead. When flying above unreachable spaces, plane will be lost.
GPS fix estimation allows to recover plane using magnetometer and baromener only.
GPS Fix is also estimated on GPS Sensor timeouts (hardware failures).
Note, that GPS fix estimation is not a solution for navigation without GPS. Without GPS fix, position error accumulates quickly, but it is acceptable for RTH. This is not a solution for flying under spoofing also. GPS is the most trusted sensor in Inav. It's output is not validated.
How it Works?​
In normal situation, the plane is receiving its position from the GPS sensor. This way it is able to hold course, RTH, or navigate by waypoints.
Without a GPS fix, the plane only has nose heading from magnetometer and height from barometer.
To navigate without GPS fix, we make the following assumptions:
- plane is flying in the direction where nose is pointing
- (if pitot tube is not installed) plane is flying with constant airspeed, specified in settings
It is possible to roughly estimate position using theese assumptions. To increase accuracy, plane will use information about wind direction and speed, estimated before GPS fix was lost. To increase groundspeed estimation accuracy, plane will use pitot tube data(if available).
From estimated heading direction and speed, plane is able to roughly estimate it's position.
It is assumed, that plane will fly in roughly estimated direction to home position until either GPS fix or RC signal is recovered.
Plane has to acquire GPS fix and store home position before takeoff. Estimation completely without GPS fix will not work.
Estimation Without Magnetometer​
Without a magnetometer, navigation accuracy is very poor. The problem that emerges without a compass is heading drift.
The longer a plane flies without magnetometer or GPS, the bigger is its course estimation error.
After few minutes and few turns, "north" direction estimation can be completely broken. In general, accuracy is enough to perform RTH U-turn when both RC controls and GPS are lost, and roughtly keep RTH direction in areas with occasional GPS outages.

(purple line - estimated position, black line - real position).
It is recommened to use GPS fix estimation without magnetometer as last resort only. For example, if plane is flying above lake, landing means loss of plane. With GPS Fix estimation, plane will try to do RTH in very rought direction, instead of landing.
It is up to user to estimate the risk of fly-away.
Settings​
GPS Fix estimation is enabled with CLI command:
set inav_allow_gps_fix_estimation=ON
Also you have to specify cruise airspeed of the plane.
To find out cruise airspeed, make a test flight. Enable ground speed display on OSD. Fly in CRUISE mode in two opposite directions. Take average speed.
Cruise airspeed is specified in cm/s.
To convert km/h to cm/s, multiply by 27.77.
Example: 100 km/h = 100 * 27.77 = 2777 cm/s
set fw_reference_airspeed=2777
It is important, that plane is flown with the specified speed in CRUISE mode. If you have set option "Increase cruise speed with throttle" - do not use it without GPS Fix.
If pitot is available, pitot sensor data will be used instead of constant. It is not necessary to specify fw_reference_airspeed. However, it is still advised to specify for the case of pitot failure.
Related command: to continue mission without RC signal, see command set failsafe_mission_delay=-1.
After entering CLI command, make sure that settings are saved:
save
Disabling GPS Sensor From RC Controller​

For testing purposes, it is possible to disable GPS sensor fix from RC controller in the programming tab:
GPS can be disabled only after:
- Initial GPS fix is acquired
- In ARMED mode
Allowing WP Missions With GPS Fix Estimation​
failsafe_gps_fix_estimation_delay
Controls whether waypoint mission is allowed to proceed with gps fix estimation. Sets the time delay in seconds between gps fix lost event and RTH activation. Minimum delay is 7 seconds. If set to -1 the mission will continue until the end. With default setting(7), waypoint mission is aborted and switched to RTH with 7 seconds delay. RTH is done with GPS Fix estimation. RTH is triggered regardless of failsafe procedure selected in configurator.
Expected Error (mag + baro)​
Realistic expected error is up to 200m per 1km of flight path. In tests, 500m drift per 5km path was seen.
To decrease drift:
- fly one large circle with GPS available to get good wind estimation
- use airspeed sensor. If airspeed sensor is not installed, fly in cruise mode without throttle override.
- do smooth, large turns
- make sure compass is pointing in nose direction precicely
- calibrate compass correctly
This video shows real world test where GPS was disabled occasionally. Wind is 10km/h south-west:
The purple line shows estimated position. Black line shows real position. "EST ERR" sensor shows estimation error in metters. Estimation is running when satellite icon displays "ES". Estimated position snaps to real position when GPS fix is reaquired.
Is It Possible to Implement This for Multirotors?​
There are some ideas, but there is no solution now. We can not make assumptions with multirotor which we can make with a fixed wing.