OpenTx - Key Concepts

Mike Shellim
Last updated 12 April 2021

Para nuestros amigos hispano-hablantes: traducción al español en formato PDF. Muchas gracias a Jorge Brun.

Introduction

OpenTX is a wonderfully flexible operating system. However if you've come from a brand like Futaba or Spektrum, it can seem strange and difficult. My aim with this article is to explain how OpenTX works, and how to design your own setups.

I'll cover the following topics:

Examples will be illustrated with screenshots and text.

OpenTx: the processing loop

Okay, so let's start at the beginning.

As with all RC systems, OpenTX executes a processing loop several times a second. With each pass, the control positions are read, mixing is applied, and channel values are calculated. All this is done fast enough to provide the illusion of a smooth response.

The graphic below illustrates the processes and data flows:

flow

The sources are the transmitters sticks, knobs, switches etc.

The blue boxes represent three stages of processing. Each has its own menu:

The starting point: Sources

Like all computer programs, OpenTx needs data to work with. There are your sticks, switches, inputs, trims and trainer inputs. The general term for these is sources.

Each source has a unique identifier, for example:

Each source carries a value between -100 and 100 according to its position. Zero represents the centre. Examples:

You can monitor the values of analog sources (that is, sources using potentiometers) in the SYS->HARDWARE menu - this is useful for checking that they're calibrated correctly.

Special sources

There are a couple of special sources which we'll be using:

Note 1: The naming scheme is reasonably consistent between transmitters, but there are occasional differences. For example, knobs are 'S1' and 'S2' on the X9D, whereas on the X9E they are 'F1' and 'F2'.

Note 2: channels, Lua scripts and telemetry values can also be used as sources, however they are outside the scope of this article.

Mixers

Mixers are the brains of your setup - they determine how the channels respond to the controls. Unlike most other radios, a mixer in OpenTX is extremely simple:

A setup will involve anything from a couple of mixers (for a simple sailplanes), to dozens of mixers (for a full house F3X ship).

Your first mix!

Below is a screenshot of the MIXER menu. It shows a single mix attached to CH1. The source is the aileron stick, and the weight is 100%. You can read the line as "Channel 1 is affected by the aileron stick, with 100% effect":

Try it and see! A long press from the MIXER menu takes you to the mixer editor. From there, you can edit various mix parameters - set the source and weight and leave the rest at their default values.

Channels

We've seen that mixers belong to channels, so let's say a few words about these. In OpenTX, a channel has a wider meaning than with other systems. Key points:

You can give each channel a name (OUTPUTS menu):

Outputs

The columns to the right of the name refer to centre and end point adjustments. That's all we'll say about the OUTPUTS menu for now - we'll be revisiting again near the end.

Three Key Mixes

In this section we'll examine three basic mixing scenarios. These will form the building blocks of all your setups.

Scenario 1: One source -> one channel

The simplest scenario. We've already seen this, where the aileron stick drives channel 1:

Scenario 2: One source -> multiple channels

In the second scenario, a single source drives more than one channel. The screenshot shows the mixers for dual aileron servos. The negative sign on the second channel indicates reverse effect.

TIP: Using two separate channels is better than a Y-lead, since each channel can be individually adjusted for direction, travel and centring.

Scenario 3: Multiple sources -> one channel

The third scenario is where a control surface is driven by more than one control stick. Examples include V-tails (rudder and elevator sticks), flaps (driven by a camber slider, and crow and aileron sticks). The screenshot below shows a V-tail surface on channel 5 driven by the rudder and elevator sticks.

The '+' sign against the Ele line indicates that the rudder and elevator inputs are added to produce the output. In other words, each line makes an independent contribution.

When using the '+' operator, the mixer order doesn't matter. Other operators like multiply and replace can also be used, and the order for these is important (we'll look at those later).

Designing a mixer scheme for your model

Let's see now design a real setup! It's a two-step procedure:

  1. identify all the interactions between sticks and servos
  2. convert them into mixer definitions

The method that I will describe can be applied to any model, regardless of complexity. I will use the example of a flying wing. This has two channels for elevons. The elevator stick drives them in the same direction, the aileron stick in opposite directions.

Step 1. Assign channels

The first step is to name the channels. We do this directly in the OUTPUTS menu.

Outputs

Step 2. Identify stick/servo interactions

Next, we identify the interactions between sticks and channels. For each stick, we list the channels which will be affected by that stick. On our flying wing, the aileron stick drives both channels:

Similarly, for the elevator stick:

At this stage, we're not interested in directions and rates.

Step 3: Convert interactions into mixer lines

Next, re-write the interactions in reverse:

So now, each line reads as "[channel] is affected by [source]". This corresponds to the way mixers are entered.

Step 4: Enter mixer definitions

Finally, in the MIXER menu, create a mix for each interaction. (If you want to try this, just set the source parameter, leave the other fields at their defaults.)

mixers

The '+=' means on each line shows that the mixes are additive.

