Circuit question from a new player

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Breakeven
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Dec 29, 2021 1:09 am
Contact:

Circuit question from a new player

Post by Breakeven »

I am wondering if its possible to set up a circuit so when my petroleum in tanks reaches... say 10k it turns on a pump to send it to be turned into acid. Then once it reaches say 2k it turns off the pump. If so, how do I do this/what does it look like with combinators.

Does that make sense?

When I set up a combinator a certain amount it just turns on and off over and over as it goes under the threshold to be active straight away, when I want it to stay active for a longer period.
Sorry if there is already a thread explaining exactly this.

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Circuit question from a new player

Post by Loewchen »

You want a hysteresis. There is no actual need for it in your usecase as switching back and forth rapidly has no downside here, but if you want the hysteresis anyway, check out https://wiki.factorio.com/Tutorial:Circ ... ok#Latches

Breakeven
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Dec 29, 2021 1:09 am
Contact:

Re: Circuit question from a new player

Post by Breakeven »

Awesome, thanks! I'll have a read of this.

Yeah I really just want it to work this way for aesthetics as I don't like it switching off and on rapidly haha.

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Circuit question from a new player

Post by astroshak »

That SR Latch forget s what you want.

That said, simply connecting the pump to the storage tank, telling it to turn On when Petroleum Gas > 10000 would work. The functional difference is the SR Latch would keep the tank between 2000 and 10000 Petroleum Gas, while the simple option keeps at least 10000 Petroleum Gas in the tank and sends excess to off.

Tertius
Filter Inserter
Filter Inserter
Posts: 652
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Circuit question from a new player

Post by Tertius »

I prefer to watch the minimum amount of things - not if some item is above a threshold and enable something to make it go away.
If it comes to sulfuric acid, its production competes with the production of plastic bars. Both have to be balanced for fair petroleum gas consumption.
You need both as soon as you need blue circuits, and of course for research.
You can use pumps to control petroleum gas flow to the sulfur plants as well as to the plastic bar plants.

How about this approach:
Put the pipe that goes to the sulfur plant before the pipe that goes to the plastic bar plant, so sulfur production is prioritized. Put a pump in the pipe to the sulfur plant.
Use a combinator to count the number of produced plastic bars (tap the belt and read contents in pulse mode, then feed this to a combinator wired as counter).
If the counter reaches a threshold, let it reset and start new. (counter is explained in the wiki)
Every time the counter reaches its reset count, enable the petroleum pump to the sulfur plant (this is only 1 tick). This way, the more plastic bars are produced, the more sulfur is produced. If there is enough petroleum gas to satisfy both, they both go up to maximum production.
If there is not enough petroleum gas to satisfy both, the plastic bar production will be reduced, because the sulfur pipe comes first. This makes the counter run slower, so the pump is activated less, so the sulfur production decreases. Which leads to some kind of balance, controlled by the counter threshold you define. The threshold is a number you have to work out by trial and error. May be the whole approach is invalid, if the pump is activated not often enough even with threshold 0. In this case it may work if you read the belt in hold mode, but this might be too inaccurate.

I admit I didn't actually tested this approach. It just popped up in my mind as I read your thread. I always needed such kind of balance, but I always decided to postpone it for later. Everyone has to solve this puzzle for his oil processes. Currently, I just prioritize sulfur over plastic with pipe placement and no circuits, which usually works but results in big fluctuation with the plastic bar production. The balancing comes as feedback from the factory, where no more sulfur is consumed if there are not enough plastic bars coming in. This has a huge latency, so it's not optimal.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Circuit question from a new player

Post by quyxkh »

For simple situations there are simpler RS latches than the wiki shows, say you want to crack excess heavy oil, you have a pump set up for say heavy > 1000 but you don't like it twitching, I get that.

So add two combinators, main circuit wired to heavy > 1000 output 1 X, wired into X * 500 output heavy wired back in to the main circuit. Now when the tank gets over 1000 the decider will trip on the heavy 1001+ signal and output 1 X, which will get multiplied by 500 and feed 500 more heavy signal into the main circuit, which will now read 500 more heavy than there really is. Until the crackers reduce the signal to 1000, at which point there will be 500 heavy in the tanks plus 500 from the boost multiplier, less than 1001 sum so the decider will shut off and you'll be down at 500 heavy and 500 heavy signal again.

Post Reply

Return to “Gameplay Help”