Automatic factory line power management.

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Automatic factory line power management.

Post by zOldBulldog »

EDIT: I figured it out, post updated with solution.

Please feel free to contribute better solutions, I am no expert at combinators and speakers and although I am pretty proud of this simple design, I am certain it can be done better.

Goals:
- To always notice when the power drops, before it is too late.
- To buy time to make the fix, minimizing the chance of a cascade collapse of the power grid.
- To be confident enough of the above that I no longer need to build more capacity than I truly need.

Specific Objectives:

1) Alert when power drops beyond certain levels.
2) Shutdown different factory lines as power drops below certain % of capacity. For example lines could sthutdown at: Rocket lines below 80%, Volume Malls 70%, Science 60%, Smelters 50%, Self-contained Basic Supply Mall 20%. Shutting down factory lines by priority buys time to correct the problem.
3) Not be annoying. Specifically, the alert should beep once, display what it is about, show on map, and then go silent.


Solution:

- Power comes in from the big pole. The right radar is only there to provide a power drain for testing when you remove the big pole.
- The factory line gets connected to the pole by the left radar (or even skip the pole and connect straight to the power switch). Make sure that the wire to the power switch is the only power connection between the factory and the power supply.

How it works:
- Accumulator charges and drops depending on power availability. It outputs its % of charge on signal A.
- The power switch reads signal A is enabled when >= the desired charge %. >= 20% in this blueprint.
- The decider combinator on the right outputs B=1 when A < the desired charge %. < 20% in this blueprint.
- The Speaker reads B and rings the alert when it is B. It would be constant ringing until you fix the power problem but...
- The arithmetic combinator on the left takes B, multiplies it by -1, feeding the resulting updated B to the speaker.
- The sum of of the B outputs from both combinators is 0. But the arithmetic combinator wasted a tick doing its part, so for a short time B was 1, allowing the alert to ring exactly once.

Possible improvements:
- When power is restored the alert could ring once. Additional circuitry could prevent it.
- Depending on the cause of the power outage, power could flutter up and down as load is reduced by shutting down factory lines. So we might get repeating alerts. Improved circuitry could prevent it.
powerAlertSwitch.jpg
powerAlertSwitch.jpg (921.89 KiB) Viewed 1336 times
Blueprint:

Code: Select all

0eNq1Vktu2zAQvYpBoJtCCiQ5/kRIF0nWAQp0WRQCJU1sIhQpkJRdw/ABepBerCfpkLJkR5btKEU3tkjOPM68+XC2JOUVlIoJQ+ItYZkUmsTft0SzhaDc7plNCSQmzEBBPCJoYVcpW/jAITOKZX4pOZCdR5jI4SeJw513Vb+Ua1C+XjOTLY9Uo/eoKrlQtChoysHXJdBXUEcQ416IFVOmwp0WpZbwwyPN290Pj4AwzDCoSXCLTSKqIsU74rDVVjSnCsFKqVFaCnsTIkw8siGxH+2sDR3l6AJ3J0CzmwbqZtIHNr5miT93+kGf8u2BhIJyfs0Wf3oeatIf0BOMYO8P/iPfmGRGSZ6ksKQrJpUVypjKKmYSPMtbzRemtEneHcwHUoNrQ206R4FdFSVV1NhLyJ9fv8muFhHoMnO5viWh/VkoAHEcdJaTeLr7geJPVdA9QArXTIH7DmzaPFVhV2b2VqaPvmnrAc2yqqi4M/SEvfFV9mRlymoYU0N4mBzZbtd3Xhsvuwytdz3uzYYlWuScDPuQ5geiFDPLAgyiYGxTJvopaxIOuwHJMQpZfTbtp+8Aesg//YEEBFp3Mw0WJjmkoo+tQ5aAiejMIJ9RdWjMavBBcevEKXLpHFlxBXlXOAzOhPGutSSHjOVY5peYHw9ifo/4b7Rfq/v7D7D9WGOWGzStEiZ5UbJImEAMEr9QruEDjeQS816/4vx9lRYGl5/HM7UW/cdm/Pg2KGEnJl/c8f4eu43lB8rRWAMkK4qTScJ0Uro3pWbdPtbaqKpAAurOivdK03TZMzHp4XzeLQ3vWuUg9ls7S043Kc1ek5XklXUdfWz3Flym2POQZLQWzcZvuU6w8W3KpRSbJonsAagTBpYo6w4adbcjRVLQstmys9o+HM7GIZNafWkBWtOFFfpqX+/R/SgKPo380TMT7JkqM8qZtmmUY9vBBHW48dHA6BFOU+Ct/oNFHX1rZoAVelPX/nwWRfPwLpjhZPQXou2UzQ==
@moderators: This issue is "somewhat solved" and not getting a lot of discussion. It might be a good idea to let it run a couple of days more in case someone can offer a better solution than my admittedly flawed one, then move it to Show Your Creations.
Last edited by zOldBulldog on Thu Aug 23, 2018 7:32 pm, edited 1 time in total.
Koub
Global Moderator
Global Moderator
Posts: 7955
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Automatic factory line power management.

Post by Koub »

I think you just need to store the previous value, and if both current and previous value are beyond the threshold, you don't play the alert (but open the switch nonetheless).
Koub - Please consider English is not my native language.
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Automatic factory line power management.

Post by zOldBulldog »

Solved - at least partially. Posting here just in case anyone subscribed and is waiting for a notification (I don't think that an edit triggers the notification).
Post Reply

Return to “Gameplay Help”