Train Station detection system.

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
wolfdog07
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Sep 25, 2020 11:25 pm
Contact:

Train Station detection system.

Post by wolfdog07 »

Hello Reader,

I have a train unloader bay that unloads specific mats for each unloader station. Underneath this is a stacker that has 1 row for each mat. I am trying to setup a network system (or whatever) that detects a train at the unloader sending a signal to the stacker telling it to hold the train. I currently have wire going from "Base Iron Unload Station" to "Nove" but I have no idea if this is right or what functions to input.

Thank you for your help in advance.
Attachments
Train Example.PNG
Train Example.PNG (81.03 KiB) Viewed 1350 times

Serenity
Smart Inserter
Smart Inserter
Posts: 1002
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: Train Station detection system.

Post by Serenity »

You can set the train stop to read the presence of a train.

Stopping a train can be done by setting a signal to red. Or letting it wait for some other signal if it's stopped at a train stop (which a stacker doesn't always need)

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Train Station detection system.

Post by astroshak »

Umm ... each train has a unique schedule, right? A train for the Base Copper Unload Station is not going anywhere that it would pick up Iron or Uranium, is it?

Assuming that the Base Copper Unload Station is the only station that such a train would want to visit at the base (ignoring where it picks up the copper) you can accomplish this by Chain Signals. Right before the track splits into the stacker, you would want a Chain Signal. For each individual line in the stacker, you would want a Rail Signal near the entrance, and a Chain Signal at the exit. From there, run (almost) nothing but Chain Signals to all of the stations. When a train is parked at any given station, it should have a Rail Signal right behind it. Also, put a Chain Signal right after each Station.

If you have two trains trying to go to Base Iron Unload Station, one will beat the other there. Due to the Chain Signals looking at the Rail Signal before the station, the train will stop in the stacker and wait for the other train to clear the Station. As long as you have enough parking space in the stacker for all the extra trains, each one will wait in the stacker until the station it is trying to reach is free. At that point, one in the stacker (with that station as its next stop) will move forward into the station.

You don’t need any circuit chicanery to accomplish it. It just works due to the way that Chain and Rail Signals work together. If you want to prevent a train from entering the open station, simply wire up your circuit logic to the Rail Signal that would be located behind the train parked at the station. Turning the station off will just send the train through to the next stop on its itinerary.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2785
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Train Station detection system.

Post by mmmPI »

If you just want to hold the trains into the stacker, using exclusively chain signals from "nove" to the entrance of each unloading station would do the trick.

It would prevent trains from going past the "nove" station if there is no room available for them at the unload.

In this case though you will need to place the "nove" station differently because atm it seems that only 1 lane of the stackers goes through the "nove" station; most likely 1 station in each stacker lane. OR you could just place 1 waypoint "nove" before the lines splits into several forming the stacker.

Then using 1 regular signal to open each lane, and each lane you close with a chain signal and continue using chain signal exclusively up to each unload area.

Which gives strong incentive to place the stacker as close as possible to the unload so that you minimize the part of tracks that trains can only go 1 by 1 .

Also it would require all trains schedule to include "nove" station as a waypoint, with no condition.



Another option would be to name each lane of the stacker individually, using a waypoint station "W-iron" "W-copper" "W-uranium" and so on. Then you can "read trains ID" on the unloading station and you connect each unload station to their appropriate stacker lane with an individual wire. Then you would need to use the "send to train" settings on the "W-iron" "W-copper" station. And finally , in the schedule of each train, you would add the condition "circuit network T=0" when in the stacker lane instead of the no condition for "nove" as previously explained.

This is not the easiest approach and would still require chain sign. but it is possible. It would make it so that when no train is present at the unload station , no signal T would be found, since T is the signal used to display train ID. This would be send to the stacker lane, and be sent to a train waiting there, telling it to go. But if unload station is occupied , then a signal T would be positive, telling the train to wait at the stacker.

You would still need chain signal to avoid the case when the first trains going to iron has just past the stacker, but has not arrived to the unload yet, the second train going to iron at this point will not receive yet a T signal, so it would go past the "W-iron" and block everything.

wolfdog07
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Sep 25, 2020 11:25 pm
Contact:

Re: Train Station detection system.

Post by wolfdog07 »

mmmPI wrote:
Sat Sep 26, 2020 2:35 am
If you just want to hold the trains into the stacker, using exclusively chain signals from "nove" to the entrance of each unloading station would do the trick.

It would prevent trains from going past the "nove" station if there is no room available for them at the unload.

In this case though you will need to place the "nove" station differently because atm it seems that only 1 lane of the stackers goes through the "nove" station; most likely 1 station in each stacker lane. OR you could just place 1 waypoint "nove" before the lines splits into several forming the stacker.

Then using 1 regular signal to open each lane, and each lane you close with a chain signal and continue using chain signal exclusively up to each unload area.

Which gives strong incentive to place the stacker as close as possible to the unload so that you minimize the part of tracks that trains can only go 1 by 1 .

Also it would require all trains schedule to include "nove" station as a waypoint, with no condition.



Another option would be to name each lane of the stacker individually, using a waypoint station "W-iron" "W-copper" "W-uranium" and so on. Then you can "read trains ID" on the unloading station and you connect each unload station to their appropriate stacker lane with an individual wire. Then you would need to use the "send to train" settings on the "W-iron" "W-copper" station. And finally , in the schedule of each train, you would add the condition "circuit network T=0" when in the stacker lane instead of the no condition for "nove" as previously explained.

