Page 1 of 1

[0.15.x] Load Resources from Mines on Request

Posted: Wed Apr 19, 2017 2:07 pm
by Zaka
Updated to V15

This system is designed to collect raw material from Mines and deliver them to Smelters or distribution points. Controllers are resource specific. The blueprints contain 6 Controllers, and 6 Mine Stations, one for each material. This is for ease of placement only.

It is designed with one rule: The number of Trains on the rails must be less than or equal to the number of stations with Resources available to pick up.

There is one problem and I have reported the bug {Bug Report}. When a train is released by the circuit network signal Green > 0 the train schedule does not update the enabled/disabled status of the mine station. To combat this issue you must create an "off track station" on a single piece of isolated track with the same name as the mines.

Train Schedule is as follows:
Iron-Waiting condition Green > 0
Iron-Mine condition Cargo Full
Iron-Smelter condition Cargo Empty

The system sequences through the mines and is configured for 1 to 20 mines.
The system is configured for up to 10 waiting bays.

The mine station is a state machine, it has 5 states and is connected to the controller using the red wire (WAN):
State 0 (Black): Idle
State 1 (Red): Material available for Pick Up
State 2 (Yellow): Station Selected and Material Out to Controller
State 3 (Green): Stop Enabled
State 4 (Cyan): Train Loading, Stop Disabled

The waiting bays are state machines as well, they have 4 states and are connected to the controller using the green wire (LAN):
State 0 (Black): Empty
State 1 (Red): Train at Station
State 2 (Yellow): Train Selected, waiting for Resource Available
State 3 (Green): Train Released

Image

The controller is the heart of the system. The controller contains the counters that sequence thought the mines and the waiting bays. The (F)requency of the counters is 10 and (M)ax is set to 21 and 11 respectively.

Signals on the Red Wire are as follows (relative to the controller):

Code: Select all

Resource (scan)          Avail(in)  Ack (output)
(A)nthracite (Coal)       Coal         1
(C)opper                  Copper       2
(I)ron                    Iron         3
(S)tone                   Stone        4
(O)il                     Oil          5
(U)ranium                 Uranium      6
The main function of the Controller is to maintain the (T)otal Available Count. This is accomplished as follows:
Output to Mines: A=1
Input from Mine: Coal=1 (Pause Mine Scan)
Count Up: T+1
Output to Mines: 1=1
Continue Mine Scan
Input from Waiting Bay: (W)aiting=1 (Pause Waiting Bay Scan)
Output to Waiting Bay 7=1 (Release Train)
Count Down: T-1
Input from Waiting Bay: 8=1 (Train Moving)
Continue Waiting Bay Scan

Image

Blueprints: https://drive.google.com/open?id=0B1hy5 ... 2lCb2tUZVE

I hope that you find this interesting and useful. Comments and Feedback welcome.

- Dakamgi
Previous version

Re: Train on request

Posted: Wed Apr 19, 2017 3:07 pm
by steinio

Re: Train on request

Posted: Wed Apr 19, 2017 3:17 pm
by Zaka
Problem definition states: "No mods allowed."

If I could "win" the game by using mods I would just run creative mode and build a rocket silo surrounded by chests. Definitely unfun.

Sorry, than was a little rude. I know that there are mods out there (Smart Trains for example), but the key is to use the base game to it's best advantage.

PS. I will be updating this when 15 comes out.
- Zaka

Re: Load Resources from Mines on Request

Posted: Mon May 01, 2017 3:27 pm
by Nich
Very nice, and yes I also love the challenges with limited parts

Re: Load Resources from Mines on Request

Posted: Mon May 01, 2017 5:02 pm
by Aeternus
Might be simpler to disable stations that don't need trains yet, and do away with the "brain" alltogether. Simply hold trains in the loading bay until a station requests their presence You could set the count of stations that need trains by running a wide area circuit network via Big Poles along the tracks - 's what I do. Electricity and signalling, all in one. I assume all these oil wells those trains are zipping off to are named with the same station name?

Re: Load Resources from Mines on Request

Posted: Mon May 01, 2017 8:00 pm
by Zaka
Aeternus wrote:Might be simpler to disable stations that don't need trains yet, and do away with the "brain" alltogether. Simply hold trains in the loading bay until a station requests their presence You could set the count of stations that need trains by running a wide area circuit network via Big Poles along the tracks - 's what I do. Electricity and signalling, all in one. I assume all these oil wells those trains are zipping off to are named with the same station name?
Remember that this was built in v14 so disabling a station meant turning a train signal to red.

The trains are going to the refinery (in this case a station that unloads full and loads empty barrels), nothing fancy there.

