What's new
Aloft Forums

Welcome to Aloft Forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Mix Flaps and Throttle to Elevator with OpenTX

I turn the "trim" off for the throttle incase I am using the throttle channel for something.
Next I set up a special function to use the throttle trim to adjust a global variable.
Then I use that global variable to adjust the flap elevator compensation level.

This is the very basic steps. Some do far fancier setups, but this has worked well for me. I'd have to load up Companion to give more solid answers on the step by step setup for this.
 
thank you so much. I suspected it might be something like that. the trick is for this to have any value, the trim setting has to be remembered.
 
It's easy to overthink compensation. It's actually very simple - if you break it down. It can be done using two or three mixes, including adjustment via a spare trim.

Let's take motor compensation.

Expressed in plain English: motor speed affects elevator

% Motor-speed => elevator.

That's an interaction. And in OpenTX, an interaction translates to a mix.
So let's make the mix!

The source of the mix is %motorspeed, and the destination is the elevator channel:

CH2:elevator
MIX1 Source = %Motorspeed

Of course we don't have a %Motorspeed source, so let's fake it from the motor channel.
Assuming that CH7 is the motor channel, we have:

CH2:elevator
MIX1 Source = CH7:Motor

Well actually.... that's not quite right, because if motor is done correctly, CH7 will vary from -100% to +100%. We want a true percentage value in the range 0% to 100%.
To do that, we apply a weight and offset of 50%. [this works because mixer-output = source-value * weight + offset]

CH2:elevator
MIX1 Source=CH7:Motor Weight=50% Offset=50%

So now compensation = motorspeed%. In other words, compensation will be zero at idle, rising to 100% at full throttle...
WHHOAAA: 100% compensation means full up (or down) elevator!! We don't want to be doing loops just by opening the throttle... We need to dial reduce maximum compensation...

Since we're going to adjust compensation using a trim, let's do both the adjustment and the reduction of max compensation all in one go. We do that by adding a MULTIPLY mix, with source=throttle-trim, and some appropriate weight:

CH2:elevator
MIX1 Source=CH7:Motor Weight=50% Offset=50%
MIX2 Source=TrmT Weight={something%} Multiplex=MULTIPLY

Looking at the individual mixer outputs:
  • MIX1 varies from 0-100% depending on the motor speed
  • In MIX2, TrmT varies from -100% to +100% (because that's how trims work). This is multiplied by the weight, so the output of MIX2 varies from -{something%} to +{something%} depending on the trim position.

Let's check the result of multiplying the two mixes:
  • When the motor is at idle, MIX1 is zero, so the result is always zero (regardless of the throttle trim position).
  • When the motor is at full power, MIX1 =100%, and the result will be dependent solely on MIX2. In other words +/-{something%} depending on the TrmT position.
At full power, we might want say +/-50% of the available elevator movement, so... we just set 'something%' to 50% (who said OpenTx was difficult!) :

CH2:elevator
MIX1: Source=CH7:Motor Weight=50% Offset=50%
MIX2: Source = TrmT weight=50% Multiplex=MULTIPLY
[...]

Hold on... we're not quite done yet.

The MULTIPLY operator works on the result of all the mixers above it, so these two lines must be at the top of the elevator channel. This is rather restrictive - for example we would hit a problem if a flap compensation mix were added.

A better way is to farm the compensation calculation to a high mix, and insert the result back into the elevator mix:

CH2:elevator
MIX1: Source=CH10:compensation
[...]

CH10:compensation
MIX1 Source=CH7 Weight=50% Offset=50%
MIX2 Source = TrmT weight=50% Multiplex=MULTIPLY

Another benefit of this approach is that it breaks up the code into manageable chunks.

Okay okay, so you want flap comp as well! No problem, it can be added in exactly the same way, except the source will be the flap lever (instead of CH7). So, if the flap lever is LS, then CH10>MIX1 would look like this:
MIX1 Source=LS Weight=50% Offset=50%
To reverse the sense of LS, change the sign of weight.
 
Last edited:
Thank you Mike! I too find the modular approach key to programming. This is basic when wanting to come back and change/add some new features.
 
It is web based as it is. That is you can download the FW. With all the interface options with mobile devices I don’t see the advantage of a mobile app. Too many opportunities for FrSky to introduce errors. As it is now I’m thankful the SW isn’t windows based!
 
Is that a question or a comment? These platform questions might best be asked in another thread.
 
Last edited:
Back
Top