BAT1_R_INTERNAL related questions

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?

@Timothy can you please take a look this, as I see, you wrote Battery::estimateRemaining function

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:

BAT${i}_R_INTERNAL:
    decimal: 2

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?

2 Likes

I ran into this issue too and I believe you are right, this needs to be fixed to include more decimal places to more accurately represent the internal resistance of a battery. Typical internal resistances of a LiPo battery are 5-20 mOhm (0.005-0.02 Ohm), so this needs higher resolution.

The parameter could also be changed to the units of mOhm instead of Ohm (which is how battery checkers/chargers usually denote internal resistance) so you don’t have to worry about decimals and converting it to Ohms.

In the meantime, I’m using the constant voltage drop parameter BAT1_V_LOAD_DROP instead of the BAT1_R_INTERNAL since you are only able to specify internal resistance in increments of 10 mOhm (0.01 Ohm).

@dagar should a PR be made for this?