Signals from the mines are sent back to the (resource specific) counter that tracks the number of UNSERVICED requests (you can see the little blue (black) light blink on the video. When the mine requires service, it sets the rail signal in front of it to green.

When a train is release from the waiting bay, a signal is sent to the counter to decrement the counter as the mine is now being serviced.

The difficulty is that only a number of trains equal to or less than the number of unserviced mines can be released in to the system. Releasing too many trains will result in them getting stuck at a station, because of the red signal blocking it.

Now in v15, I will be changing the logic to enable the station when it requests service. I believe that the number of trains being release will remain important however.

In v14 extra trains would go to other stations (normally the closest). In v15 only 1 station will be enabled and any extra trains will go there. It would be interesting to watch 3 or 4 trains racing to a resource patch to see who can get there to load the resources and more interesting to see what the other trains do when the stop is disabled when it is empty again.

Re: Load Resources from Mines on Request

Posted: Tue May 02, 2017 5:15 pm
by Zonk
Failed to import string unknown version (H)

Re: Load Resources from Mines on Request

Posted: Wed May 03, 2017 5:07 pm
by Aeternus
Zaka wrote:
Aeternus wrote:Might be simpler to disable stations that don't need trains yet, and do away with the "brain" alltogether. Simply hold trains in the loading bay until a station requests their presence You could set the count of stations that need trains by running a wide area circuit network via Big Poles along the tracks - 's what I do. Electricity and signalling, all in one. I assume all these oil wells those trains are zipping off to are named with the same station name?
The difficulty is that only a number of trains equal to or less than the number of unserviced mines can be released in to the system. Releasing too many trains will result in them getting stuck at a station, because of the red signal blocking it.

Now in v15, I will be changing the logic to enable the station when it requests service. I believe that the number of trains being release will remain important however.
Less important if your stations allow both fast loading and are not on dead end rails. If a train reached a station in 0.14 with the signal being red, it'd just wait there until it's green. If a train reaches a disabled station, it'll move past it (disabled stations are skipped). It should repath to the station that actually needs the train. Only potential jam could occur if you can't buffer a train before reaching the station - it'd wait there until the train that reached it first is done loading. So if you got a reasonably fast loading station on a low traffic part of your network, it's not too big a deal.

Re: Load Resources from Mines on Request

Posted: Wed May 03, 2017 6:03 pm
by Shokubai
This is just a long shot thought but I was playing with switches recently and you could use them to turn on/off a depot by killing power to the inserters or drills or whatever. I tried to make an image to guide you along.

The trick here would be to run a dedicated power line from your signal source(wherever you are turning the signal off FROM).

Lets work with Iron Ore
Our Iron ore chests on the UNLOAD of the train depot are wired together and connected to the switch which sits before first pole heading to my Iron Ore.
The Enabled condition (which turns on power to my iron ore depot on the left) could be something like EACH < [some number]. The "some number" here is arbitrary. It could be the total ore capacity of all those chests...or half that... or 0. The point is you want the number to be the amount of ore sitting idle in those chests is the trigger to turn on power to the line of poles that feed your mines. You could modify this a little by putting an arithmetic combinator between the chests and switch. Then have it do something like EACH / [number of chests]. This would give you an average chest load rather than a total that you could use in the switch.

The trains then need orders that work with this idea. The most logical would be to not leave the mines until full. This would keep the trains in queue at the mine (you might need to add a queue) until the mines turned on and produced ore.

This should be expandable using slightly different conditions in the switch such as specifying Iron Ore < X instead of EACH. This would be especially helpful if you are doing universal unload where every unload station handles ever type of input.

Side note...Shift clicking a pole clears it's connections. You can then manually connect them to each other/switches with regular copper cable.
Switches.png
Switches.png (15.39 KiB) Viewed 7619 times

Re: Load Resources from Mines on Request

Posted: Fri May 05, 2017 10:23 pm
by boggis2
in my testing i found out that you can call all the ore of the same type the same and deactivate them if they could not fill a train. i also found a way to only send out the same amount of trains that there were active open outposts. but even tho they were only sent out after the first one had reached the first outpost they still didn't path find to those that wasn't occupied they went for the first open outpost. perhaps someone could design a brain that opens up the ones that are farther away before sending the next train that way that train wil path find tho that one first.

Re: Load Resources from Mines on Request

Posted: Tue May 30, 2017 1:58 am
by Zaka
Updated OP with V15 Video.

Now with State Machines.

Re: [0.15.x] Load Resources from Mines on Request

Posted: Fri Jun 09, 2017 2:36 am
by Zaka
Updated to 0.15.x :D
-Dakamgi