Blackline

[1.3.x] Real Battery v1.3.2

Recommended Posts

SyRiNx    0
4 hours ago, Blackline said:

@SyRiNx i updated RealBattery to v1.1.6, now you can set the low and high EC values via cfg. Might need some time for CKAN, but you can get it from Github now.

Thnx, I just tested it and changed the min value to 50% and it works, so for me this is a better value.

CKAN already has the new version, so that was easy :)

Share this post


Link to post
Share on other sites
AeroGav    628

I like the sound of this,  but to get any degree of realism we're at risk of drowning in battery parts unless we make them configurable somehow?  Eg. just have batteries for each size class then provide dialogs to set the type in VAB.

After all, if you add NiCad and NiMH as well as the various non-rechargable types used by nasa and the military (lithium thionyl chloride for very high energy density and long shelf life,  thermal batteries for high power/short duration) we'll end up with a lot of batteries !

BTW I think the way it currently handles charge/discharge rate ( Lead = slow, Lithium = fast ) isn't quite realistic since that has more to do with how the battery is constructed than cell chemistry.  Car batteries are capable of very high discharge rates when cranking an engine, whilst a laptop or phone battery is designed for steady power release.

High rate batteries use a large number of much thinner anode / cathode plates for a high surface area for reactions,   with a thinner layer of active materials on the anode/cathode.  The drawback is that a higher percentage of the battery's mass is made up of the base metal of these anodes and cathodes as well as the associated separator sheets, leaving less for the active materials that store energy.

Temperature/degradation

Lead acid loose capacity when stored at low states of charge.  The longer they are left there, and the deeper the discharge, the more  permanent capacity loss results.

Lithium Ion  loose capacity when stored at high states of charge (over 66%).  The higher the temperature and the closer to full, the worse this gets.  Also, they are damaged by charging them below freezing .     If you avoid these pitfalls however, current lithium ion cells accept an almost unlimited number of charge/discharge cycles.

 

Near future batteries 

Lithium Sulfur - more power to weight than lithium ion,  but have not yet made a commercial impact because degradation with cycling occurs much faster than with  current lithium ion.    A space agency might not care so much about that however..

Silicon Anode Lithium ion - Using silicon instead of carbon anodes gives an immediate boost of 33% to any lithium chemistry, but they also degrade rapidly with cycling.

 

 

 

 

Share this post


Link to post
Share on other sites
Blackline    97

Damn, forum software ate my post..

In short, initially I wanted to make all possible relations between temperature, charge rate, self discharge and whatsoever, but it gets unplayable. The first thing I stumbled upon was warping. Warping at 10000 rate, and the whole electrical simulation goes haywire. It needs to be robust and reliable, no one would use my mod if it only works in real-time. The next thing is the stock temperature model. Just enable the advanced temperature Infos in the cheat menu and watch the core temp at different warp rates -> totally unpredictable behaviour. If you drop from the wrong warp rate back to real-time, you end up with a 100K battery. That's the reason why I ditched low charge rates at low temperatures.

Share this post


Link to post
Share on other sites
Gordon Dry    116

Exactly this.

The "overheating issue" that many people have in stock KSP - and other say they don't have any issues and tell me I have too many mods.
(Indeed, perhaps I have, but OTHER issues are made of mods, part temperature issues are made of KSP itself)

In short: KSP 1.2.2 is a beta.

Share this post


Link to post
Share on other sites
msnbcorp    23
4 hours ago, Blackline said:

Damn, forum software ate my post..

In short, initially I wanted to make all possible relations between temperature, charge rate, self discharge and whatsoever, but it gets unplayable. The first thing I stumbled upon was warping. Warping at 10000 rate, and the whole electrical simulation goes haywire. It needs to be robust and reliable, no one would use my mod if it only works in real-time. The next thing is the stock temperature model. Just enable the advanced temperature Infos in the cheat menu and watch the core temp at different warp rates -> totally unpredictable behaviour. If you drop from the wrong warp rate back to real-time, you end up with a 100K battery. That's the reason why I ditched low charge rates at low temperatures.

I guess it could be possible to solve equations to have exact analytic solutions depending of time. So no problem in warp time :wink:

 

Little question : does your mod fit well with ampyear power management ?

I don' think so, but asking ^^

Share this post


