First time Circuit

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Flame1869
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Oct 24, 2017 6:21 pm
Contact:

First time Circuit

Post by Flame1869 »

Ok its the first time im working with circuits, but i cant fully get what i want yet, so i need a bit of help/advice here.

The case:
I have a patch of solar panels attached to a bunch of accumuilators.
What i want to do, is when the accumiltors get below 10%, my backup of steampower should kick in, but continue until the accumilators are back at minimum 90% and then the steam will shut down again.
once the accumulators get below 10% again, the backup will kick in and so on..

So what have i done so far (see screenshot)
On 1 accumulator i have connected 2 deciders, and the accumilator will output its percentage loaded power in %
One decider is set to output L=1 when A<10.
the other is set to output H=1 when A<90.
//<something is missing here, read on>
These 2 deciders are connected to a third that says: if L > H (so power is below 20%) then output S = 1.
last is the power switch that looks at S, and checks if S = 1 -> turn on.

So what happens now, is when the power gets below 20%, the steam kicks in, but at 21% stops, but kicks in at 20% again and so on and so forth, ending up in a stroboscope effect.
I am differently missing a part here, but im unsure how i should do this :/

I was thinking of some way that i sent a S=1 to turn it on, but then i need some "while A<90" statement to keep it on.
Attachments
accumi.PNG
accumi.PNG (1.3 MiB) Viewed 1946 times
The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Re: First time Circuit

Post by The Eriksonn »

the while statement you are talking about is what you are supposed to use the last combinator for

if the 2 first ones outputs 1 black and -1 black and the last one outputs 1 black if black > 0 it will work.

Becauce if the Power is below 20% the black comes on and constantly triggers itself, and when Power is above 70% it adds negative = subtracts away the black and it stops:
Blueprint
the constant is to make it easier to change values and an easy way of getting the -1 black output without needing a math combinator to flip it.
i_like_dragons
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Oct 09, 2017 3:51 pm
Contact:

Re: First time Circuit

Post by i_like_dragons »

What you need for your steam engines is called a Schmitt trigger. You can do this with two deciders. The first one can be set like one you already have, L=1 if A<10. This is our trigger. Feed it to decider no. two. Now here is the important part, we'll make a 'ghost' value so we get what we want. In your case, we need 10(the start value) - 90(the stop value)... A=-80 if L=1 and wire it to the triggers input.
I find the schmitt trigger useful to control much of my production, and occasionally requester values, to reduce # of bots in the air.
Flame1869
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Oct 24, 2017 6:21 pm
Contact:

Re: First time Circuit

Post by Flame1869 »

i_like_dragons wrote:What you need for your steam engines is called a Schmitt trigger. You can do this with two deciders. The first one can be set like one you already have, L=1 if A<10. This is our trigger. Feed it to decider no. two. Now here is the important part, we'll make a 'ghost' value so we get what we want. In your case, we need 10(the start value) - 90(the stop value)... A=-80 if L=1 and wire it to the triggers input.
I find the schmitt trigger useful to control much of my production, and occasionally requester values, to reduce # of bots in the air.
thanks
it took me a while to understand (learning C# when i was younger seemed to be easier then factorio logic), but i have it working now:
Attachments
accumi_2.PNG
accumi_2.PNG (582.12 KiB) Viewed 1928 times
Post Reply

Return to “Gameplay Help”