Jump to content

A problem with Gamers_Handbook's power grid


Recommended Posts

Since the last update I had some problems with this type of grid:

Brownouts and overloads that lasted for a very brief moment (like 1/10th of a second). Transformers showed (again for a brief moment) the loop warning icon and sometimes the brownout icon.

If you encounter the same problem, it seems I've found a solution. It's described here:

https://imgur.com/a/TUcScNG

and discussed here:

https://www.reddit.com/r/Oxygennotincluded/comments/fg2fpe/possible_power_switches_bug/

I believe this could/shoud have happened even before the last update, but it didn't at least for me.

In short, when you have two power switches and you want them to be alternating, you can't just connect one directly with an automation wire and the other via a NOT gate. At times for a brief moment they'll be out of sync (either both open or both closed).

I think the NOT gate introduces a small delay, you need to make sure that both signals go thru the same number of gates. So I tried an OR gate and it worked. A buffer gate set to 0.1s works as well.

This solves the problem, at least for me.

Link to comment
Share on other sites

4 minutes ago, Saturnus said:

This is the traditional set up that the Gamer's Handbooks' one was supposed to be an improvement on. Though traditionally an AND or OR gate was used as the delay.

I've shown only the consumer side for simplicity. The generator side (where he adds the transformers, which is his original contribution) is exactly the same as far as the switching is configured. I applied the fix on both sides.

The strange thing is that I've been using his design (from his video) before and I never had the problem. It's quite noticable even if only for a split second.

To me, it happens only since the last update. Are you saying you saw this before? Then I've just been lucky so far with my old colonies.

Link to comment
Share on other sites

37 minutes ago, TheMule said:

Are you saying you saw this before?

Well, the behaviour of switch battery goes back and forth with most updates.

I originally suggested adding a delay to compensate for the NOT in this two year old post.

But battery switching goes back even further to before we even had smart batteries. Here's an example I posted in November 2017 (without the OR/AND gate delay) because it was the day automation came out I hadn't had time to play with it enough yet.

5be5e99dd242e_SwitchedBattery.png.07da2f

Link to comment
Share on other sites

2 minutes ago, Saturnus said:

Well, the behaviour of switch battery goes back and forth with most updates.

I originally suggested adding a delay to compensate for the NOT in this two year old post.

I did search a bit but have missed those posts. TY for pointing that out. I've been playing only since release so maybe that's why I've never encountered that behaviour before.

Link to comment
Share on other sites

Supposedly this used to be a problem but at least a year ago they "fixed it" and it hasn't been since then.  If it has come back that sucks.  I haven't played yet since this last update but prior to that the only problem I had with that power grid was that sometimes when you load the game the shutoffs would both get stuck open and you had to jiggle the settings on the battery to fix it.

Link to comment
Share on other sites

I've been using a transformer/smart battery switching system to transfer power across a regular wire and I haven't had any brownout issues.  I have, rarely, had some overloaded wire issues, but only when the switching was slow due to lack of available power on the generator side. 

My main difference from those posted above is that the consumer grid always has a battery that never switches.  I only switch the transformers, isolating a single battery.  Here's the receiving end for a 4kw grid.  I'm powering an aquatuner and a metal refinery using regular wire to transmit the power from my generators.

Spoiler

image.thumb.png.ff87f1429a0f3404bc828f26920042d1.png

image.thumb.png.716c9e217b1dba1bb88dbe0345ab5cfd.png

image.thumb.png.56c65d95eff52cc4a22d747aa422e63f.png

So, when the smart battery drains to whatever point, it turns on the 4kw transformer and turns off the consumer grid transformers.  Power then flows through the 4kw transformer to recharge the battery.  Once its charged, the state of the transformers flip, and power is transferred from the smart battery to the consumer grids.  Because of the battery on the consumer side, the momentary 'blip' where no power transfers never causes a brownout.

However, if there is insufficient power on the generator side to transfer the full 4kw of power, then the battery takes too long to charge and I get an overloaded circuit warning on the small wire going from my generators to the above grid.  This can be solved by simply making the battery flip faster -- with some conditions.

For example, with the current setup, a 90/40 setting on the smart battery works just fine, even when running the aquatuner and the smelter simultaneously for extended periods.  However my generator grid is only capable of producing a maximum of 3600 watts, so when continuously operating both the aquatuner and the smelter, my generator batteries will become depleted and will no longer be capable of transferring 4kw across the small wire to charge the battery.  We must also consider that my base is using power from these generators as well.

