How to capture Frsky max altitude during a flight?

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
Post Reply
spagoziak
Posts: 23
Joined: Sun Mar 11, 2012 4:59 am
Country: -

How to capture Frsky max altitude during a flight?

Post by spagoziak » Sat Jul 08, 2017 3:50 am

Hi folks!

I'm getting into discus launched gliders and I've acquired a Frsky variometer for use in reporting my height and vertical airspeed. The telemetry works great--I have the current values displayed perfectly.

My puzzle is trying to figure out how to get er9x to record the highest altitude value observed until cleared. I've read the manual and it seems that the 'Latch' logical switch mode is the right choice. I noticed that the custom telemetry display will show global variables... and I can assign a global variable to accept the values of a pair of logical switches. Seems like I"m nearly there, but the GV field in the custom display screen remains 0. I suspect I don't quite understand how latch switches look.

Here's the logical switch pair that i hacked together...

The thought is that the latch logical switch will be triggered any time altitude is greater than 600 feet. I live at 900 feet, so it should always be on.
Logical switch 2 is a latch that sets its point when L1 is triggered, and clears when the throttle momentary switch is flicked (which right when I launch it). None of this happens, of course. How close am I?

Code: Select all

LSw   Funct     V1      V2
L1    v>val     Alt     600(feet)
L2    Latch     L1      THR

User avatar
MikeB
9x Developer
Posts: 14359
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: How to capture Frsky max altitude during a flight?

Post by MikeB » Mon Jul 10, 2017 9:53 pm

A bit of a fiddle, but here is one method you may use. It uses a "high" channel to "store" the max altitude. Channels actually take on values between -1024 and +1024 (unless you enable extended limits).
So, first use a Scaler (SC1)to convert the Altitude value to be in the range -1024 to +1024. Note the altitude may well be stored in metres with a resolution of 0.1m, so 400 feet is likely to be 1219 representing 121.9m.
Now set up a logical switch:
L1: v1>v2 SC1 CH16
Now set up some mixes on channel 16:
CH16: +100% CH16
R +100% SC1 switch(L1)
R -100% HALF switch(RUD)
Finally you need another Scaler to convert channel 16 back to altitude (metres or feet).

The first mixer line makes channel 16 hold its value.
The second line (a replace multiplex), changes channel 16 to the value from Scaler SC1 if SC1 is larger (controlled by switch L1).
The third line (also a replace multiplex), uses a physical switch (RUD in this case) to "reset" channel 16 back to minimum for the next flight.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

spagoziak
Posts: 23
Joined: Sun Mar 11, 2012 4:59 am
Country: -

Re: How to capture Frsky max altitude during a flight?

Post by spagoziak » Wed Jul 12, 2017 7:22 pm

Wow, thanks!

I'll start fussing with this tonight. Much appreciated, this is pretty tricky stuff.

spag

spagoziak
Posts: 23
Joined: Sun Mar 11, 2012 4:59 am
Country: -

Re: How to capture Frsky max altitude during a flight?

Post by spagoziak » Sat Jul 15, 2017 10:18 pm

Mike,

I gave this a go, but could not get the alt to stick--it only reports alongside the Alt value in the custom display field (in the telemetry window).

Piping the values through the scalar worked just fine--it seems like L1 isn't being triggered. The value for CH16 on its own at +100% would be 1500, right? Maybe if I lower CH16's threshold value so L1 can trigger....

User avatar
MikeB
9x Developer
Posts: 14359
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: How to capture Frsky max altitude during a flight?

Post by MikeB » Sat Jul 15, 2017 10:36 pm

I tested the logic by using the Thr stick as the source for the first scaler:
SC1 Source Thr
and set the second scaler to show CH16:
SC2 Source CH16
I displayed SC1 and SC2 on a custom telemetry screen.
As I advance the throttle, both folow it, but if I then reduce the throttle, while SC1 follows the Thr back down, SC2 remains at the max value.
With the Thr stick right down, toggling the RUD switch on and off, resets SC2 (so CH16) back to -1024.

Make sure you have both the second and third mixes set as REPLACE mixes.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “er9x”

Who is online

Users browsing this forum: No registered users and 5 guests