Jump to content

Help needed with a mix, please


Allan Bennett
 Share

Recommended Posts

A few days ago I got excellent help with programming a logic switch.  The result is that when my Thr value exceeds a certain threshhold for the first time in a flight L03 is turned ON for 0.5 seconds.

 

Ch6 in my X8R receiver controls my on-board sound system via SwC on my Taranis:  The switch is normally at mid position, giving an output of 0; a brief blip down gives a brief output of +80 which triggers the engine-start sounds; up gives an output of -80 which gives machine gun sounds for as long as the switch is in that position.

 

My intention with L03 is to give Ch6 a brief blip (0.5 seconds) of +80 when the throttle is opened for the first time, to avoid having to manually coordinate sound and motor using SwC and throttle stick.  (Once motor-start is triggered, the sound is then controlled by throttle position).  My problem is achieving that while still having control via SwC.

 

I have plenty of experience of simple mixing, usually for rates, but when I add another line to my Ch6 mix it either stops SwC from having any effect (REPLACE mode) or gives an incorrect output value (ADD or MULTIPLY mode).  Why does REPLACE mode disable SwC forever, rather than just for the 0.5 seconds that L03 is ON?  And how best can I achieve my aim.

Link to comment
Share on other sites

3 minutes ago, Allan Bennett said:

A few days ago I got excellent help with programming a logic switch.  The result is that when my Thr value exceeds a certain threshhold for the first time in a flight L03 is turned ON for 0.5 seconds.

 

Ch6 in my X8R receiver controls my on-board sound system via SwC on my Taranis:  The switch is normally at mid position, giving an output of 0; a brief blip down gives a brief output of +80 which triggers the engine-start sounds; up gives an output of -80 which gives machine gun sounds for as long as the switch is in that position.

 

My intention with L03 is to give Ch6 a brief blip (0.5 seconds) of +80 when the throttle is opened for the first time, to avoid having to manually coordinate sound and motor using SwC and throttle stick.  (Once motor-start is triggered, the sound is then controlled by throttle position).  My problem is achieving that while still having control via SwC.

 

I have plenty of experience of simple mixing, usually for rates, but when I add another line to my Ch6 mix it either stops SwC from having any effect (REPLACE mode) or gives an incorrect output value (ADD or MULTIPLY mode).  Why does REPLACE mode disable SwC forever, rather than just for the 0.5 seconds that L03 is ON?  And how best can I achieve my aim.


Can you upload some screenshots of the mixer and logical switch screens in Companion, or the .OTX file itself? It will make it a lot easier to troubleshoot. 

Link to comment
Share on other sites

Thanks for looking MattyB.  Here are screenshots of the Inputs, Mixes and Logic lines:  I can't help wondering if "L03" is supposed to go into the 'Switch' box instead of the 'Source' box for the mix but, if so, what goes in the 'Source' box?

 

Note that I6 is set to 80% simply because this was the first model I programmed in OTX, and I was advised to do that so that servo throws would be the same as they had been with my Futaba setup.

 

 

Clipboard02.jpg

 

Clipboard03.jpg

 

Clipboard04.jpg

Edited by Allan Bennett
Link to comment
Share on other sites

All sorted - it was not that hard once I got it into the Companion sim.

 

The main issue was there was no switch applied to your replacement line against CH6; you were using L03 as a source, not as a switch to activate it. As a result it was getting stuck permanently on. I also had to play with the logical switches; I added an additional AND condition for the initial one-time blip of CH6 (to check that the throttle was activated), and removed the original (and superfluous) L05 in your original setup (L05 could never fire, since the Thr can never be >100. Even if it could have fired, it wasn't set to trigger an action anyway!).

 

Here goes (if you need further explanation, just give me a call)...

 

Inputs (unchanged)

image.png.b34462ed2d71b54c854d7b03c3bfa8be.png

 

Mixes:

image.png.bc3d5481c6627c27eafd5697289ad0a6.png

  • L04 now activates your REPLACE mix line against CH6 (you had no switch here previously), as well as being the source
  • L04 is a 0.5 second momentary switch that is is triggered when a) throttle is enabled AND b) throttle is advanced beyond -81% AND c) it is the first time these two conditions have been met since the throttle was activated (see Logical switches below).

