OpenTx - Key Concepts

Mike Shellim
Last updated 25 Nov 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.

Like 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

In the graphic above, 'sources' are the transmitters sticks, knobs and switches. The boxes represent three stages of processing:

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:

Note 1: Source names may differ slightly between transmitters, for example knobs are 'S1' and 'S2' on the X9D, but 'F1' and 'F2' on the X9E.

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:

Mixers are managed in the MIXER menu. A setup will contain anything from a couple (for a simple RE sailplane) to dozens of mixer (for an F3X ship).

A simple mix

The screenshot below shows the simplest possible setup. Just a single mix, with aileron stick as source, and Channel 1 as output. You can read the line as "Channel 1 is affected by the aileron stick, with 100% effect":

Try it and see! As you move the aileron stick, the servo on CH1 will respond.

Channels

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

Channels are managed OUTPUTS menu. Here's an example for a 3-channel setup:

Outputs

Each channel is given a name of your choice. 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 them again later.

Mixer building blocks

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

The screenshot shows the mixers for dual aileron servos. The source for both mixers is the aileron stick. 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 how to design a real life setup, using a simple 4-step procedure. The same method can be applied to any model, regardless of complexity.

Example: a flying wing

We'll 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.

There's just one problem: 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. A much better way is to use an aileron input.

INPUTS

Inputs are based on the built-in sources like sticks and sliders (Ail, Ele, LS etc.). Like the built-in sources, they can be used as the source of a mix. However inputs include rates and expo. So they're very useful for aileron, elevator and rudder controls. Inputs are not built in - they must be created first, using the INPUTS menu.

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, we'll use inputs for the aileron and elevator controls. We'll assign a weight of 90% to the aileron stick, and 30% for the elevator. The INPUTS menu will look like this:

inputs

Next, we must go back and edit the mixers, so the source refers to these inputs:

mixers

Note the 'I' which precedes the 3-character input names, to distinguish them from regular sources.

Note also that we have set the mixer rates to 100%. It's generally good practise to set the mixer rates to 100% when the source of the mix is an input.

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

Once you've designed your setup, you'll want to check that it works as intended. You can do this on the transmitter, or in the in Companion simulator, using the Mixers monitor.

On the X9D, To activate the mixers monitor, go to the splash screen press and press {Page} until you get to the channels monitor, then press Enter.

The values are percentages of available travel on each channel. The available travel is set later in the OUTPUTS.

OUTPUTS

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 of mixer values, and mapping to PWM values. 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.

Mapping

After clipping, OpenTX maps the mixer values in the range -100% to +100% to PWM values in the range 'Min' to 'Max'. Rather confusingly, Min and Max are shown as percentages of a standard servo travel.

The relationship between % values and PWM values is:

Values outside the range -100% to +100% are only available if extended limits are enabled in the model setup menu.

To calibrate your servo limits, generate mixer values of -100 and +100, then adjust Min and Max as required. Similarly to calibrate the servo centre, generate a mixer value of zero, then adjust Subtrim.

Channels monitor

You can monitor the final output values 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.

More about mixers

Mixers are the key to mastering OpenTx, and you can read more about them here.

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