Monday, 25 February 2019

Crow-aware adaptive elevator trim

In this post I describe an adaptive trim system which makes it easy to achieve perfect pitch trim when using crow brakes.

Using the adaptive trim, it takes only a single flight to optimise the trim across the full range of crow. Furthermore, the process is completely transparent since it uses the regular trim lever.

I'm now using this system across all my F3F models.

Quick revision: crow compensation

Crow brakes are at their heart very simple: the flaps go down and the ailerons go up, increasing the model’s rate of descent. However crow brakes have an unwelcome secondary effect, in the form of a non-linear pitching moment.

The standard remedy is a crow-to-elevator mix, plus a 'compensation curve' to handle the non-linear behaviour.  Typically the curve starts steep, tailing off at mid-crow and maybe increasing again at full crow.

Crow/elevator 'compensation' curve on author's Stribog

The problem is that curves are normally adjusted manually. These means landing the model each time, and it can take several flights to get right.

But hey, it's really just about pitch trim... wouldn’t it be nice if we could simply use the elevator trimmer to bend the curve whilst flying the model?  Turns out it is indeed possible.

Adaptive trim system - how it works

The key is to repurpose the trim so that it behaves like a dumb 2-sided momentary switch - easily done in OpenTX. The second element to the system is a Lua script running in the background. Its job is to monitor the trim lever.

When a 'click' is detected, the script reads the crow value, identifies the nearest points on the compensation curve, and moves that part of the curve up or down.

The elevator correction is obtained via a simple crow to elevator mix, with the compensation curve applied.

Between zero and 4% crow the system emulates the system default behaviour (+/-25% trim range). Beyond 4%, the limits are relaxed allowing for aggressive compensation. Beeps and repeats are handled correctly.

Info screen

Changes to the compensation curve are reflected in the OpenTX 'Curves' menu. In addition, a custom screen displays the curve along with crow value and active points. The screen is just for info - there is no need to look at it whilst flying.

Telemetry screen (X9D, X9D+, X9E). Vertical bar is crow value.

OpenTx Widget (X10, X12S)

In use

To optimise the curve, the pilot makes a couple of passes through the crow range, adjusting the trim as needed.

With slope soarers and F5J models, optimisation can be completed in a single flight. Thermal soarers may require a couple of flights due to reduced flight time.


Below is a video showing how the system works, and the aftermath of a flying session. Just to make things difficult, the wind was around 40 mph, and the compensation curve was zeroed before the flight.

Download the script

The Lua script can be downloaded here. [23 Sept 2020 - version 3 supports all transmitters from the X9-Lite to the X12S, and clones].


My thanks to Lothar Thole for porting my original script to the X10 and X12S. Also to MiamiMike, L Shems, and hisroyaldudeness on RC Groups for their invaluable input.


pernstig said...

Implemented the This Lua to my TopModel Astra V-tail and it´s working perfect, at least on my workshop desk. Modified to be activated by TrmT as I am used to have both motor comp and spoiler comp on this trim. When (if!) wheather improves in Sweden I will try a test flight soon. Thanks a lot!

Philippe said...

This is great! I am already a big fan of your F3F, Wingy, Ahi and F5x templates which are a blessing for those not as fluent in OpenTX and Lua than you, Mike. Thinking about it, your OpenTX F3F template was my reason to move from Graupner to FrSky some years ago.

Your Crow-aware adaptive elevator trim will find its way to your F3F template soon.

Small thing: On the blog page above you mention a different set of compatible radios compared to the script page (X10 and X12 not mentioned).

Many thanks for your continued contributions to the OpenTX community.

RvD said...

Have 2.1 and incorporated into the eSoar Template on my older Horus X10 - works well.
Tried installing it on my new Horus X10S Express and comes back with an "unsupported radio" error message on the widget screen. Is the Express supported, and does the lua script need to be modified?

RC Soar said...

Hi @RvD: it'll work fine with the Express (and other X10 clones) if you comment out the radio checks by inserting two dashes at the start of line 200. It should look like this:

-- if not supported[radio] then AdpError = "Unsupported radio" return end

The published scripts will be updated in due course.

RC Soar said...

Version 2.4 of the widget version (for colour screen tx's) is now available. The radio checks have been removed so it'll work with any such transmitter, including X10 Express etc.

RvD said...


UlfH said...

I have added and changed a few lines of code to make this script work with low resolution radios as well, e.g. QX7 or Xlite (version 2.2.1). I will send it to Mike and he can use it as he wants.

RC Soar said...

@UlfH: received - thank you!