Jump to content

OpenTx - what is the fuss really about?


Recommended Posts

Suppose you want some rudder coupled with the ailerons, but don't know how much. You set the rudder channel up like:

+20% AIL
*50% LS offset 50% (the MULTIPLY multiplex)
+100% RUD

With the left slider (LS) at one end you get 0% of aileron mixed to the rudder channel and with the LS at the other end you get 20% mixed. Now, while flying, you may adjust LS to get the required amount you need.

The LS mix line provides a value from 0% to 100%. You don't want this going negative or you will get opposite rudder applied !

Mike.

Link to comment
Share on other sites

Logical switches example 1 - the sticky throttle cut

OK, so as promised here is a simple example of how logical switches can be cascaded in sequence to provide more advanced functionality. Since BEB has already outlined the basics of logical switches in previous posts above I will assume you’ve read that, know where the screen is and are comfortable with the idea that OpenTX uses Boolean operators (AND, OR, NOT etc.) extensively to define how the switches are triggered. I am also going to assume that you will do this in Companion rather than on the TX itself, though of course the process is fundamentally identical (I just can’t take screenshots from the TX!).

What example shall we use? I have chosen a “sticky” throttle cut for electric models. What’s one of them then?! Well a traditional throttle cut is useful for electrics, but has a dangerous failure mode – if you flip it by accident when the throttle stick is raised the motor will go instantly to the throttle level set by the stick with potentially nasty consequences. To avoid this we will setup the throttle cut so that two conditions are required for the throttle to become active – throttle cut switch is off AND throttle stick is at zero. If you look carefully there is a clue as to how we will do this in the previous sentence!

So, off we go … Like all problems in OpenTX it’s best to break it down into manageable stages. In this instance they are:

  1. Setup logical switches to test for the target activation condition (throttle cut switch off, throttle stick at zero);

  2. Setup a logical switch that can trigger enablement or disablement of the throttle;

  3. Link the logical trigger switch to the relevant lines on the mixer screen to actually make the sticky throttle cut work.

Edited By MattyB on 18/10/2016 15:16:41

Link to comment
Share on other sites

Let’s setup the test conditions first. I want the Throttle stick position (Thr) to be at the very bottom, and switch SF to be up (towards me). SF is just my choice; if you want to use another physical switch and/or the alternative direction, feel free.

Because all logical switches have an optional AND operator at the end of them in addition to the other variables in the switch we can actually do this in a single switch line:

stickythr1.jpg

Next we need to setup the logical switch that is used to activate and deactivate the throttle. For this we use a special type of logical switch, the “Sticky” switch. Sticky switches are activated by one specific condition (which can be physical switch, another logical switch, flight mode change etc.), and stay on until they are deactivated by another specific condition. In this instance we want the trigger to activate the throttle to be the logical test we configured as logical switch L1, and the off condition to be flipping the throttle cut switch SF back (away from us). The Logical switches screen therefore now looks like this:

stickythr2.jpg

Important note – In this setup the throttle will be activated when L2 is ON, and inactive when L2 is OFF. You could of course reverse this logic if you preferred by reconfiguring the switch to one based on a>x, V2 = -99.

That’s it for the logical switch screen, but before we go click the Simulate button and validate that L1 and L2 trigger when SF is down and Thr stick at minimum, and are both turned off when SF is flicked back to its original position.

Edited By MattyB on 18/10/2016 15:19:27

Link to comment
Share on other sites

Now we need to do step 3, linking L2 to the relevant mixer lines. Go to the mixer screen and drag down the existing throttle mix line to create a duplicate, then double click it to open the window where we set the parameters. Name it “ThrCut”, set “Source” to MAX (this is used whenever you want a servo to move to a specific position and stay there without moving) and “Weight” to -100, like this:

stickythr3.jpg

Now the clever bit… We want this mix line to REPLACE the one that allows the throttle to work when switch L2 is NOT on. How do we do that? First click on the “Switch” parameter and you will see there are two sets of switches – one set scrolling towards the bottom without an exclamation mark in front (i.e. L2), and one scrolling up with an exclamation mark (i.e. !L2). The one with the exclamation mark denotes it will be one when the specific condition is NOT true, so select !L2. Finally under “Multiplex” select Replace – the dialog box should now look like this:

stickythr4.jpg

Click OK. Your mixer screen should now look like this:

stickythr5.jpg

That’s it! Click simulate and you should have a working sticky throttle cut which can only be activated when the throttle is at minimum AND SF↓, and is deactivated when SF↑. If you like you can also have the TX play voice alerts when throttle is activated and deactivated – trigger them off SF↑ and SF↓, or L2 and !L2. Not too hard!

That’s all for now, but next time we will build on this with an advanced version of the throttle cut linked to flight modes. That may take me a bit more time to explain though…