A smart battery contains 20kj of power.  At 4kw, this means you can completely charge the smart battery in 5 seconds, as a watt is defined as 1 joule/second.  Since a setting of 90/40 uses 50% of the battery, it takes 2.5 seconds to charge.  If only 2kw of power is available, then at 90/40 it will take 5 seconds to charge, which is long enough for the wire overload to trigger and start to cause damage to the wires.  Yes, 2kw is not sufficient to run both the aquatuner and the smelter, but this problem is temporary and usually I'll have the full 4kw available and things will be fine. We're only looking at the wire burnout problem right now.

If we change the battery to flip at, say, 65/40, we're now using only 25% of the battery's total capacity, and at 2kw it will take 2.5 seconds to recharge, which is short enough to avoid triggering the circuit overload warning or damage the wires.  At a setting of 60/40, the smart battery will only be using 4kj of its capacity, taking only 2 seconds to recharge at 2kw of available power.  However, now we're approaching another problem...

 

Switching time delays power transfer.  If your battery is flipping the transformers too quickly, then the switching time itself begins to matter.  At 2.5 seconds, the flip time of 0.1s or 0.2s is short enough that it doesn't really matter.  However, if you're flipping every second or faster, then it becomes a much bigger deal.

Lets start by looking at the original setup. With the battery set at 90/40, it takes 4kw of power a total of 2.5 seconds to charge the battery back up after the flip.  If we assume that both the aquatuner and the smelter are running simultaneously, then we're using 2400 watts of power.  During the time that the battery is charging, we've used 6kj of power.  We put 10kj of power into the smart battery.  Batteries appear to operate 'in addition to' the stuff that is using power on a circuit, so even though our small transformers are capable of only transferring 1kw each (giving 4kw total to the consumer circuits) the batteries will charge as if that full 4kw is available to them.  This means that our internal batteries will recharge in 1.5 seconds.  During that time, another 3600 joules of power is used by our consumers.  This leaves  a surplus of 400 joules, which isn't enough for another full second of operation.  Total time to 'discharge' the smart battery to the recharge point is roughly 1.5 seconds, giving a total time of 4.0 seconds for both charge and discharge states.  The transition between states is about 0.1s, giving a total time of 4.1s.  Since charging takes 2.5 seconds, a bit more than 60% of the time our battery is charging.  60% of 4kw is 2400 watts.  We're good.

Now lets do the same thing, but with 1 second recharge.  Lets assume that we're able to transfer the full 4kw used above.  If we're recharging the battery in 1 second, then we're using 4kj of power, which is 5% of the total battery capacity.  This means our smart battery must be set to something like 50/45.  During the 1 second that the battery is charging, our consumers used 2400 watts of power.  It will take 0.6 seconds to recharge the consumer batteries.  While it does, another 1440 joules of power is used by the consumers.  A total of 3840 joules of power has been drained from the smart battery, leaving a surplus of 160 joules.  As above, 160 joules isn't enough for another second of operation for the consumers.  Thus the total time to charge and discharge the battery is roughly 1.6 seconds.  State transition is 0.1 seconds, so our total time is 1.7 seconds.  During the 1.7 seconds of operation, 1 second was spent charging.  This is 58% of the time.  58% of 4kw is 2353 watts.  This is 47 watts less than our consumers are using.  The internal batteries will slowly lose charge and eventually you'll hit a tick of brownout.  However, it will take a long time to reach that point.

Lets look at the limit:  0.1s to discharge.  Assuming all other conditions are optimal, then for 1/3rd of the time, power is either charging the battery.  For 1/3rd of the time, the smart battery is discharging.  1/3rd of the time, nothing is happening.  Assuming we have 4kw of total power available, we can only transfer power to the smart battery 1/3rd of the time, giving a maximum rate of 1333 watts.  This is short by 1067 watts, close to half of our total need.

Notice, I'm only counting the time of 1 automation transition.  This is because the OTHER transition has the opposite problem: All transformers are temporarily active:

Spoiler

image.thumb.png.afa7e657bf5f8d0e047922e70dc3a220.png

Since all power coming into the circuits from the generators is going to all the batteries and consumers, the discharge/charge cycle is at this moment, cancelled out, so we can ignore it from our calculations.

 

Link to comment
Share on other sites

7 hours ago, KittenIsAGeek said:

the battery takes too long to charge and I get an overloaded circuit warning on the small wire going from my generators to the above grid. 

Quick question. Say you have 5 of such contraptions attached to your main grid, each having a 4kW transformer. I get that you don't trigger the overload warning if one battery charges fast enough, but what happens the 5 transformers go online at 2s intervals? Is the load going to be 4kW or more for 10s continuosly? Will that burn your wire?

Anyway you post deserves a thread on its own.

