This is my first of many ideas that I've actually posted to the forums so I hope you like!
I've always thought it would be neat to use logic circuits to create a redundant power fail safe to keep your prison running safely in case of an unintended expansion caused blackout preventing the need to frantically remove electrical cables to reduce some of the load on the power station that tripped.
I drew out the logic for my idea and I've got something that seems to work except for the fact that it’s missing one crucial feature - being able to detect when the power is on or off in an electrical cable. Being totally automatic is more or less the idea here so an object is needed that that if powered sends out a 1 and if not powered sends out a 0. To my knowledge, there is no current way to achieve this. In my experimenting, no wired objects seem to effect their output regardless of if they have power or not.
UPDATE: I found out how to make an electrical detector object! It’s as simple as creating a door control and setting all of its time slots to OPEN. When the door control has power it will send out a 1 and if it does not, it will send out a 0.
Version 1 uses 2 redundant stations for every 1 main station. Initially I figured this would be needed because if you’re like me, every single power station built is maxed out with capacitors meaning if you trip the main breaker, the same load that’s differed to the backup would immediately trip the backup. In version 1 this is avoided by having the leads from the main power station separate into 2 primary electrical cables that feed 2 separate locations in the prison. When the backups switch on, the 2 primary electrical cables are separated by a power switch to avoid the 2 backup stations from crossing and tripping each other.
Version 2 is a little more cost effective because you won’t need 2 power stations for every 1. Instead of splitting the load between 2 backups, v2 has a pre-set area that you've chosen to be non-critical in the event of a blackout. This way when the load is diverted to the backup, it’s slightly less than what caused the main station to trip – keeping everything but the non-crucial stuff running while you fix the problem or build more stations.
Version 3 is where it really starts making sense for a large prison. I made this one using 9 main generators and 1 backup. The wiring is laid in a way that allows the backup station to connect to any of the main lines at any time as needed. I figured this was a much more efficient use of the redundancy. With v3 instead of having the load split between 2 or having a non-critical area go dark to reduce the load, I instead limited each of the main stations to 11 capacitors with the backup having all 12. This works to prevent the backup from immediately tripping once switched over assuming you don’t increase the load too substantially all of a sudden.
The layout for v3 works really well and fits neatly in a room 18 meters wide with room for walking in between the generators.
I decided to throw a water pump in here too (as I usually do with a utility room) and connected it to 3 separate power stations using switches giving it triple redundancy. I’d like to come up with a way of switching to #1 if #1 is on, if not then to #2 if it’s on and if not to #3. Any suggestions on the logic for that?
Here’s a video of V3 in action
http://youtu.be/8eBcUldr3go
Here’s a more detailed look at the wiring…
So when the door control loses power, it signals to our circuit to switch to the backup generator. You may think this looks more complicated than necessary, and maybe it is, but I found in my experimenting PA is not always consistent with the speed at which is calculates the logic circuits. Sometimes circuits process very quickly and other times not. Processing takes even longer when you have more circuits. This can be a problem because if both switches are toggled at the same time. Not always, but frequently both switches will be green for a second causing the backup and the main to connect and shut off. To solve this I introduced a delay by connecting our logic circuit to a power switch and then back to another logic circuit. In some instances I used two copies of this delay configuration, in others I only used one. Sometimes it even seems to work fine with no delay but it’s very inconsistent so find out for yourself how yours handles this.
Here’s a more simplified version of this setup that’s easier to see the wiring.
The easiest way to wire up this setup is like so starting from the top going down (or down going up, it’s the same forwards and backwards!):
Logic Bridge + Status Light
Logic Circuit - Not
Logic Bridge + Status Light
Power Switch
Logic Bridge + Status Light
Logic Circuit - Not
Logic Bridge + Status Light
Duplicate this again to the side except for the first logic circuit in the series switch to an =.
Logic Bridge + Status Light
Logic Circuit - =
Logic Bridge + Status Light
Power Switch
Logic Bridge + Status Light
Logic Circuit - Not
Logic Bridge + Status Light
PS I just realized you can place status lights on top of logic bridges (you’d think they would just have a light already like everything else) Note: if you do this it can be annoying wiring to the correct object. Before connecting a wire to a logic bridge in the same square as a status light, mouse over the bridge and make sure the “Logic Bridge” tooltext appears. If the status light tooltext appears, press tab to switch to the next object on the same square.
Also PPS technically you can drop the first logic bridge for the second row because it does the same thing as the one next to it, but I left it in for this example to make it easier to see how the circuit works. If you see how you can save 1 logic bridge by not including this redundant one, go right ahead.
Now connect the Door control to the first logic bridge. Then proceed to wire everything to the thing below it. Keep in mind wires can go either direction so a connection starting with A going to B is different a connection starting with B connecting to A. So connect bridge to circuit to bridge to switch to bridge to circuit to bridge. Do the same for the second row. Once done, the final status light on one should be green and the other should be off. If you switch off the main power station you should see both status lights turn off and then the one that was previously off now turns on. If not repeat try repeating the steps above and make sure your logic circuits are in the correct state. Finally connect the last logic bridge that is green to the power switch that should be in the ON in position 1 (normal operating mode) as shown in the diagram above. Connect the other non-lit logic bridge to the power switch that should be in the OFF in position 1.
That’s all there is to it. The wiring for the logic is the exact same for v2 and v3. Feel free to rearrange any of the elements to fit the rooms space requirements.
Here’s the diagram for v2
The only difference to v1 in this circuit being which switches are turned on and off.
Here’s the diagram for v3
Minimally with no delay you need 5 logic bridges, 4 logic circuits and 1 door control. For the one I made using 2 delays you need 7 Logic Bridges, 4 Logic Circuits, 2 power switches, 1 door control and however many status lights you prefer for every main power station. I find it fits nicely if you place it like this.
Just make sure not to place the power switches on a square adjacent to 2 different power lines because it will cause them to connect!
So that’s what I've got so far, I hope you guys like it. If anyone has any ideas for the logic to decide which power station to power the water pump with, let me know too!
Cheers and happy prison building!








