Need help with combiators

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
ARC190
Inserter
Inserter
Posts: 27
Joined: Sat May 23, 2015 9:03 am
Contact:

Need help with combiators

Post by ARC190 »

Hey, is there a way to make a lamp that turns on when my stock of something is rising, and turn off if it starts to fall, using wires and combinators?

I'm asking because liquids are a tricky thing to monitor because of the way the notation cuts off at three digits and uses K, M, etc. after that. It's really hard to see whether, for example, you are getting more petrol gas than you're using.
I think I could figure some way to do it out myself, if I tried long enough, but doing anything big with wires is tedious and time consuming, especially when you have to redo the whole thing because you messed up some fundamental logic. So, has anyone come up with a solution before or can do it on the fly?

Thank beforehand to anyone who invests even a single thought into solving this problem for me.
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Need help with combiators

Post by ratchetfreak »

As a high level approach you can use a delay circuit and A simple comparisons (previous < current and current < previous) and a RS latch to smooth out the jitter
ARC190
Inserter
Inserter
Posts: 27
Joined: Sat May 23, 2015 9:03 am
Contact:

Re: Need help with combiators

Post by ARC190 »

ratchetfreak wrote:As a high level approach you can use a delay circuit and A simple comparisons (previous < current and current < previous) and a RS latch to smooth out the jitter
ya know, that would probably be a fantastic piece of advice, if I knew how to do any of those, but sadly, I do not know a lot of terminology in this field, much less how to build them with the combinator. Maybe I should have said
that in the initial post
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Need help with combiators

Post by Peter34 »

ARC190 wrote:
ratchetfreak wrote:As a high level approach you can use a delay circuit and A simple comparisons (previous < current and current < previous) and a RS latch to smooth out the jitter
ya know, that would probably be a fantastic piece of advice, if I knew how to do any of those, but sadly, I do not know a lot of terminology in this field, much less how to build them with the combinator. Maybe I should have said
that in the initial post
I'm just waiting for people to start making YouTube tutorials for Combinators.
Lupoviridae
Fast Inserter
Fast Inserter
Posts: 155
Joined: Mon Apr 20, 2015 6:26 pm
Contact:

Re: Need help with combiators

Post by Lupoviridae »

Here's what I came up with, sorry if it's a little messy, let me know if you have questions: (Input is on the left, output on the right)
Essentially, this breaks down into three steps, controlled by a clock (combinators 1 and 2, Blue counting up to 600)
Step 1- At the beginning of the cycle, grabs the value of Oil and stores it. (Occurs when Blue ==1)
Step 2 - Near the end of the cycle, compares the stored value to the current value (Occurs when Blue == 500)
Step 3 - Erases the stored value (Occurs when Blue == 599)
EPSON005.JPG
EPSON005.JPG (70.69 KiB) Viewed 11112 times
1) Constant; outputting "Blue" == 1
2) Decider; when Blue is < 600, output everything (input count)
3) Decider; When Blue == 599, output Blue (1)
4) Top - Decider; When Blue == 1, output everything (input count)
Bottom - Arithmetic; Take Oil, do nothing to it, and output as signal "1"
5) Decider; When Blue == 1, output Everything (input count)
6) Top - Decider; When signal "1" is > Oil, output Red (1)
Bottom - Decider; When signal "1" < Oil, output Green (1)
7) Decider; When Blue == 500, output everything (input count)
8) Decider; When Red > Green, output Red(1)
9) Light; Light up when Red == 1

This is what each part does:
1 + 2) This is a counter, that controls the timing of everything. A setting of 600 means one cycle every 10 seconds (60 ticks/second). This should be enough to smooth out usage spikes and give an accurate reading.

4) The top combinator passes the value of Oil to combinator 5 at the beginning of the cycle (when Blue ==1). The bottom combinator converts the oil signal to signal "1", so it can be used for comparison later.

5) This is the component that remembers the value of Oil at the beginning of the cycle (when Blue ==1)

3) This resets the value in combinator 5 at the end of the cycle. (It makes Blue ==2, so combinator 5 drops it's remembered value)

6) These two combinators perform the comparison between the remembered value in combinator 5, and the current value which has been converted to signal "1"

7) This is the main cycle controller. When Blue == 500 (near the end of the cycle), it passes the Red or Green signal from combinators labeled 6 on to combinator 8.

8) This is a memory cell. It will keep outputting a red == 1 signal until it recieves an input of green == 1.
Lupoviridae
Fast Inserter
Fast Inserter
Posts: 155
Joined: Mon Apr 20, 2015 6:26 pm
Contact:

Re: Need help with combiators

Post by Lupoviridae »

Here's the same layout, but hopefully a bit easier to read.

Two dots in each box indicate input.
Red = red wire, black = green wire
EPSON006.JPG
EPSON006.JPG (76.2 KiB) Viewed 11097 times
ARC190
Inserter
Inserter
Posts: 27
Joined: Sat May 23, 2015 9:03 am
Contact:

Re: Need help with combiators

Post by ARC190 »

@Lupoviridae, Thanks a lot, thanks to you, I now know whenever my light oil is in the decline. Now, all I need is something that tells me how much I lost or got between those comparisons
Lupoviridae
Fast Inserter
Fast Inserter
Posts: 155
Joined: Mon Apr 20, 2015 6:26 pm
Contact:

Re: Need help with combiators

Post by Lupoviridae »

Add an arithmetic combinator at 6 (with the red input from 5, and the green from 4)
Set it to "1" - Oil; Output Oil
Connect the green output to the other green outputs from 6.

Add another decider combinator at position 8.
Set it to If Blue == 500, output everything (input count)
Connect the red wire from input 7 to the new combinator's red input.
Connect a green wire from output of 7 to the input. Then loop the green output of this new combinator back to the input as well.
Mousing over this combinator should tell you the result you are looking for under "output value".

PS, I haven't tested this, but I believe it should work. Please let me know if it does not.
Lupoviridae
Fast Inserter
Fast Inserter
Posts: 155
Joined: Mon Apr 20, 2015 6:26 pm
Contact:

Re: Need help with combiators

Post by Lupoviridae »

Here's the wiring diagram, note the new combinators at positions 6 and 10. 10 is the one you'll want to mouse over.
And actually, if you connect the red output from 10 to the light, then set the light to Oil > 0, you can do away with combinator 8, as well as the top two at 6.
EPSON007.JPG
EPSON007.JPG (79.7 KiB) Viewed 11070 times
Lupoviridae
Fast Inserter
Fast Inserter
Posts: 155
Joined: Mon Apr 20, 2015 6:26 pm
Contact:

Re: Need help with combiators

Post by Lupoviridae »

I just tested this out and it doesn't work as I have it in the diagram. However I did get it to work, and I will post the wiring diagram for the working version later.
Here's a screenshot of my test setup, using water. The pump provides 60 water/s. My calculated system is saying 59 water/s, pretty close.
Flow Rate.PNG
Flow Rate.PNG (818.63 KiB) Viewed 11063 times
Lupoviridae
Fast Inserter
Fast Inserter
Posts: 155
Joined: Mon Apr 20, 2015 6:26 pm
Contact:

Re: Need help with combiators

Post by Lupoviridae »

Here's the wiring diagram for the above image. To prime the system, do the following:
Disconnect the green output from the B=544;B combinator near the top left.
Set the constant combinator to B=1 to start the clock.
Once the system has run through one cycle (after ~9 seconds), reconnect the green wire.

If done correctly, the top middle combinator should output a constant Blue = 545.
EPSON001.JPG
EPSON001.JPG (41.53 KiB) Viewed 8453 times
Post Reply

Return to “Gameplay Help”