This is not the easiest approach and would still require chain sign. but it is possible. It would make it so that when no train is present at the unload station , no signal T would be found, since T is the signal used to display train ID. This would be send to the stacker lane, and be sent to a train waiting there, telling it to go. But if unload station is occupied , then a signal T would be positive, telling the train to wait at the stacker.

You would still need chain signal to avoid the case when the first trains going to iron has just past the stacker, but has not arrived to the unload yet, the second train going to iron at this point will not receive yet a T signal, so it would go past the "W-iron" and block everything.
Your second option is the one I was trying to accomplish and you have explained it beautifully. The "Nove" is just 1 station on the stacker for testing purposes while other trains travel through, the plan is to have a named station on each stacker for each unload. I have also set a "Time period" function or something to "Nove" to allow that issue with the two trains arriving at the same time. The main problem I am having was just the circuit functions on the stations and train for example, is the "T" just a random symbol assigned to the ID or is it something else?

If I did the wapoint stations with the circuit network would I still need all of those chain signals? and if so would I place them at the entrance point of each unload station?

Thank you for your post.

wolfdog07
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Sep 25, 2020 11:25 pm
Contact:

Re: Train Station detection system.

Post by wolfdog07 »

astroshak wrote:
Sat Sep 26, 2020 1:12 am
Umm ... each train has a unique schedule, right? A train for the Base Copper Unload Station is not going anywhere that it would pick up Iron or Uranium, is it?

Assuming that the Base Copper Unload Station is the only station that such a train would want to visit at the base (ignoring where it picks up the copper) you can accomplish this by Chain Signals. Right before the track splits into the stacker, you would want a Chain Signal. For each individual line in the stacker, you would want a Rail Signal near the entrance, and a Chain Signal at the exit. From there, run (almost) nothing but Chain Signals to all of the stations. When a train is parked at any given station, it should have a Rail Signal right behind it. Also, put a Chain Signal right after each Station.

If you have two trains trying to go to Base Iron Unload Station, one will beat the other there. Due to the Chain Signals looking at the Rail Signal before the station, the train will stop in the stacker and wait for the other train to clear the Station. As long as you have enough parking space in the stacker for all the extra trains, each one will wait in the stacker until the station it is trying to reach is free. At that point, one in the stacker (with that station as its next stop) will move forward into the station.

You don’t need any circuit chicanery to accomplish it. It just works due to the way that Chain and Rail Signals work together. If you want to prevent a train from entering the open station, simply wire up your circuit logic to the Rail Signal that would be located behind the train parked at the station. Turning the station off will just send the train through to the next stop on its itinerary.
Yes, each train has a unique schdule and yes, the copper train would only go to the copper stations.
I had a feeling you could do it with just chain signals but I already have a fair understanding of all the train processes and thought the circuit network would present an interesting challenge, and it has.

Thank you for your post though.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2785
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Train Station detection system.

Post by mmmPI »

wolfdog07 wrote:
Sat Sep 26, 2020 12:08 pm
The main problem I am having was just the circuit functions on the stations and train for example, is the "T" just a random symbol assigned to the ID or is it something else?

If I did the wapoint stations with the circuit network would I still need all of those chain signals? and if so would I place them at the entrance point of each unload station?

Thank you for your post.
When you use "read trains ID", the game will emit a number ( 105, or 255 or 380 or 455 ...) on a channel/signal, "T". That's how the functionnality works. The ID would be the number that is a multiple of 5.

The first locomotive you place should have "5" as ID, but if you add a wagon to it, it changes its ID and it becomes the next number available, "10", if you then place another loco it would receive the number "15", add a wagon to it and its ID will update to the next number available "20" and so on. ( That's just a rough generic description).

So yes it would seem like it's a random symbol assigned to the ID. ( T for train i guess ;) ).


If you use correctly placed chain signals in correct amount, you don't need all the wiring. It makes it redundant.
file.png
file.png (68.09 KiB) Viewed 1167 times
I would place exclusively chain signals in the green rectangle.
The purple cross represent regular signal.

If you want to have several trains in each stacker lane as pictured by the black arrows, then you HAVE TO place regular signal there.
This is made possible only if you have a "W-iron" "W-copper" "W-uranium" waypoint station to allow trains to stack in their proper area and not block each other.


On the other hand, if you use the wiring at station AND properly set-up the time delay to avoid the "2-trains-following-each-other-going-to-the-same-place" problem you may not need all chain signals, though this is (imo) not the proper way to do it. It would be error-prone and difficult to predict all possible behaviour in edge cases. ( that's not what i usually do but it might work).

Also to answer your 2nd question there is one particular edge case where i am not sure i can tell the difference in behavior between chain and regular signal.
chained2.jpg
chained2.jpg (148.09 KiB) Viewed 1167 times
notice how 3 chain signal are blue ? one could expect them to be red. BUT when they guard a station, chain signal would allow train heading toward the station they guard.

This means you CAN place only chain signal in your case ( the whole green rectangle). but you can also place a regular signal instead of "a2" and "b2" that represent "the entrance point of each station".

Post Reply

Return to “Gameplay Help”