# Soaring¶

The autonomous soaring functionality in ArduPilot allows the plane to respond to rising air current (thermals) in order to extend endurance and gain altitude with minimal use of the motor (soaring). Its full technical description is available in

S. Tabor, I. Guilliard, A. Kolobov. ArduSoar: an Open-Source Thermalling Controller for Resource-Constrained Autopilots. International Conference on Intelligent Robots and Systems (IROS), 2018.

This picture shows the different phases of flight when using the soaring functionality:

1. If modes AUTO, FBWB or CRUISE are entered, and Soaring is enabled, the throttle is set to zero provided the aircraft is above SOAR_ALT_MIN altitude and the aircraft then begins gliding.

2. In AUTO, if the aircraft descends to SOAR_ALT_MIN altitude, throttle is re-enabled and the aircraft will begin to climb to the altitude of the next waypoint. If that waypoint altitude is less than SOAR_ALT_CUTOFF altitude, then Soaring can not begin before reaching the waypoint. If it is above SOAR_ALT_CUTOFF altitude, then Soaring can occur once that altitude has been reached. In FBWB or CRUISE modes, if SOAR_ALT_MIN altitude is reached, an RTL will be initiated, so the pilot must disable Soaring, or change to a mode other than FBWB or CRUISE to climb back above SOAR_ALT_CUTOFF to begin gliding again and prevent an RTL beginning.

3. When the aircraft reaches SOAR_ALT_CUTOFF altitude, throttle is set to zero again.

4. If, during gliding flight, the air is estimated to be rising at more than SOAR_VSPEED and the RC switch position allows it, the aircraft will automatically enter LOITER mode. While in LOITER mode the aircraft will adjust the loiter position to better centre the thermal.

5. LOITER mode is exited under the following conditions:

The flight mode will be returned to whatever it was before LOITER was triggered, with the following exception: If the previous mode was FBWB or CRUISE, and thermalling ended due to reaching SOAR_ALT_MIN, RTL will be triggered instead.

## Non Supported Boards¶

Generally all boards support soaring, except those with firmware limitations referred to on this page. As of June 2020, non-supported boards include:

• KakuteF7Mini
• KakuteF7
• sparky2
• Pixhawk1-1M
• OMNIBUSF7V2

## Setting up soaring¶

To use your plane for soaring, it should ideally be a glider type aircraft with a good lift to drag ratio and be equipped with an airspeed sensor. There are a few steps involved in setting a plane up for soaring:

1. Set up a suitable mission.
2. Tune the TECS.
3. Estimate aircraft drag.
4. Set up the soaring parameters.
5. Set loiter radius and bank angle limit.

## Mission Setup¶

The main requirement for a mission is that it take the aircraft above SOAR_ALT_CUTOFF so that gliding flight is initiated. To achieve this, set the waypoints’ altitude(s) above SOAR_ALT_CUTOFF .

## Tune the TECS¶

Note

In firmware revisions before 4.1, it was necessary to set TECS_SPDWEIGHT to 2.0 when using soaring. This is now handled automatically.

For best results the TECS needs to be set up to fly the aircraft at a consistent airspeed when gliding. To achieve this, set SOAR_ENABLE to 1 and set SOAR_VSPEED to a large number, say 50.0, or use the RC switch to inhibit mode changes. This means that the aircraft will glide but will never begin thermalling. Set SOAR_ALT_CUTOFF to an altitude you feel comfortable with. It should be high enough to allow a good length of time to be spent gliding. Launch the aircraft and put it in AUTO mode. It should climb to SOAR_ALT_CUTOFF and then begin a gliding descent. Watch the telemetry graphs or look at the Dataflash logs. Is the aircraft maintaining the demanded airspeed? The actual and demanded airspeed can be seen in the onboard log as TECS.sp and TECS.spdem, and via telemetry you can use NAV_CONTROLLER_OUTPUT.aspd_error. You will probably need to increase PTCH2SRV_IMAX and TECS_INTEG_GAIN to achieve good airspeed tracking in gliding flight.

## Estimate Aircraft Drag¶

To work out how fast the air is rising or sinking the autopilot needs to know the aircraft’s sink rate for a given airspeed in still air. This is related to the drag polar of the plane. Estimating the polar can be a little involved. If you have an airframe reasonably similar to a Parkzone Radian, it is reasonable to leave the SOAR_POLAR_B and SOAR_POLAR_CD0 unchanged. You should adjust SOAR_POLAR_K for your plane using the following formula:

SOAR_POLAR_K = 16*Weight/Area (weight in kg, area in metres squared).

SOAR_POLAR_K = 703*Weight/Area (weight in oz, area in inches squared).

## Set up the Soaring Parameters¶

Change the SOAR_VSPEED parameter back to a sensible value. Remember, this parameter controls when the mode will be changed to LOITER and thermalling starts. Change SOAR_ALT_MAX to the altitude you want the autopilot to stop thermalling.

