Mike Shellim 25 July 2014
Last updated 17 January 2021
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.
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:
The sources represent your sticks and knobs. The blue boxes are the three stages of processing. Each has its own menu:
Like all computer programs, OpenTx needs data to work with. A generic term is sources. Examples of sources are: sticks, switches, inputs, trims and trainer inputs. Each source has a unique identifier. Examples:
Sources carry a value between -100 and 100 according to their position. Examples:
You can monitor the values of sticks and knobs in the SYS->HARDWARE menu - this is useful for checking that they're calibrated correctly.
Mixers define the control logic of your setup, in other words how the sources (sticks, sliders etc.) affect each channel.
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).
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 - this makes a good first test of your radio system! 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.
We've seen that mixers belong to channels, so let's say a few words about these.
In OpenTX, channel has a wider meaning than with other systems. Key points:
It's a good idea to assign a name to each channel that you use. You will do this in the OUTPUTS menu. In the screenshot below, channels 1 to 3 have been reserved for rudder, elevator and spoiler.
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.
In this section we'll examine three basic mixing scenarios. These will form the building blocks of all your setups.
The simplest scenario is where one stick drives one channel. We've already seen this, where the aileron stick drives channel 1:
In the second scenario, a single source drives more than one channel simultaneously. This is commonly used for dual aileron servos. The screenshot below shows that moving the aileron stick will drives channels 1 and 5. The negative sign indicates that ailerons should move in opposite directions.
The third scenario is for control surfaces which are driven by more than one control stick simultaneously. Examples include V-tails (rudder and elevator sticks), flaps (driven by a camber slider, crow stick and aileron stick), and many others.
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 final movement of the control surface.
Let's now design an actual setup. The basic idea is to (a) identify 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.
The first step is to assign the lowest numbered channels for the servos. We do this directly in the OUTPUTS menu.
Next, we identify the interactions between sticks and channels. A formal way is to consider each stick in turn, then list the channels which will be affected when the stick is moved.
On our flying wing, the aileron stick drives both servos, so there are two interactions:
- Ail -> CH1
- Ail -> CH2
Similarly, for the elevator stick:
- Ele -> CH1
- Ele -> CH2
At this stage, we're not interested in directions and rates, only that the interaction exists.
Next, swap the left and right sides from Step 2.
- CH1 <- Ail
- CH2 <- Ail
- CH1 <- Ele
- CH2 <- Ele
So now, each line reads as "[channel] is affected by [source]". This corresponds to the way mixers are defined.
Finally, in the MIXER menu, create a mix for each line in step 3. For each mix, just set the source parameter, you can leave all the other parameters at their default values.
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 elevator and aileron responses. We can do this via the weight parameter.
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.
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.
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.
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.
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:
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:
You don't alway have to use inputs. Sometimes it's more appropriate to use the regular sticks.
Inputs are an important part of OpenTx, and you can read more about them here.
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.
We've already looked at mixer weight. We'll now investigate offset, expo, diff, functions and curves.
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
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.
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!
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.
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.
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!
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.
The OUTPUTS stage is the final stage of processing prior to transmission.
The processing is controlled via the OUTPUTS menu
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:
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:
You can monitor channel outputs in real time, using the Channels monitor.
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:
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
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
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.
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).