lua script for performance measurements

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
strgaltdel
Posts: 8
Joined: Thu Jan 05, 2017 6:48 pm
Country: -

lua script for performance measurements

Post by strgaltdel »

Hello,

attached you can find a lua script which i've built for simple ealtime performance measurement purposes by using the openXsensor (including altitude & airspeed sensor).
The script is designed to run with oTx 2.2 (tested on RC8) / Taranis transmitters.

How it works:

Without further configuration this script performes 4 measurement cycles and builts the average of the determined values.
The duration for a specific cycle can be preselected between 10 seconds (min) and 25 seconds (max) by using pod S2. The duration can't be changed during measurement.

A measurement will be initiated by pulling switch „sh“

During record, the script builts the altitude difference between start and end, and permanently calculates the average speed.
So the L/D ratio can be determined when the record is succesfully finished.

During measurement, the maximum deviation from the average speed will be traced.
If the deviation exceeds 3 percent from average speed, the script aborts this cycle and you can restart it by pulling „sh“ again.


Conditions:

- openXsensor, including altitude & airspeed sensor
- openTx 2.2
- Altitude sensor labeled „Alt“, Precision 1
- Airspeed sensor labeled „ASpd“, Precision 1
- actual lua returns mp/h speed values, which are recalculated into km/h


Configuration

There are some variables where you can customize the functionality in order to fulfill your individual requirements:

- sw_record: choose switch to start record / cycle
- Tmin: minimal duration (in seconds) of a record
- Tmax: maximal duration of a record
- setTime: pod where you can select duration between Tmin / Tmax
- max_cyc: maximal number of records for building average values
- Vdelta: max allowed deviation from average speed during measurement (in percent)
-…. telemetry labels (VSpd is obsolet)

have fun & regards
Udo
Attachments
PerfMeas.zip
(138.94 KiB) Downloaded 251 times

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”