Link to post
Share on other sites
Blackline    97
1 hour ago, msnbcorp said:

I guess it could be possible to solve equations to have exact analytic solutions depending of time. So no problem in warp time :wink:

 

Little question : does your mod fit well with ampyear power management ?

I don' think so, but asking ^^

I agree, there are ways, and there might eventually be time do to all that stuff, but in the short amount of time I currently can spend, I can't handle it (alone). And btw, if EC rates get bigger than EC capacity, no analytical solution will help. Only a proper resource broker will do.

I've never used ampyear, but you are the second one mentioning it in this thread, so I'll consider looking at it.

Share this post


Link to post
Share on other sites
msnbcorp    23
Posted (edited)

It's a managing system for power reserve that are kept from the primary network unless people activate it (but in a little amount). It's to avoid the terrible effect that occurs in warping when, for exemple, you need a little amount to deploy the thing that will get you the power :P .

 

Very usefull to avoid inatention problem to destroy a complete mission.

 

And a very common mod now.

 

For the analitical solutions you are mostly risght, as you can't guess the income and outcome of current (could depend on lightning etc...) it could be difficult to summarize that... 

But, you should not have a problem in warping, as all variable (income and outcome) are scaled, you should be able to just use your non simplified equations without error. (as for the current charge test in stock indeed).

Maybe you should also use Background processing for this too ^^.

 

 

 

 

 

Edited by msnbcorp

Share this post


Link to post
Share on other sites
Blackline    97
35 minutes ago, msnbcorp said:

It's a managing system for power reserve that are kept from the primary network unless people activate it (but in a little amount). It's to avoid the terrible effect that occurs in warping when, for exemple, you need a little amount to deploy the thing that will get you the power :P .

 

Very usefull to avoid inatention problem to destroy a complete mission.

 

And a very common mod now.

 

For the analitical solutions you are mostly risght, as you can't guess the income and outcome of current (could depend on lightning etc...) it could be difficult to summarize that... 

But, you should not have a problem in warping, as all variable (income and outcome) are scaled, you should be able to just use your non simplified equations without error. (as for the current charge test in stock indeed).

Maybe you should also use Background processing for this too ^^.

 

 

 

 

 

They are scaled, yes, but for the following situation, only a dynamically increasing resource buffer would help (like @FreeThinker's KSP-interstellar ext does with it's heat resource):

Parts: an empty, 10EC battery; 100 EC/s Power generator; 100 EC/s consumer (could be a RealBattery).

At real-time, assume a step time of 20ms. So in one timestep, the power generator is first in queue, and commits 2 EC to the battery (100*0.02). Then the consumer part is called (it's onFixedUpdate tbh) and it tries to retrieve 2 EC for doing it's thingy (again, 100*0.02). All is fine.

At warp speed, assuming a timestep of 2s ( imho 100x time warp ), the power generator wants to commit 200EC to the empty EC storage. 190 EC can't be used and are thrown away, because the EC storage can only hold 10 EC. Next, the consuming part tries to retrieve 200 EC, but only gets 10, thus only working on 5% of whatever it is usually doing with the EC.

And that's the problem...

Share this post


Link to post
Share on other sites
msnbcorp    23

And what about a simple solution like scaling the EC ?

Like, the battery capacity is also scaled and here have 1000Ec ? In fact, it is same thing as describing the battery not as EC capacity but as "which capacity by step i can eat assuming other processes eat it". 

 

It could work fine. Of course it's imprecise, and lot of case could be more easy to use in warp that not in warp (charge-discharge non linear phenomenon) ... but don't think it could be notice (we notice what is difficult and kill the mission in warp but not imprecision that make the thing more easy...

 

Share this post


Link to post
Share on other sites
Blackline    97
5 hours ago, msnbcorp said:

And what about a simple solution like scaling the EC ?

Like, the battery capacity is also scaled and here have 1000Ec ? In fact, it is same thing as describing the battery not as EC capacity but as "which capacity by step i can eat assuming other processes eat it". 

 

It could work fine. Of course it's imprecise, and lot of case could be more easy to use in warp that not in warp (charge-discharge non linear phenomenon) ... but don't think it could be notice (we notice what is difficult and kill the mission in warp but not imprecision that make the thing more easy...

 

Yes, thats one possible solution for the missing resource broker. It is easier to do for a custom resource like wasteheat, but such a common used one like EC could bring tons of problems. I think about it, maybe I'll setup a test release :-)

Share this post


Link to post
Share on other sites
msnbcorp    23
19 hours ago, Blackline said:

Yes, thats one possible solution for the missing resource broker. It is easier to do for a custom resource like wasteheat, but such a common used one like EC could bring tons of problems. I think about it, maybe I'll setup a test release :-)

It's just some ideas, no pressure ^^ :P

Share this post


Link to post
Share on other sites
Blackline    97

No worries, but i thought about the dynamic EC storage and came across some problems. assume we went to 1000x warp and now have 1000EC instead of 10EC, if we go back to realtime:

a) do we discard all the excessive EC? This way we would eventually waste resources (think of a LFOx powered generator)

b) do we not exceed 10EC during warp, and limit our 1000EC storage to 10EC every call? Then the whole functionality wont be there...

c) many more issues arise if i think about it.

