Barotrauma

Barotrauma

Not enough ratings
Adaptive Overload Buffer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
158.183 KB
19 Jul, 2022 @ 10:59am
4 Jun, 2023 @ 4:01am
12 Change Notes ( view )

Subscribe to download
Adaptive Overload Buffer

In 1 collection by uberdrück
Elektrotrauma
15 items
Description
A robust active overload protection system meant to deal with power spikes reliably, while minimizing disruptions to the power grid. It uses capacitors to create temporary protective loads. The basic examples use dedicated capacitors, but it can be modified to supply weapons as well (example included).

The file containes working examples for several reactor types, an example setup to handle reactor upgrades, and ideas for further modifications.

There are other systems that accomplish the same goal; battery buffers separating the reactor from the grid are a common method. Keeping the roles of backup power and overload protection cleanly separated is the main advantage of this system: reactor and battery power can be used in parallel. However, it is also quite complex and uses more components than other methods.

It can be configured in a way that makes the sub practically immune from overload damage (which can be kinda boring). However, its performance can be limited intentionally, to reduce overload damage rather than prevent it fully (so that catastrophic !!!FUN!!! is not completely ruled out).

More infos in the file itself.

Examples of community subs that use this system:
Winterhauler by Koffer
KingFisher Mk3 by SNSDestiny
D.B.E Buchanan By Flightless Lobster
Apotheosis by me

Using the DIY Controller by Ignis (though any other "smooth" controller should work as well)



Basic Explanation:
(Graphs are just sketches and not to scale)
I. Unmitigated Disaster
Fig. 1: Unprotected Reactor

An overload will cause damage if the power output of the reactor is at least twice as big as the power consumption of all connected components (load): P >= 2L
Let's look at the most severe case: The load drops from 100% of reactor output to almost nothing. The reactor will lower its output far too slowly, and the junction boxes will be damaged and might start fires. Even when using a custom reactor controller (generally much faster than built-in control), damage can't be avoided. The speed at which the reactor output can be lowered is inherently limited.

II. Solution: A Temporary Buffer Load
Fig. 2: Preventing Damage

Activating an alternative load brings the power under the damage threshold again. This buffer load can be created by any device that consumes power, but let's assume we use capacitors or batteries for this purpose. If the buffer load is at least 50% of max. reactor output, the grid will be completely safe from overload damage: The condition P < 2L (Where L is the complete load including the buffer) is always fulfilled.
A concrete example: A 4000kW reactor would need two capacitors to create such a buffer load (max charge speed 1000kw each), but it would need four batteries (500kW) - the main reason why capacitors are used here.

There's a problem: The reactor will always aim for the total load it "sees": The load of the buffer AND the rest of the submarine. A temporary load should be shut off eventually - but shutting down the buffer could create another overload situation. This method isn't a practical solution yet.

III. Using a Modified Load Signal
Fig. 3: Hiding the buffer load from the reactor

The solution is to use a reactor controller that receives a modified value for L. This is done by subtracting the buffer load from the rest of L. The resulting value is labeled the "adjusted" load, and represents the power consumption of the rest of the submarine:
L_adjusted = L_total - L_buffer
As long as the buffer isn't active, LA is identical to L. Once it is activated, the reactor will lower its output to the adjusted load value, and ignore the buffer load. Eventually, the buffer can be turned off safely.

The file contains an example of this method. Although it can be used for overload protection as it is, problems remain:
The buffer always greedily consumes a big chunk of the reactor power, leaving very little for other devices like steering and lights when it is active, causing them to shut down. Also, a lot of power is wasted, since the energy that enters the buffer is lost for other purposes.

IV. Adaptive Buffer Load
Fig. 3: Ideal behavior of the buffer load (only adjusted load shown for clarity)

Instead of using a constant buffer load of 50% maxP, it would be better to make it variable. It only needs to be as big as 50% of the current reactor output - just enough so that 2L remains larger than P. This minimizes the amount of power loss for the rest of the sub. Adapting the load can be done by changing the charge speed of batteries or capacitors - however, it can only be set to multiples of 10%. The resulting load curve will look differently:

V. Load Curve for Capacitors
Actual behavior of the buffer (Adj. load not shown for clarity)

Capacitors add another complication: Their charge speed is dependent on the square of the control input. A few math components are needed to calculate it.
This stair-like load curve is not ideal, but it leaves enough power for the rest of the sub - some instances of power loss can occur, but they will be brief and not cause too much trouble.

VI. Power Dissipation

So far, the buffer was treated as if it had an unlimited capacity to store excess power. But the capacitors must be drained of stored energy; the buffer won't work when it's full. Lamps with a custom power consumption are used here (any other item that consumes power would work as well):

Using a very high value (like 1000kW) will give the system basically unlimited capacity, since power exits the capacitor faster than it can enter. Lower values (around 20-50kW) will give the buffer a cooldown period that players will have to take into account, and might not leave enough capacity to absorb overloads that are too extreme. There's no 100% correct value; it depends on your sub design and on how powerful you want the system to be in practice. The same applies to the number of capacitors: Using fewer than 2 per 1000kW reactor power is possible and can be enough for most situations (since extreme overloads like the one described above should be very rare on a normal sub).
15 Comments
uberdrück  [author] 26 May, 2023 @ 2:46am 
Cheers!
JagdPanzer IV 25 May, 2023 @ 6:27am 
Right, thanks for the replies mate. Have a good one.
uberdrück  [author] 25 May, 2023 @ 6:23am 
That would probably work. You could raise the charging speed to use fewer batteries, and then connect the output to other devices. Haven't tried that myself though, since my goal to use only unmodified components where possible.
JagdPanzer IV 25 May, 2023 @ 6:14am 
what if you replace the capacitors with batteries using custom values?
uberdrück  [author] 24 May, 2023 @ 3:11pm 
@El Chupacabras
Theoretically yes, but the energy stored in the capacitors is very small (capacitors waste 90% of the power that goes in), too little to be of much use elsewhere. Also, I wouldn't recommend connecting the output of the capacitors to the rest of the power grid (except directly to the weapons), it could lead to some weird behavior.
If you want to use the stored excess energy, it would be much better to use a different system with batteries (something like: reator power -> many parallel batteries -> power grid), and not a capacitor buffer like this one.
JagdPanzer IV 24 May, 2023 @ 2:24pm 
would it be possible , instead of just burning off the energy stored in the buffer with lights, you somehow route it to power the sub directly in place of the reactor?
Colin McRave 20 Apr, 2023 @ 3:24am 
Great mod collection, I'm probably going to use half of it on my sub :chug:
uberdrück  [author] 23 Jul, 2022 @ 4:09pm 
Yeah, I can see why that's annoying. But to be fair, powering down a nuclear reactor should take a while, even if it's just a game with magic repair beams and stuff.
Dance with the dead 23 Jul, 2022 @ 3:22pm 
Baro devs be like: no, you must suffer, so we nerfed that :captainclown:
uberdrück  [author] 23 Jul, 2022 @ 2:07pm 
@Dance with the dead
I kinda figured the controllers I used here worked much better in the past (I only really started building stuff after that update).