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: 25
Joined: Sun Mar 11, 2012 4:59 am
Country: -

How to capture Frsky max altitude during a flight?

Post by spagoziak »

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: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

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

Post by MikeB »

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.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
spagoziak
Posts: 25
Joined: Sun Mar 11, 2012 4:59 am
Country: -

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

Post by spagoziak »

Wow, thanks!

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

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

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

Post by spagoziak »

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: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

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

Post by MikeB »

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.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

123jhe
Posts: 15
Joined: Sat Nov 21, 2020 11:00 am
Country: -

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

Post by 123jhe »

Hi. I tried the method to record and display the max altitude and it works - exept the scaling.

I get meters in the Alt sensor value. But the channel value is 0.2% when the max altitude should be 2 meters. So I probably need the scalers MikeB mentioned. But I don't know how to implement a scaler.

Could anyone explain how to scale the sensor value before putting it in/out the channel?
Thank you!
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

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

Post by MikeB »

I'm not sure why I didn't mention this before. Go to the telemetry screens, move left or right until you get to screen with the 6, cell voltages at the bottom. In the middle of the screen there is a line starting "Alt=", and on the right is a "Max" value. This is the maximum altitude seen since the altitude value was set to zero. If you set the zero altitude, this should also set back to zero.

Is that good enough for you or do you still need to use scalers?

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
123jhe
Posts: 15
Joined: Sat Nov 21, 2020 11:00 am
Country: -

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

Post by 123jhe »

Hi Mike

Thank you. This really helped. I've been trying for max alt since some weeks now. Problem solved :D

But I got another issue with this: The widget 'value' seems to have a bug. When I set color to black, the display shows the value in dark gray instead of black.

This is the Telemetry screen: https://www.dropbox.com/s/17mgj6mr6kxlz ... 1.bmp?dl=0
Image

This is the setting of the Alt value: https://www.dropbox.com/s/w799uak5n9mxl ... 8.bmp?dl=0
Image
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

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

Post by MikeB »

This is an er9x thread, yet you seem to be looking at openTx on a colour screen radio.

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

Post Reply

Return to “er9x”