Combinator Help

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
BRaven
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Aug 18, 2016 5:00 pm
Contact:

Combinator Help

Post by BRaven »

Hey everyone!

I read through the Combinator help page before posting this, I've watched several youtube videos and searched for a design. I've fiddled for a couple days trying to get it to work properly and can't get this last part down.

I am using barrels on trains for oil. I want to have a single train go to each of the depots and have the depot only withdraw a certain amount of barrels (for this lets say 50). Then once the filter inserter removes 50 empty barrels it will stop taking out of the train. Those 50 barrels will get filled and then put back into the train and the train will move on.

I have done that! I used a simple chest and counter to count how many barrels get taken off. The system does what I want it to and then moves on. The problem I am having is that the arithmetic combinator will not reset once the train leaves. I've tried doing an S-R latch but I'm extremely confused. I can get it to work up to that point. The train only takes off a certain # of barrels at each station and then moves on. It's only good for that one trip at the moment though cause then I have to go around and manually reset each arithmetic combinator.

If someone can help me I'd really appreciate it. I assume it's a simple S-R latch attached to my counter but I can't seem to get it to work...

Thanks

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Combinator Help

Post by XKnight »

You can use rail signal right ahead the train stop to detect when train leaves from the station and reset your counter.
Also, some pictures/blueprint of your setup could be useful to give more detailed help.

BRaven
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Aug 18, 2016 5:00 pm
Contact:

Re: Combinator Help

Post by BRaven »

XKnight wrote:You can use rail signal right ahead the train stop to detect when train leaves from the station and reset your counter.
Also, some pictures/blueprint of your setup could be useful to give more detailed help.
I can take a picture of the counter I have but other than that I don't have anything at the moment. I keep taking it down when it doesn't work. I'll take a picture when I get back home, I'm out at the moment

How would I go about using the train stop to reset the counter? I tried connecting the stop to the network and even though it connected I saw no options to be able to tell when it left. That would be the best way to reset if I can figure it out.

Edit: you said use the rail signal not the stop to tell when it leaves. I'll try that when I get back and see if it works.

Edit 2:
I tried to use the rail signal, and I see that you'd need to set it to reset when the light turns red (signifying that the train left and the counter can reset) but I couldn't get it hooked up right. I added a picture of my counter, I'm not sure how I would hook up the counter. I tried using an S-R latch (not shown) but couldn't get it to work.

In the picture I just attached the filter inserter takes an empty barrel off the train, puts it down. The slow inserter puts it in the first chest and the fast inserter immediately takes it out. This first chest is the one I'm using to count how many come off the train. The second chest is so that if I take off more than what fits on the belt, the counter chest doesn't have stuff in it (which screws up the count). The Arthimetic Combinator is set to:
"Input: Empty Barrel * 1"
"Output: Empty Barrel"
and it counts perfectly the first time but won't reset (as I stated above).

I'm not sure how to connect the S-R Latch to the rail signal to reset this counter
Attachments
14060320_10206760074633032_2050148102_o.jpg
14060320_10206760074633032_2050148102_o.jpg (571.87 KiB) Viewed 2443 times

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Combinator Help

Post by XKnight »

Usually making print screen is enough, and making photo of your display is definitely an overkill :)

So, If you want to have at least 50 empty barrels at each station you don't need counter at all.
Vid1
And if you want to unload 50 empty barrels every time when train arrives
Vid2
Hope this will help.

dragontamer5788
Fast Inserter
Fast Inserter
Posts: 154
Joined: Fri Jul 15, 2016 1:44 am
Contact:

Re: Combinator Help

Post by dragontamer5788 »

XKnight wrote:And if you want to unload 50 empty barrels every time when train arrives
Vid2
Hope this will help.
Why not connect the network to the Train Stop and then use a circuit-condition to control when the train leaves?

I guess there almost-always will be a rail-signal at the Train Stop (its just good block-design). So the point is somewhat moot, but having that logic explicitly in the train schedule seems to make more sense.

BRaven
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Aug 18, 2016 5:00 pm
Contact:

Re: Combinator Help

Post by BRaven »

XKnight wrote:Usually making print screen is enough, and making photo of your display is definitely an overkill :)

So, If you want to have at least 50 empty barrels at each station you don't need counter at all.
Vid1
And if you want to unload 50 empty barrels every time when train arrives
Vid2
Hope this will help.

This worked perfectly for what I need. Thank you!

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Combinator Help

Post by siggboy »

BRaven wrote:This worked perfectly for what I need. Thank you!
Your problem was that you used an arithmetic combinator as the memory register. You cannot easily reset those.

XKnight showed the best design for these simple memories that you want to reset: use a decider with a condition like "E=0", where "E" is your erase signal.

In this case it was straightforward to use the output from the rail signal as the erase (which happens to be "red" when the train leaves).

Another approach to this barrel system that you want to use is to not count empty barrels, but instead take the sum of empty and full barrels at the outpost -- that's the total barrel count. Then try to keep this total barrel count at a certain value. That way, your outposts will never "overflow" with barrels, which can be a problem if you always unload the same amount every time the train arrives.

In practice, let's say your desired amount of barrels is "100". You have a chest with empty barrels and a chest with full barrels. You add the amounts of both together. Then your "stop" condition for the inserter is when this sum exceeds "100" (so the enable condition is "sum < 100"). In the train you simply reserve half of the slots in the wagon for full and the other half for empty barrels (or use two wagons, one for each barrel type).

At the train stop, the train will unload empty and load full barrels at the same time, but the condition keeps the total of both at "100". The only thing missing now is a leave condition on the train stop, I would use something like "IF full barrels in the buffer chest < 5 THEN leave".

(In this light, the first, simple variant shown by XKnight is better than your "counting" approach: just make sure there are at least X barrels in the chest, don't unload a fixed amount every time. What I've suggested above basically just expands on that.)
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Post Reply

Return to “Gameplay Help”