Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(telemetry): Edit Sensors: display the percentage (%) equivalent to ratio when scaling a sensor value #4648

Open
1 task done
frankiearzu opened this issue Feb 16, 2024 · 3 comments · May be fixed by #4649
Open
1 task done
Labels
enhancement ✨ New feature or request

Comments

@frankiearzu
Copy link
Contributor

frankiearzu commented Feb 16, 2024

Is there an existing issue for this feature request?

  • I have searched the existing issues

Is your feature request related to a problem?

Not a bug, just enhancement.

The original ratio was design to correct for ADC Voltages to display the correct voltage.

Some people who knows how to compute a voltage divider knows what number to type if they know the electrical schematics of the RX voltage input.

For a big majority, they really don't know where to start unless is documented in the RX manual (or somewhere else). They just start changing the number until they get the voltage they see in a multimeter.

A "ratio" of 0 (display as "-") mean bypass the scaling logic, so it give the raw value coming from the telemetry screen.
A "ratio" of 25.5 will give you the original sensor value (or 100%).
Could be helpful to display the percentage on the side of the ratio, so if a user needs to scale up, they know to go to a value higher than 100%,

Some people are using "ratio" for sensors who are not voltages. For example, If you have a Current (A) reading, you could compute a new sensor for consumption by adding this current periodically. Then adjust "ratio" +/- until you get a consumption closer to reality at the end of the flight.

Describe the solution you'd like

Display the equivalent percentage on the side of the "ratio" field.

Example:
image

Describe alternatives you've considered

No response

Additional context

No response

@silicongarage
Copy link

silicongarage commented Feb 26, 2024

Hi Frankie,
I haven't followed the Sensor Scaling saga lately since my model usage is working correctly. Seems this whole scaling scheme is getting more and more confusing.

Is there any underlying code issue that would prevent just having a decimal value used to multiply the sensor input?
Maybe a value range of 99.99 to 0.01 (or other reasonable decimal precision range)?
The default scaling could be the legacy 255 ratio system, with maybe a toggle option to enable a straight forward decimal value multiply?

@frankiearzu
Copy link
Contributor Author

@silicongarage The scaling problems are solved by now (crossing my fingers :-).

Internally as you saw the code is all done by the formula new_value = (old_value *ratio) / 255. The original purpose of the code is to adjust Voltages, and there is a formula to compute the ratio depending on RX electronics (resistors used for voltage divider). There are multiple places documenting what value of "ratio" should be used for different brands of RX (multi-module documentation).

So changing to a totally new formula might affect people who use it, as well as is a deep change in both firmware and companion. A good trade off is to show the equivalent in percentage for the non electronic inclined users :-) At least gives you an idea if you are adjusting up or down, and for how much.

@silicongarage
Copy link

silicongarage commented Mar 1, 2024

Just out of curiosity, what file is the ratio formula for calculating a voltage divider value with ratio being used in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants