Page 1 of 1

Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Tue May 19, 2020 6:31 pm
by Ruedli
Hello perhaps a newbe question: I have a Jumper T16 since a week.

I was used to my previous "analog" vario with its own downlink radio that (besides the vario performance and altitude) would also announce every minute how many meters of gain/loss I had for my glider over the "past" minute of trying to fly thermals.

I could find "Alt" and "Vspd" sensor values (ID 224) but no "Rate" (with a configurable interval to calculate over).

I consider the following approach:

- Setup a calculated sensor from the (Alt) telemetry value. A calculated value (called "Rate") of type "distance" in meters.
- Setup a timer, that triggers every minute (for one second).
- Setup a function on the start of that timer edge to playvalue "Rate" and immediately after that do a reset of "Rate" on the falling edge.

Is this a good approach? I got the timer / reset / play out thing working, In the "special function" I see the "Play Value" get bold, hear the sound ("Zero meters" and see the reset turn "Bold" very briefly, shortly after the play out. So far so good: timer, play out and reset are working.

What I am not sure about is :roll: : can I indeed calculate the rate from "Alt" by resetting each time and the "Distance function", and does this leaf the "alt" at its correct value (so no reset of that one).

If this works it is a pretty need trick :lol: , but maybe it can be done more easily?

-- Edit -- I wrote a LUA script to accomplish it. It is attached in the thread below

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Tue May 19, 2020 7:07 pm
by Kilrah
Distance is for calculating pilot to model distance with a GPS-equipped model.

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Tue May 19, 2020 7:13 pm
by Ruedli
@Kilrah: I see: is there a function to calculate the difference between two sampled values from the "Alt" sensor: the current one and one sampled a minute ago?

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Tue May 19, 2020 10:16 pm
by Kilrah
No.
Might be possible to do something with a GVAR and a timer... otherwise a lua script.

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Wed May 20, 2020 4:31 am
by Carbo
Ruedli wrote: Tue May 19, 2020 6:31 pmI consider the following approach:

- Setup a calculated sensor from the (Alt) telemetry value. A calculated value (called "Rate") of type "distance" in meters.
- Setup a timer, that triggers every minute (for one second).
- Setup a function on the start of that timer edge to playvalue "Rate" and immediately after that do a reset of "Rate" on the falling edge.
Try this changes:
- setup a calculated "add"sensor with Alt only and "Autooffset"
- setup a timer, that triggers every minute (for 0.2s in my case)
- setup SF to play the calculated sensor and reset this sensor

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Wed May 20, 2020 4:59 am
by Kilrah
Wow nice find, yep that will work

You can also duplicate the Alt sensor (change instance on existing one, run a discovery again, change back)

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Fri May 22, 2020 7:56 pm
by Ruedli
@Kilrah and @Carbo

what an innocent beginner in OpenTX world can set in motion... ;-)
I tried it as well, but only managed to get it done while losing my "altitude" readout, but I did not try with the "copy" trick.

So: instead of leaving it that way, I decided to bite the apple... and wrote a Lua script. This can be installed as a Mixer script. It adds two methods for calculating this moving average, and you can configure sample time etc.
Dalm.jpg
The script is attached... Worked like a charm in the companion. I strugggled a bit with the "Id'-s, the telemetry ID's are not the same as the "getValue" id-s, and they differ from what is displayed in the telemetry table. I made the "ID" configurable, if you change it, you should remove your old values and (re)discover the new "Dalm".

Cheers Ruud

-- EDIT -- attached Dalm.lua v0.2: Precision of "Dalm" is now set to one decimal: Match this in you setup screen for Dalm.
-- EDIT -- It also works on my real transmitter (Jumper T16). Let me know if it also works on Taranis and other radios.

Re: Using Vario Alt for rate (ascend/descend per minute) announcements

Posted: Fri Jan 29, 2021 7:29 am
by flyingernst
Hi Ruedli and thanks for you work. I would like to tet your script with my tx16s and the tunigy/flysky altitude sensor, which also just gives "ALT" but no vspeed.

How can I detect the TElID (is it called that way?) of my sensor? In the sensor List it has ID1, but you say it would be the same ID.
The costum Script page shows "error" right now, possibly because of the wrong ALT sensor ID.

Thanks and regards,
Michael