edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

feat(telemetry): Modify Sensor Edit screens to show Ratio + Percentage

Open frankiearzu opened this issue 1 year ago • 2 comments

Fixes #4648 Works in main as well as 2.9 branch. Changes are isolated in the display portion of the UI

Summary of changes: Change the Telemetry Sensor Edit to show the equivalent percentage. Works on color and B&W radios.

image image

image image

frankiearzu avatar Feb 16 '24 03:02 frankiearzu

We are past feature freeze (fixes only now), so this will be 2.11

pfeerick avatar Feb 16 '24 04:02 pfeerick

Firmware for Radiomaster TX16S if you want to try it (2.9.4 + this change) tx16s-edgetx-v2.9.4-Tel-Ratio-Percent.bin.zip

frankiearzu avatar Feb 16 '24 04:02 frankiearzu

My take on this would be to hide the ratio value/percentage altogether and instead show the adjusted sensor value as you edit the field.

This is how the battery calibration field works on the hardware page - you don't see the calibration factor, you just see the adjusted battery voltage.

This remove any confusion over the meaning and gives you real time feedback of what the change is doing to the sensor value.

Should probably also change the 'Ratio' label to something more intuitive like 'Calibrated value'.

philmoz avatar Mar 16 '24 20:03 philmoz

I like the idea

3djc avatar Mar 16 '24 21:03 3djc

My take on this would be to hide the ratio value/percentage altogether and instead show the adjusted sensor value as you edit the field.

Edit: Rereading, perhaps I misunderstand. Are you saying still allow entering the ratio in edit, just not display it on the sensor page? If so disregard the rest of this.

Then how would you enter the ratio without the sensor present? If I build a V1 or V2 voltage divider I know what ratio value to enter (it's easily calculated) and for v1 and v2 sensors the values for ratio have been documented in the instructions for years.

I guess I don't understand the current confusion (if it even exists) because it's been the way it is for over a decade and is well documented in many places. Lets not dumb it down too much and break all the existing documentation.

https://www.frsky-rc.com/wp-content/uploads/Downloads/Amanual/FBVS01%20Manual.pdf https://doc.open-tx.org/manual-for-opentx-2-2/software-overview/model_menus/telemetry https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/blob/master/Protocols_Details.md#FLYSKY-AFHDS2A-RX---56

jtaylor2 avatar Mar 16 '24 21:03 jtaylor2

@philmoz, @3djc : this has been discussed in other tickets as well as Discord if you have follow the threads. People are using ratio/offset not only for voltages.

Voltage adjustment: On many protocols/rx (like FrSky) is documented what value to put in the ratio field, and adjust the offset.   In the beginning I only wanted to do percent but a lot of people commented in Discord about the documented ratios, as well if you know the voltage divider circuit, you can calculate the proper ratio. On some instructions, you set the ratio to given value and adjust the offset.

Computing battery consumption (mAh): If you have real-time current(A) only sensor (like in Spektrum ESCs). You create a calculated-consumption sensor using the raw real-time current as a source, but in there there is no way to adjust it up/down to match the actual battery consumption. Your only alternative is to adjust the source real-time current sensor using ratio. On average (for me), the Computed battery mAh used after a flight is higher than actual (could be lower). So the real-time current has to be adjusted down a but using ratio (24.6 or 96% in my case), A percentage makes more sense in this case. Nobody knows that 25.5 is 100%.

General math: Recently someone also use it for angles.. the angle came x10 so he wanted to /10. 10% that is ratio of about 2.5. The Sensor "computed-multiply" only works with two sensors, not constants, so not an option. Changing Precision also did not work since it will internally multiply/divide by 10 to compensate. Using ratio to do 10% and offset did the trick.

There is no single answer.. people are using ratio in very creative ways.. not only for voltage. That’s why I think keeping ratio is important, but having a way to see the equivalent in percentage is very useful too.

frankiearzu avatar Mar 16 '24 22:03 frankiearzu

I could agree for percentages, but not for meaningless numbers just because old documentation exists.

3djc avatar Mar 17 '24 07:03 3djc

The numbers are hardly meaningless. A 4 :1 ratio voltage sensor on a 3.3 Volt ADC input is 4 X 3.3-13.2 for the ratio. I don't find that meaningless. It lets me know the max voltage I can apply to that sensor. I find that a lot more useful than the weight which is meaningless to me, But why not have it both ways? I really don't see any reason to dumb it down.

Edit: And it's not just old documentation. The first link in my comment is to the current Frsky voltage sensor manual and the last is to the current Multimodule documentation.

jtaylor2 avatar Mar 17 '24 10:03 jtaylor2

@philmoz Do the changes I just made make sense?

bw212 currently looks like this (only minimal change - % suffix trails number properly): image

bw128 now ditches the .0 once you hit 1000% and converts ratio to try and fit bigger and bigger numbers... can only do such much though once it gets ridiculously high... image image image

pfeerick avatar May 28 '24 09:05 pfeerick

You could move both numbers a bit to the left when the ratio gets higher (128x64).

philmoz avatar May 28 '24 09:05 philmoz

Thank you for the nice formatting!!

frankiearzu avatar May 28 '24 15:05 frankiearzu

You're welcome! :) Glad you like it ;) And thanks for the suggestion Phil ;)

Just tested this on hardware now, RM Pocket, and the position adjustment for both columns appears to be working perfectly... effectily keeps at least a two digit spacing between the columns at all times, regardless of which one gets longer... and only moves them as necessary. Is good from 0 though the maximum ratio value of 3000.0

pfeerick avatar May 29 '24 03:05 pfeerick