Gliding at accurate airspeed for L/D measurement

Been thinking of the best way to accomplish this and it looks like ‘soaring’ could be used, please advise.
If I enable soaring but set SOAR_VSPEED very high so that THERMAL mode is not entered, then allow it to do a series of climbs and glides and adjust the throttle stick during the glide portion to set a fixed airspeed.
Would that work and is there a better way to get a series of ‘motor off’ glides at different speeds?
Thanks

You can test this in SITL.

Hi,
i had the same/similar problem not that long ago.

What parameter can i read out to get the current desired mission trim speed (“DO_SPEED_CHANGE”)?

In the end i did not use LUA.
I just used a three way switch for SOARING an did not allow it to automatically change the mode to circling.
I wanted defined flight speeds, not just a stick input.
In the end i just rewrote one line in the code to achieve that.

In navigation.cpp i changed the following. (approx line 217)

#if HAL_SOARING_ENABLED
    } else if (g2.soaring_controller.is_active() && g2.soaring_controller.get_throttle_suppressed()) {
        if (control_mode == &mode_thermal) {
            float arspd = g2.soaring_controller.get_thermalling_target_airspeed();

            if (arspd > 0) {
                target_airspeed_cm = arspd * 100;
            } else {
                target_airspeed_cm = aparm.airspeed_cruise_cm;
            }
        } else if (control_mode == &mode_auto) {
            float arspd = g2.soaring_controller.get_cruising_target_airspeed();

            if (arspd > 0) {
                target_airspeed_cm = arspd * 100;
            } else {
                target_airspeed_cm = aparm.airspeed_cruise_cm;
            }
        }
#endif

to

#if HAL_SOARING_ENABLED
    } else if (g2.soaring_controller.is_active() && g2.soaring_controller.get_throttle_suppressed()) {
        if (control_mode == &mode_thermal) {
            float arspd = g2.soaring_controller.get_thermalling_target_airspeed();

            if (arspd > 0) {
                target_airspeed_cm = arspd * 100;
            } else {
                target_airspeed_cm = aparm.airspeed_cruise_cm;
            }
        } else if (control_mode == &mode_auto) {
            float arspd = new_airspeed_cm;

            if (arspd > 0) {
                target_airspeed_cm = arspd * 100;
            } else {
                target_airspeed_cm = aparm.airspeed_cruise_cm;
            }
        }
#endif

the difference is just
float arspd = new_airspeed_cm;

it works quite nice (i think it was Ardupilot 4.4.4) and i was able to produce some OK-ish polars for my paper at Forum80.
It basically just uses the airspeed that is programmed in the flight path as defined speed to fly in SOAR mode.
When it gets to the altitute floor it automatically climbs with motor to the ceiling and glides down again.

Biggest problem for me were thermals. I am not yet able to get good data later than approx. 30-45min after sunrise.

  • Christian
1 Like

There might also be a LUA possibility in the future: