Factorio

Factorio

View Stats:
Unloading a train with circuits
For unloading a train I have build the following situation:

https://steamcommunity.com/sharedfiles/filedetails/?id=2385112266

Wat this actually does is when one block of chests is full the cargo will be unloaded onto the belt if the other chests still have some space.
More wagons will be a little bit difficult but that is not my intention (for now but with this solution it is also quite difficult if not impossible). I always can send more trains. I don't run a base with a bus but a base with a circular belt with the most used items which is entirely circuit controlled. And that suffices since I don't have the intention to run a mega base.

Are there more possibilties to solve this (train) circuit problem? Because now I need three decider combinators. I tried something with an arithmetic combinator but they don't accept negative output.
Last edited by GreenBeanN1; Feb 5, 2021 @ 4:37pm
< >
Showing 1-15 of 16 comments
Purpleganja Feb 5, 2021 @ 9:38am 
I think unloading to reload and unload again is a bit over complicated. It would be simpler to control how those chests unload unto the distribution belts and better balancing of the belts from the chests to consumers could be enough.
Warlord Feb 5, 2021 @ 9:46am 
Originally posted by Purpleganja:
I think unloading to reload and unload again is a bit over complicated. It would be simpler to control how those chests unload unto the distribution belts and better balancing of the belts from the chests to consumers could be enough.
I kind of like it. The OP already has the infrastructure for unloading from each wagon. It seems simple enough if one wagon fails to unload because the chests are empty to then move the remaining contents of the wagon to the other side.

@OP:
Unless this is just a mock-up, though, I don't quite see the point. One chest of coal is a LOT of coal. Since it's not unloading onto belts and the chests aren't logistics chests, they're there purely for you to pick up on the go, and you should never need to pick up a wagon's load of coal, let alone 18 steel chests worth.

As to the circuit question, sorry I can't contribute. I do NOT touch circuitry in my games. I usually just brute-force things with trains and balance their contents using belt balancers.
Purpleganja Feb 5, 2021 @ 10:07am 
Its a fun idea to patch a problem.
It could work without any circuitry. Just let the wagon inter exchange all the time and the content will eventually get into the chests.
You can also just check if the set of chest is full and output on the belt without checking if the other set of chests is not full.
Fishy Feb 5, 2021 @ 10:12am 
Are you trying unload into one block of chests first, and then fill the other ones?
Or just fill as needed until a wagon stops unloading then send the remaining items to the other side?
GreenBeanN1 Feb 5, 2021 @ 10:19am 
That the chest are not unloading to a belt is because my coal patch just above isn't empty yet. So for now I do not need the coal. (The train unloads to the chests and when the coal patch above is empty it will join the circular belt (more north) untill a certain condition is reached the chest (inserters that I have not build yet) will stop providing until coal is needed again etc.)

Of course I can build a belt balancer but I like the circuits in factorio and especially this kind of uncommon solutions.

My main problem with the arithmatic decider is this -> already in the first step :) (Wiki:
The internal logic process has three steps:
1) "All input signals on the red and green wires are summed within the combinator."

That makes I can't use them for this situation. (Or atleast I don't see how)

If there is an easier (circuit) approach I can probably add a third wagon in the end. But for now I think it will be a little to much ;)
Last edited by GreenBeanN1; Feb 5, 2021 @ 10:31am
GreenBeanN1 Feb 5, 2021 @ 10:24am 
Originally posted by Fishy:
Are you trying unload into one block of chests first, and then fill the other ones?
Or just fill as needed until a wagon stops unloading then send the remaining items to the other side?

No both at the same time (9 chest left is one block the other block are the 9 chests right). So when both sides of the chests have space the inserters below (yellow) don't do anything.
Last edited by GreenBeanN1; Feb 5, 2021 @ 10:26am
AlexMBrennan Feb 5, 2021 @ 10:39am 
The solution is to multiply the sum of the items on the left side by -1; then you can add them together to find out if the left is bigger (total < 0), if they are equal (total=0) or if the right side is bigger (total>0).

If you only want to start moving items between the train cars if the chests are completely full then you will require 4 extra decider combinators:

One hooked up to the left chests, set to output A=1 if the coal chests are full.
The other is hooked up to the output of the arithmetic combinator and set to output A=1 if coal<0. Connect both outputs to the inserter, and set the inserter to activate when A=2.

The other side works the same except it's coal>0.

(If you want to save a bit of power you can also do it with two deciders and 3 constant combinators)

