Mike Shellim 10 Feb 2015
Last updated 27 Mar 2020
This article has been updated for OpenTx version 2. The original version for OpenTx Classic is here.
Trimming out a new model can be a long process, involving lots of small adjustments to diff, mixing, and so on. The traditional procedure is to fly, land, and adjust, and it can take dozens of cycles to achieve that perfect setup.
But hey, this is OpenTx... so why not make adjustments whilst actually flying the model!? Not only is it better for the model (since fewer landings are required), it means you can compare settings instantly. In short, your model will fly better, sooner...
In this article I'll describe how you can do this, using custom in-flight adjusters. These are knobs, sliders or trims which are programmed to act like volume controls. They can adjust a mix, diff, expo... or anything you like. As an example, the graphic below shows the in-flight adjusters on my F3F setup:
In-flight adjusters on author's F3F setup
Various strategies exist for implementing in-flight adjusters, however all of them are based on the concept of a volume control.
A volume control consists of two parts: a physical knob or slider which you move with your finger; and a mixer line which converts the position of the knob to a percentage value. By applying the percentage value to another mixer, we have our in-flight adjuster. It really is that simple - in principle at least.
In practice a little 'scaffolding' code is usually required to interface the adjuster with the parameter we want to adjust. But we'll come to that later. First, let's make the basic building block: a simple volume control.
Our first volume control will be based on rotary knob, S1 and provide a range from 0 - 100%.
Create a mixer line with src=S1, wt=50 and offset=50:
Using your transmitter or Companion, check that the output of CH10 varies from 0 to 100 as S1 is rotated clockwise. How does it work? Recall that the output of a mixer line is calculated by OpenTx v. 2 according to this formula:
output = (src * wt) + offset
Let's see what happens with wt=50% and offset=50.
In other words, the output of the mixer line varies between of 0 - 100% as S1 is rotated.
We'll use this volume control in a 'snapflap adjuster' later on, but first let's see how to alter the range of adjustment.
The simple volume control in ¶1.1 provides an adjustment range of 0 - 100%. While this is fine for many applications, there are times where a different range may be required. For example, for adjusting aileron diff, the range should be something like 10 - 70%.
In such cases, we need to do some calculation to determine wt and offset for the volume control. Here's now:
For example, to create a volume control with range 10 to 70:
So here's amended code for the volume control (CH10).
Later on, we'll use this volume control in a diff adjuster.
To reverse the sense of the volume control (e.g. from clockwise to anticlockwise), simply negate the wt parameter
Let's now make some mix adjusters. Each adjuster will consist of a volume control + scaffolding code.
Snapflap is just another name for elevator-to-flap mixing. Here's a simple snapflap adjuster, using S1. Flap is CH4.
Start by creating a snapflap mix. We'll give it a nominal strength of 25%.
Next, we create the volume control in CH10, source=S1, range 0% - 100%. We can use the example from ¶1.1:
The next task is to multiply the snapflap mix by the value of the volume. We do this by appending the volume control as a mix line using the MULT directive. The MULT line must be second in the list:
CH4 (flap 1)
Src=Elevator wt=25 trim=No
Src=CH10 Multiplex= MULT
The MULT directive in the second line says "multiply the snapflap mix above with the value of the volume control passed in CH10". Since there are no more mixers listed, the result is assigned to the flap servo (CH4). Snapflap now varies between zero and 25%, depending on S1.
[Aside: the flap channel will typically have other inputs, e.g. aileron, camber and so on, but we won't consider these here, except to mention that the position of the MULT line is important - more on this later.]
Let's move on to something slightly more complex but perhaps more common - an adjuster for aileron differential. We will use S1 to vary aileron diff between 10 and 70%.
The volume control comes from ¶1.2:
The next task is to build the scaffolding code, to link the diff value to Ch10.
OpenTx does not allow diff to be linked directly to CH10. However, diff can be updated via a global variable (GVAR). So we do it in two stages. First we use the volume control to update GV1, then we use GV1 to update diff.
The first stage is to go to the Special Functions menu and add an 'Adjust GV' line. Set it so that GV1 is the target to be updated, with CH10 is the source.
GV1 is now bound to CH10.
Finally, we assign GV1 to Diff:
An essential feature with F3X setups is aileron differential suppression. This enhances roll control under crow braking by suppressing aileron diff as crow is deployed.
We can implement diff suppression using the previous example, but adding a second volume control based on the crow stick (Thr). Plugging in the figures above into the equation in ¶1.2, our crow-based volume control looks like this:
The full code for the combined volume control (S1 + Crow) looks like this:
Note the MULT directive in the last line, effectively combining the two volume controls.
The scaffolding code to set the diff is the same as ¶2.2.
Spare Trims (TrmT, TrmR, TrmA and TrmE) can be used as adjusters, just like sticks and knobs.
Remember to de-couple the trim its parent control first, by specifying include trim = no in any relevant mixes.
Trims have a useful property: the values they report are flight mode dependent. If you switch flight modes and adjust the trim, and then switch back to the first flight mode, the original trim value will be restored.
This allows you to repurpose a trim lever depending on the flight mode. For example on my F3F setup, the throttle trim adjusts either (a) spoiler compensation or (b) snapflap volume, depending on the flight mode.
For the adventurous, trims can be also be overloaded, that is perform different functions within the same flight mode; the function selected by a switch. For more info see Repurposing trims.
The MULT directive applies to the result of all the lines above. It's easy to forget this and introduce a bug. For example, take our snapflap example:
CH4 (flap servo)
Src=Elevator wt=25 trim=No -- snapflap mix
Src=CH10 Multiplex= MULT -- volume control
Suppose that we wanted to add direct control of flap via the left slider (LS). To do this, we add a mixer line, with Src=LS. Let's see what happens if we place the new mixer line at the top of the list:
CH4 (flap servo)
Src=LS
Src=Elevator wt=25 trim=No -- snapflap mix
Src=CH10 Multiplex= MULT -- volume control
Immediately we have a problem: since MULT directive acts on the result of the lines above, the volume adjustment will also affect the sum of the snapflap line and LS mixer lines.
The correct location for the new mixer line is after the volume control.
CH4 (flap servo)
Src=Elevator wt=25 trim=No -- snapflap mix
Src=CH10 Multiplex= MULT -- volume control
Src=LS
As we saw with the volume control for Diff, determining the correct wt and offset may involve some calculation. An alternative and more explicit approach is to use a curve.
Here's the original code using offset and wt (from ¶1.2):
Here's a version using Curve 1 to define the 10 - 70% range:
The two points define the minimum and maximum adjustment values.
The benefit of the curves approach is that it's more explicit than using wt and offset. On the other hand, the definition is split two screens, making it arguably more difficult to maintain. Whichever method you use will come down to personal preference.
Applications for in-flight adjusters include:
Whatever type of model you fly, there is bound to be a use for in flight adjusters, so get experimenting!
Happy flying :-)