Link to comment
Share on other sites

14 hours ago, KittenIsAGeek said:

I have, rarely, had some overloaded wire issues, but only when the switching was slow due to lack of available power on the generator side. 

No, it is because you are overloading the wire.  The idea of the battery switcher is that you have one battery powering the load while the other is being charged from the main line.  The power going into the battery on the main line does not count towards its power limit.  You have a large transformer coupling power into the batteries, which means you are pulling 4kw over a wire that can only handle 1kw.  So you should be seeing the wire go into overload every time that transformer is on.  I suppose most of the time it is only on for a second and so the wires don't take damage, but sometimes it's on longer and so they do.  When you get several such substations then the odds of two of them switching on back to back and keeping the wire overloaded long enough to take damage increases.  You're also using a lot more metal and turning more power into heat with all of those transformers and batters instead of just using two batteries and two switches.

 

Link to comment
Share on other sites

11 hours ago, TheMule said:

Quick question. Say you have 5 of such contraptions attached to your main grid, each having a 4kW transformer. I get that you don't trigger the overload warning if one battery charges fast enough, but what happens the 5 transformers go online at 2s intervals? Is the load going to be 4kW or more for 10s continuosly? Will that burn your wire?

Anyway you post deserves a thread on its own.

I'm not completely certain exactly what you're asking.  I have used 5 4kw transformers to send 20kw over a regular wire without burning it out.  The drawback of the design I posted above doesn't occur at the "transmitting" side.  The "High" side of a transformer counts as a consumer for however much power is being sent out the "low" side.  Thus using transformers in this way WILL trigger overload if the circuit is online for more than about 2.5 seconds. If you want to avoid that particular problem, then use automated power switches and a pair of batteries at your receiving end.  This will prevent the regular wire from ever seeing a consumer, so you'll never trigger overload, regardless of how much power or how long it takes to recharge the batteries.

I use this method because it is quick and simple and it does the trick most of the time, as long as you understand its limits.

 

5 hours ago, psusi said:

No, it is because you are overloading the wire. 

Yes, the wire is overloaded.  But if the time that it is overloaded is under about 2.5 seconds, then the wire won't be damaged and you won't get an overload alert.  Thus when there wasn't sufficient power available to transmit the full 4kw, the wire would take damage because it would take too long to recharge the smart battery.

 

You can develop much more robust methods of transferring power where overload wouldn't be a problem.   Perhaps I'll bring my electric grid post back from the grave and add some more information to it.  I've got a fairly robust design using the new watt sensors instead of smart batteries to control my generators.

Link to comment
Share on other sites

On 3/13/2020 at 1:17 AM, KittenIsAGeek said:

I'm not completely certain exactly what you're asking. [...]  Thus using transformers in this way WILL trigger overload if the circuit is online for more than about 2.5 seconds. [...] Yes, the wire is overloaded.  But if the time that it is overloaded is under about 2.5 seconds, then the wire won't be damaged and you won't get an overload alert

Maybe I don't grasp where those 2.5s come from. My question is: if you attach multiple consumers to your main grid (talking about the consumer side here). I get you can time things so that one transformer drains 4kW  for less than 2.5s. But with multiple consumers, what is preventing them from overlapping and loading the main wire >1kW for longer than 2.5s? 

Link to comment
Share on other sites

1 hour ago, TheMule said:

Maybe I don't grasp where those 2.5s come from. My question is: if you attach multiple consumers to your main grid (talking about the consumer side here). I get you can time things so that one transformer drains 4kW  for less than 2.5s. But with multiple consumers, what is preventing them from overlapping and loading the main wire >1kW for longer than 2.5s? 

Ah!  OK, I get what you're saying.  First, the 2.5 seconds comes from the amount of time between when a wire is first overloaded and you get the alert that your circuit is overloaded.  After that point, your wire can start taking damage.

So.. what prevents that from happening if you have more consumer-side transformers?  Nothing.  This method is good for transferring power to a secondary relay point, but if you have multiple transformers you run the risk of them going active consecutively and keeping the wire overloaded long enough for it to take damage.

You can get around this, however, with a couple of small changes.  First, you'll want to use an automated power switch.  I used a 4kw transformer at the input side of my consumer grid as a means of circuit isolation and to limit the maximum amount of power that could be taken down the line.  This is an alternative way to do the same thing:

image.thumb.png.47878968ca81ee5d245481d45a37dcaa.png

Spoiler

image.thumb.png.b7b8dee46c30b3e487260455e814ed22.png

image.thumb.png.406ebb33112ac652747715b412c8eb5c.png

