Barotrauma – Stabilised Battery Charging Guide

100% charge rate when battery is empty. 0% charge rate when battery is full. Qualification: 1st grade math.

Guide to Stabilised Battery Charging

The Setup

Look at the green wire, this output from the battery carries a value from 0 to 100. Depending how charged the battery is. Carry this output to our Subtractor component input2.

This memory component simply stores a value of 100 (you have to set this value by yourself, consult image, look at where my cursor is). Carry its output to Subtractor component input1.

It is not visible, but subtractor component simply performs following formula: input1 – input2 = output. Send this components output back to our battery to set the batteries carging rate (consult first image).

Lets test with some numbers:

  • If battery is 80% charged -> 100 – 80 = 20 -> Battery charge rate will be 20%.
  • If battery is 6% charged -> 100 – 6 = 94 -> Battery charge rate will be 90% (because charge rate can be set only in 10ths).

Where is this practically useful? It is not apparent immediatelly, but if you consider time in the equation, this helps with stabilising your load as your batteries wont suddenly require 2kW across the entire sub in load, neither will it suddenly stop requiring such load. The load across the sub will be stable as the demand increases or decreases. All that with a very simple solution.

Tip: Create 1 such battery and then copy paste the solution together with components if you plan to add many batteries, the configuration of all components is saved when you copy/paste.

Egor Opleuha
About Egor Opleuha 4436 Articles
Egor Opleuha, also known as Juzzzie, is the Editor-in-Chief of Gameplay Tips. He is a writer with more than 12 years of experience in writing and editing online content. His favorite game was and still is the third part of the legendary Heroes of Might and Magic saga. He prefers to spend all his free time playing retro games and new indie games.

4 Comments

  1. Would prefer if the battery requested 100% charge rate before reaching 10% capacity. You could increase the memory value to 150 but then it would be at 50% draw at 99%.

    More parts and second grade math would then be needed to get the smooth operation this offers. Specificity a memory and multiply to increase the “deficit” value fed to charge rate by 2x.
    105 – Charge% * 2 =ChargeRate
    10% at 100cap and 100% at 55cap

    • Sounds like overengineering where there is no need for it.
      With this simple solution batteries request more power as they get more empty, so once they are 10% full the batteries would request as much load as they can output (500kW).

      Although true, this solution is not for those who want to just keep full reserves of batteries full at all times, this however helps subs with 4+ batteries to have smooth load curve instead of sudden spikes of 2kW.Sounds like overengineering where there is no need for it.
      With this simple solution batteries request more power as they get more empty, so once they are 10% full the batteries would request as much load as they can output (500kW).

      Although true, this solution is not for those who want to just keep full reserves of batteries full at all times, this however helps subs with 4+ batteries to have smooth load curve instead of sudden spikes of 2kW.

  2. the bat charge rate to itself (add clamp 0-100). and turn the mem into a sig with a 0 can let you do 50-100% charge range so u dont kill u bats to get full juice. and turn charge on and off at will

Leave a Reply

Your email address will not be published.


*