Page 1 of 1

Combinator based supply train MK 1 - MOD FREE

Posted: Thu Oct 13, 2016 8:51 pm
by pato
Hello all

i am new to the Factorio Forum and want to share my combinator based supply train setup with you:

What does it make different to other smart train set ups?

1. It uses no mods at all
2. handle all items your outposts will ever need in just 1 supply train
3. maintain different and independent robotic networks
4. even if you dont understand combinators, you will find this setup very easy to use
5. no mindblowing and complicated contraptions!

This setup comes with different modules to help you maintain your outpost and defensive lines

Module 1: The Depot
Depot
BLUEPRINT
Module 2: The Outpost
Outpost
BLUEPRINT

Module 3: The Logistics Network

LOGISTICS NETWORK
BLUEPRINT

The System itself takes some time to run smoothly, depending on how many items your outposts need at a time.
If you want to fill your outposts from 0, then you need some patience as the train will grab a bulk of different items and then starts to deliver them until an item is no longe required. If all your outposts have the desired items, the train will supply them much faster, as only ammo, repairkits and such are needed.
If no items needed the lamp will turn red and the train will wait until green light

Some Action Screenshots
SCREENS
Please let me have your Feedback/Improvements/critics!!

Thanks and have fun

Re: Combinator based supply train MK 1 - MOD FREE

Posted: Sun Dec 25, 2016 10:50 pm
by hansinator
Nice setup, but... it is very, very crude. I don't want to offend you, it's just my impression.

1) Why do you have the divide by two combinator in the depot circuit? It seems to serve no function.

2) You say that one of the train conditions in the depot should be circuit "green > 1". However, green will only take values 1 and 0, so the condition is very useless.

3) When the train gets loaded with material then the depot requester chests will start to request items again. If the bots are fast enough this means the steel chests will be refilled when the train is still in the station. Eventually the train will be filled with as much items as the system can deliver while the train is waiting for 100 seconds.

4) The 5 seconds of inactivity train waiting condition for the depot will cause the train to leave the station even if it has nothing to deliver, burning up fuel for nothing.

5) As a consequence of point 4 the train will be out visiting all outposts most of the time. So when suddenly there is a request it will take a while until the train is back in the depot. If the train wouldn't drive around empty but wait in the depot then it could immediately be filled as soon as a request arrives.

6) The system tends to put too many items in the steel chests at the depot. This, combined with point 3, results in way too many items being in the cargo wagon. The outposts however will only pick up whats needed so there are surplus items in the wagon after it has completed its round.

7) To fix the problems described in 6 you have added an unloading stage to the depot that will unload the wagon so it doesn't fill up with items that are not needed anymore which would block space for needed items. This however stresses the logistics system and uses electricity (for the bots) for nothing but to compensate a bad system design decision.

Edit: 8) If you have logic that makes your factories produce items and refill your logistics storage up to a certain threshold it will fill up your storage when the train gets loaded. When the train returns and all those surplus items get unloaded and returned to your logistics storage again it will accumulate more and more items until the storage is full. Thus you will need to expand the storage continuously when using this supply train stuff.

I understand that some points are hard to improve, for example that the bots will deliver too many items into the requester chests. But you could fix point 2-5 easily. Use an edge detector that only reacts when the outpost request changes. If an item request goes from say 0 to 100 an edge detector will pulse the value 100 for just 1 tick (search forum for edge detector). Then you filter this value with each > 0 and input it into to an integrator (an arithmetic combinator with each + 0 looped back to itself) which will add up all request values. Then you use an edge detector on the steel chests, filter it with each > 0, negate the pulse (* -1) and input it into the integrator. This will subtract the items that have been loaded into the steel chests. The integrator output should be connected to the requester chests. Now if the train wagon gets filled from the steel chests the system will not request more items even if the steel chests are empty and the outposts are still waiting for the material.

By the way, here's a simpler version of your logistics module that uses less combinators:
Image

