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

power charging #123

Open
kenan991 opened this issue Jan 12, 2022 · 24 comments · May be fixed by #262
Open

power charging #123

kenan991 opened this issue Jan 12, 2022 · 24 comments · May be fixed by #262

Comments

@kenan991
Copy link

Is there a specific reason why other than in PyBaMM there are only constant current operations are supported? in another word is there any way I can dis/charge power from/to battery?
and is liionpack a suitable library for simulating the behavior of a bigger battery like a power bank?

@TomTranter
Copy link
Contributor

No specific reason other than it hasn't been developed yet. liionpack is still pre-release. If you are interested in adding that functionality we can help and that would be great

@TomTranter
Copy link
Contributor

@cyasing

@TomTranter
Copy link
Contributor

@OlliRuokojoki

@TomTranter
Copy link
Contributor

So I think we'd need to control power at the pack level and then work out the total pack voltage then divide power by this to get current and apply the single step currents as normal

@TomTranter
Copy link
Contributor

Have to allow power control in protocols
https://github.com/pybamm-team/liionpack/blob/develop/liionpack/protocols.py

@TomTranter
Copy link
Contributor

It's used in the solver here

netlist.loc[self.I_map, ("value")] = self.protocol[0]

@TomTranter
Copy link
Contributor

And here

self.netlist.loc[self.I_map, ("value")] = self.protocol[step]

@TomTranter
Copy link
Contributor

Terminal voltage can be used to divide power to set terminal current. This is set here

self.V_terminal[step] = V_node[self.Terminal_Node][0]

I guess using the value from previous time step should work

@cyasing
Copy link

cyasing commented Feb 1, 2023

@cyasing

Thank you.

@cyasing
Copy link

cyasing commented Feb 2, 2023

Terminal voltage can be used to divide power to set terminal current. This is set here

self.V_terminal[step] = V_node[self.Terminal_Node][0]

I guess using the value from previous time step should work

It looks like the terminal voltage is set after solving solve_circuit_vectorized(netlist) in the function _step(), which in itself requires current value I_map to solve:

self.netlist.loc[self.I_map, ("value")] = self.protocol[step]

Power needs to be converted to current before that, doesn't it?

@TomTranter
Copy link
Contributor

Yep you could loop in the initialisation step to get the right current

@OlliRuokojoki
Copy link

@cyasing I could work with you on this issue. Can I find you for example in the pybamm Slack channel so we could chat?

@cyasing
Copy link

cyasing commented Feb 2, 2023

@cyasing I could work with you on this issue. Can I find you for example in the pybamm Slack channel so we could chat?

@OlliRuokojoki I don't have a slack account yet. I'll ask for an invitation.

@TomTranter
Copy link
Contributor

@cyasing
Copy link

cyasing commented Feb 2, 2023

@TomTranter
Copy link
Contributor

Did you get something working for this? I ask because the script you use on the other issue uses power

@cyasing
Copy link

cyasing commented Feb 14, 2023

Did you get something working for this? I ask because the script you use on the other issue uses power

I have added some code to convert power to current in the way you described, but getting that to test requires me to figure out the problem with the shifting solver, or at least the reason behind the capacity warning coming up in it. It's in a loop.

@TomTranter
Copy link
Contributor

Is everything you are working on in a branch somewhere I can take a look at?

@cyasing
Copy link

cyasing commented Feb 14, 2023

I had forked the repository, actually. It is here: https://github.com/cyasing/liionpack-power-trial.git . Do tell me if forking like this is not something I should do.

@OlliRuokojoki
Copy link

Hi,
Is anyone still working on this? I'd really need this feature.

@TomTranter TomTranter linked a pull request Jun 7, 2023 that will close this issue
@TomTranter
Copy link
Contributor

Hey @OlliRuokojoki - I made some changes to the vectorized circuit solve which iterates until a certain power is within tolerance. I haven't updated any solvers to accommodate this change yet but there is an example of how you would call this function. Do you think you can handle doing the rest? I don't have much time to work on this right now

@TomTranter
Copy link
Contributor

FYI - there is a PyBaMM change to experiments coming in to the next release imminently so might make sense to wait for that pybamm-team/PyBaMM#2960

@OlliRuokojoki
Copy link

Hi @TomTranter,
I have now simplified my large battery pack to just a single large battery cell as basic PyBaMM works much better. I may just keep working on my simulation with the single cell to make the process a lot easier.

By the way does Liionpack support drive cycles? If I used drive cycles and current data I could get the results I'm looking for. At some lower and upper voltages I could stop the drive cycle, write new current data based on the new terminal voltage and then continue the drive cycle at the point it was interrupted by my voltage check. Do you think this approach is feasible with Liionpack?

Thanks for the help!

@TomTranter
Copy link
Contributor

It does support drive cycles but stopping and re-starting simulations with old solution is not totally straight forward. Our plan is to merge liionpack into PyBaMM so the solvers and experiments will all work exactly the same in future. It's just quite a big job and other things have taken priority right now. If you can get the single PyBaMM model working for your needs I would stick with that

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.

4 participants