Logical switches:

image.png.633812f6f40d8bc60f2ba4ce6599f55d.png

  • L01 & L02 - Sticky throttle cut; throttle only active when SG is up (identical to my last demo file)
  • L03 - Logical test: ON if Thr> -81 AND Throttle is active (because the Throttle being activated is the action that denotes the start of a new flight)
  • L04 - Additional logical test: ON if all conditions in L03 met AND it is the first time that has happened this flight (i.e. since throttle was activated). Duration set to 0.5 seconds to provide the CH6 blip requested
  • L05 - Sticky switch that is effectively used to a) see if it's the first time the conditions required for the CH6 blip have been met, and b) resets the system at the end of the flight. ON the first time L04 fires (L04 gives your one time CH6 blip); OFF when the throttle is cut at the end of the flight.

Demo file: 

Alandemo v2.otx

 

Edited by MattyB
Link to comment
Share on other sites

1 hour ago, Allan Bennett said:

Note that I6 is set to 80% simply because this was the first model I programmed in OTX, and I was advised to do that so that servo throws would be the same as they had been with my Futaba setup.

 

PS - That may be required on an output with a servo (I've not used a Futaba set for ~25 years so wouldn't know), but it shouldn't matter a jot if you are outputting to a sound module. Try changing it to 100% and see, but remember, if for any reason it the response to the SC switch is the wrong way round, reverse it on the Mixer or Servos screen, NOT Inputs (funny things related to trims can start to happen if you do that on primary controls; it's simplest to remember only +ve values should be used at the Inputs layer, then these issues will never happen).

 

Edited by MattyB
Link to comment
Share on other sites

Thanks MattyB, I'm aware of the danger of reversing the Inputs, having suffered reversed trims on a model a few months back 😵

 

I've just checked with Ch6 increased to 100% in the Inputs screen, and in simulation it still doesn't react to SwB input even though it does blip briefly to +100 when the throttle passes -81.

 

Attached is the OTX file:

 

 

18-08-23 (T2) Logic L03 created to trigger sounds when throttle is raised.otx

Link to comment
Share on other sites

5 hours ago, Allan Bennett said:

Thanks MattyB, I'm aware of the danger of reversing the Inputs, having suffered reversed trims on a model a few months back 😵

 

I've just checked with Ch6 increased to 100% in the Inputs screen, and in simulation it still doesn't react to SwB input even though it does blip briefly to +100 when the throttle passes -81.

 

Attached is the OTX file:

18-08-23 (T2) Logic L03 created to trigger sounds when throttle is raised.otx 1 kB · 0 downloads

 

In my demo I used switch C rather than B, sorry. Just change the I6 source to SB on the Inputs screen and all should be well.

 

Yep, tested in Companion - that works fine 👍

 

Edited by MattyB
Link to comment
Share on other sites

SB is the engine sounds switch and, so long as I have the := L03 (+100%) second line in the Ch6 mix, its output value stays at -80 irrespective of the switch position.  The output value does blip to +80 when the throttle exceeds -81, as specified by the L03 line.  I've tried changing the source in the Ch6 mix from I6 to SB, but the result is the same.

 

If I delete the := L03 (+100%) line from the mix, Ch6 output value goes from -80, 0, +80 in response to SB position as normal.

  • Like 1
Link to comment
Share on other sites

5 hours ago, Allan Bennett said:

SB is the engine sounds switch and, so long as I have the := L03 (+100%) second line in the Ch6 mix, its output value stays at -80 irrespective of the switch position.  The output value does blip to +80 when the throttle exceeds -81, as specified by the L03 line.  I've tried changing the source in the Ch6 mix from I6 to SB, but the result is the same.

 

