OpenTx - Key Concepts

Mike Shellim 25 July 2014
Last updated 12 February 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 generic term is sources. Each source has a unique identifier, for example:

Each source carries a value between -100 and 100 according to its position:

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

Inputs
These are based on the sources described above, but have rate and expo associated. We'll look at these in detail later.
MAX
'MAX' carries a constant value of +100. It's not based on any real stick or switch.
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 describe how the sticks, sliders etc. should affect each channel. In other words, they define the control logic.

Unlike the complex mixers in other systems, a mixer in OpenTX is a very simple construct:

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 channel 1 with a single mix. The source is the aileron stick, and the weight is 100%. Read the line as "Channel 1 is affected by the aileron stick, with 100% effect":

For simple mixes like these, just three columns are shown:

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.

Best practice: when designing a mixing scheme, keep in mind that they're solely about control logic. Don't be concerned about the linkages or left/right imbalances - these will be dealt with later in the Outputs.

An introduction to 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:

It's a good idea to assign a name to each channel. This is done in the OUTPUTS menu. In the screenshot below, channels 1 to 3 have been reserved for rudder, elevator and spoiler.

Outputs

The remaining columns refer to centre and end point adjustment. That's all we'll say about the Outputs menu for now - we'll be revisiting again near the end.

Basic mixing schemes

Back to the subject of mixers... 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 simultaneously. This is used for dual aileron servos. In the screenshot below, the aileron stick is driving channels 1 and 5. The negative sign indicates that each channel should move in opposite directions.

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 to the movement of the control surface.

When using the '+' operator, the order of the mixes 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 now design an actual setup. The basic idea is to (a) identify all the interactions between sticks and servos then (b) convert them into mixer definitions.

The method I describe can be applied to any model, regardless of complexity.

We'll use the example of a flying wing with two channels driving left and right 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 assign the lowest numbered channels for the servos. 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, simply 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, only that the interaction exists.

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

Step 4: Enter mixer definitions

Finally, in the MIXER menu, create a mix for each line in step 3. (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! We're not quite finished though, as we haven't taken into account the differences between pitch the elevator and aileron responses.

Setting mixer weights

The mixer weight determines the strength of the mix.

For our flying wing:

The 90% and 30% values are for illustration only - actual values will depend on the model.

INPUTS

Our flying wing example will work, however, there are a couple of problems.

Fortunately OpenTX offers a solution to both issues, in the form of Inputs.

Overview of inputs

Inputs are based on sticks, but with weight and expo parameters built-in. Once an input has been created, it can be used as a mixer source just like a stick source. The great thing is: if you want to alter the stick rate, you do it the (single) input, rather than in all the mixers where it's used.

To help avoid confusion, OpenTX displays sticks and inputs using different icons:

Also, in the MIXER menu, OpenTX diplays inputs with '[I]' prefix.

Creating an input.

Unlike regular sources which are built-in, inputs must be created. You do this in the INPUTS menu. Each input will have a name (max 3 characters), a source (stick, slider etc.), a weight, and 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.

Of course, you can clear any inputs you don't use, alter their weights and expo, and create your own.

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 10% 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 must change the mixer sources to use these inputs. Since the weights are now stored in the input, we can - and should - reset the mixer rates to 100%.

This is how the MIXER menu looks before and after the changes:

BEFORE:


AFTER:

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 mixers process commands

In this section, you'll learn how your mixers process your stick commands. A good understanding is key to troubleshooting your setups.

Let's take a simple example from earlier:

OpenTX calculates the results of each mixer line, then it aggregates the results:

CH1 = (Ail_Stick x 90%) + (Ele_Stick x 30%)
CH2 = (Ail_Stick x -90%) + (Ele_Stick x 30%)

Let's plug in some figures:

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 mixer values for all 32 channels 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.

Even 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

example: motor to elevator compensation. Mixer offsets are used for crow and motor compensation mixes. In these mixes, the mixer output must be zero at one end of stick travel (instead of at stick centre). You can achieve this by setting offset = weight. The output will then vary between 0 and (2* weight)

Here's an example showing a typical motor compensation mix. As the throttle stick is pushed forward from the idle position, a corrective value between 0% and 40% is added to the elevator channel.

MIXERS menu

CH2 (elevator)
Src=Ele, wt=100%

Src=Thr, wt=20%, offset=20

Note: offsets should be used sparingly! Don't 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.

Setting aileron differential in a mixer

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.

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.

For our flying wing example, aileron and elevator trims must always be active, so we'll use the default settings.

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.

Order of processing in a mixer

When calculating a mix line value, OpenTx first applies the trim value. Then it applies the function (diff, function, curve, expo), followed by weight, and finally adds the offset. Order may be important when combining operations especially where offsets are involved!

Mixer best practice

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

Final adjustments for the actual model are done in the Outputs.

OUTPUTS stage

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

The processing is controlled via the OUTPUTS menuoutputs

Outputs processing

When designing your mixer setup, you are not concerned with model geometry (linkage angles, lengths, servo directions etc.). However, at some stage you have to match up your 'ideal' mixer design to the real model. In other words, set the direction, centres and limits of each channel... and compensate for left/right differences. This is the purpose of the Outputs layer.

The Outputs layer performs two main tasks:

  1. Limits ('clips') incoming mixer values to -100 and +100
  2. Applies a scaling and offset to the clipped values.

Let's look in more detail:

Outputs limiting

Output limiting is often misunderstood or overlooked. In this section I'll explain what it is, and why it's needed.

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. These adjustments define the limits and centre of the control surfaces. Also, by setting the output parameters appropriately, you can compensate for differences in the linkages between the left and right sides of the model.

Notes:

Channels monitor

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

Where to adjust weights

The three processing layers (Inputs, Mixers, and Outputs) each apply a weight or scaling to their inputs, and these values are cumulative. So final channel output is as follows (ignoring clipping):

OutputValue = SourceValue x Rateinput x Ratemix x Rateoutput

Clearly there is an infinite combination of rates which will produce the same movement at the servo. So where should you set them? Good practice is to adjust servo-related adjustments in the OUTPUTS, control rates in the INPUTS, and as little as possible in the MIXERS!

This is the procedure I recommend:

  1. Initialise all weights in MIXERS and INPUTS to 100%.
  2. In the OUTPUTS menu, adjust MIN, MAX and SUBTRIM to achieve the required servo limits and centres.
  3. In the INPUTS menu, adjust the weights to achieve the desired control surface travel.
  4. Any remaining mixer interactions can be adjusted via weights in the MIXERS menu.

 

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