Monday, 25 February 2019

Crow-aware adaptive elevator trim

In this post I describe an adaptive trim system. It extends the function of the elevator trim, so it can adjust pitch trim at any crow brake setting. This enables the pilot to optimise pitch trim across the full range of crow in a single flight. The system is based on a Lua script.

Landing approach with full crow

Quick revision: crow compensation

Crow brakes are simple, in principle at least: when you pull on the lever, the flaps go down and the ailerons to up, and the model loses height more rapidly.

However crow brakes also have an unwanted side effect: they tend to pitch the nose up, and the effect is non-linear. To compensate for this, we use a crow-to-elevator mix together with a 'compensation' curve.

Compensation curve on author's Stribog (manually adjusted)
The problem is that the curve must be adjusted manually, which involves landing the model followed by a bit of guesswork about what to adjust. It can take several flights to get it right.

Wouldn’t it be nice if we could optimise the whole curve using the regular elevator trim, whilst flying the model? Well, thanks to OpenTx and Lua, there’s a fully viable solution.

A better mousetrap

With the crow-aware adaptive trim, the elevator trim lever is radically repurposed. Instead of applying a fixed trim offset, it bends the compensation curve. The curve points are selected automatically according to the amount of crow, with the result that the pilot doesn't need to look at the screen.

All this means that the compensation curve on an F3F model can optimised during its initial test flight.

How it works

The heart of the system is a Lua script. The script runs in the background, waiting for a trim action. When a trim click is detected, the script reads the crow value, identifies the nearest points on the compensation curve, and adjusts those points up or down. It also handles repeats and beeps.

The changes to the curve are reflected in real time in the Curves menu. In addition a custom telemetry screen shows the compensation curve, crow value, and active curve points:

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

OpenTx Widget (X10, X12S)

Programming discussion alert! For this to work the trim lever must be completely decoupled from the elevator stick so it acts as a dumb on/off/on momentary switch - this can be done within OpenTx (no soldering required!).

Flight testing

For the flight tests I used my Stribog with my X9D+ and a modified version of my F3F template v. 5. The model normally uses around 5mm of compensation, however I initialised the trim curve to provide zero compensation throughout the crow range.

During the flight I applied varying amounts of crow, using the elevator trim to trim out any pitch deviations. The trimming process was completed successfully, and I was able to land the model normally despite the 40 mph wind.

During the trimming process, I never felt the need to look at the screen.

Below is a video showing (a) the script running on my X9D+ and (b) the result of the flight test. Note that an early version of the script was used, with 4 points instead of 5.

Download the script

The Lua script and a demo setup can be downloaded here. At the time of writing, the script supports the X9D, X9D+, X9E, X10 and X12S.

Instructions for integrating the script into your own setups are in the script comments. A key requirement is a spare GVAR. If you're using one of my F3X templates, a little creativity may be required to release a GVAR (tip: the GVAR for reverse diff can be freed up with minimal changes).

Note 1 (July 2019): A new version will be released soon which offers the option of using two logical switches to store the trim state, instead of using up a valuable GVAR. It will be backwards compatible with the previous version.

Note 2: As you may have gathered, a good working knowledge of OpenTx is required in order to modify your setups. If you're using my F3X templates, then do have a look at the Excel reference before diving in.


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

No comments: