Enable & Disable timer on Taranis Plus

kc-unreal

New member
OK so here's my situation. I want to set my arm switch (SF) on my Taranis Plus to enable and disable the timers. I want the timers to work when the arm switch is enabled, but disabled when not armed. I have my timers set to start counting when throttle is being applied, and stop when no throttle is applied. The problem I have, is sometimes I will bump the throttle and it starts counting when I am not flying. Any help would appreciated!
 

rockyboy

Skill Collector
Mentor
I have a similar use of timers, but use a throttle cut switch to ensure any accidental bump of the throttle stick doesn't actually result in any throttle output - and that seems to work perfectly as the throttle timers seem to be connected at the throttle output point rather than at the input or mix steps in OpenTx.

I can upload some epee info later this evening if that doesn't make sense yet.

Good luck!
 

rockyboy

Skill Collector
Mentor
I'll upload and walk through the epee for my multi-rotor's then instead of my fixed wing one :) Everything's working right (for me anyway) on both types of aircraft. I keep a flight controller arming switch separate from my throttle cut switch (mostly so I can keep switches doing the same things across all my models). I've recently decided to try leaving on air-mode on all the time through, and that might cause me to link those functions together so enabling happens on the throttle cut switch instead. Planning to give the current setup a try at the field this weekend with airmode and see if it bugs me or not.

The throttle cut has some fancy logic that requires the throttle stick to be 100% down position before it will reactivate, no matter what the switch position says - this prevents accidental bumps of the cut switch from letting the aircraft suddenly come on at a very high throttle position and shred my good feelings for the day :black_eyed: (this excellent programming was stolen from someone else btw - I'm not the genius that came up with it)

I use a separate switch for the timer reset - a quick pull of that switch just triggers an audio read out of the timer value, and a long pull (2 seconds) resets the timer values. (This one took a much lower value of genius and I was able to hack through it on my own :p )
 

kc-unreal

New member
I have been racking my brain trying to figure out how to correctly configure a switch to do what I described! The Taranis is a great TX, but you almost have to be a computer engineer to program it ha ha. Thanks for the help I appreciate it.
 

pressalltheknobs

Posted a thousand or more times
Not to take away from RockyBoy's promised full solution but..

Your problem is that you are starting the timer on the throttle. What you need to do is start the Timer on a Logical Switch which tests the Throttle channel position. You can combine that with whatever logic you use to arm.


Assuming the Thr channel is CH3...
A very simple solution is..

1. set up a basic arm switch using a Special Function.... say
SF1 SF^ OverrideCH3 -100 enabled (check box at the end of the line)
2. setup a logic switch L1 so it is true if the Thr channel is above min, say -95, AND if the ARM switch is not set.
L1 a>x CH3 -95 AND SFv
3. use the logical switch L1 for the timer start on the Model setup page...

The timer will only run if armed and the throttle is above -95%.

Notes: Override CH3 -100 is an absolute value not scaled or reversed by the Input, Mixer or Output so you need to be sure that it is the correct value for whatever you want it to do. The value CH3 you can test is the result of the Mixer not the Output so, when using OverrideCH3 you have to test the enabling switch state. The CH3 value will not reflect the "OverrideCH3 -100" although the final channel output will.
 

rockyboy

Skill Collector
Mentor
Yep - I was/am/are a computer engineer and I often need to find a better one to figure it out too :)

Ok, epee link http://www.filedropper.com/quad-thrcut-timer

I'll try to walk through the specific things that make the throttle cut and timer functions work the way they do. There are plenty of other little functions and switches in here to browse around for ideas too - not saying any of what I have here is the best way to accomplish these tasks, just the way that I've been able to get them to work for me :)

Starting with the Throttle Cut. The Inputs tab has two lines for the [I3]Thr function. The first line says if Logical switch 20 (L20) is true, then pass 100% of the throttle input on to the mixes. The second line says if Logical switch 20 is NOT true (!L20) then 100% of the throttle value gets sent to Curve 4 to get modified before being sent on to the mixes.

