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

Post Reply
Ruedli
Posts: 4
Joined: Tue May 19, 2020 6:07 pm
Country: Netherlands
Location: Switzerland

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

Post 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
Last edited by Ruedli on Sun May 24, 2020 6:10 pm, edited 1 time in total.

User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

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

Post by Kilrah »

Distance is for calculating pilot to model distance with a GPS-equipped model.
Ruedli
Posts: 4
Joined: Tue May 19, 2020 6:07 pm
Country: Netherlands
Location: Switzerland

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

Post 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?
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

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

Post by Kilrah »

No.
Might be possible to do something with a GVAR and a timer... otherwise a lua script.
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

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

Post 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

User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

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

Post 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)
Ruedli
Posts: 4
Joined: Tue May 19, 2020 6:07 pm
Country: Netherlands
Location: Switzerland

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

Post 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.
Attachments
Dalm.lua
(5.33 KiB) Downloaded 363 times
flyingernst
Posts: 1
Joined: Fri Jan 29, 2021 7:25 am
Country: -

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

Post 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

Post Reply

Return to “openTx model setup”