Edited By MattyB on 18/10/2016 15:14:57

Link to comment
Share on other sites

Posted by MattyB on 18/10/2016 15:08:27:

Logical switches example 1 - the sticky throttle cut

Well a traditional throttle cut is useful for electrics, but has a dangerous failure mode – if you flip it by accident when the throttle stick is raised the motor will go instantly to the throttle level set by the stick with potentially nasty consequences.

Hands up who hasn't done that! I've used SF as a standard throttle switch for some time and made that mistake once, luckily no damaged digits etc., After that I treble check the throttle is closed first but this sticky throttle is excellent.

Thanks Matty and BEB for sharing your expertise yes

Shep

Link to comment
Share on other sites

Posted by Chris Bott - Moderator on 18/10/2016 17:48:34:
Matty - Great example that sticky throttle cut.
Another example of different ways to do the same thing would be that I would probably use Special Function "Override" to apply the output of your L2 to the throttle channel.

Yep, you can absolutely do that - it's just a matter of personal preference. I put it on the mixer screen because that saves me having to go to a third screen to setup the cut and I find it reassuring to see that cut line in the mixer, but the outcome is the same.Choices choices!

As BEB says the only really important thing is to use consistent method to acciomplish the same task across all your models, otherwise troubleshooting a setup issue can be tricky. To help here I try to run all my models off a small set of templates I have developed (or borrowed from others such as Mike Shellim), then just make any minor tweaks for the model in question. Works for me.

Edited By MattyB on 18/10/2016 18:21:12

Link to comment
Share on other sites

Yes - I do something similar. When I am programming a new model I look around the existing fleet for something basically the same - I then copy the programming for that, rename it for the new model and start customising it.

If you have a poke around on my examples above (on the mixer and logocal switches tabs) you'll see yet another sticky throttle cut set up on my channel 16! (The progarmming of which I can't claim as mine - I nicked it from somewhere!!) wink 2

BEB

Edited By Biggles' Elder Brother - Moderator on 18/10/2016 19:09:19

Link to comment
Share on other sites

I thought it might be of interest to show how this looks on an FrSky Horus that has had OpenTx installed.
i.e. It's exactly the same.

With the extra display space available, the OpenTx programmers have added lots of subtle little extras.

For example these shots are nearly all the same page, but I've stepped across to each parameter to show the extra snippets of help given along the bottom of the screen, and the field name in the top right corner.

Sorry about the quality of the pictures. That's an interaction between display pixels and camera pixels (I think)

1-img_6766.jpg

1-img_6767.jpg

1-img_6768.jpg

1-img_6769.jpg

1-img_6770.jpg

1-img_6771.jpg

Finally this is a shot of the Channels Monitor. For Ch3 (Throttle) there's a little padlock sign showing that this channel has been overridden. The grey bar shows the output of the mixer at -36% (That goes up and down with the throttle stick). The red bar shows the output of the channel, which is being held here at -100% by the throttle cut.

1-img_6772.jpg

Link to comment
Share on other sites

The Horus screens are very impressive Chris. Pity about the price though.

Matty, Id love to say that my programming is consistent across models but unfortunately my models are a perfect demonstration of evolving knowledge of the system - one day I will go back to the early setups and bring them in line with my current prefered methods, maybe over the winter layoff. You can tell recent additions as I'm now using favourite existing model setups as templates.

Link to comment
Share on other sites

Logical switches example 2 – an advanced sticky throttle linked to flight modes

OK, so here is another more advanced example I created for my Durafly Excalibur warmliner. As a right handed mode 1 flier I hate having to use my chin or teeth to throttle up whilst holding a hand launched model, but I also don’t like launching left handed either! This setup is aimed to address those issues as follows:

  • Three way sticky throttle cut (throttle activated only when SF↓, Thr at minimum and LS at minimum)

  • Throttle activation automatically engages Takeoff flight mode

  • Takeoff flight mode transfers throttle command to LS, with a max power available of 70% to avoid torque rolling it in at launch and a custom throttle curve

  • Advancing the throttle stick automatically beyond 75% engages Acro flight mode, and Takeoff flight mode cannot be re-engaged without killing the throttle (i.e. at the end of the flight)

Sound tricky? It is certainly more complex than the previous example, but we can break it down in much the same way – first set the activation conditions for the throttle activation/Takeoff flight mode, test for the right conditions, then cascade the various throttle and flight mode changes off that switch. The main challenge is preventing Takeoff mode (and the throttle control on LS) from being reactivated by an accidental flick of the flight modes switch SE. Onwards…

Edited By MattyB on 19/10/2016 16:08:54

Link to comment
Share on other sites

OK, so here is a screengrab of the logical switches I have setup to achieve the above goals (click the pic to make it bigger):

