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 at all crow settings.

With the adaptive trim, the elevator trim is repurposed so that it bends the crow compensation curve. The process is completely transparent - no special action is required during the flight. The pilot simply uses the trim as required.

I'm now using this system across all my F3F models. It allows me to optimise the compensation very quickly - even before the first landing of a new model.


Graphic of crow aware adaptive trim system

Quick revision: crow compensation

Crow brakes are at their heart very simple: the flaps go down and the ailerons go up, increasing the rate of descent. However crow brakes have an unwelcome secondary effect, in the form of a non-linear pitching moment. Left uncorrected, the pilot has to juggle both the crow and elevator controls, making it difficult to achieve an accurate landing.

The 'compensation' mix

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

All fine, except that traditionally the curve is adjusted manually. This means landing the model each time an adjustment is required, 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? That way, we would be able to optimise the curve whilst flying the model.

Turns out it is indeed possible.

The Adaptive Trim system - how it works

I've called my solution the 'crow-aware adaptive trim' system. The basic idea is to use the elevator trim to bend the compensation curve.

There are three elements to the implementation. The first is to repurpose the elevator trim lever as a dumb two-sided momentary switch - easily done in OpenTX. Once freed from its normal duties, the trim becomes a highly flexible device.

The second element is the Lua script. Its job is to monitor the trim lever, waiting for clicks. When a click is detected, the script fetches the crow value, identifies the nearest point(s) on the compensation curve, and moves it up or down. (In terms of the Lua code, the script reads the curve, modifies it, and writes it back.)

The rest is straightforward: the compensation curve is applied to a regular crow-to-elevator mix.

With minimal crow (up to around 4%) the system emulates a regular trim lever with range of +/-25% of full travel. With > 4%, the limits are relaxed allowing for aggressive compensation. Beeps and repeats are handled in the script.

Telemetry screen

Changes to the compensation curve are reflected in the regular Curves screen. In addition, the script generates a telemetry screen showing (a) the compensation curve, (b) the crow value and (c) the active curve points. The screen is just for information  - there is no need to look at it whilst flying.

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

OpenTx Widget (X10, X12S)

Optimising the curve

To optimise the compensation curve, the pilot deploys crow incrementally, adjusting the trim as needed. Two or three cycles through the entire range will normally be required. 

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

Video 

Below is a video showing how the system works, and the result of a flight test in a 40 mph wind. Just to make things difficult, 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].

Acknowledgements

My thanks to Lothar Thole for the initial port to the X10 and X12S. Also to MiamiMike, L Shems, and hisroyaldudeness on RC Groups for their invaluable input.


13 comments:

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...

Thanks!

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!

RC Soar said...

Version 3 is now available, adds support for transmitters with 128x64 mono screens e.g. Q X7, X9 Lite etc. More info and download

Javier ariza said...

Javier Aiza - CVC Barcelona - Spain

This is great! I am already a big fan of your F3F, Ahi and others templates which are a blessing for those not as fluent in OpenTX and Lua, thank you.

I'm thinking about you on each landing.

Your Crow-aware adaptive elevator trim its rally a good solution and help me so much on my landings. I recommend it to several pilots, close friends, and they are so000oo happy with it.

Just to know, maybe a silly idea, if we can have more point in the curve, how to implement it???

great job. Congratulations again

RC Soar said...

@Javier, thanks for the feedback :-) Yes it's possible to add extra points but some Lua experience would be necessary. First increase the number of points in curve adp, and then adjust NPTS in the script. You would also need to adjust the 'regions' array. An easier enhancement would be to adjust the distribution of the 'regions' array without increasing the number of points.

Javier ariza said...

Hi. , thanks very much for your reply. ;)
I'm analysing such LUA and to be hones it's really nice job.
I'll try to change it, just only curiosity.
If work I'll let you know together with alterations to original code for your approval.

Thanks again . Great contribution

regards
Javier Ariza CVC Barcelona - Spain

RobinS said...

I use adaptive trim with crow and also on my spoiler only equipped models too where it works well.