SAIC-iSmart-API / saic-python-mqtt-gateway

MIT License
66 stars 20 forks source link

OBC voltage and current #230

Closed shilga closed 4 months ago

shilga commented 4 months ago

The reported voltage and current of the Onboard Charger seems to be only half of the actual value. In my example it reports something like 115V and 7.5 A. The actual values are probably double of that (~230V in the grid in Europe and reaching up to 16A at a 11kW charger)

Is this a general error, or is it just depening on region? Eg the values would be correct in USA/Asia with 110V grid, but in Europe they need a multiplicator?

nanomad commented 4 months ago

Hi,

I had the sensor disabled under diagnostic since it needs more investigation. In particular, how does it behave while charging from three-phase socket?

shilga commented 4 months ago

I can't tell how it looks like with actual 3 phases, as the MG4 SE only has a 1-phase charger. But from what I have seen on my car the values look like to be half of the actual value. It was charging with 3.5kW (shown on the charging station) at roughly 230V. That would be around 15.2A . The sensors showed 115 V and 7.5A.

nanomad commented 4 months ago

@shilga looks like the formula is not straightforward.

For a 3-phase charging session:

I'm starting to think that value is the "phase" load on the inverter but a good formula still escapes me

shilga commented 4 months ago

I assume that was at 230V as also from Europe, right?

The voltage is really strange, but it could be half of the phase-to-phase voltage (400V), But the current could be the sum of all phases but also half. (22.5 / 3 ) * 2 would be 15 A, which would sound correct at a 11kW charger in Europe.

On the second numbers you provided that would be this: (186V*2) * ((22.9A*2)/3) * sqrt(3) = 9.84 kW That comes close to what the CPO is presenting.

nanomad commented 4 months ago

I assume that was at 230V as also from Europe, right?

Correct. Single phase tests were at around 223-225V minus losses . So around 220

nanomad commented 4 months ago

So ... I guess everything makes sense. Internally the OBC is probably using a center tapped transformer to get 2 phases out of the single input phase. In this scenario the textbook formula becomes the one you already found

2 * (Output Voltage) * (Input Current*2)/(# Input phases)) * cos(phase shift)

For a single-phase supply we get: 2 * (Output Voltage) * (Input Current*2)

For a three-phase supply with a standard 120degree phase shift: 2 * (Output Voltage) * (Input Current*2)/3 * sqrt(3)

nanomad commented 4 months ago

Looks like we can sort of deduce the number of charging phases via ccuOnbdChrgrPlugOn, altough more research is needed

nanomad commented 4 months ago

Second round of testing shows that no, we cannot rely on that value. It seems linked to the PP signaling of the capacity of the physical cable itself: image

nanomad commented 4 months ago

Implemented in 0.6.2-rc8

shilga commented 3 months ago

Screenshot 2024-05-27 at 10-00-47 MG4 - Dashboards - Grafana

Wanted to give you a final update as I tested some things using Grafana. I have charged the car in my garage with a charging brick. I have an energy meter in my apartment and in my garage which send periodic values which I all write into a InfluxDB. Same with all the SAIC gateway values which also end up in a InfluxDB. This way the values can now compared. Looking at the graphs I find the values quite reasonable. Thanks for looking into this and providing a solution in that short amount of time.