In this tutorial, I want to show you a way to get your Taranis to read out the top speed of your aircraft when you beat your previous best. To do this, you will need to have the telemetry sent down from your receiver and have all sensors detected in the Taranis. This method doesn't need any LUA scripts, but may on occasion read out the same speed twice, due to the limits of the logical switches and special functions.
How it works
To get this to work, we are going to create a Global Variable that tries to track the top speed of the aircraft; I say "tries" as one of the limiting factors is that we can't directly write the speed to the Global Variable, so we need to increment it, which relies on the speed of timers. We will give this a baseline value close to the top speed of the aircraft, so that it has more chance of being accurate. The accuracy isn't an issue for the readout of the speed, as we get this value directly from the telemetry, but could cause the same speed to be read out multiple times, if the increment does not reach the speed in time.
Once we know that the top speed has changed and stayed constant for 2.5 seconds, we read out the actual top speed from the telemetry. In this example, I'll be using GSpd, but if you have a pitot tube fitted you could replace this with ASpd to get the actual airspeed. There is also a Special Function that resets the top speed when the aircraft is armed; however, if you only want new best top speeds read out for all time, just don't add this function.
Step 1 - Creating the Global Variable
Before we create out Global Variable, we need to have a base top speed from which to start. In my example, I'm going to use a Strix Goblin, which is capable of 130MPH+ out of the box, so I will use the value of 125, but you will need to come up with a suitable value for your aircraft based on your experience. Another thing to note, is that in OpenTX Companion the Global Variables are on the Flight Modes page, whereas on the Taranis its self there is a separate page.
Name the variable TSp and give it the initial Value of 125 (your base top speed).
Step 2 - Create the Logical Switches
The first pair of Logical Switches we are going to create are to deal with incrementing the TSp variable when the current speed of the aircraft is higher than the current known top speed.
L01 checks to see if the Ground Speed GSpd is more than the top speed we have recorded in TSp. Because we want TSp to increment until it matches GSpd, we need to add L02 which will will keep getting called every 0.2 seconds all the time L01 is on. It's L02 that we use to increment TSp in the Special Functions.
Now we need to add the Logical Switches that will tell the Taranis to read the top speed out.
L03 is a sanity check, to make sure that TSp is higher than the initial top speed value (125MPH in this example) and that the aircraft is armed (SF↑ in this example). This will stop the baseline top speed being read out ever time the transmitter is switched on. L04 will check to see if the GSpd is less than TSp and has been for 2.5 seconds, and make sure that L03 is on. When L04 is on, the top speed is read out. If the new top speeds are being read out too often, you can increase the Delay in L04 to suit.
Step 3 - Special Functions
The last step is to add 3 Special Functions to take care of everything.
SF1 increments our variable TSp by 1 whenever L02 is active. You can increase this value to increment TSp faster, but you risk missing new top speeds.
SF2 is a resetting mechanism so that will reset the baseline top speed when you disarm the aircraft, so you're ready for the next run. In this example I have it activating when switch SF is in the ↓ position, but you should set this to the physical switch or Logical Switch you use to disarm your aircraft. However, if you only want the top speed to be read out when it's a new best over all flights, just don't add this Special Function, or don't enable it so you have the choice to switch it on at a later date.
SF3 will read out the maximum speed achieved when L04 is active. Note that here we're using telemetry variable GSpd+, which reads out the maximum speed reached, compared to GSpd, which is the current speed.
Setting your baseline top speed
If you don't know what your baseline top speed should be, start low, maybe 50MPH, and have a flight. Remember the top speed that you achieved, then take some speed off for your base. How much you take off would depend on the flying conditions, if it was dead calm, maybe take off 5MPH, but if you had plenty of wind assistance, maybe take off up to 20MPH. Once you have your baseline, you will need to set it in these locations:
Global Variables: TSp - Value
Logical Switches: L03 (in the above example) - V2
Special Functions: SF2 (in the above example) - Parameters
You can always adjust it later if you feel you're getting too many or too few top speed readouts.
Using Airspeed instead of Ground Speed
If you have a pitot tube in your aircraft, and the telemetry is sent to the Taranis; to use Airspeed instead of Ground Speed, just replace all instances of GSpd with ASpd and all instances of GSpd+ with ASpd+.