So let's follow that over to the Curve tab next and we'll come back to the mixes. On the Curve tab you'll see that Curve 4 is a 2 point straight line curve from zero to zero. Basically a flat line with no output whatsoever. So it doesn't matter what the input throttle value (the x axis) is going into this "Curve", the output value (y axis) returns a flat zero. Big goose egg. Throttle is cut and nothing happens.

Next let's go look at those logical switches. The two important ones for this part of the program are L19 and L20. L19 only goes true when the raw throttle value from the stick input is less than -98. Now comes the interesting part. L20 will only go true and activate when L20 (itself) and L19 (throttle stick low) and switch SA is not in the up position, and it has a delay of .5 seconds before it comes back to check itself.

So that's pretty complicated, right? Yes - makes my head hurt a little too. But turn on the Simulator screen and watch the channel output and play with the behavior. When you first activate the simulator, L19 and L20 are both false. So the throttle value is going through Curve 4, the value is cut to zero there, and what comes out of channel 3 to the receiver is zero - no motors are moving.

If you move the throttle stick down to the bottom, you'll see L19 activate - that's when it's safe to turn off throttle cut. Nobody sane wants to turn throttle cut when you're giving the ship 80% throttle for instance. Good way to end up in the emergency room.

So with L19 active, move the SA switch out of the up position - you'll see L20 go active. Now the throttle is active - and you can move the throttle stick up and down all you like and L20 stays active, keeping the throttle input on that first line where 100% of the value goes through and nothing uses Curve 4.

Now for fun, leave the throttle up at half stick or so and flip SA back to the up position. Bang - L20 goes out in .5 seconds and the throttle ouput value on channel 3 drops to zero as the dreaded Curve 4 steps into play.

Alright, we hit the throttle cut as we crashed and now we're picking up the quad and looking it over. We turn to let our laughing... er..concerned friends on the flight line know that everything looks OK and accidentally bump SA back down turning off the throttle cut! Oh no - we're going lose our fingers! Nope - it's all safe here friends - this is where the magic of the curve and logical switch setup saves the day. When that SA switch goes back to middle or down, L19 and L20 are both still off - and they stay off because of that nice OR statement and .5 second delay. The throttle says cut, and our fingers stay un-cut. The only way to reactivate the throttle is to put the throttle stick back down to 0 and wait .5 seconds to reset.

Hope that makes sense - the other tab where there is important throttle stuff happening in the mixes tab, where I have 1 important line (the first one) and 1 other line I'm playing with on occasion. The 1st throttle line for channel 3 says use 100% of the throttle value when L21 is not active, and the second line says replace the throttle value with a value piped through Curve 1 when L21 is active. And back in the logical switch page I have L21 setup to look just like my throttle cut line but using switch SE middle value as the trigger.

What I was doing there was making the throttle cut work with using switch SE as a manual arming switch with the SE value mixed out of channel 5 for Betaflight to use for arming. The other values that get mixed into channel 5 and the betaflight settings end up working so that when SE is down it's disarmed, anything else is armed, and then the switch SB value drives the arco/angle/horizon mode controls as seen on the mixes screen. But that's not why we're here, I just wanted to mention it as it is a little tied into the system here.

So why do we do the Curve in the input screen instead of the Mixes screen? a) it could be more risky if I got creative with other mixes, but most importantly for me b) this way the timer doesn't start moving when the stick is up but the throttle is cut!! Oh yeah, that was the original question here, right? Boy I took you down a rabbit hole for an answer... :p