I tried something with an arithmetic combinator but they don't accept negative output.
I don't know what you are trying to say here but you are wrong; you can use negative numbers.
Last edited by AlexMBrennan; Feb 5, 2021 @ 10:43am
Nellvan Feb 5, 2021 @ 10:41am 
Unless I'm just being too dense, you want the MadZuri (tm) loader / unloader, or some variation of that system.

https://www.reddit.com/r/factorio/comments/4e03g2/madzuris_smart_loading_train_station_guide/

The pic in the thread should explain all the wiring, in the arithmetic combinator always divide by the negative amount of chests, and in the inserters the condition should be smaller than the inserter stack size
Fishy Feb 5, 2021 @ 10:50am 
Just something to think about: you could unload into another wagon that is on a small piece of track unconnected to the main line as kind of a extra wide shared chest. use two rows of long inseters
Last edited by Fishy; Feb 5, 2021 @ 10:51am
knighttemplar1960 Feb 5, 2021 @ 10:54am 
Do you even need all the wires? Once one of the chests is full the associated stack inserter will stop moving. Once all of the chests on that side are full no more material can go off that rail car in that direction which means the material's only option for motion is the circular loop on the other side where it will happily spin around from one car to the other until the entire train is empty.

As long as you set the train's condition at the stop to empty cargo it should stay at the stop until the very last bit of material is in one of the chests, in an inserter's hand, or on the circular belt.

If it isn't perfectly balanced at that time it will only be off by a tiny bit and that situation will only last until the next train arrives.

You could even use the set up on a train with more than 2 cargo wagons. Just make a circular belt loop with standard (yellow) belts that runs the entire length of the train and use 3 standard inserters on one end of the wagon to unload on to the belt and 3 long inserters to take off the other side of the belt and put back in the wagon. When you pull up, the stack inserters will move things into the chests quickly while the rest of the material starts playing ring around the rosey. It will eventually balance to almost perfect equilibrium until all the wagons are completely empty at which time the train will leave the station. That is of course taking into consideration that you will have to saturate the total number of chests used for storage to x- one full train load. At that point this set up should give you near perfect equilibrium and before you reach that state it should still be relatively balanced due to the inserters unloading the cars at nearly the same speed.
Fishy Feb 5, 2021 @ 2:51pm 
https://steamcommunity.com/sharedfiles/filedetails/?id=2385482719

0 circuits and 0 wires

You could use a car or tank instead of the wagons for the same effect
Last edited by Fishy; Feb 5, 2021 @ 2:54pm
Katitoff Feb 5, 2021 @ 3:34pm 
Why not just use regular balancer?
Fishy Feb 5, 2021 @ 4:12pm 
Originally posted by Katitoff:
Why not just use regular balancer?
lol Sometimes the problem is more enjoyable than the solution!
GreenBeanN1 Feb 5, 2021 @ 4:33pm 
Originally posted by Nellvan:
Unless I'm just being too dense, you want the MadZuri (tm) loader / unloader, or some variation of that system.
https://www.reddit.com/r/factorio/comments/4e03g2/madzuris_smart_loading_train_station_guide/
Interesting. Never thought about the possibility of connecting the box and the inserter too. Could be the solution. Probably will test this in the weekend.


Originally posted by Fishy:
https://steamcommunity.com/sharedfiles/filedetails/?id=2385482719

0 circuits and 0 wires

You could use a car or tank instead of the wagons for the same effect

But I want wires :) . And in your solution the inserters between the wagons are moving. Thats not esthetic ;) . My solution in the first post works and the yellow inserters are only activated when when needed. But at the price of 6 combinators which makes adding an extra wagon almost impossible (I think).

But with the madzuri's solution only one arithmatic combinator is needed!
Last edited by GreenBeanN1; Feb 5, 2021 @ 4:36pm
AlexMBrennan Feb 6, 2021 @ 5:19am 
But with the madzuri's solution only one arithmatic combinator is needed!
But that solution solves a completely different problem - for trains to be loaded quickly the resources need to be evenly split between all chests (12 inserters moving 166 coal each is faster than one inserter moving 2000 coal), which you can either achieve by using splitters or this circuit.

It does not magically balance belts after unloading which is what you seem to be trying to do.
Last edited by AlexMBrennan; Feb 6, 2021 @ 9:49am
< >
Showing 1-15 of 16 comments
Per page: 1530 50

Date Posted: Feb 5, 2021 @ 8:53am
Posts: 16