advstkythr1.jpg

Working from the top…

  • Group A (L8-L10) is the three way sticky throttle check and implementation. Line 1 is the same test as our first example, line 2 adds in checking LS is near the bottom of its travel, and L10 is the enable/disable line used to deactivate and activate the throttle kill mix line.

  • B (L11) is a bit of a strange one. Basically we need to make sure that Takeoff mode can only be enabled once (immediately after the throttle is enabled), so I use an OR with both inputs the same (SF↓, the throttle enable action) and a duration of 2 seconds. That means that 2 seconds after SF↓ is selected this switch will go back to off. More on this below.

  • C (L12) is the conditional test used for engaging Takeoff flight mode. It basically checks that throttle is enabled (L10) AND the flight mode switch has been pre-set to Takeoff (SE↑, which is mandated on the Setup screen as a start-up switch position) AND throttle switch activation (L11) happened within the last 2 seconds.

  • D (L13) is the conditional test for switching over from Takeoff to Acro flight mode. It is activated only when the throttle stick is advanced beyond 75% travel when in Takeoff flight mode (FM2)

  • E (L14) is the actual switch used to trigger Takeoff Flight mode. It is activated by L12 and deactivated by L13. Since Acro is setup as Flight Mode 0, deactivating Takeoff flight mode automatically selects Acro i.e.

advstkythr2.jpg

...and...

advstkythr3.jpg

That’s it for the logical switches, but there are a few more key things needed to make this setup work…

Edited By MattyB on 19/10/2016 16:10:47

Link to comment
Share on other sites

Throttle on LS in Takeoff mode – I chose to do this on the inputs screen. Basically I have an additional line active only in Takeoff flight mode, driven by a source of LS and with a max weight of 70%. It’s the third line down below (click the pic to make it bigger):

advstkythr4.jpg

As a result the throttle section of the mixer screen looks identical to the previous example:

advstkythr5.jpg

There is one more nuance though… I had to apply a custom throttle curve to the throttle when using LS that had a flat point at the bottom end:

advstkythr6.jpg

This is because when I tested it initially on the TX it was clear from the outputs screen that my LS slider is a bit spongy(!) and doesn’t get to -100; -93 was about its lowest point. I didn’t want the prop to start instantly on disengaging the throttle cut, so I added in some wiggle room in the form of a flat spot at the bottom end – essentially the throttle will not start up until LS it has moved about 20% of its travel. Safety first!

Here endeth the (somewhat esoteric) lesson... wink

Edited By MattyB on 19/10/2016 16:11:09

Link to comment
Share on other sites

Posted by Chris Bott - Moderator on 18/10/2016 17:48:34:
Matty - Great example that sticky throttle cut.
Another example of different ways to do the same thing would be that I would probably use Special Function "Override" to apply the output of your L2 to the throttle channel.

I find you have to be very careful using Override or it can have unintentional consequences. The special function 'Override CHxx' doesn’t take in account the min/max, direction, etc. specified in the output menu. Only the PPM Centre parameter is used. If you're not very careful, servos can be driven out of their mechanical limits and in the wrong direction...

Edited By Biggles' Elder Brother - Moderator on 19/10/2016 17:47:50

Link to comment
Share on other sites

Posted by Andy48 on 19/10/2016 16:59:09:

Surely your slider problem can be cured by recalibrating the tx?

Maybe, but it seems to be a physical issue with the pot itself - it can achieve -100 if you hold it back with a touch of force, but release the pressure and it returns to -93. Godd idea though, I may try a calibration to see if that helps.

Link to comment
Share on other sites

Ah yes, that's the problem, when you calibrate you just need a gentle touch on the sliders and joysticks, you can force them further than they would normally go. You can get this problem with the throttle, so that every time you switch on you get a throttle warning even though the throttle is fully down.

Link to comment
Share on other sites

Posted by MattyB on 18/10/2016 15:08:27:

Logical switches example 1 - the sticky throttle cut

I just can’t take screenshots from the TX!

You don't need to. Use the Companion simulator, and go to the Taranis screen, there is a camera icon in the bottom left hand corner which will take a snapshot of the Taranis screen just as if you were looking at the screen itself.

  • Like 1
Link to comment
Share on other sites

Posted by Andy48 on 19/10/2016 17:26:10:
Posted by MattyB on 18/10/2016 15:08:27:

Logical switches example 1 - the sticky throttle cut

I just can’t take screenshots from the TX!

You don't need to. Use the Companion simulator, and go to the Taranis screen, there is a camera icon in the bottom left hand corner which will take a snapshot of the Taranis screen just as if you were looking at the screen itself.

Oh that's very cool - I hadn't spotted that!!! Good info Martin!

BEB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...