i dont think there is an easy solution...

Share this post


Link to post
Share on other sites
Nightside    184

Cool idea with the batteries producing heat. I will try this out. Do they also produce heat when charging? I know that when the rechargeable things get hottest. (Now that the weather is getting hot where I live I suddenly notice how hot my laptop charger gets!).

Share this post


Link to post
Share on other sites
Blackline    97
Posted (edited)

Yes they get hot whenever they are charging or discharging.

As for a formula, the heating power is this new configurable * current power^2 / max power.

I play with switched of heating, because of bugs during very fast warp.

Edited by Blackline

Share this post


Link to post
Share on other sites
PyroSA    1

Sadly not live on (my?) CKAN yet.
Should your .netkan in github not be updated to "ksp_version": "1.3"? Or is it submitted separately from the repo?

I quite enjoyed this mod on 1.2.2.

Main pain point were not being able to stop/start the charge/discharge manually. I had to send a lot of science over a very 'expensive' relay link. Battery alone could not handle it, but if the 'real' battery was discharging it was enough to send the last few packets while in sunlight.

Yip, bad planning :wink:

I wasn't expecting a specific experiment to need 800+ in a single burst and had several antennas that combine :P

Share this post


Link to post
Share on other sites
Blackline    97

@PyroSA It should be up2date on the CKAN. You can configure the discharge threshold in the cfg file, see a few posts earlier.

Share this post


Link to post
Share on other sites
Gordon Dry    116

I don't find Real Battery anymore inside the Filter Extensions "Filter by manufacturer" ...

Share this post


Link to post
Share on other sites
Blackline    97
On 24.6.2017 at 4:11 PM, Gordon Dry said:

I don't find Real Battery anymore inside the Filter Extensions "Filter by manufacturer" ...

I don't use filter extensions, but they should appear in the normal electric tab though.

Share this post


Link to post
Share on other sites
Blackline    97
Posted (edited)

Hey everyone, i am currently working on a support package for DynamicBatteryStorage from Nertea. This way you can warp as much as you'd like, without loosing any of that precious charge anymore!

See more at: 

EDIT: Done, the new release 1.3.1 now supports DynamicBatteryStorage, which hopefully will support RealBattery within the next release. Stay tuned!

Edited by Blackline

Share this post


Link to post
Share on other sites
Nertea    5260

Damn you, now I actually need to maintain DBS :p.

I'll review your PR today or tomorrow, hopefully it will go smoothly.

Share this post


Link to post
Share on other sites
Gordon Dry    116
Posted (edited)

Seems that 1.3.1 is the same .zip has the same contents than 1.3 ... :D

Edited by Gordon Dry

Share this post


Link to post
Share on other sites
Blackline    97
10 minutes ago, Gordon Dry said:

Seems that 1.3.1 is the same .zip has the same contents than 1.3 ... :D

Damn me if I did something wrong, sorry... It showed me an updated build date tho. Unfortunately I'll be in Spain this week, so if there is something wrong, you have my blessing to post a link to a fresh compile.

Wait.. I forgot to update the version file! The DLL should be updated though!! 

Share this post


Link to post
Share on other sites
Gordon Dry    116

Neither inside the release .zip or the repo .zip - all files are bitwise compared the same.

Share this post


Link to post
Share on other sites
Blackline    97

Hey, i managed to squeeze an update through the morning wake up process. Have fun!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now