Differential without GVARs
GVARs are a precious resource
Gvars are the great unsung heroes of OpenTx. They're perfect for storing configuration parameters, and the Gvars menu provides a nice user-friendly front end.
However, gvars are a limited resource - only nine are available. If you run out of gvars, you'll find yourself having to delve into the Mixers menu to configure your model. So anything which saves on unnecessary use of gvars is to be welcomed. Which is where Diff comes in...
In order to implement aileron or flap differential, the standard method is to specify a gvar in the Diff field:
CH01 (RtAil) aileron servo channel [I3]Ail Weight(+100%) NoTrim Diff(GV8) [Aileron]
CH01 (RtAil) aileron servo channel [I3]Ail Weight(+100%) NoTrim Diff(GV8) [Aileron] GV8 is set via SF3 CH15 (Diff) TrmR Weight(+100%) NoTrim Curve(3) [DifAdj] TrmR sets diff value SF3 Adjust GV8 <= CH15 binds GV8 to CH15
Using mixes to calculate downward travel of ailerons and flaps
Because of this, I decided to explore an alternative method of implementing diff. I felt it should be possible to do using mixers, with OpenTx performing the necessary calculations to implement not just diff, but also diff suppression and reverse diff.
The method involves splitting the aileron input into separate 'up' and 'down' mixes.
Flap down travel
The down-travel for flaps is straightforward:
Flap-Down = (A2F * (100-Diff)) (Equation 1)where:
A2F = aileron to flap mixAileron down travel
Aileron down-travel is more complicated as it takes into account diff, crow position and reverse diff.
When crow is off, the aileron down travel is reduced according to the value of diff. As crow is deployed, two effects occur, both of which increase the downward travel component: first, diff reduces to zero, and secondly reverse diff kicks in.
Ail-Down = Ail * (100% - (Diff * (100%-Crow)) + (RevDiff*Crow))Simplifying:
Ail-down = Ail * (100%-Diff + Crow(Diff+RevDiff)) (Equation 2)where:
Ail = aileron input
Implementation using mixers
The next task is to implement the down-travel mixes, according to equations 1 & 2 above. I'll reserve a couple of high mixes for these, and use OpenTx to perform the arithmetic:
In the code which follows,
CH13 (Diff) Ouputs diff value, according to Rudder trim TrmR Weight(+100%) NoTrim Curve(3) [DifAdj] Source = rudder trim CH14 (DnAil) Ouputs down aileron value (equation 2) CH13 Weight(+100%) Offset(GV6) [Diff] (Diff+RevDiff) *= CH16 Weight(-50%) Offset(50%) [Crow] *Crow += CH13 Weight(-100%) Offset(100%) [Diff] +(100 - Diff) *= [I3]Ail Weight(+100%) NoTrim [Ail] *Ail CH15 (DnA2F) Ouputs down flap value (equation 1) CH13 Weight(-100%) Offset(100%) [DifAdj] (100 - Diff) *= [I3]Ail Weight(100%) NoTrim [Ail] *Ail CH16 (Crow) Ouputs raw crow value in range -100 to +100 MAX Weight(+100%) [Fixed] default = crow off := Thr Weight(+100%) Flight mode(Landing) [Thr] Crow value (over-rides line above)
Putting it all together:
The right aileron channel starts like this:
CH01 (RtAil) [I3]Ail Weight(+100%) NoTrim Function(x>0) [UpAil] func 'x>0' so active with RIGHT ail only += CH14 Weight(+100%) Function(x<0) [DnAil] func 'x<0' so active with LEFT ail only += CH21 Weight(+100%) [AilTrm] [...]
CH03 (RtFlap) [I3]Ail Weight(GV5) NoTrim Function(x>0) [RollUp] GV5 is Ail2Flap mix += CH15 Weight(GV5) Function(x<0) [RollDn] += CH21 Weight(GV5) [AilTrm] [...]
On my F3X setups, the modification saves 2 gvars at the cost of 2 or 3 mixers depending on the setup. The cost/benefit for other setups will vary.
The solution puts me in a bit of a dilemma. It works very well, however it's not obvious to the casual observer how it works, and I've always designed my setups for ease of maintenance. So I'm not quite ready to include this solution in my F3X templates - but there's nothing to stop you doing so! Get experimenting, and push the boundaries!!
Mike's OpenTx Clinic - your source for F3X templates
Mike's other blog - OpenTx chatter and tips
Glider Simulator a great testing and simulation tool by 'MiamiMike'.
Last edited by mikeshellim; Mar 22, 2017 at 08:21 PM.