So the other function I mentioned - the timer readout/reset. That starts in the General Settings area, not in the OrangeQuad model. I like to have the same functions across all my aircraft as much as possible, so setting things up in here when I can is really helpful. On the Global Functions tab in General Settings I have switch SF-down set to play value from Timer 1. (Also, I replaced that physical switch with a momentary one - you might have a better flying experience mapping this to SH if you haven't started hacking the Taranis hardware yet.)

The timer reset function has to be done in each model individually still - so back into the OrangeQuad tab for Logical Switches. The important one this time is L2 - that uses EDGE (which means hold it for a bit) to see if switch SF is held down position for 1.5 seconds - and then instantly activate L2. Then we move over to the Special Functions tab where SF1 and SF2 both look for that logical switch L2 to go active, and when it does perform a reset on Timer 1 and Timer 2 respectively. SF4 also plays an audio file so I know I held the switch long enough for the reset to happen.

Oh yeah, lots of SF lines in there to play audio queues for various flight modes - and SF14-SF17 play the sounds for arming/disarming, and throttle active/throttle cut.

Make any sense at all? :confused:
 

rockyboy

Skill Collector
Mentor
Not to take away from RockyBoy's promised full solution but..

Your problem is that you are starting the timer on the throttle. What you need to do is start the Timer on a Logical Switch which tests the Throttle channel position. You can combine that with whatever logic you use to arm.


Assuming the Thr channel is CH3...
A very simple solution is..

1. set up a basic arm switch using a Special Function.... say
SF1 SF^ OverrideCH3 -100 enabled (check box at the end of the line)
2. setup a logic switch L1 so it is true if the Thr channel is above min, say -95, AND if the ARM switch is not set.
L1 a>x CH3 -95 AND SFv
3. use the logical switch L1 for the timer start on the Model setup page...

The timer will only run if armed and the throttle is above -95%.

Notes: Override CH3 -100 is an absolute value not scaled or reversed by the Input, Mixer or Output so you need to be sure that it is the correct value for whatever you want it to do. The value CH3 you can test is the result of the Mixer not the Output so, when using OverrideCH3 you have to test the enabling switch state. The CH3 value will not reflect the "OverrideCH3 -100" although the final channel output will.

I second this approach as a simpler solution than mine - only thing you gain by the complexity of the approach I took is the 'extra safe throttle cut'. (Which for me is worth it, but YMMV)

Love OpenTx for having such a flexible platform there are many of ways to accomplish just about any task. :)
 

cumpsd

New member
Sorry for bumping this old thread. I was just trying to set this up, the filedropper link has long expired of course, so I went with the text.

It seems I am unable to add a line with !L20 as an Input, any idea how to deal with this?

Or any chance you can share your latest .otx file @rockyboy ?
 

cumpsd

New member
I think I got it.... Check the playground model in https://mega.nz/file/94tTSSxY#icfSNg9ZsMnx8jaPY5SDPAyogFV9_1Oefhn8HBTojtk

It seems to behave as described:
SF is my arm switch, up is disarmed, down is armed.
CH1 is my throttle.

If I start the simulator, and SF is up, I can move the throttle as much as I want and nothing happens.
If I turn down SF (arm) and my throttle is down, I can start using throttle, If it is not down, nothing will happen (throttle cut)
If I turn up sf (disarm), CH1 drops and when I re-ARM it stays down.
The timer only runs when CH1 is receiving a value.

Feedback welcome!
 

rockyboy

Skill Collector
Mentor
I think I got it.... Check the playground model in https://mega.nz/file/94tTSSxY#icfSNg9ZsMnx8jaPY5SDPAyogFV9_1Oefhn8HBTojtk

It seems to behave as described:
SF is my arm switch, up is disarmed, down is armed.
CH1 is my throttle.

If I start the simulator, and SF is up, I can move the throttle as much as I want and nothing happens.
If I turn down SF (arm) and my throttle is down, I can start using throttle, If it is not down, nothing will happen (throttle cut)
If I turn up sf (disarm), CH1 drops and when I re-ARM it stays down.
The timer only runs when CH1 is receiving a value.

Feedback welcome!

I'll get a current OTX file uploaded to help out, but it sounds like you got it working great! :)

For anyone else who runs across this thread, the !L20 is the "L20 is not active" option, and scrolling the opposite way in the selection box from the L20 will get you into the "!" or "not true" options.
 

Tench745

Master member
I'll get a current OTX file uploaded to help out, but it sounds like you got it working great! :)

For anyone else who runs across this thread, the !L20 is the "L20 is not active" option, and scrolling the opposite way in the selection box from the L20 will get you into the "!" or "not true" options.
You can also hit the + and - buttons at the same time to invert a value or go from, for instance, L20 to !L20 and back.