Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Cell_SOC #39

Closed
DarioSlaifsteinSk opened this issue Jan 5, 2024 · 2 comments · Fixed by #40
Closed

Incorrect Cell_SOC #39

DarioSlaifsteinSk opened this issue Jan 5, 2024 · 2 comments · Fixed by #40

Comments

@DarioSlaifsteinSk
Copy link

Hi!
I´m running some simple simulations with LiiBRA and I couldn´t help to notice that the $SoC$ values I´m getting don´t seem to add up.

I have a power setpoint $P_{BESS}$ I´m running through the cell.
image
Unfortunately the $SOC^+$ I´m getting from Simulate.jl (in blue) doesn´t seem to be ok:

  • The battery is delivering power through out the simulation, but the $SOC$ doesn´t drop.
  • The shape of it doesn´t seem to be an integrator of the input but a mirror of it.

Everything else checks out, for example, the terminal voltage below:
image
* the $v_t^-$ comes from my previous estimate

And when printing the transition matrix of:

using LiiBRA

#---------- Cell Definition -----------------#
Cell = Construct("LG M50")
Cell.RA.Fs = 4.0 # Modify transfer function sampling frequency
Cell.RA.SamplingT = 0.25 # Modify final system sampling period
Cell.Neg.Ds = 2.0e-14 # Modify negative electrode diffusion constant
Cell.Const.T = 298.15 # Modify cell temperature= collect(1.0:-0.1:0) # List of SOC points for model generation
SOC = 1. # Starting SOC

#---------- Generate & Simulate Model -----------------#
A, B, C, D = Realise(Cell, Ŝ);
A[1]
[5×5 Matrix{Float64}:
  0.940359     -3.89234e-16   1.29328e-16  2.85417e-16  0.0
  1.89597e-16   0.993649      7.42181e-17  3.1269e-16   0.0
 -1.78499e-16   1.68973e-16   0.998722     3.43525e-16  0.0
  2.98961e-16   1.67496e-16  -3.68353e-16  0.999933     0.0
  0.0           0.0           0.0          0.0          1.0]

clearly the integrator state is x[:,end] but when checking Simulate.jl the state used is x[:,1]:

cs_neg_avg = Results.x[i+1,1] * csegain_neg + SOC_Neg * Cell.Neg.cs_max

How do you handle pull requests and such? So I can change it and push to the repo.

@BradyPlanden
Copy link
Owner

Thanks for catching this @DarioSlaifsteinSk. I've updated it and confirmed the Cell_SOC is now varying in the correct amplitude. Feel free to open further issues in the future and corresponding PR's – I'll review as I have time.

@DarioSlaifsteinSk
Copy link
Author

Works like a charm!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants