Hey guys. I have two question about battery setup for px4. As documentation says:
Set the parameter [BAT1_R_INTERNAL] to the internal resistance of battery 1 (and repeat for other batteries).
but parameter description says:
Explicitly defines the per cell internal resistance for battery 1
So, should it be set per cell or for entire battery?
And one more question, documentations says:
There are LiPo chargers out there which can measure the internal resistance of your battery. A typical value is 5mΩ per cell but this can vary with discharge current rating, age and health of the cells.
But according to param description, it can take only 0.2 Ohm maximum. How can we set it 5 000 000 omh here?
I checked sources and have found this code: cell_voltage += _params.r_internal * current_a;
as far as I understand, this code add voltage loss corresponding the battery load (current). So I took my recent flight logs and checked: on my battery (3s) 25A load causes 0.332V loss per cell. Ok in this case, to get correct cell voltage offset the _params.r_internal should be set to 0.0138. It does’t look like some kind of internal resistance values, but any way, we have only 2 decimals to store:
So in my case closest will be 0.01, and will give 0.25 volt loss per cell and 0.75 for whole battery, but in fact battery voltage loss is 0.996.
Was this parameter added with mistakes, should we create PR to fix this part, or I totally missed something?