R/C Settings
Overview Search Downloads Submit file Up
Download details
L/D rate calculation script Version:OpenTX 2.0.x
(0 votes)

Script remembers up to 30 last altitude readings and uses the oldest and newest altitude to calculate ascend or descend rate in meters per minute. The result is an output value of the script. The value can also be played at any time.

The script if for OpenTX 2.0.x series. The only change needed for OpenTX 2.1.x is to change the line where the Altitude is read to the name of the actual altitude sensor (which defaults to "Alt").

Put the script in SCRPTS/MIXES directory and use it in CUSTOM SCRIPTS screen on the radio.

Input parameters:

  • Play: plays current rate one time (use with a logical switch that is switched on every 30 seconds for example)
  • Dur: how many altitude samples are stored/used. Use biger number for more smooth/precise but at the same time more slow changing rate.
  • Test: set to 1 to test the script, the input for Altitude is taken from the throttle stick. Set to 0 to use the real Altitude from the sensor

Output:

  • Ascend/descend rate in meters per minute. Positive rate means ascent, negative rate means descent.



Data

Size 2.07 KB
Downloads 2444
Created 2015-11-09
Created by dinamich
Changed at 2015-11-09
Modified by dinamich

View Model Details

Download

Comments   

 
#1 Ricardo Raimondo 2016-01-08 12:31
dinamich, you will have to apologize me, but this is my first try on Lua code and on top of that I only wrote some small C++ code lately, and certainly, I do not quite know anything about the interface between the code and the taranis. With that said, here is my first question: It seems that your Lua is based in a Vario Sensor. I am using a GPS sensor, therefore, I guess I have to change the lines where appears alt to GPS Alt?
What about the term 'pushing alt' in line 65?
Some additional questions I have, are: Do I have to create a MIXES subdirectory under SCRIPTS?. Which is the CUSTOM SCRIPTS screen? Is this screen created by the Lua? Can I run the Lua from companion? How this Lua is initiated, or it starts running as soon as the model is selected?
Thank you for your help and sorry for so many questions.
 

You have no rights to post comments