disabling a switch by a logical switch

General Help and support for the Taranis Radio.
Post Reply
PistaJ
Posts: 1
Joined: Sat Oct 10, 2020 12:47 am
Country: -

disabling a switch by a logical switch

Post by PistaJ »

I use reversible ESC in a glider to make landings shorter. The esc works normal from the middle to max (0 to 100) and reversed from middle stick to min. (0 to -100). To control that with the Thr stick (not centered) I created two curves and switch between them using a SF switch. To ensure I do not activate the switch when the motor is working, I would like to deactivate the switch when the Thr stick is above the min position. (using this ESC it means whenever the Thr signal is whatever else than 0
I thought I could use the logical switch to do that but I am missing the special function to deactivate a switch. Any help?

ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: disabling a switch by a logical switch

Post by ReSt »

I just stumbled over your problem and had an idea that I realized in ER9x, but I assume it should be possible in OpenTx also

For the throttle channel you use two mixer lines, one using curve1, the other using curve2.
These lines are activated alternating by means of the status of the logic switch L1

That requires an auxilliary channel, e.g. CH7 and some logic switches.
Ch7 has itself as source, that means, if you alter its value by activating another mix, it will hold that value, even when the other mix no longer is activ. A short pulse of LE or LD toggles CH7 between +100 and -100.
You get that pulse when throttle channel is low and throttle switch is either low or high. L1 now is set depending on the status of channel7 to on or off and that finally selects curve1 or curve2 on the throttle channel.

You can change the direction of the motor only when throttle is low.


CH3 + 100% Thr L1 c1
R 100% Thr !L1 c2

Ch7 + 100 CH7
R 100 FULL LE
R -100 FULL LD

L1 v>val CH7 0

LD v<val Thr -98 THR
LE v<val Thr -98 !THR

Reinhard
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: disabling a switch by a logical switch

Post by ReSt »

You can do it even easier, without curves
(I just recognized, that I didn't post the curves. Y-value of c1 goes from 0 to +100%, for c2 from 0 to -100%)

Replace the first two lines with the following lines

CH3 +50% Thr (L1) Offset(50%)
-50% Thr (!L1) offset(-50%)

Reinhard
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: disabling a switch by a logical switch

Post by ReSt »

And you can even do it without an auxilliary channel, al least with ER9x and ERSKy9x with the Latch function of the logic switches (don't know if opentx has this function too).


L1 Latch LD LE
LD v<val Thr -98 THR
LE v<val Thr -98 !THR // onlly the last 6 switches can work with inverted switches (!THR)

CH3 +50% Thr (L1) Offset(50%)
-50% Thr (!L1) offset(-50%)


Reinhard
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: disabling a switch by a logical switch

Post by ReSt »

And you can do the preselection with a momentary switch

Throttle cut switch is used for throttle cut, trainer switch is used as direction preselection switch
For every motor direction you have the full range of the throttle stick (-100 to +100)

The motor direction can be preselected at any throttle stick position, but
Motor direction is changed only when throttle stick is at minimum value (motor is stopped).
Every time when the intended motor direction is changed (TRN sw activated one or more times) and the throttle stick is at - or reaches - the minimum position, the new active direction is announced by the voice alert.



CH3 +50% Thr (L1) Late Offset(50%)
-50% Thr (!L1) Late Offset(-50%)

L1: F-Flop L3 L2
L2: F-Flop TRN !L2
L3: v<val THR -98 !TRN

Safety Switches
CH3: X !THR 0.0 Thr

VoiceAlert
You need two voice files for forward and backward (or whatever should be announced) e.g. MotDir_1.wav and MotDir_2.wav

VA1: Sw(L1) BOTH Play Name MotDir_1




L1 stores the status of its L2 input (= Data), when the L3 input (= clock) gets activated.
L2 changes its value between ON and OFF with every activation of the TRN switch.
L3 gets active, when the throttle stick is at minimum and TRN switch is not activated or
when the throttle stick is at minimum and TRN switch is activated and released
The voice alert gets activated, whenever the status of L1 changes (BOTH).
It plays MotDir_1.wav (forward) with L1 getting active and MotDir_2.wav (backward) with L1 getting inactive.


Reinhard

For ER9x you must replace L3 with one of the last six logic switches, because only they have the capabilty to use an inverted switch as AND switch (!TRN)

Post Reply

Return to “General help (FrSky Taranis radio)”