Newcal / opentx

Automatically exported from code.google.com/p/opentx
0 stars 0 forks source link

maximum power reading is 655 watts with Frsky FAS-100 with the FrSky FLVS-01. #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which board are you using?
STOCK WITH 9x Solderless Programmer Board Rev 2.4 and 9x TelemetrEZ.

What is your openTx FW version?
opentx-r2281

What is your openTx EEPROM version?
213.-

What steps will reproduce the problem?
1.Fly a plane that uses more than 655 watts and the power reading will restart 
at 0. 
2.conversation at http://openrcforums.com/forum/viewtopic.php?f=45&t=3467
3.Request from MikeB
to post issue here.

What is the expected output? What do you see instead?
"The power calculation is done using 16 bit values, giving a maximum value of 
655.36 after multiplying the volts and amps together."

Please provide any additional information below.
I just added this on er9x and will have the same problem.
The basic problem is both the voltage and current are values with 1 decimal 
place, e.g. 11.3V 26.6A, but are stored multiplied by 10 (as 113 and 266). 
These are multiplied together, then the result divided by 100. So for these 
values you get 113*266 = 30058. When divided by 100 you have 300.
Possible solutions:
1. Extend the values to 32 bit, then do the calculations, takes a lot more time 
on stock board.
2. Divide both voltage and current by 2, then multiply, then divide by 25.

For (2) it is may be worth rounding up the values before the divide by 2.
So (integer arithmetic):
113 + 1 = 114 266 + 1 = 267
114/2 = 57 267/2 = 133
57 * 133 = 7581
7581 / 25 = 303
Without the +1 on each you get an answer of 298, probably close enough.

This will take you up to 2621 watts

Mike.

Original issue reported on code.google.com by dan...@nb.sympatico.ca on 18 May 2013 at 8:15

GoogleCodeExporter commented 8 years ago

Original comment by bson...@gmail.com on 19 May 2013 at 8:48