So that's the basics of our flying wing setup.

It's not quite right though, as we haven't taken into account the differences between pitch the elevator and aileron responses. We could do this by adjusting the mixer weights, but it would mean two adjustments for the aileron stick, and two for the elevator stick. Another drawback is that the weights will also affect the trim lever.

A much better way is to inputs!

INPUTS

Inputs provides a single adjustment point for rates and expo. Always use inputs for your main flight controls!

Inputs are not built in - they must be created. The INPUTS menu is where you create and edit inputs. Each input must have a name (max 3 characters), a source (stick, slider etc.), a weight, and optionally an expo value.

Did I say you have to create your own inputs? Well conveniently, when you create a new model, OpenTX creates four inputs [I]Ail, [I]Thr, [I]Rud and [I]Ele.

Inputs example

Using our flying wing example, lets use a couple of inputs for the aileron and elevator sticks.

We'll assign a weight of 90% to the aileron stick, and 30% for the elevator. The INPUTS menu should look something like this:

inputs

Now, to alter the aileron or elevator rate is just a single adjustment!

Next, we change the mixer sources to refer to our new inputs. We can - and should - reset the mixer rates to 100% (since the rates are now derived from the inputs). This is how the MIXER menu looks before and after the changes:

MIXER menu without inputs:

MIXER menu using inputs:
mixers

Choosing between inputs and sticks.

You don't alway have to use inputs. Sometimes it's more appropriate to use the regular sticks.

More about inputs

Inputs are an important part of OpenTx, and you can read more about them here.

How stick commands are processed

In this section, you'll learn how your commands are processed. A good understanding is useful for troubleshooting your setups.

The first thing to remember is that weights are applied cumulatively. Let's take the flying wing example. We'll consider just the inputs and mixers:

inputs

mixers

Taking the inputs first:

[I]Ail = Ail_Stick x 90%
[I]Ele = Ele_Stick x 30%

Next, the inputs are aggregated in the Mixers:

CH1 = [I]Ail + [I]Ele = (Ail_Stick x 90%) + (Ele_Stick x 30%)
CH2 = -[I]AIl + [I]Ele = (Ail_Stick x -90%) + (Ele_Stick x 30%)

So let's see what happens as we move the sticks:

S T I C K S M I X E R  O U T P U T S
Ail stick Ele stick CH1 CH2
(centre) 0  (centre) 0 0 0
(full  right) 100% (centre) 0 90+0=90 -90+0=-90
(full left) -100%  (centre) 0  -90+0=-90 90+0=90
(centre) 0 (full forward) 100% 0+30=30 0+30=30
(half right) 50% (half forward) 50%  45+15=60 -45+15=-30
(full  right) 100% (full forward) 100% 90+30=120 -90+30=-60

 

The last line shows the effect of "stick in the corner": the mixer output for Channel 1 is 120. In fact, mixer outputs are clipped to +/- 100 in the OUTPUT stage. More on that later.

The mixers monitor

Mixer values can be viewed in the mixers monitor (introduced in OpenTX 2.2). To activate it on the X9D, go to the splash screen press and press {Page} until you get to the channels monitor, then press Enter.

These values represent percentages of available travel. The available travel is set later in the OUTPUTS.

More about mixers

We've already looked at mixer weight. We'll now investigate offset, expo, diff, functions and curves.

Mixer offsets

The Offset parameter is used to shift the mixer output up or down. Offset is applied after weight:

Mixer line value = (Source * weight) + Offset

Offsets are useful when the mix's starts from one end of stick travel instead of the centre.

Example: motor compensation. With motor compensation, the throttle stick is mixed to the elevator channel. The output must be zero when the throttle is fully back (idle), rising to some maximum value when it's fully forward (max power). We achieve this by setting offset = weight. The output will then vary between 0 and (2* weight).

Example:

MIXERS menu

CH2 (elevator)

Src=Thr, wt=20%, offset=20 -- motor compensation mix

The motor compensation will be 40% at full throttle.

Note: offsets should be used sparingly! Do not use them to make ad-hoc adjustments to servo centres - use OUTPUTS->Subtrim for that.

Mixer curves (diff, expo, functions and curves)

In addition to weight and offset, OpenTx offers one additional parameter from the following list of choices:

The first three options can in fact all be represented as curves - think of them as short cuts to particular curve types.

Including/excluding trims

By default, trim values are included in sources. You can exclude trims on a per-mixer basis by unchecking "Include Trim" in the mixer dialog.

Order of processing

When processing a mixer, OpenTx first applies the trim value (if applicable). Then it applies the function (function, curve, expo), followed by weight, and finally adds the offset. The single exception to this rule is diff which is applied after weight and offset.
Order may be important when combining operations especially where offsets are involved!

How to set aileron differential

The 'diff' parameter is available in both the INPUT and MIXER menus. So which should you use to implement aileron diff? First, the incorrect way, using INPUTS menu:

INPUTS menu

[I1]Ail

Src=Ail, wt=90%, expo=10, diff=20

 

MIXERS menu

CH1 (right elevon)

Src = [I1], wt=100%

 

CH2 (left elevon)

Src = [I1], wt=-100%

The problem is that diff is applied to the aileron stick, while we want it to be applied to each aileron servo. The correct way is therefore to apply it to the servo mix:

INPUTS menu

[I1]Ail

Src=Ail, wt=90%, expo=10, diff=0

 

MIXERS menu

CH1 (right elevon)

Src = [I1], wt=100%, diff=20%

 

CH2 (left elevon)

Src = [I1], wt=-100%, diff=20%

To summarise: Do not specify diff at the Input level. Specify diff separately for each aileron mix!

TIP: Use a GVAR to supply the diff value. That way, you can set diff for both channels with a single adjustment.

Default mixer settings

When you create a new mix, the initial settings are weight=100% and offset=0, diff/expo=0 and no curve. The source value is therefore passed through unchanged.

Mixer best practice

Your mixing scheme is the heart of your setup and it's important to understand best practice. First of all,

 

OUTPUTS stage

The OUTPUTS stage is the final stage of processing prior to transmission.

The OUTPUTS menu is where you adjust the direction, end points and centres of each servo. More formally, it's where you map mixer outputs of -100, 0 and +100 to actual PPM values and - ultimately - control surface deflections.

By careful adjustment you can compensate for linkage differences between the left and right sides of the model.

outputs

Outputs processing

The Outputs layer performs two main tasks: clipping and scaling. Let's look at these is more detail:

Clipping

Recall how mixer outputs are aggregated from individual mixer lines:

CHx_MixOutput = SUM (CHx_MixLine1, CHx_MixLine2, ...)

If several mixers are active, and aggressive stick movements are applied, then clearly the command could exceed the mechanical limits of the servo. To prevent this, OpenTX clips mixer values which exceed bounds of -100 and +100.

Outputs scaling

After clipping, a scaling and offset are applied via the MIN/MAX/SUBTRIM parameters. MIN affects one end point, MAX the other, and SUBTRIM adjusts the centre. In effect they define a 3-point curve mapping your mixer values of -100, 100 and 0 to actual PPM values.

Notes:

Channels monitor

You can monitor channel outputs in real time, using the Channels monitor.

Designing a setup: best practice

Don't be concerned about the linkages or left/right imbalances when designing your mixers - these will be dealt with when you calibrate the Outputs.

Advanced topics

Mixer operators

We've seen how mixer line values are aggregated to produce mixer outputs. So far, we've only used addition. In fact OpenTx also offers multiplication and replacement operations.

This is very useful. For example, multiplication is key to implementing in-flight adjusters, and 'replace' can be used to implement throttle safety switches.

The operator is specified in the mixers Multiplex parameter, and the options are 'ADD' (the default), 'REPL' and 'MULT'.

When aggregating mixer lines, OpenTx initially assigns a value of zero. Starting at the top line, it steps through each mix, and applying the result according to the multiplex parameter:

Note:

The following examples illustrate the effect of the various multiplex options. Note the importance of mixer order when using 'REPL' and 'MULT'.

Src = I1, op=ADD

Src = I2, op=ADD

result = I1 + I2

Src = I1, op=ADD

Src = I2, op=ADD

Src = I3, op=MULT

result = (I1 + I2) * I3

Src = I1, op=ADD

Src = I2, op=MULT

Src = I3, op=ADD

result = (I1 * I2) + I3

Src = I1, op=ADD

Src = I2, op=MULT (disabled)

Src = I3, op=ADD

result = I1 + I3

Src = I1, op=ADD

Src = I2, op=REPL

Src = I3, op=ADD

result = I2 + I3

Src = I1, op=ADD

Src = I2, op=REPL

Src = I3, op=MULT

result = I2 * I3

Src = I1, op=ADD (disabled)

result = 0

The 'MAX' source

MAX is a special source which doesn't correspond to a physical control. Instead, MAX supplies a fixed value of +100. In conjunction with weight, it can be used to simulate the effect of a fixed stick position.

Src = MAX, wt =100 -- output = 100%

Src = MAX, wt=50 -- output = 50%

Src = MAX, wt=-100 -- output = -100%

Here's a simple example, showing a crude motor arming system. The motor is armed when SA is down.

MIXERS menu

CH7 (motor)

Src = Thr, wt=100%,

Src = MAX, wt=-100%, switch=!SA_down, multiplex = REPL

F3X sailplane mixer scheme

If you're familiar with F3X sailplanes, you may wish to look at interactions and mixes for F3X sailplanes. Such a scheme will normally be optimised by means of Inputs (described later in this article), GVARs and cascading mixers.

Links

LapinFou has produced some useful data flow diagrams which describe the internal workings of OpenTx (Note: at the time of writing, there are one or two errors in the order of processing of curves).