Page 1 of 1

wait until full/empty function for train stations

Posted: Sat Sep 21, 2013 2:12 am
by reset
Well, I guess the topic is almost enough explanation.
I would like to tell my trains to wait until they are full at the mines and then wait until they are empty at the factory.

Re: wait until full/empty function for train stations

Posted: Sat Sep 21, 2013 3:03 am
by kovarex
This is reasonable addition especially when/if we make the cargo wagon inventory larger.

Re: wait until full/empty function for train stations

Posted: Sat Sep 21, 2013 4:30 am
by n9103
That seems to be pretty much what the train/route scheduling was made for.
Most trains IRL don't run based on load amounts, but on timetables.
It's a matter of fine tuning it.

Re: wait until full/empty function for train stations

Posted: Sat Sep 21, 2013 12:15 pm
by MF-
I would still favor a circuit network integration.
cargo wagon full/empty is easy to detect.

Re: wait until full/empty function for train stations

Posted: Sat Sep 21, 2013 8:29 pm
by ssilk
I would like to have also a signal "train in station", because that's the moment, from where everything could be triggered.

Re: wait until full/empty function for train stations

Posted: Sat Sep 21, 2013 10:18 pm
by n9103
If you want a "train in station" signal, that's easy enough.
Loading stations:
Set up a Smart inserter to load a chest with only one more item than can be grabbed in one action, which depends on your current research level. (i.e. no research, 2 items, level one, 3, etc.)
This chest must be the first in line for being loaded from belts, and either first or last to start unloading, depending on if you want to know when it enters the station, or when it's reached the far end of the station.
It must have a Fast or better inserter to get the items out as fast as they're put in.
Anytime that smart chest has less than the 'inserter stack limit +1' level that was set before, there is a train in the station being loaded.

Unloading Stations:
Have your smart chest either at the near or far side of the station, depending on when you want to receive a signal.
Anytime the smart chest is not empty, there's a train in the station.
Having a slower inserter taking out of the smart chest than putting in means a steady signal, but will increase the latency from when they've stopped unloading to signal that the train is no longer present.
You'll need to have a 2nd chest (smart not required) if you have any level of inserter stack research, in order to keep a signal with low latency.

These setups can be refined with delay circuits to make the inserting/removing inserter only trigger after a short time so that the signal doesn't pulse in the Loader version, or to refine the latency even more on the Unloader.

Re: wait until full/empty function for train stations

Posted: Sun Sep 22, 2013 12:46 am
by ssilk
Well, but its not working in every case. When the wagon is full, when there are no more items coming, when there are too many items in the main station... And it obtains one chest/inserter. I mean ok for the beginning, but to built up a large train/track needs much more reliability than that.

Edge points of a train station:
- the input belts should be splitted into as many belts as wagons to have the same load for all wagons
- symmetrically the output belts should be joined (but joining prefers only left side, so the weighting is very difficult!)
- there should be one big chest (1x5 tiles or 2x5 tiles) for every wagon, not 5, because the chests are uneven filled. The chest should be nearly the same stack-size as the wagons.
- out-signals: train coming/leaving, train standing, one/two/three... wagon full, all wagons full, one/two/three... wagon empty, all wagons empty, timer seconds left...
- in-signals: stop/go, move ahead one wagon position (some kind of filler station, to spare all the stuff to built),

Other non subjects:
- I don't like to guess where to place the signal, so that the wagons stand at the right place.
- I don't like to place the train and wagons and then couple them and then programming. It would be easier, if there is an engine-shed or something, where I can program the next train and insert loks and wagons.
- I don't like to find out, why the train is not moving now. Too many cases, which looks the same.
- if you have a very long track then it would be useful, to make a parallel track and the train can move between the tracks. But you cannot lay he tracks directly parallel, there is no way to connect them, you need some space between the tracks.