How to make in-flight adjusters

Mike Shellim 10 Feb 2015
Last updated 21 Mar 2017

This article has been updated for OpenTx version 2. The original version for OpenTx Classic is here.

Trimming out a new model is 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 be used to adjust the strength of 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 my Taranis

In-flight adjusters on author's F3F setup

1. The heart of the adjuster - the 'volume control'

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

1.1 Creating 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:

CH10
Src
=S1, Wt=50, 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.

1.2. Refining 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 appropriate. For example, for adjusting differential in a sailplane, it would be better to use a volume control with a range of say 10 - 70% as this would avoid selecting values which might cause control issues.

In such cases, we need to do some calculation to determine wt and offset for the volume control. Here's now:

  1. Choose appropriate min and max for the volume control's range.
  2. Apply the formula wt = (max-min)/2
  3. Apply the formula offset = (min + max)/2

For example, to create a volume control with range 10 to 70:

So here's amended code for the volume control (CH10).

CH10 (vol control 10% - 70%)
Src=S1 wt=30 offset=40

Later on, we'll use this volume control in a diff adjuster.

1.3. Reversing the direction of the volume control

To reverse the sense of the volume control (e.g. from clockwise to anticlockwise), simply negate the wt parameter

CH10 (vol control reversed 70% - 10%)
Src=S1 wt= -30 offset=40

2. Putting it all together - creating mixer adjusters

Now we know how to make a volume control, we can use it as a basis for some useful mix adjusters to help with trimming the model.

Each adjuster will consist of a volume control + scaffolding code.

2.1. A snapflap volume adjuster

Let's start off with a simple snapflap adjuster. (Snapflap is an alternative term for elevator-to-flap mixing). It's useful to be able to adjust snapflap in flight when trimming the model.

We'll create a snapflap mix with volume controlled by S1. Start by assigning a flap to CH4, and create a snapflap mix of 25%.

CH4 (flap 1)
Src=Elevator wt=25 trim=No

Next, we create a simple volume control in CH10. We can use the example from ¶1.1:

CH10 (volume control 0-100%)
Src=S1 Wt=50 Offset=50

The next task is to multiply the snapflap mix by the value of the volume control (0% - 100%). 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.]

2.2. An adjuster for aileron differential

Let's move on to something slightly more complex but equally useful - an adjuster for aileron differential. We will use S1 to vary aileron diff between 10 and 70%.

The volume control comes from ¶1.2:

CH10 (vol control 10% - 70%)
Src=S1 wt=30 offset=40

The next task is to build the scaffolding code, so Ch10 can act as a volume control for aileron Diff.

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.

CF1 (custom function, stores diff in GV1)
Switch=ON Function=Adjust GV1 Source=CH10 Enable=ON(checked)

GV1 is now bound to CH10.

Finally, we assign GV1 to Diff:

CH1 (aileron1)
Src=Aileron Diff=GV1

... repeat for aileron 2...
And that's it!

2.3. Adding aileron differential suppression

A standard feature with F3X setups is aileron differential suppression. This is a measure to enhance roll control under crow braking.

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:

Src= Thr wt=50 offset=50 trim=no -- outputs 0 - 100% depending on crow

The full code for the combined volume control (S1 + Crow) looks like this:

CH10 (vol control 0 - 70%)
Src=S1 wt=30 offset=40 --- max diff adjustable via S1 10 - 70%
Src=Thr wt=50 offset=50 Trim=no Multiplex=MULT -- ail diff suppression

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.

2.5. Using trims as adjusters

Spare Trims (TrmT, TrmR, TrmA and TrmE) can be used as adjusters, just like sticks and knobs.

CH10 (vol control 10-70%)
Src=TrmR wt=30 offset=40

Remember to de-couple the trim its parent control first, by specifying include trim = no in any relevant mixes.

2.5.1 Trims are flight mode aware

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.

2.5.2 Overloading trims

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.

3. Using MULT: order is important!

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

In general the volume control will be the second item in the mixer list, and the mix that it's adjusting will be at the top.

5. Using curves in volume controls.

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):

CH10 (vol control 10 - 70%)
Src=S1 wt=30 offset=40

Here's a version using Curve 1 to define the 10 - 70% range:

Curve 1
2 points: 10, 70


CH10
(vol control 10 - 70%)
Src=S1 Curve/Differential = "Curve 1"

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.

6. Other applications

Applications for in-flight adjusters include:

Finally

Whatever type of model you fly, there is bound to be a use for in flight adjusters, so get experimenting!

Happy flying :-)