image.thumb.png.c32adb926589784be632994987bb240e.png

 

In this way, the smart battery is connected to either the high power line (blue) or the small transformer going to a 1kw circuit (white conductive).  The small battery on the consumer side (white regular wire) will prevent the consumer circuit from losing power while the smart battery is recharging.  

The benefit of this method is that the regular wire never sees an actual power load, so it can't burn out.  It only sees batteries that need to charge. 

The drawback is that if your high-side source is a bank of batteries charged with renewables (steam/solar), then your smart battery will not charge without a transformer between the switch and your battery.

Link to comment
Share on other sites

8 minutes ago, KittenIsAGeek said:

 if your high-side source is a bank of batteries charged with renewables (steam/solar), then your smart battery will not charge without a transformer between the switch and your battery.

Also, the transformer doesn't have much energy storage. Meaning when the battery is connected to the main grid, the consumer side most likely gets a brownout. A power switch would do just the same job unless the load is very light.

This is basicly the single battery, two switches configuration. I use that when the load doesn't need constant power. The best example of that is a Transit Tube Access, which has an internal battery.

There's a reason why the two battieries, four switches configuration is the standard one. And it's nothing new as @Saturnus pointed out. If you replace the transformer with a battery, when the first one is recharging (connected to the main grid) the second one is providing power to the load, then they switch role. No load is ever connected to the main grid.

 

Link to comment
Share on other sites

1 minute ago, TheMule said:

Also, the transformer doesn't have much energy storage. Meaning when the battery is connected to the main grid, the consumer side most likely gets a brownout. A power switch would do just the same job unless the load is very light.

This is basicly the single battery, two switches configuration. I use that when the load doesn't need constant power. The best example of that is a Transit Tube Access, which has an internal battery.
 

If you'll notice, there's a battery on my consumer side to solve the brownout issue.  Besides, when the transformer is disabled (and the battery connected) none of the power in the transformer would be going to the consumer grid anyway.

Link to comment
Share on other sites

1 minute ago, KittenIsAGeek said:

If you'll notice, there's a battery on my consumer side to solve the brownout issue.

In that case, it don't see the point of using a grid->battery->transformer->battery->load configuration instead of the standard grid -> battery/battery -> load one.

Link to comment
Share on other sites

4 minutes ago, TheMule said:

In that case, it don't see the point of using a grid->battery->transformer->battery->load configuration instead of the standard grid -> battery/battery -> load one.

Even with a battery/battery -> load setup you will get the occasional brownout.  When the switches change state, there's a 0.1s period of time where either both batteries are connected to your consumers or both batteries are connected to your grid.  If this occurs at the same time your consumers are looking for power, you'll get a brownout.  Which was the entire reason this thread was started -- someone observed that sometimes they were still getting the occasional brownout.  

I'm not saying my method is better.  I'm just saying that to avoid the brownout, you need to have some power that is always connected to the consumers.  This is the small battery in my setup.  Because it is behind a transformer, it will always recharge when power is reconnected.  If I used two switches, then it would eventually discharge -- unless I used the battery/battery setup you're referring to.  In which case we come back to the momentary brownout issue because the second battery isn't always connected to the consumer grid.

 

Link to comment
Share on other sites

10 minutes ago, KittenIsAGeek said:

Even with a battery/battery -> load setup you will get the occasional brownout.  When the switches change state, there's a 0.1s period of time where either both batteries are connected to your consumers or both batteries are connected to your grid.  If this occurs at the same time your consumers are looking for power, you'll get a brownout.  Which was the entire reason this thread was started -- someone observed that sometimes they were still getting the occasional brownout.

Ehm I kinda know that. That someone would be me.

I also found a solution, just add a second port, which brings the delay the same on both paths. Something that was already well known to the community, as Saturnus kindly taught me. Pretty much what this thread is about.

Link to comment
Share on other sites

On 3/14/2020 at 12:06 PM, KittenIsAGeek said:

Even with a battery/battery -> load setup you will get the occasional brownout.  When the switches change state, there's a 0.1s period of time where either both batteries are connected to your consumers or both batteries are connected to your grid.  If this occurs at the same time your consumers are looking for power, you'll get a brownout.  Which was the entire reason this thread was started -- someone observed that sometimes they were still getting the occasional brownout.  

My last world I played for ~1400 cycles and never had a brownout.  AFAIK this is because power is only transferred every 1 second, not every 0.1 seconds, so the power grid does not notice a 0.1 second interruption.  Also @Saturnus is fond of pointing out that you can use an OR gate to balance the delay of the NOT gate to prevent that from happening, but I've never seen it cause a problem.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...