Edit:
I've tested my suggestions and it turns out that it is more complex. The edge detector stuff runs into problems with multiple outposts when more items get unloaded than are needed, due to inserter stack sizes. There is a solution to that, but then it gets problems when logistic bots return items to the storage chest of an outpost. I believe I know a solution for that, but it will require more and more combinators.

I hate it... it is always the same. Every time when one wants to control item flow the inserter stack sizes make it impossible, because you can not control how many items are transferred between chests. It breaks a lot of use cases for combinators and really just destroys all fun. Often a workable solution can still be found, at the cost of days of work and dozens of combinators.

Re: Combinator based supply train MK 1 - MOD FREE

Posted: Sun Jan 08, 2017 11:15 am
by pato
Hi,

let me first answer your points:

1. The combinator devides the input by 2 because my setup uses 2 requester chests. This is only to load the train faster. You can also use only 1 requester and delete the combinator, or you can add more requester and set the devide count to 3 or 4 or as many requesters you use. This is because the wires provide 100% of outpost request, but you dont want that your 2 requesters request each 100%, instead you want your requesters to receive 50%+50%

2. Yes this is my fault, it should be green = 1, so the train does not move until the light turns green.

3. this is why i made the requester - steel chest setup. The inserter which loads the steel chest will deactivate while the train is loaded. This is to prevent overflow of the system, because i did not find a compact way to pulse the outposts requests as you mentioned.

4. it is an AND condition. So it needs to be green AND 5 sec inactivity.

5. Yes the train will visit all outposts one by one. This is because VANILLA Facorio does not allow to control the train by circuit network.

6. This is an issue caused 1. by bot stack size, 2. inserter stack size. Currently no possibility to change this.
So i tried to use this disadvantage to make it an advantage - train loads unnessecary items at outposts and all overflow items will be sorted out by the unloaders.

7. Current system supports ALL items. You can limit it to specified items to prevent overflow, but my intension was to NOT limit it, so i dont need to care about my outposts at all, because they are 100% self sustaining.

8. Those items get loaded only twice. After the first round requesters will no longer requests unnessecary items, instead the train will pick them up once more, do a second run and if all outposts are filled the requesters will be empty so they will load only ammo and repair kits for example. (like in 3. i did not find a way to pulse the signal, which would make the steel chests unnessecary.)


So in the end, i understand your critics and those points annoy me too. But current Vanilla makes a better handling really hard, because you have no train control, you have no items stack size control, you can not read items in cargo wagons and so on. The pulsed singal is the only thing we can fix currently.

As i made a huge megacomplex and it is impossible to maintain all outposts by myself this system really helps a lot, even due its lack of efficiency, because the system will always balance itself over time.

Maybe with the next Factorio update 0.15 i will be able to fix the other issues.


EDIT: I just found out i did not include the wiring for the inserters like i mentioned in 3.... sorry, i will update my blueprint later.

Re: Combinator based supply train MK 1 - MOD FREE

Posted: Sun Jan 08, 2017 12:49 pm
by hansinator
pato wrote:let me first answer your points:
...
So in the end, i understand your critics and those points annoy me too. But current Vanilla makes a better handling really hard, because you have no train control, you have no items stack size control, you can not read items in cargo wagons and so on. The pulsed singal is the only thing we can fix currently.
Yes I understand. I have to add that I am very miserable at putting forth criticism. I don't want to say "all is bad", but I do want to list the weak points.

Anyhow, I have fixed all of it, but my solution is still in beta stage. My depot circuit still needs a reliable way to detect if the cargo wagon is full and both the depot and outpost need an isolated power supply because if they ever have a power outage the whole system will go nuts. Take a look at this:
Advanced Smart Supply Train Depot Beta
The green lamp you see there is for debugging, it is not the same as in your design. It says "train is not here". The depot benefits if you have a roboport with some storage chests nearby (for quick unloading and caching the unloaded items).
Advanced Smart Supply Train Outpost Beta
The outpost has a steel chest for testing. You need to replace it with a storage or provider chest, whatever you like. For bigger outposts I don't wire the circuit to the chest but to a roboport in "read logistics network contents" mode (just run the green wire that is going to the chest to a roboport instead).

