FrSkyRC / ETHOS-Feedback-Community

Feedback & suggestions are welcomed here for ETHOS by FrSky
192 stars 86 forks source link

Still an issue with Calculated Sensor #4730

Open PeterGraz opened 2 weeks ago

PeterGraz commented 2 weeks ago

Dear Bertrand, on October 2, in response to my reference to errors in the calculation with Calculated Sensors (#4585), you convinced me by means of the following examples that the calculations are now correct (your screenshots).

372784977-7af08bde-b04e-4c01-84f0-7eee887d107e 372785273-a385cd6c-799c-4d80-a72e-fe68fef30373 373005790-fa333e10-ff7b-43dc-8a47-4cee667cef5b

These particular examples are still calculated correctly today (1.5.18). However, if you adjust the decimals (e.g. to 1 or 3) for the telemetry value used in your examples (Tension RX), the result changes by a factor of a power of ten and is then incorrect. Your examples are therefore only correct (by chance) for two decimal places. Furthermore, in your 2nd example, if you change Tension RX from 2 to 1 decimal place, the constant 0.02 is changed to 0.2! Regards, Peter

bsongis-frsky commented 1 week ago

It's time to use float there internally for all calculations, and store the result as needed.

PeterGraz commented 1 week ago

Very good decision!