Friday, 16 January 2026

MG S5 ev: using the API #2

 OK, so I got distracted...

...and I've been using api access to investigate the 12V system battery

but I often drift off-piste on projects like this!

When I bought my first car, 55 years ago, vehicle electrics were [mostly] pretty simple; under the bonnet you only had a lead-acid battery, a coil, a capacitor, and a funny switch which operated every time the crankshaft did a complete rotation.

When you turned off the ignition and pulled out the key, the car was off.

But with modern electric vehicles, the car is never off. Its always busy doing something. Even when you've parked it in the driveway for the night, the car has to keep the anti-theft system running, has to have the key-less entry system ready to let you in, and has to be ready to follow any late-night commands you issue via the iSmart app.

With this in mind, I was intrigued by a post on the MG S5ev forum entitled "Parasitic drain on 12V battery". Here was someone who, in principle, had identified the problem as the 12V battery going flat overnight, and wanted to know what was draining the battery, when the car was off?

This was certainly not an unreasonable post.

So I took a closer look by running my python program overnight, and then plotting the system battery voltage. Under the conditions at the time of the test, the battery voltage was slowly reducing to a point where the system switched on charging, from the traction battery.

This was evident when the voltage suddenly rose from approx 12 Volts to over 14 Volts...


 

I also asked chatGPT to analyse the data and give me feedback. The annotations (from AI) show 4 identified stages;

  • When charging stops, the battery voltage drops quickly from 14V. This region is identified as "surface charge". Think of this as an unstable, unsustainable voltage, not a true indication of the state of charge (SoC) of the battery.
  • Then there is the AGM flat zone. AGM = absorbent glass mat, which is a type of lead-acid battery where the electrolyte is held in a mat, so not sloshing about as per a traditional (flooded) battery. This is the region where you can calculate the true SoC and rate of discharge.
  • From subsequent tests I was able to establish that recharging via the 'big' battery was generally initiated when the system battery dropped to 12V.

However, the charging control system is almost certainly 'adaptive'; e.g. the charge-discharge-recharge cycle was observed taking 5hrs in initial testing, but this behaviour varies depending on other factors, such as when the traction battery was last charged & when the car was last used.

Something else to consider is that this AGM battery always operates with a partial state of charge (PSoC) typically around 70-75%. So its not a good idea to fully charge it via a battery charger. Its relative longevity & best performance may depend on it staying around 50 - 80% PSoC

Going back to what it means to turn off the car, electric vehicles often follow a pattern like this, with maybe 4 sleep states;

  • S0: this may be referred to as: Deep Sleep; long term parked, no recent activity, no app access (after many hours/days of complete inactivity).  Anti-theft active (always). Keyless may need waking by door button press. Low current draw (maybe 10-20mA)
  • S1: Security standby (default standby). Door monitoring & alarm sensing. Low current draw (20-50mA)
  • S2: Connected standby. Triggered by recent car or App access, recent charging. Some TCU, ECU, CAN bus activity. Periodic burst from cellular modem. Still lowish current (50-150mA)
  • S3: semi-awake. Triggered by frequent iSmart/api requests.  TCU, ECU & CAN may be fully awake. Current draw: 200 - 1000mA, maybe in bursts, rather than continuous.

Note: this is not a factual representation of how the S5 operates, just a typical ev model.

So, does any of this help our friend the poster?

Probably not. Whatever the problem that results in a flat 12V battery, it will have to be fixed by the service technician.

At least an understanding of how the system operates shows that the user is not at fault. It doesn't matter if you leave your dash-cam on all night, the car is supposed to take care of the 12V system battery, by charging it from the traction battery.

How did life get so complicated?


No comments:

Post a Comment