How to make in-flight adjusters

Mike Shellim 6 Feb 2013

This article applies to OpenTx "Classic". Although the principles remain the same, the numbers will be different for OpenTx v. 2

Trimming out a new model often involves making lots of small adjustments to the settings. The traditional procedure is to land, adjust, launch and re-test. Not surprisingly, this method can take a lot of time.

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 - without altering the programming. In short, your model will fly better, sooner!

In this article I'll describe how to create custom in-flight adjusters in OpenTx.

 

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. The principle is very simple!

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

CH10
Src
=S1, Wt=50, Offset=100

Using Companion9X or your tx, check that the output of CH10 varies from 0 to 100 as S1 is rotated clockwise. From now on, you can reference CH10 wherever you wish to use S1 as a volume control.

How does it work? Recall that the output of a mixer line is calculated by OpenTx v. 1 according to this formula:

output = (src + offset) * wt

Let's see what happens with wt=50% and offset=100.

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)/200
  3. Apply the formula offset = 100 + min/wt

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=133

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

1.3. Reversing the direction of the volume control

To reverse the direction of the volume control (e.g. from clockwise to anticlockwise), simply negate the wt and offset parameters. e.g.

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

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

We'll start off with a snapflap adjuster (snapflap is where the flaps go move as you apply elevator, and is commonly used in gliders). The pilot will use S1 to adjust the snapflap volume in flight.

Start off by defining a simple volume control in CH10 - we'll use the example from ¶1.1:

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

The next step is to define a snapflap mix. Let's say that the flap deflection at any moment will be 25% of elevator stick displacement:

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

Now we add the volume control (CH10). Note the MULT directive, and also the order:

CH4 (flap 1)

Src=Elevator wt=25 trim=No

Src=CH10 Multiplex= MULT

The MULT directive says "multiply the % volume with the result from the preceding lines". In other words, multiply the snapflap by the volume control value passed in CH10. The result is assigned to the flap servo (CH4). If you have a second flap servo, you can duplicate the code in CH4.

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 diff between 10 and 70%.

The volume control comes from ¶1.2:

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

Now let's build the scaffolding code. Its job will be to link the volume control (Ch10) to the Diff parameter.

OpenTx does not allow diff to be linked directly to a channel output. However, diff can be updated via a global variable. So we do it in two stages.

The first stage is to create a custom function, so GV1 is updated from Ch10:

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

Finally, we assign GV1 to Diff:

CH1 (aileron1)
Src=Aileron Diff=GV1

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

2.3. Aileron differential suppression

A common feature on glider programs is 'aileron differential suppression', where diff is automatically reduced as spoiler is deployed. This is similar to the previous example, except that instead of using S1 as the volume control, we use the spoiler control itself.

The Diff must be zero when spoiler is fully deployed, to some maximum value when spoiler is off. Let's say max diff is 50%. Then our volume control must provide a range of 0 - 50%. Plugging in the figures using the procedure described in ¶1.2, we obtain wt=25 offset=100.

Our modified volume control looks like this:

CH10 (outputs amount of diff 0-50% depending on spoiler state)
Src= Throttle wt=25 offset=100trim=no

The scaffolding code to set the diff is the same as in ¶2.2.

2.4. Combining diff volume & aileron diff suppression

Using the two previous examples, we can control the amount of diff via S1, while at the same time using diff suppression. The modified volume control is as follows:

CH10 (vol control 0 - 70%)
Src=S1 wt=30 offset=133 --- max diff adjustable via S1 10 - 70%
Src=Throttle wt=50 offset=100 Trim=no Multiplex=Mult -- ail diff supp 0-100%

Note that in this case, the throttle line outputs a range 0 - 100% and contains a MULT directive.

The scaffolding code to set the diff is the same as ¶2.2.

2.5. Using a trim lever

Spare trim levers (TrmT, TrmR) have a very useful property: the values they report are flight mode dependent. Using a trim as the source of an adjuster, you can store different values for each flight mode with no extra code.

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

3. Using MULT: order is important!

Remember that 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 both the snapflap line and our new LS line.

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 fact, the volume control will normally be the second item in the mixer list, just under the mixer it's adjusting.

4. Other tricks with trims

By using a trim lever as your volume control, you can adjust different parameters depending on the flight mode. For example, the trim lever could adjust snapflap in one flight mode, camber in another, and spoiler compensation in another.

Overloading the trim levers in this way allows you to make best use of the limited trimming controls available, however it should be used sensibly. If a feature isn't intuitive, it's best to leave it out.

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=133

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

Curve 1
3 points: 10, 40, 70


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

The first and last points on the curve define the minimum and maximum adjustment values. The middle point should lie on the line between the end points. Finally, the curve is referenced in the volume control mix.

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