How does it work? It accounts perfectly what has been put into the train and what gets unloaded.
Here are the things it can do:
  • It will only let the train move when it is absolutely necessary.
  • It detects if you manually put things into or take things out of the chests (ALL chests you see there) and takes that into account properly.
  • It detects if an outpost cancels a request. If items that are not needed anymore get delivered to the requester chest the system will not put them into the train. It will dump them into the provider chest to quickly make them available to the logistics network again.
  • If a request is canceled and the items that are not needed anymore are already in the train, they will get unloaded from the train if it is still waiting.
  • If there are more items delivered to the requester chest than needed (due to logistic robot stack size and due to how the system works) it will load a little more (~ +10 items) into the train. This is good and wanted, because the outposts also unload a little more than is needed..
  • If items get delivered when the train has left the station already (due to slow robot logistics network with very long robot paths) and if they are not needed anymore, those items will be dumped into the provider chest.
  • You can use multiple supply trains on the same depot but they must all visit the same outposts (i.e. have the same schedule).
  • You may accidentally cut the green wire. The outpost has built-in circuity to detect that and it will remember what has been unloaded and transmit it to the depot once you re-connect the green wire. There is one important thing to note: When you disconnect the green wire, the outpost train signal will turn red, preventing the train to leave. This is necessary to protect the system.
What you may never ever do is manually put things into or take things out of the cargo train! It's the golden rule.
Also, when you tear down an outpost, you must disconnect it from the green wire bus first.

What still needs to be done:
  • Add isolated power networks with solar+accumulators to depot and outpost
  • Properly detect when the wagon is full, or more accurately, when the depot can not put more things into the wagon. These are different things.. When there are different item types in the wagon, all slots may be in use but not all may be full. Example: If you requested, say, just 1 ammo and 10000 repair kit, there is an inventory slot that has just 1 ammo and the stack is not full and all other slots are filled with full stacks of repair kits. As the wagon can't hold 10000 repair kits the depot circuit condition will not be < 1 and the train will not start. However, because the ammo stack is not full, the train condition full cargo inventory is also not true. But the inserters can't input more, because all inventory slots are in use. Then the train waits forever. I know a solution to detect if nothing can be put into the train anymore, I just was too lazy to integrate it, because I can't find more space for combinators without re-arranging everything...
The following are only minor bugs or aesthetic problems, they don't hurt the functionality:
  • The depot obviously needs to be layout cleanly. It's still a beta version right now.
  • Make space and add a second unloading inserter to the depot (to remove items that are not needed anymore from the train).
  • Fix that when using multiple trains and many requested items the depot unloading inserters may have their filters set to items that are not in the train.
  • Fix that the train may leave the depot while surplus items that are not requested anymore are being unloaded.
I was thinking about a hysteresis for the outpost requests so that the train will not visit them for just 5 pieces of ammo. What do you think about that? It makes outpost configuration trickier, because you need to setup two values per requested item. One for the lower boundary when the request should be activated and one for the upper boundary when the request is considered fulfilled.

I am using it to supply my outposts and so far it has been working great. I am not yet using multiple trains (only for testing, but it would work okayish) and I am not requesting more than the train can fit, so I will not run into the problems I still need to fix.

If you have any more ideas, now is the right time to tell me ;-)
Blueprint Depot
Blueprint Outpost

Re: Combinator based supply train MK 1 - MOD FREE

Posted: Thu May 18, 2017 8:26 am
by DOSorDIE
I also make a system like this and the problem that it should not start when 1 Ammo is used is quiet simple.
I send a W=20 (20%) Signal that meen that then it hold 100 Ammo it only come when its under 20 Ammo.
So my system runs only when a outpost is really low on 1 item.

Re: Combinator based supply train MK 1 - MOD FREE

Posted: Thu May 18, 2017 5:45 pm
by cid0rz
Very nice setups guys, love to come in the forum and have a look at all your ideas. Also the discussions are very interesting. Keep up the nice work!