even distribution of ore between stations of same name

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

even distribution of ore between stations of same name

Post by varundevan »

Hi,

I need a help in creating a logic , that enables 5 different stations of same name in sequence.

I have 5 stations of same name say "iron pickup", normally all 5 stations are enabled at the same time.
now, what i need is .. i want to enable station 1 only, when train arrives station 1 , station 2 should be enabled (only station 2 , station 1 should be disabled) and when a train reaches station 2, station 3 should be enabled (only station 3 and rest should be disabled) and so on.

i have an idea like ,
can have a variable say "O" and set is as enable condition in all 5 stations, like station 1 enable condition is O=1, station 2 enable condition is O=2.
so the value of O should be 1 initially and when the value of O reaches 5 , it should start from 1 again. (cycles from 1 to 5 based on the input from the 5 stations)
so only one of 5 stations will be in enabled condition at any time.

the help i needed is to have a setup to read the signal of the 5 stations and increase the value of O in sequence.
its like a simple case command in C program,
it might be simple for many , but achieving with this combinators and wiring is weird and hard for me . (PS i am neither a programmer , nor a electrical engineer)

i welcome if any one suggests a better method
thanks for reading and your answers.
Last edited by varundevan on Thu Jun 18, 2020 4:25 am, edited 2 times in total.

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 168
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: enable stations of same name in sequence

Post by Ranger_Aurelien »

To me the logic would work as follows:

Trains will path to "Iron pickup intake" station with no tasks there. Beyond it you have the Iron stations all called "Iron Pickup". The reason is a train will only path once it passes the "Intake" Station.

At station1, read the serial# of the currently docked train. if not=0, you have a train, and then set an output signal "HasTrain" (maybe H) to +1.


That outlines implementing what you are describing but I fear the an issue may arise when a train departs station1 and you have trains at stations 2 and 3. 2 and 3 will still output a +1 and give signal total 2. Were you planning to lock station1 until all 5 had been used? That could work as well by using S-R latches to disable stations until all have seen trains.

Are the Stations 1-5 far apart? Is there a reason a typical stacker setup will not work?


To me Factorio is all about solving problems, so I enjoy these mental exercises...
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 168
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: enable stations of same name in sequence

Post by Ranger_Aurelien »

Alrighty, re-reading, then yes, understand your intention. One station unlocked at a time, rotating as the previous is used.

My thought for a station's logic is then to
Only enable Station N when Station N-1 has a train (trainID non-0) Arrive. (Keep it on forever, until below)

Disable Station N always, immediately when Train leaves Station N (e.g., only in the transition from <TrainID> to 0.)

(If you disable the station early the current train will give up and leave)


Whew. I think I did it. I have the logic set up so the top train's arrival will unlock the lower station, and the departure of the lower train will lock that station again. All one needs to do is chain these up...

Image




Whew! I feel exhausted.
I'm no Factorio logic expert but I think I must have gone up a level from this! Let me know what you all think...
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

Re: enable stations of same name in sequence

Post by varundevan »

Ranger_Aurelien wrote:
Fri Jun 12, 2020 5:03 pm
To me the logic would work as follows:



Are the Stations 1-5 far apart? Is there a reason a typical stacker setup will not work?


To me Factorio is all about solving problems, so I enjoy these mental exercises...
the 5 stations are close , the they are stacked,
the problem is that , the first station is visited more than the rest. (the factorio train algorithm prefers the shortest path, and waits even the longest path is available).. i had a problem which i posted here ..
viewtopic.php?f=18&t=85687

this leads to accumulation of ore in station 1 and the it is not evenly distributed.

thanks for being here
Attachments
123.png
123.png (187.7 KiB) Viewed 556 times

varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

Re: enable stations of same name in sequence

Post by varundevan »

Ranger_Aurelien wrote:
Fri Jun 12, 2020 10:09 pm
Alrighty, re-reading, then yes, understand your intention. One station unlocked at a time, rotating as the previous is used.

My thought for a station's logic is then to
Only enable Station N when Station N-1 has a train (trainID non-0) Arrive. (Keep it on forever, until below)

Disable Station N always, immediately when Train leaves Station N (e.g., only in the transition from <TrainID> to 0.)

(If you disable the station early the current train will give up and leave)

Whew. I think I did it. I have the logic set up so the top train's arrival will unlock the lower station, and the departure of the lower train will lock that station again. All one needs to do is chain these up...

