Mike Shellim 08 May 2015
Last updated 6 Jan 2021
Cascading (or chaining) is a great technique for complex models. It avoids unnecessary duplication of mixers, simplifies adjustment, and encourages the use of elegant, hierarchical schemas. It's especially useful for F3X sailplanes.
Cascading is very simple to describe: it's when the output of a channel is used as the input to another channel. Here's a trivial example:
CH1 is driven by knob S1, and the output of CH1 is cascaded to CH2:-
CH1
src=S1 wt=80
CH2
src=CH1, wt=25
The output of CH2 varies, as CH1 varies, as S1 varies.
The weights cascade by multiplication, so
CH2 = CH1 x 25% = S1 x 80% x 25% = S1 x 20%.
So, as S1 is rotated between its end stops:
Though not strictly part of cascading, another feature we'll use is the MULT operator. The MULT operator is used to multiply mixes within the same channel.
CH1
src=RS, wt=100
src=S1, wt=100, multiplex=MULT
In the example, CH1 = (100% x RS) x (100% x S1) = RS x S1
Okay, so let's see how cascading works in practice. We'll use the example of an elevator to flap mix, also known as 'snapflap'. We'll add 35% of the elevator value to the two flap channels.
First, here's the 'brute force' approach without cascading:
CH3 (right flap)
Src=Ele, weight=35
...
CH4 (left flap)
Src=Ele, weight=35
...
This works, however there's a drawback: In order to adjust the amount of snapflap, two identical adjustments are needed, one in each channel.
Let's modify the code. We'll isolate the snapflap mix in, say, CH10, and cascade its output to the individual flap servos:
CH10 (snapflap)
Src=Ele, wt=35
CH3 (right flap)
Src=CH10, wt=100
CH4 (left flap)
Src=CH10, wt=100
Woohoo! CH10 now provides a single point of adjustment for both flaps.
It's good practice to reset the weights in CH3 and CH4 to 100% (remember that weights are multiplied cumulatively as OpenTx progresses through the cascade).
On a 4-servo wing, you'll want snapflap to apply all four surfaces. So let's also cascade the snapflap value (CH10) to the ailerons:
CH10 (snapflap)
Src=Ele, wt=35
CH1 (right aileron)
Src=CH10, wt=100
CH2 (left aileron)
Src=CH10, wt=100
CH3 (right flap)
Src=CH10, wt=100
CH4 (left flap)
Src=CH10, wt=100
This'll work, but there's a problem: CH10 controls both flaps and ailerons without distinction. In practice the linkages for flaps and aileron will have different geometry. To cater for this, we need a separate adjustment for the ailerons. So let's set up a separate high mix in CH11:
CH10 (snapflap -> flaps)
Src=Ele, wt=35
CH11(snapflap -> ailerons)
Src=Ele, wt=15
CH1 (right aileron)
Src=CH11, wt=100
CH2 (left aileron)
Src=CH11, wt=100
CH3 (right flap)
Src=CH10, wt=100
CH4 (left flap)
Src=CH10, wt=100
So now,
We can adjust CH10 and CH11 to achieve the desired relative movement between flaps and ailerons.
Say we want to adjust the overall snapflap whilst flying the model. We can do this by creating a volume control, and applying it to CH10 and CH11.
We start by making a volume control based on knob S1, with range 0% to 100%:
CH20 (global snapflap adjuster)
Src=S1, wt=50, offset=50
The output of CH20 varies from 0 to 100% as S1 is rotated clockwise. To use this as a global adjuster, we cascade the output to CH10 and CH11, using the MULT operator:
CH20 (global snapflap adjuster)
Src=S1, wt=50, offset=50
CH10 (snapflap->flaps)
Src=Ele, wt=35
MULT: Src=CH20
CH11 (snapflap->ailerons)
Src=Ele, wt=15
MULT: Src=CH20
CH1 (right aileron)
Src=CH11, wt=100
CH2 (left aileron)
Src=CH11, wt=100
CH3 (right flap)
Src=CH10, wt=100
CH4 (left flap)
Src=CH10, wt=100
The MULT operator multiplies the global adjustment (from CH20) with the local adjustments of 35% (flaps) and 15% (ailerons). (Without the MULT operator, the local and global adjustments would be ADDed, which is of course not what we want).
Let's dig a little deeper: taking CH10, which controls the snapflap mix to the flaps:
CH10 = CH20 x Ele x 35% = Ele x S1{0-100%} x 35%.
Rotating the global adjuster varies the snapflap mix between 0% and 35%. Similarly the range for the ailerons is 0-15%.
So now, we use the local adjustments to set the relative travels for aileron and flaps, and the global adjuster S1 to tune both together.
A variation is to move the elevator input to the global adjuster line:
CH20 (global snapflap adjuster)
Src=S1, wt=50, offset=50
MULT: Src=Ele, wt=100
CH10 (flaps)
Src=CH20, wt=35
CH11 (ailerons)
Src=CH20, wt=15
CH1 (right aileron)
Src=CH11, wt=100
CH2 (left aileron)
Src=CH11, wt=100
CH3 (right flap)
Src=CH10, wt=100
CH4 (left flap)
Src=CH10, wt=100
The result is exactly the same as before, but isolating the MULT line at the top layer will make it easier when we add extra mixes.
Suppose we want to add a camber mix, controlled by slider LS. Ailerons and flaps will be affected, and we'll have a global adjuster (S2).
We can do this using similar code to snapflap:
CH21 (global camber adjuster)
Src=S2, wt=50, offset=50
MULT: Src=LS, wt=100
CH20 (global snapflap adjuster)
Src=S1, wt=50, offset=50
MULT Src=Ele, wt=100
CH10 (flap mixes)
Src=CH21, wt=20 -- camber
Src=CH20, wt=35 -- snapflap
CH11 (aileron mixes)
Src=CH21, wt=7 -- camber
Src=CH20, wt=15 -- snapflap
CH1 (right aileron)
Src=CH11, wt=100
CH2 (left aileron)
Src=CH11, wt=100
CH3 (right flap)
Src=CH10, wt=100
CH4 (left flap)
Src=CH10, wt=100
So now CH10 aggregates the camber and snapflap mixes. Note the small number of changes needed!
In practice, snapflap and camber will be active in different flight modes. We can achieve this by applying a flight mode filter as follows:
CH21 (global camber adjuster)
Src=S2, wt=50, offset=50, flightmode='thermal'
MULT: Src=LS, wt=100
CH20 (global snapflap adjuster)
Src=S1, wt=50, offset=50, flightmode='speed'
MULT: Src=Ele, wt=100
...
...
It's fairly clear how the above works if thermal mode is selected, but maybe not so clear in other flight modes, so let's break it down...
In flight modes other than thermal, then CH21 is equivalent to:
CH21 (global camber adjuster)
MULT: Src=LS, wt=100
So we now have the equaivalent of a single MULT mix. MULT mixes are applied to the result of all the mixers above it. In this case there are no mixes above, so the result of all the lines above is zero, and the value of CH21 is therefore zero. So, in modes other than thermal, camber will be zero - which is what we want.
One final tweak is to put the local adjustments (CH10, CH11) into a GVAR.
...
CH10 (flaps)
Src=CH20, wt=GV1
CH11 (ailerons)
Src=CH20, wt=GV2
...
This offers a couple of benefits:
There are some rules and limitations to observe when cascading.
In CH10 and CH11 above, the camber and snapflap inputs have the same 'directionality': they move control surfaces in a similar way.
Suppose we wanted to combine an aileron function ('flapperon'). Aileron has a different directionality to camber and snapflap, so we cannot simply add it to CH10 and CH11. Instead, we would need to define additional aggregator channels. Another complicating factor is differential - this must be applied at the level of individual servos.
For more insight, I would recommend having a look at my F3X templates, in particular the XLS reference documentation which contains both the schema and annotations.
In the schema which we've developed in this article, you'll note that there three distinct layers:
Cascading can be extended to other mixes such as reflex and crow brakes. The result is a hierarchy of mixers, fed by sources and inputs, with a calibration layer to deal with linkage differences. This type of schema is economical with mixers and is ideal for F3X models.
Let's summarise what's been achieved by employing cascading mixers.