## Set loiter radius and bank angle limit¶

The parameter WP_LOITER_RAD sets how tight the loiter circle is. For thermalling it is usually best to have the aircraft fly at a 30 - 45 degree bank angle. The corresponding loiter radius can be calculated as about airspeed squared over ~10 (for 45 degrees) or ~6 (for 30 degrees), from the equation

$r&space;=&space;\frac{v^2}{g&space;\tan&space;\phi}$

The tanget is for the desired bank angle, the result will be in meters for the radius,with g = 9.81 m/s/s, velocity (v) is in m/s. For example, if the airspeed in loiter is 20m/s, then the WP_LOITER_RAD should be 40 for a 45 degree bank, assuming that LIM_ROLL_CD is set at 4500 or higher.

You should make sure that the limiting bank angle LIM_ROLL_CD is set a bit larger to give some room for manoeuvring.

## Set up RC switch (Optional)¶

Note

Available in firmware revisions 4.1 and later.

You can use a 3-position RC switch to control when the autopilot can use soaring. Set the parameter SOAR_ENABLE_CH to the corresponding channel number. The 3 positions have the following effect.

• Below 1500us. Soaring is disabled (equivalent to setting SOAR_ENABLE = 0). Throttle will be used as normal. Switching to this from either of the positions below, will disable Soaring and maintain the current flight mode.
• 1500us to 1700us. Soaring will have control over throttle. The mode will not automatically change to LOITER based on detected rising air. However, when manually set to LOITER mode using RC controller or GCS, the autopilot will try to follow rising air currents. It will still restore the previous mode if the aircraft is not climbing, or if it drifts too far (see below). Switching to this position from the one below, while LOITERing in a thermal has no effect until the thermal is exited.
• Above 1700us. Fully automatic mode changes to LOITER from AUTO, FBWB or CRUISE modes in response to detected rising air, and following of rising air currents.
 PWM Value Auto throttle cutoff Tracking thermal updrafts Automatic change back from LOITER Automatic change to LOITER < 1500 us N N N N 1500 - 1700 us Y Y Y N > 1700 us Y Y Y Y

## Set limits¶

Because the soaring feature can follow rising air as required to gain altitude, it is important to set limits to avoid it leaving the original flight area completetly. This is especially important in windy conditions as the autopilot will try to follow thermals downwind. There are three ways to set limits.

### Limit maximum drift¶

Note

Available in firmware revisions 4.1 and later.

The parameter SOAR_MAX_DRIFT can be used to limit how far (in metres) the aircraft can drift while in LOITER mode. If the airfraft reaches this limit in LOITER mode, it will revert to the original flight mode.

If the original flight mode was FBWB or CRUISE mode, the drift distance is measured from the location LOITER was entered.

If the original flight mode was AUTO mode, the drift distance is measured from the closest point on the mission segment to where LOITER was entered. Drift sideways or backwards, but not along the original mission track, is counted. This allows thermalling to continue if the wind is moving the aircraft in the direction of the next waypoint.

The image below shows a scenerio where the mission track is north to south and the wind is causing thermals to drift east to west. The aircraft will follow them but will respect SOAR_MAX_DRIFT. Note that sometimes it will go a little beyond SOAR_MAX_DRIFT as it lines up its heading to the next waypoint before reverting to AUTO mode.

### Limit maximum distance from home¶

Note

Available in firmware revisions 4.1 and later.

If using FBWB or CRUISE mode, the parameter SOAR_MAX_RADIUS can be used to trigger RTL if the aircraft is more than this distance from home when thermalling while in LOITER mode. Note that this parameter won’t stop the aircraft from exceeding this distance before it enters LOITER mode.

If Soaring is enabled when beyond this SOAR_MAX_RADIUS, it will not begin any Loitering in thermals, ie the same effect as if the middle RC switch option for Soaring was used.

Warning

If altitude is below SOAR_ALT_MIN, when Soaring is enabled beyond this limit, it will begin gliding, but not climb or RTL, nor LOITER in a thermal, and will glide to the ground!

### Time limits¶

Note

Available in firmware revisions 4.1 and later.

SOAR_MIN_THML_S : Minimum time to remain in LOITER once entered for a thermal before exiting due to low lift or altitude limits.

SOAR_MIN_CRSE_S : Minimum time to remain in glide after exiting LOITER due to low lift or altitude limits before entering LOITER mode again, or when entering Soaring initially.

### Use geofence¶

Geofence can be used as a last line of defence. Set it up in the usual way.

## Use of TECS synthetic airspeed¶

If your plane can’t accommodate an airspeed sensor, it is possible to use the TECS synthetic airspeed estimate TECS_SYNAIRSPEED. Make sure you read the warning regarding this feature before deciding to use it. To use this feature, set the parameter TECS_SYNAIRSPEED to 1.