Whew! I feel exhausted.
I'm no Factorio logic expert but I think I must have gone up a level from this! Let me know what you all think...
hey ,
thanks for showing your interest , and i appreciate your effort. I am yet to understand and evaluate your setup. Thanks.
i have also came up with the solution the same day i posted this .
it works , but needs some refinement..
here is the logic,
Image
when a train reaches a station signal O is sent and it is stored in a combinator,
and it enables the next train (o =2 ), the next train tigres another O and enables the next train (o=3) and the O adds up until last station.
as the train reaches the last station , the memory cells is reset. and starts from 1 again.
Attachments
Capture.PNG
Capture.PNG (2.28 MiB) Viewed 547 times

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

Another approach could be to enable stations based on the amount of ore present.
To prevent looping trains when all stations are full add a dummy station with a signal closed with a circuit network condition, between the stacker and the load/unload stations, so trains will still go to the stacker.

varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

Re: enable stations of same name in sequence

Post by varundevan »

disentius wrote:
Sat Jun 13, 2020 9:15 am
Another approach could be to enable stations based on the amount of ore present.
To prevent looping trains when all stations are full add a dummy station with a signal closed with a circuit network condition, between the stacker and the load/unload stations, so trains will still go to the stacker.
you foreseen the problem i am facing now ,
i am trying to figure out how to sort the ore amount ... and and how to enable based on that ..
can you please help if possible and you are interested

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

Sure:)
What sort of help do you want?
(if you post a blueprint of your station setup< I can add the trick i am talking about, for instance.)

varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

Re: enable stations of same name in sequence

Post by varundevan »

disentius wrote:
Sat Jun 13, 2020 4:52 pm
Sure:)
What sort of help do you want?
(if you post a blueprint of your station setup< I can add the trick i am talking about, for instance.)
i have refined this loading station , as far as i can . i have cramped as much waiting stations as i can
this i have designed for 12 input trains and 12 output trains ..(but this can accommodate more while operating)
because of enabling the station the ore is distributed evenly but the drawback is , because of enabling one station at a time , the input trains wait in the waiting station.
if it occupies the dropping station it would free up the waiting area.

if you have any other ideas , please share ..
here is bp


User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

