rdancer / Color_LCD

0 stars 0 forks source link

Voltage readout in the SOC header and the main screen field vary wildly #10

Open rdancer opened 3 years ago

rdancer commented 3 years ago

When motor is running, the battery voltage readout in the field in the main body of the display goes down, as one would expect. However, the readout next to the battery graphlet in the header of the display goes up(!). Two wildly different (by several volts) readouts, both of which are moving up and down. Disaster.

rdancer commented 3 years ago

To reproduce, need to set the display to voltage in settings

rdancer commented 3 years ago

https://user-images.githubusercontent.com/51028/122908440-05032700-d34c-11eb-8be1-3434874b5e0a.MOV

rdancer commented 3 years ago

The problem is that we are too clever by half: we are adjusting the raw voltage by battery's internal resistance, but the adjustment calculation gives a wrong result:

https://github.com/rdancer/Color_LCD/blob/f22fe053c1932a49dfabae52532464f0d0e400ac/firmware/common/src/state.c#L399-L407

Seems like incorrect battery resistance value.