Electronics > Projects, Designs, and Technical Stuff

Battery Modeling - What am I Doing Wrong?

<< < (4/4)

Daixiwen:
The first thing that strikes me when looking at the curve is the load current that has some huge peaks from time to time, often corresponding to sudden drops of state of charge. The amplitude of the spikes is much higher than what the battery is supposed to produce from its voltage so there is clearly something wrong there.
Also if I read the graph correctly, the current in the load is actually higher when you turn off Is? That doesn't make a lot of sense either.
I'm still wondering if the big value for C1 doesn't make the simulation completely unstable. Just to check that hypothesis, could you run a simulation with a value of C1 lowered by several orders of magnitude?

SolidBanks:

--- Quote from: Daixiwen on February 01, 2022, 08:19:30 am ---The first thing that strikes me when looking at the curve is the load current that has some huge peaks from time to time, often corresponding to sudden drops of state of charge. The amplitude of the spikes is much higher than what the battery is supposed to produce from its voltage so there is clearly something wrong there.
The amplitude of the spikes represent around a 1.2C discharge of the battery. It is undesirable for sure but my thinking is that it's not wrong.

Also if I read the graph correctly, the current in the load is actually higher when you turn off Is? That doesn't make a lot of sense either.
So this is a good observation and it highlights another failure on my part. I need to clearly communicate the timing of everything that I have right now, or redo the simulation so that it's simpler and try to find the flaws that way.

I'm still wondering if the big value for C1 doesn't make the simulation completely unstable. Just to check that hypothesis, could you run a simulation with a value of C1 lowered by several orders of magnitude?
I'm going to rerun the simulation making it simpler. For now, I'll hold off on making a change to the value of C1 until we can get a look at a graph that represents a single charge and discharge cycle.

--- End quote ---

I'm also wondering if my time stepping might be wrong. I'm using a time step of 1 in my ODEs. I apologize for not making this easier, hopefully the next graph will be more helpful.

Daixiwen:

--- Quote from: SolidBanks on February 02, 2022, 05:45:18 pm ---The amplitude of the spikes represent around a 1.2C discharge of the battery. It is undesirable for sure but my thinking is that it's not wrong.

--- End quote ---
But you are using 0.8 ohms for RL when discharging, aren't you? If you have a look at the spikes at around 3000 minutes, the spikes go up to 36-38A if I'm not mistaken, which means a voltage of 32-34V, higher than the batteries OCV. It gets worse around 4900 minutes.

It is a good idea to try and change the time step. I also wonder if changing both IS and RL at the same time when you switch from charging to discharging (if I understand your document correctly) doesn't cause further unstability.