I will look at it tonight.
I am spotting a problem in your description above .
Using activate on minimum and enabling one station at a time will restrict your throughput too much. If you want to enable one station only based on amount of product, you are in for a few combinator contraptions. (like Haphollas vanilla train network, HTN here: https://docs.google.com/document/d/1gje ... lYi1Q/edit}

Premu
Inserter
Inserter
Posts: 49
Joined: Wed Nov 13, 2019 4:40 pm
Contact:

Re: enable stations of same name in sequence

Post by Premu »

disentius wrote:
Sun Jun 14, 2020 10:38 am
I will look at it tonight.
I am spotting a problem in your description above .
Using activate on minimum and enabling one station at a time will restrict your throughput too much. If you want to enable one station only based on amount of product, you are in for a few combinator contraptions. (like Haphollas vanilla train network, HTN here: https://docs.google.com/document/d/1gje ... lYi1Q/edit}
Instead of disabling the station as whole you can simply set the train signal of stations with more than the minimum amount to red. This will effectively disable it and the trains will drive to stations with the lowest amount stored.

It might lead to deadlocks from time to time, though as it can happen that one station empties faster than others and signals turn red while a train is trying to enter there. So you need a deadlock detection and unlock mechanism on top. I use a chainsignal in front of all the other signals for that - if it stays red for too long, I assume that there is a deadlock and unlock all stations for use (unless already occupied, of course).

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

@Premu: Yes, that is viable too.

Here is your blueprint with a few things added:
- MadZuri loading, to fill the chests evenly. (He is the one who invented this)
- Station and signal enable/disable based on the amount of ore in the stations.
- different transfer of ore from unloader to loader.
- All stations are evenly filled, if possible. Output stations are enabled whenever there is enough ore to fill a train.
- added dummy stations to prevent looping when all loaeders would be disablet in case of not enough ore available.

Made this in editor mode with an ore source and ore dump attached for testing. The bottleneck is the path from the stacker to the stations, since all trains have to take that one. I do not think it is possible to fully use the 5 exchanges in this setup.
Blueprint is made for editor mode, with an ore dump and an ore load with infinity chests.
Blueprint is to big to post here, so i used pastebin. Link: https://pastebin.com/ipa4HEjg


Have fun :)

Ore echange V1.png
Ore echange V1.png (4.52 MiB) Viewed 398 times

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

Another solution for round robin station enable:


I kan look at this for a looong time :D
station round robin selection.gif
station round robin selection.gif (4 MiB) Viewed 391 times

Premu
Inserter
Inserter
Posts: 49
Joined: Wed Nov 13, 2019 4:40 pm
Contact:

Re: enable stations of same name in sequence

Post by Premu »

disentius wrote:
Sun Jun 14, 2020 5:35 pm

Made this in editor mode with an ore source and ore dump attached for testing. The bottleneck is the path from the stacker to the stations, since all trains have to take that one. I do not think it is possible to fully use the 5 exchanges in this setup.
Yes, the yellow section which has to be shared by all trains is pretty long.

In the design I linked I made sure to make this part as short as possible - trains (2-4) needed less than 2 seconds to pass it normally. With that it was possible to fill up five stations completely. I guess up to seven or eight stations might be even possible with such a short bottleneck.

To calculate the maximum allowed travel time, you need to calcualte the percentage of time in which a train needs to be unloaded in each stations to keep it fully supplied, and how long it takes for each train to actually unload. In my case I came to the conclusion that each station must actually unload 50% of the time, and each train needed 10 seconds to unload. So theoretically with a travel time of 2 seconds through the bottleneck up to 10 stations could be fully filled, although in practice you might have jitters leading to a slightly lower practical value. If the travel time is 5 seconds, only four stations could be fully satisified.

A design with a shorter bottleneck will most likely not look as tidy as the OP's design - my definetly doesn't - but might be necessary.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

erm.. can't find the link...

Premu
Inserter
Inserter
Posts: 49
Joined: Wed Nov 13, 2019 4:40 pm
Contact:

Re: enable stations of same name in sequence

Post by Premu »

disentius wrote:
Sun Jun 14, 2020 11:12 pm
erm.. can't find the link...
Ah, I must have mixed the threads up. :oops:

This is my design: viewtopic.php?f=194&p=495282#p495282

User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1009
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: enable stations of same name in sequence

Post by 5thHorseman »

If your stations are unloading so fast that the trains only go to the first one, then is balancing going to help in any way?
Factorio For Beginners Come along with me as I detail (hopefully) every single thing you can do in Factorio with a focus on explaining to beginners, in a lighthearted, slow paced Let's Play style.

varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

Re: enable stations of same name in sequence

Post by varundevan »

disentius wrote:
Sun Jun 14, 2020 5:35 pm
@Premu: Yes, that is viable too.

Here is your blueprint with a few things added:
- MadZuri loading, to fill the chests evenly. (He is the one who invented this)
- Station and signal enable/disable based on the amount of ore in the stations.
- different transfer of ore from unloader to loader.
- All stations are evenly filled, if possible. Output stations are enabled whenever there is enough ore to fill a train.
- added dummy stations to prevent looping when all loaeders would be disablet in case of not enough ore available.

Made this in editor mode with an ore source and ore dump attached for testing. The bottleneck is the path from the stacker to the stations, since all trains have to take that one. I do not think it is possible to fully use the 5 exchanges in this setup.
Blueprint is made for editor mode, with an ore dump and an ore load with infinity chests.
Blueprint is to big to post here, so i used pastebin. Link: https://pastebin.com/ipa4HEjg


Have fun :)


Ore echange V1.png
thanks for sharing your effort , i really appreciate it
i am trying to employ your design and trying to understand it ,
in the meantime , i tried to enable stations based on the lowest ore amount ( even though this does not fill evenly , this fills based on demand created)
can you please share your thoughts in this

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 409
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: enable stations of same name in sequence

Post by disentius »

@5th Horseman:
No, I dont think so.

@Varundevan:
Out of curiosity: What do you need this for? I usually have one (ore more) smelter setup and deliver ore directly to it.

varundevan
Fast Inserter
Fast Inserter
Posts: 107
Joined: Mon Jan 20, 2020 4:41 am
Contact:

Re: enable stations of same name in sequence

Post by varundevan »

disentius wrote:
Mon Jun 15, 2020 8:07 pm
@5th Horseman:
No, I dont think so.

@Varundevan:
Out of curiosity: What do you need this for? I usually have one (ore more) smelter setup and deliver ore directly to it.
actually , i created a 60 spm tilable bp (with its own smelter all it needs is just resources) .. so i can add more and more of those tiles .. like i have shown in an image in this post viewtopic.php?f=18&t=85687

each of the tile requires 60 spm worth of resources , and each tile has 6 trains for iron(2), copper (2) , water , oil , stone and coal ..
as i add more and more tiles , the resources gathering rate slows down even with enough mining set up .. especially for iron and copper...
so i created this loading setup , for delivering (only iron and copper, and they are required more) the resources to the tiles
and then i faced other problem as we discussed in this post ...

Post Reply

Return to “Gameplay Help”

Who is online

Users browsing this forum: No registered users