iltis42/XCVario

s2f switch in two seater setup

Closed this issue · 11 comments

hjr commented

The s2f switching setup for a two seater use case offer a lot of options. One basic principle is, that the vario's s2f switch status attribute offers a bidirectional synchronization, as well as being propagated and influenced by other smart devices connected by NMEA (using the CAI !g extensions).
Now setup's are imaginable where the two varios (pilots) disagree on the favored s2f mode. Fine, that should be possible.
We ran into the situation that with such a setup the s2f mode started to toggle ca once a second on both varios. It is reproducible on the ground as well as in flight.

Steps to reproduce the behavior:

  1. CAN master vario s2f setup to connected switch
  2. CAN slave vario s2f setup "auto speed"
  3. glider on the ground
  4. s2f switch cruise

Principle the expectation is that the master, front vario follows the switch position, the rear follows the setup auto speed to switch s2f mode.

What happens is:
https://user-images.githubusercontent.com/415029/162902984-77d015b5-c0b2-48a5-a71e-5aa99345611f.mp4

xcv firmware rev.: 22.0410

Proposed solution: Only allow the s2f mode change from a secondary vario, when "external" is chosen as input for the s2f mode change.

Guess the proposed solution intends that secondary vario must not sent s2f mode changes to the external world, except in "External" mode.
Meanwhile the above observation from the video is just misconfiguration as mode 'External' is to be selected for the second seat what fixes of course the issue, in general the idea is great, hence in my opinion not thought to the end, the idea would introduce several issues i want to explain hereafter and i have not any idea how those things could be solved:

  1. One use case of course then we loose then, is once someone has chosen the secondary vario as s2f master, means the front vario in "External" mode, what is supported today as well. This is useful if the existing s2f cables were connected to some gadget near the rear seat before and so near to the rear vario, this request was already there at least once.
  2. The next problem comes with the sound, the existing concept entertains one s2f mode for one plane, and as the sound system usually gets used from rear vario (good to hear for both seats as in the middle), the front vario would loose the control over the sound as the mode now might be a different one selected from the second seat, and pilot in front may not have any idea what is the sound mode about, s2f or variometer (?), and also enabling two different sounds would remind on a ghost train, is not the solution either.
  3. The second navi today is allowed to be connected as well to the front vario WiFi access point (from whatever reason, pilots choice), in that case the s2f mode set on the rear seat won't be propagated anymore from second vario to the second navi.
  4. One plane one mode: I put into question the use case at all, not fine either bad. This should not be possible.

Thank Helmut for rising the issue:
@iltis42´s answer 2. Sound;
Exactly, with the Janus´s configuration we had, the 2 different sounds i heard in the front seat were extremly confusing in flight, indeed.

Agree, hence there is a solution: Just allow Audio on exactly one device and configure Audio to silent by "Max Volume" setting to zero on the other device:
http://xcvario.de/handbuch#__RefHeading___Toc10069_1194972902
I admit, this is gap in the description, will add this for next release, thanks for reporting.

My proposal for a double seater:
Install an additional speaker in the rear panel and wire it to the front vario.
In the rear vario set MaxVolume to zero.
For single pilot operation, the front pilot will be able to control vario´s volume and there will be no need to switch on the rear vario.
Agree?

Sure, this is the Mercedes. If someone wants to spent the effort to pull another wire to the back seat and buy a further speaker, no problem. This configuration can be seen as the green solution saving ~1.0 Watt as the second vario remains powered off, you can't also forget to power on the second one (otherwise you stay without sound unless enabling max volume again), and also the sound is not only louder, also sounds better with a larger speaker.
Note that volume control is shared, so no matter where you adjust volume, both amplifiers will follow, except one max volume is set to zero, this argument is not applicable for this configuration, hence the above advantages are of course attractive.

hjr commented

Guess the proposed solution intends that secondary vario must not sent s2f mode changes to the external world, except in "External" mode. Meanwhile the above observation from the video is just misconfiguration as mode 'External' is to be selected for the second seat what fixes of course the issue, in general the idea is great, hence in my opinion not thought to the end, the idea would introduce several issues i want to explain hereafter and i have not any idea how those things could be solved:

I guess it is just the other way around. The s2f mode denotes selects input trigger to that soft switch. So the master varion in this scenario set to something not "external" must not follow the external trigger. And that's what the current implementation does.

So of course this was a misconfiguration which revealed an undesired system behavior. Please let this open and lets fix it. (You are fast with closing issues, no need for this).

And yes, assuming the switch does only affect audio .. there is only one cockpit audio, hence only one s2f mode in a two seater. Another consideration ot change the xcv configuration for a "slave" configured instance. There should be no auto speed selectable for s2f mode.

Regarding:

So the master varion in this scenario set to something not "external" must not follow the external trigger.
That's in fact true, sure we can add this filter. By that flapping is avoided even the second vario is in "s2f" standalone mode. Hence this just fixes flapping, everything said above remains still true, and second vario still needs to put to "External", otherwise won't follow the master vario s2f mode with all the drawbacks mentioned still in place.
By that, independent mode is possible then, and point 1) we don't loose, great.
Points 2) and 3) i see not possible to addressed except ensure by configuration of audio: One cockpit -> one sound.

The following changeset should cover this, @hjr please crosscheck, IMHO this is the optimal solution, and honestly i guess it was just a bug using directly the synced cruise_mode.get() instead reading the value from the Switch class that already handled this with mode (External), dependency:
846e579

hjr commented

The change description sounds reasonable and suites to the issue. Would have expected to find a line of code like :
if ( s2f switch set to external ) { digest the external input }
but did not find one.
Maybe I did not look thoroughly enough .. thx!

It was already there:

https://github.com/iltis42/XCVario/blob/master/main/Switch.cpp#L47

bool Switch::cruiseMode() {
if( s2f_switch_mode.get() == AM_EXTERNAL ){
// just take from master and ignore setting
_cruise_mode_xcv = cruise_mode.get(); // updated from master