If I delete the := L03 (+100%) line from the mix, Ch6 output value goes from -80, 0, +80 in response to SB position as normal.

 

@Allan BennettUnfortunately there were a few issues with that last file you uploaded, the most significant of which was that you had no enabling switch on the replace line for CH6 (you were using L03 as the source of the mix, but not the switch to trigger it). The bits missing are highlighted below:

 

image.png.67612f8b5b02d95955ac450b2cbfb11f.png

image.png.383782f7e780c5cb2928429ead6f29ad.png

 

You had also only copied a subset of the logical switches in my example file, so the reset of the system on activating throttle cut wouldn't work, and the final logical switch in your setup wasn't used for anything and would never have fired (as it's not possible to move the Thr beyond +100). 

 

Anyway, to simplify things I have gone through that file, made all changes needed to get it working (including implementing a sticky throttle cut), and tidied up the Special Functions so they are grouped for ease of use/troubleshooting in the future. Everything else (e.g. all your Inputs and Mixer values etc) are identical to the setup you uploaded, so you should just be able to import this model memory into your TX and everything will work with zero changes. Try it on the sim first though to check it all works for you.

Magnatilla MB v4.otx

(EDIT - the v3 I uploaded first was the wrong file, apologies. If you downloaded that by accident, please delete it and use v4 above)

 

PS - CH8 on the mixer screen I'm guess was just an experiment and isn't necessary, but just in case I set it to exactly follow how Ch1 behaves with respect to the sticky throttle cut. If it's not needed, just delete both lines from your final setup.

 

Edited by MattyB
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Thanks for taking so much trouble MattyB.  Adding L03 to the Switch field in the second line of Ch6 mix has done the job, as you say.

 

As for Ch8, that sends the throttle signal to the sound board to keep the 'engine' sound in sync with Thr value after startup has been triggered.  I prefer to use a separate channel if it's available, rather than using a Y-lead from the throttle channel.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, Allan Bennett said:

Thanks for taking so much trouble MattyB.  Adding L03 to the Switch field in the second line of Ch6 mix has done the job, as you say.


To be fair the mistake you made was easy to do - it took me a while to work out what was going on. The problem is that it is so rare to use a single logical switch as both the source and trigger for the same mixer line, this made it tricky to realise no trigger had been set for the action in question. 

Link to comment
Share on other sites

MattyB, I've just got around to substituting your Magnatilla program for my original, but before doing that I tested my original programming with the addition of L03 in the mix Switch field, and there's something I don't understand:-

 

Basically it works as I wanted except that moving the throttle stick past the -81 mark triggers the Ch6 blip even if the throttle output is inhibited by my basic !SG^ throttle cut.  How can that happen?  Does the term 'Thr' not represent the throttle signal output, which is -100 when !SG^ ?  In OTX simulation you can see that with SB- and SGv the throttle output is pinned at -100 even though the throttle stick is halfway up, so why is the logic condition of Thr > -81 triggering under those conditions?

 

Clipboard01.jpg.13c77f2031291a2484552776b80b61e4.jpg

 

I'm using your version, with sticky throttle, anyway, thank you MattyB.  Just curious about the 'Thr' term's meaning.

  • Like 1
Link to comment
Share on other sites

2 hours ago, Allan Bennett said:

Does the term 'Thr' not represent the throttle signal output, which is -100 when !SG^ ?  In OTX simulation you can see that with SB- and SGv the throttle output is pinned at -100 even though the throttle stick is halfway up, so why is the logic condition of Thr > -81 triggering under those conditions?


No, Thr is just the throttle stick position - it’s an input, not an output. That particular logical switch will fire every time the throttle stick passes -81, irrelevant of whether the throttle cut is active. 

Link to comment
Share on other sites

No, you can absolutely use an output of another channel as an input to another mix line or logical switch - in this instance, you would just replace Thr with CH1 within the mix line that gives the blip.

 

Short summary - If asking "Is it possible within OpenTX/EdgeTX/erSKYTX", the answer is always yes!  😄

 

Edited by MattyB
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...