Page 1 of 1

Low power detector w/ combinators instead of inserters

Posted: Wed Apr 13, 2016 8:53 am
by JasonC
Here is a low power detector that uses combinators instead of inserters:

Image

The top combinator should be powered by the accumulators of the system being monitored. The bottom combinator is always powered.

The top one is set to YELLOW * -1 and outputs YELLOW. The bottom one is set to YELLOW + 1 and outputs YELLOW. The connections are what they look like (red wire connects top combinator input, bottom combinator input, and bottom combinator output).

Run a green wire out from the top combinator and a red wire out from the bottom (or a green wire out from both), and the sum of YELLOW on the two circuits will be 1 when the power is OK and >1 when the power is out.

The lamp is not necessary, it is just an example. The lamp here is set to YELLOW > 1 and lights up when the power is out.

You can use a decider to translate that to whatever signal you need.

The idea is that the bottom combinator is a counter, and the top combinator always outputs its negative value as long as it has power. The reason for using a counter is to keep a signal change happening constantly, which requires power. So while there is power the sum of the two outputs will be 1 (it's 1 not 0 because it takes a tick for the value to be computed, but that's not important here). When there is no longer power, the top combinator stops updating, and so the sum of the two outputs becomes a count of the number of ticks since the power went out.

When monitoring accumulators it's pretty clean cut. If monitoring the main system, insufficient power will cause the top accumulator to slow down, so the output sum will reset more and more slowly until it stops resetting.

Re: Low power detector w/ combinators instead of inserters

Posted: Wed Apr 20, 2016 9:09 pm
by Qon
Nice idea, I like it. Didn't know combinators slowed down on low electricity. Thanks.
Edit: Your picture disappeared :o

Re: Low power detector w/ combinators instead of inserters

Posted: Wed Apr 20, 2016 10:12 pm
by JasonC
Qon wrote:Edit: Your picture disappeared :o
Should be fixed. Moved the pic to imgur. Snag.gy has been very unreliable lately.

Re: Low power detector w/ combinators instead of inserters

Posted: Thu Apr 21, 2016 1:22 am
by Qon
The Map
You can upload them to this forum. The "Upload attachment" button is right below area where you type your messages. Or is there a reason you refuse to use something that is as reliable as the forum itself?

Re: Low power detector w/ combinators instead of inserters

Posted: Thu Apr 21, 2016 1:26 am
by JasonC
Qon wrote: You can upload them to this forum. The "Upload attachment" button is right below area where you type your messages. Or is there a reason you refuse to use something that is as reliable as the forum itself?
There's a good reason why I don't do that: 'Cause I'm stupid. I didn't realize that button could be used for inline images. I thought it was only for documents. Thanks!!

Re: Low power detector w/ combinators instead of inserters

Posted: Thu Apr 21, 2016 1:57 am
by Qon
JasonC wrote:
Qon wrote: You can upload them to this forum. The "Upload attachment" button is right below area where you type your messages. Or is there a reason you refuse to use something that is as reliable as the forum itself?
There's a good reason why I don't do that: 'Cause I'm stupid. I didn't realize that button could be used for inline images. I thought it was only for documents. Thanks!!
As good reason as any! Live and learn. ;)

Re: Low power detector w/ combinators instead of inserters

Posted: Fri Apr 29, 2016 12:44 am
by sckuzzle
Hi JasonC,

I found this contraption quite useful and used it in my creation here. Thanks for sharing it!

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 8:36 am
by Guu
and how it affects the performance of the game ? because the combinators constantly sum up their counters . not whether these calculations slow down the game?

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 9:31 am
by Qon
Guu wrote:and how it affects the performance of the game ? because the combinators constantly sum up their counters . not whether these calculations slow down the game?
Sounds like you are worried that this will affect your UPS.

Addition and multiplication are one of the simplest and fastest things you can do on a CPU. Math blocks aren't animated, don't require any physics calculations, interacts mostly with circuit signals, has no complex behaviour or state. Basically everything else requires much more calculations. This design uses 2 math blocks.

It's a design that is beyond tiny and each part uses much less calculations than every other item in the game. If this affects your UPS then you should avoid building inserters, splitters, belts, trains, electric network, assemblers, pipes, miners, robots, radars, roboports, anything that pollutes and so on to avoid getting lower UPS.

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 10:32 am
by Guu
well , I just drew attention to the huge numbers that can arise for a long time

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 10:49 am
by Qon
Guu wrote:well , I just drew attention to the huge numbers that can arise for a long time
If your power is off for a year you will have a count of 1 892 160 000, which requires the exact same computing power as 0.
That year of 2 billion increments can be done in a second on any modern CPU.
For a computer, that number is tiny. Though the combinators might be using 32 bit numbers so you might get overflow if you try to play factorio without power for 2 years. But no one will do that...

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 11:38 am
by Guu
Qon wrote:
Guu wrote:well , I just drew attention to the huge numbers that can arise for a long time
If your power is off for a year you will have a count of 1 892 160 000, which requires the exact same computing power as 0.
That year of 2 billion increments can be done in a second on any modern CPU.
For a computer, that number is tiny. Though the combinators might be using 32 bit numbers so you might get overflow if you try to play factorio without power for 2 years. But no one will do that...


my friend , stop humiliating me your knowledge :shock:

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 2:35 pm
by JasonC
Qon wrote:... you might get overflow if you try to play factorio without power for 2 years. But no one will do that...
Challenge accepted.

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 3:32 pm
by Qon
Guu wrote:my friend , stop humiliating me your knowledge :shock:
The key to learning new things is to feel awe and wonder when presented with knowledge you don't already have. There's no shame in not knowing things if you are willing to learn from you mistakes. We all have to start from the beginning. ;)
JasonC wrote:
Qon wrote:... you might get overflow if you try to play factorio without power for 2 years. But no one will do that...
Challenge accepted.
You should get a mod that lets you speed up the game above 60 UPS. And avoid building things that are not absolutely necessary. GL :)

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 5:25 pm
by JasonC
Qon wrote: You should get a mod that lets you speed up the game above 60 UPS. And avoid building things that are not absolutely necessary. GL :)

Code: Select all

/c game.speed = 100
:D

Re: Low power detector w/ combinators instead of inserters

Posted: Mon May 09, 2016 7:58 pm
by Adil
Yeah game.speed and headless server. Come back to nauvis few centuries after the first contact.

Re: Low power detector w/ combinators instead of inserters

Posted: Mon Jul 31, 2017 1:06 am
by Ahry
This is quite good, but It work only if power supply is less then 50%. So i do not see any advice over accumulator and read signal A.

Re: Low power detector w/ combinators instead of inserters

Posted: Thu Sep 14, 2017 11:51 am
by The Eriksonn
Ahry wrote:This is quite good, but It work only if power supply is less then 50%. So i do not see any advice over accumulator and read signal A.
I belive this thread was created Before accumulator Connections was implemented.