What's new
Aloft Forums

Welcome to Aloft Forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Trainer-Student : connection loss detection

pct06

New User
Hi

I am currently setting up training between a X9D+ SE 2019 and a X9D+ via a cable, both running OTX2.3.15 and using the below setup to check the link between the 2 radios:
I have setup CH7, on the Student's Tx, with SH as Source and Weight 100.
On the Instructor's, setup a Logic Switch a<x, CH7 , 0. Then set a Special Function with the Logic Switch as the Switch, and use Play Sound Siren.

The logic:
With the 2 position SH switches used as Source in the Mix, on the Students TX, with a weight of 100 the Channel will have a value of either +100 or - 100. Using that channel as a Source for Channel 7 on the Instructors Tx will mirror the value, so as long as the TXs are linked the channel will have a value of either 100 or -100. Once the link is broken it will default to zero. Using a Logic Switch to check for the Channel to have a value of zero will then be true if the link is broken. The Logic Switch can then switch a Special Function to give a warning.

But when I disconnect the cable to test, the value of the channel TR7 remain at -100 and do not drop to 0 : thus it does not detect the loss and do not activate the warning, while the radio detect and play the "Lost trainee radio" message.

It seems it was working on previous versions of OpenTx but not here.

Is there a reason why the radio keep the last value on TR7 sent by the remote radio instead of dropping to 0 when loosing signal ?

Thanks
 
Last edited:
I think the reason why may be:
If you have an unstable connection between master and slave-radio the value of TR7 would always switch between 0 and the real value in milli seconds.
(I had this case once and the ESC grilled my motor).
Keeping the last received value of TRx does work like a "failesafe = hold".
Because there were many "lost warning" of the master/slave connection OTx also established a hardware check for the jack in version 2.3.12 (or 2.3.11).
In the Dsc socket there is a integrated switch that recognizes whether a plug is inserted.

The following example should work:
Do not check the value of TRx directly.
Instead use a new channel Chx and add 2 mixer lines
first line "mode=add, source = Max, weight = 100 (for example)". --- so the default value of Chx will always be 100%
second line "mode=replace, source = TRx, weight=80" --- if there is a master/slave signal the value of Chx will be in the range -80% to +80%
Then you create your logical switch with the source Chx

This should work (cause OTx checks the existence of master/slave-connection before executing mixer line 2.
 
Come to think of it you do not even need an extra channel to transmit if you only want to check whether there is a signal.
You can take every existing Tr-channel.
For example in my case TR1 is the aileron. (Replace and Weight are important in Line two)

1738258206890.png


so the values for CH24 will be:

-100% if TR1 Signal is not present
anything between -50 % and +50% if TR1 signal is present.

So the logical Switch can be true if CH24 > -90%
 
Alois
I have to share a huge thanks : it does works.

I have created CH10 as you described above using TR1, and a switch a>x CH10 -80 (sorry, I wanted to upload screen picture but I encounter an error each time I tried)

When the 2 radios are connected, the value of CH10 is -50, thus the switch is true.
When I disconnect the cable, it drops to -100, thus the switch is false.

So I am able to detect the disconnect of the cable.

But to be honest, it still kind of mystery to me.

When cable is disconnected and If I understand well, the CH10 is set to -100 as the second line ( := TR1 Weight (+50%)) does not return anything ? How does it works ? Because TR1 still exists and probably still store the last received value before the deconnection of the cable ?

Side question : as OpenTx test the hardware check of the jack in DSC port, being able to announce lost warning message, is this stored somewhere in memory (i.e. Jack In DSC True/False) and can we read this ?

Thanks
Philippe
 
When cable is disconnected and If I understand well, the CH10 is set to -100 as the second line ( := TR1 Weight (+50%)) does not return anything ? How does it works ? Because TR1 still exists and probably still store the last received value before the deconnection of the cable ?
Side question : as OpenTx test the hardware check of the jack in DSC port, being able to announce lost warning message, is this stored somewhere in memory (i.e. Jack In DSC True/False) and can we read this ?

Thanks
Philippe

First Question: The processor has a storage for this field (TR1 for example). There is always a value in there (may be null or the last value coming from the signal line). The devs that made the code did decide to do not change to null when there is a signal lost - I think because this has the disadvantage that at that moment you would get an erratic move in the servos springing to center position. Instead he keeps the last known position (like a receiver faile safe "hold"). Please keep in mind that when using special functions for trainer then the change is directly (TR.. does replace the values of the sticks on system level). Having an unstable signal line could kill your servos and the esc.
Now why does it work with mixers: Very simple I believe - before running the mixer-line the code checks whether the source is really available. I recon when the source is a TR..-signal and the signal line is not present the code ignores the mixer-line.

second question: As much as I know there is no way we can read the status of the jack. It is somewhere in the code not open for us user.

regards Alois
 
Back
Top