GPS Rescue mode in Betaflight is similar to “Return to Home” on a DJI drone. It is meant to help bail you out when your video feed or radio signal gets sketchy, and in failsafe, the quad is supposed to return to you automatically using GPS.
Disclaimer – Rescue mode in Betaflight should be treated as experimental. Do not rely on it and expect to get your quad back every time you lose signal, because you won’t. There have been times it didn’t work properly for me and definitely isn’t as reliable as a DJI drone. It’s good to have as a last resort nonetheless.
Rescue mode is like “return to home”, but in its simplest form. It’s designed to bring your quad close enough to home so you could get your signal back and regain control. It’s a useful feature to have in Betaflight, especially if you fly long range and it could save your drone one day :)
Check out my other Betaflight Tutorials.
Requirements to use GPS Rescue Mode
- Flash your FC to the latest Betaflight (v3.5 or newer)
- Tutorial: Setup a GPS module on your FC
- Enable Accelerometer (it uses Angle mode when flying back home)
This is the GPS module i use, product page – http://bit.ly/2KZcdR7
Barometer is not required, but can be useful. It’s used to calculate the altitude of the quad. If you don’t have this, altitude can be calculated from GPS data, but it’s won’t be as accurate as having a barometer. FC that has barometer built-in: Rush Digital F722, Kakute F7.
Compass is not required in Rescue Mode, direction is estimated from GPS data.
GPS Rescue Mode Configuration
To use GPS Rescue mode, you must have a 3D fix first. You can check this in the Setup page, GPS section.
Settings for GPS Rescue mode are available in the Failsafe page. To edit the settings, you need to select “GPS Rescue” first. But if you are not ready to use Rescue mode as failsafe method, just change it back to Drop after configuration.
You might have to tweak the settings in Betaflight to make it work for your particular setup and environment. Make sure to check out the Betaflight wiki to fully understand what the parameters do: https://github.com/betaflight/betaflight/wiki/GPS-rescue-mode
Here are the settings that work for me.
The same settings are also available In CLI, enter
get gps_rescue and you will get the list of GPS related parameters. Here I will briefly explain what each parameter means.
set gps_rescue_min_sats = 6
Minimum Satellites – Your quad won’t arm if the GPS has fewer satellites than this value. The recommended number of Sats is 8 for reliable rescue mode. 5 might still work, but it can be sketchy. Expect the quad to become a bit more unstable as it might wander around intermittently during Rescue mode.
Note that if you take off before the GPS sees a good amount of satellites, it won’t know where home exactly is. More satellites means better position accuracy, you can reduce the number of sats but the position accuracy will go down.
You can disable “Allow arming without fix” to allow you to arm without a satellite fix. Beware that GPS rescue will not work for that flight if you arm before getting a fix (because it doesn’t know the home position).
Altitude Mode – it determines the altitude at which the quad returns home.
- Maximum altitude is the highest altitude your quad was flown during flight
- Fixed altitude is just a user defined value
- Current altitude is whatever height that the quad was at when GPS rescue mode was activated
The option depends on your environment. Maximum altitude is probably the safest option, but if you flew way too high in that flight, you could be wasting energy climbing back to that altitude when Rescue mode is activated.
To set “Fixed altitude”, enter number in “Initial altitude”, or enter this command line:
set gps_rescue_initial_alt = 50
Initial Altitude (meters) – at what minimum height the drone returns home relative to the take off point. It should be high enough to avoid trees, buildings and power lines.
set gps_rescue_angle = 35
Angle – It’s in degree. For a smaller quad, you might want to set it to a higher angle than the default 30, in case the quad isn’t strong enough to fight head wind. However if the angle is too steep it might struggle to stay in the air so it really depends on the power of your quad.
You need to enable Accelerometer and need to be calibrated/trimmed properly for this to work accurately. If your ACC is faulty, rescue mode might not work correctly for you. Verify by flying in Angle mode.
set gps_rescue_descent_dist = 200
Descent Distance (meters) – at what distance from home our drone starts to descent. Enter a distance at which you think you would get your signals back reliably.
Ground speed (meters/second) – Note when entering value in GUI, the unit is different than CLI (which is cm/s). This is the speed at which the quad travels back. The default 20m/s is about 70km/h.
set gps_rescue_sanity_checks = RESCUE_SANITY_ON
Sanity Checks – when set to “ON”, it constantly monitors GPS Rescue mode conditions, for example:
- is GPS still connected
- are we getting good number of satellite fix
- are we at least 100 meters away from home? (distance can be changed)
- are we getting closer to the home, and we didn’t hit an obstacle
If any of these conditions are not met, it will abort rescue mode and your quad will just disarm and drop to the ground. So yea, it’s not ideal if you are flying over unrecoverable area like water, but generally, it should be on for safety reasons.
The Betaflight wiki also recommends setting Sanity Checks to “Failsafe Only” if you are having trouble with the option “On” during testing. It turns Sanity Checks off when Rescue mode is activated by a switch but only turns it on when it’s in failsafe. This is my preferred option.
If you decide to turn it off entirely, you should be aware of the risk, such as fly away.
You can change the minimum distance with this command line (range: 50 – 1000)
set gps_rescue_min_dth = 100
When the quad is too close to yourself, the direction estimation might not work well and the quad won’t know which way to go exactly (because it doesn’t use a compass). This is to prevent activating Rescue mode when the quad is too close and endangering yourself by flying your quad accidentally to your face :)
set gps_rescue_throttle_min = 1100
set gps_rescue_throttle_max = 1600
set gps_rescue_throttle_hover = 1250
Throttle (min/max/hover) – these are the min, max and hover points of your throttle value you want to use in rescue mode. Set max to a value so the quad isn’t too fast, set min to keep the props spinning at a reasonable rate, and set hover point to just enough to keep the quad afloat.
Activating GPS Rescue Feature
There are two ways to activate GPS Rescue mode, either by Failsafe, or by a switch on your transmitter.
Go to the Betaflight Modes tab and add a switch/AUX channel for GPS Rescue Mode.
To set it up for failsafe, go to the Failsafe tab in Betaflight Configurator. If you don’t see it, you have to first enable “Expert Mode” (next to Update Firmware button on the top).
Alternatively you can do that in CLI by entering:
set failsafe_procedure = GPS-RESCUE
Note that your quad will enter rescue mode if RC signal is lost, and it will go back to acro mode as soon as RC signal is restored. At this point it’s possible that your video signal is still lost and you are flying blind!
Therefore it’s important to assign rescue mode to a switch. When failsafe happens, you should put your switch to rescue mode as well. Only put your switch back to acro mode when you are ready to take over control.
It is nice to be able to set GPS Rescue as your failsafe, but it really depends on the environment. For example I wouldn’t use GPS Rescue mode as failsafe if I am flying in a forest, bando, or garage. Imagine losing your control link while under a tree, or inside a building. Your failsafe would kick in, and Rescue mode would immediately send your quad into the branches or the ceiling, which isn’t very helpful!
Besides, if you have no GPS fix when it failsafes, the quad will just drop to the ground.
What Happens when Rescue Mode is Activated?
The quad climbs to the altitude you set (or maximum altitude during flight). Then it starts flying toward the launch point. It’s not going to be a smooth cruise, it might jiggle left and right as it’s trying to figure out the direction, but it will eventually get home.
It won’t stop at exactly where it took off, instead, when it reaches the “descent distance” from home, it will start to descent and “land”.
However, don’t rely on Rescue mode for landing, speaking from experience, it’s not pretty (not what it’s designed for anyway)! You could end up on top of a tree, or just crashed straight into the ground. It simply doesn’t care what’s underneath, or how high it is from ground.
As soon as you get your video and radio links back, you should take back control and resume flying.
Testing GPS Rescue Mode
Assign a switch to Failsafe in the Modes tab in Betaflight. It emulates full failsafe mode in Betaflight. Note that this is only for testing GPS Rescue mode, as soon as you finish testing, you should remove it.
Remove all props, go into the Modes tab and verify that Failsafe mode can actually get activated by the switch. At this point your quad will go into Rescue mode, and your radio controls will be locked out. Now check if you can deactivate failsafe and take back control. (You could also just turn off the radio to simulate a failsafe, but it takes time to turn it back on, so it’s safer to use a switch)
When you are testing this on the bench, with the USB cable connected, the Rescue mode box won’t turn yellow like other modes. This is fine as long as the small yellow bar can move to the activation range.
It’s useful to enable these GPS related OSD elements, they will help you understand what your quad is doing. You can also have Flight Mode enabled, it’ll say “RESC” when Rescue mode is activated.
Make sure you have enough locked satellites in the OSD before arming.
Fly in a straight line, past your descent distance and more. For example, if your descent distance setting is 200 meters, fly 300-400 meters away.
Activate Failsafe mode. Now the quad should enter GPS Rescue mode. You should also activate Rescue mode now, as I mentioned earlier. When you get out of Failsafe, you can manually disengage Rescue mode and that gives you enough time to take back control, otherwise it would just drop to the ground.
Pay attention to the home arrow in Betaflight OSD, if it’s pointing up, it means you are flying home. If it’s pointing down, means you are flying away from home. The arrow might be pointing the wrong direction from time to time, this is normal. Just make sure the quad isn’t flying the complete opposite direction.
When the quad gets close enough to home, you have to get ready to take over control. Keep the throttle stick around 40-50% (slightly higher than hover point), and the roll and pitch stick at the neutral position.
Disengage failsafe, then rescue mode, and now you have full control to the quad as normal.
If you don’t disengage rescue mode and let it fly too close to launch point, it will just start to descend when it hits the “descent distance”.
Repeat the procedure again and again until you are feeling comfortable with it.
Once you are done with testing, remove Failsafe from the Modes tab.
- Oct 2018 – tutorial created
- Aug 2020 – updated, GUI changes, CLI parameter names changes, added throttle min/max/hover values