Joules versus AmpHours

Open
#564 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

  • #687 by @keesverruijt — closed without merging

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
json

Research direction

Read the discussion and linked pull request #687, then review the specification entries for /capacity/nominal, /capacity/actual, /capacity/remaining, and /capacity/dischargeLimit. The issue proposes expressing capacity in Ah or coulombs rather than joules; done means the unit choice is resolved and reflected consistently in those entries.

Written by the indexing model from the issue text.

Description

Hi,

When trying to output the data of my BMS I stumbled over the specs which want to have all capacity related data expressed in Joules rather than AmpHours. Apparently, someone went to great lengths to get everything into SI units, but made a serious mistake.

The problem is: Since an Amp Hour (Ah) is a measure of charge (Coulombs) whereas a Joule is a measure of energy, you can't convert mAh to Joules without knowing the voltage at which the charge was transferred. Similary, you can't convert "Joules remaining" to "Ah's remaining" without knowing the voltage at which the transfer is going to take place.

Battery manufacturers specify their battery capacity in AmpHours (at a give discharge rate). Battery Management Systems track the Amps going in and out of the battery and use it to calculate the State Of Charge. Voltage is entirely out of the equation here and would deeply confuse matters.

Let me clarify why this is creating a problem: Suppose we are discharging a 100Ah battery with 10 Amps. The battery is fully charged and starts at a voltage of 13.7 Volts. During the discharge, after one hour the voltage has dropped to 12.5V. We have used 10 AmpHours. During the next hour, the voltage drops a bit more, to 12.2V. Again we have used 10 AmpHours. Now, if we convert both hours to Joules, we will see a difference between the amount of Joules used during these two hours because the voltages during the discharge were different, yet the amount of AmpHours used is in both situations the same.

It gets even more confusing when we want to indicate how much capacity is left in the battery. It is easy in AmpHours, because we used two hours of 10Ah, so there is 80Ah left. But even if we went through the trouble to track the amount of Joules used (which was dependent on a varying Voltage), we are now stuck with a capacity expressed in Joules which we can not convert back into Ah's without knowing at forehand at which Voltage the transfer is going to take place. You see, voltage varies with temperature so when the temperature of the battery changes, the amount of Joules left changes as well, whereas the amount of Ah's left remains the same.

It is not a small error we are talking about. Battery voltage varies quite a bit, in a working installation it can easily vary between 11.5 V to 14.5 Volts. If we convert Ah's to Joules back and forth we are talking about an error easily exceeding 20%!

Technically, the Ah's is what we want to track. This is the unit specified by the battery manufacturer, and this is the unit users understand. This is also the only unit Battery Management Systems can use to track the State Of Charge. Battery voltage varies between charging and discharging, yet you can expect that when taken out 10Ah's you also need to put 10Ah back into the battery. The voltage (and hence the amount of Joules) is variable, not just due to the charge left in the battery, but also due to temperature, load, internal resistance, but although the voltage varies, it has no effect on the amount of AmpHours. The user wants to know how many amphours are left in the battery, and he doesn't expect this value to change when the temperature of the battery (and hence the voltage and thus Joules) changes.

So, I would propose to use Ah (or Coulomb) as a unit, not Joules, as there is no linear relationship between Ah's and Joules, and in battery terms Ah is the unit we are interested in, and we don't want to see this unit polluted by temperature differences and internal resistance etc.

The keys/paths affected are:
/capacity/nominal
/capacity/actual
/capacity/remaining
/capacity/dischargeLimit

Dominant language
JavaScript
Stars
105
Forks
72
Avg merge
11h 49m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SignalK/specification

All issues in SignalK/specification

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.