Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Minecart transportation schemes  (Read 9557 times)

anzelm

  • Bay Watcher
    • View Profile
Minecart transportation schemes
« on: June 09, 2013, 01:03:16 pm »

There was a minecart oriented topic some time ago (http://www.bay12forums.com/smf/index.php?topic=109460.0), but it dealed with detailed mechanics. I'd like to see how you deal with minecart transportation systems on a large scale (and gather the ideas in one place) - OpenTTD style: http://wiki.openttdcoop.org/images/5/55/SnakeNest.png. There is some info on the wiki, but it involves detailed mechanics and only one, very basic usage example.
Here is my try:

Simple: single source, single destination, dwarf interaction required at source:
Code: [Select]
S - source stop, maximum friction, set to push on full
D - destination stop, minimum friction, dump wherever, no route point needed
<>v^ - roller with direction (apply as needed)
B - retracting bridge
 
 S═════╗<╗
       ╚>╚════╗═D
              ╚>╝
With proper roller use this works between levels, the split in the middle allows for speedup while having the cart run in both directions.

More advanced: allows you to setup lever-controlled destination anywhere along the loop (think block delivery for great wall project). Link levers to retracting bridges to control destination point. Single source, multiple destinations, dwarf dwarf interaction required at source:

Code: [Select]
dump at north destination (south bridge can be extended/retracted):

    ╔D╗
╔══<╝═╚══╗
║        ║
║        ║
║        ║
║   S════╝╗
║        ╔╝
║        ║
║  ╔D╗   ║
╚══BBB>══╝

dump at south destination:

    ╔D╗
╔══<BBB══╗
║        ║
║        ║
║        ║
║   S════╝╗
║        ╔╝
║        ║
║  ╔D╗   ║
╚══╝═╚>══╝

On a loop going all around a 4x4 embark (with a 10 tile margin) I used only one roller in this setup.
Logged
And they raise their wooden pints
And they yoik and sing
And they fight and dance till the morning!

Suoli

  • Bay Watcher
    • View Profile
Re: Minecart transportation schemes
« Reply #1 on: June 09, 2013, 03:21:53 pm »

I've got an idea for an automatic airlock that keeps dwarves out of the railway system.

Code: [Select]
#######
═pDS═ #
###h###

═ - track
p - pressure plate, linked to the door and the hatch
D - door
S- track stop used for loading
empty space - an open pit
h - hatch covering an open pit

Normally, the only path to the railway system is through a pit with no ramp or a door that can't be opened by a dwarf. When an empty cart enters from the west, it triggers the pressure plate, opening the door and the hatch. The cart can now pass on to the track stop but the dwarfs can't get to it until the pressure plate resets, closing the hatch and the door. This ensures that dwarves can't ever be in the same area with a moving cart.

When the cart is loaded, it is pushed east, where it will fall one z-level on to a downward ramp/impulse ramp/roller powered track and move on to it's destination, which should have a similar setup for unloading. The dwarves, of course, can't follow the cart through a sheer drop.

The pit under the hatch should have a path leading out in case someone is standing on the hatch while a cart is moving on to the pressure plate.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Minecart transportation schemes
« Reply #2 on: June 10, 2013, 09:11:51 am »

Hmm, I've designed a system that I've been planning to build for some time now. No time for DF now, so only plans so far...

The idea is to have a double helix track that spans all the z-levels of the fortress, any cart can enter at any point, and the exit points can be controlled with doors. Here's how a quickfort template looks like:
Spoiler: 8z Helix (click to show/hide)

The blue track head downwards (direction is towards the 'h'/channel), the red track heads upwards (h-»d). You can enter/exit the helix at every even level, and you put rollers/derail ramps+track stops on every odd level to power/slow down your minecarts. The empty squares at the edges show the entry points, you can mine all of those, while the white 'd' letters at the edges show the possible exit points: these tiles should only be mined if you want to use that z-level, and should be covered with doors, because every minecart WILL exit otherwise.
If you plan to build it with derail ramps, then the 3x3 in the middle can be a stairway, in case of rollers you channel the middle tile and build axles/gears there. According to my calculations the powered design uses 7,5 power/level.

The next step is designing the machine components:
Spoiler: Machinery (click to show/hide)

You need one changeover switch (SYSx) per minecart route, and one power-to-signal converter (LOOPSYS). The LOOPSYS is to stop any two minecarts from entering the system at the same time. I used the designs by TinyPirate and Bloodbeard from this board.

How this should work:
The dwarves load a minecart at TS0, and push it when a condition is met. The cart exits the loading station, trigger PP1, which changes the state of SYS1:

PP4 is ON, which opens the exit door from the helix on the destination floor, the return door on the starting level, (and any extra doors on the way... Dx+Dy+etc,). Plus triggers LOOPSYS, which closes all the doors (DL) marked with yellow to stop any other minecarts from being launched. They will go around in the small loop in the launching station waiting for their turn. The roller there shouldn't be on highest power, the exact ammount is yet to be determined....

PP3 is OFF, which switches ON the dumping trackstop (TS1) at the destination, and closes Dz, so the cart will know where to return.

...and the cart dumps at TS1, returns to the starting position, triggers PP2, which resets SYS1. LOOPSYS is turned OFF, DLs OPEN, so any other minecarts that were filled and pushed will be free to enter the system.

And this is how I plan to build it into a modular system:
Spoiler: Production modul (click to show/hide)

Color codes
gray: track system
red: power system
yellow: loop doors
orange: living rooms, 42/modul
purple: stockpiles
brownish: workshops, dining room, statue garden

These 3 levels are meant to be a self contained burrow.  Raw materials arrive at z+1, finished goods go to z-1, workshops in between. On the right side of the stockpiles you can see the dumping stations, on the left the loading stations. I think I went a bit crazy with the size, 8 launching station is a lot, the bottom workshops can be removed so the design fits into 38x50 tiles, and the stockpiles can even be lot smaller, as we are doing quantum stockpiling anyway... The finished fortress would have 3-5 of these production modules. Magmaworkshops can be a bit tricky to build on z-1, you need to think it through before you start digging. Ideally you'd use minecarts to fill a 1 tile hole with magma underneath your smelters.

Food and cloth hauling routes need to have a destination at every module, so the logic circuit will be different for these: combine 4-5 newton cradles that take a single input, but cycle their output. Or build a 'clock' that advances one with every haul. Fairly easy to do.

Strip mining operations can be moved pretty easily once the system is ready: The destination for the ores/stones remains the same, so all you need to do is build (and connect) a new exit door (from the helix) on the new strip mining floor, and deconstuct/reconstruct the door on the abandoned floor.

Important: while I tested some of the components, the whole system is yet untested. I'm fairly confident this works more or less as planned, but I don't know if it's worth the trouble in the long run.
I tried designing a system that can tolerate more then one cart in the sytem at the same time, but the logic circuit tends to get VERRY complicated. Using weight adjusted pressure plates tailored to the exact weight of an empty minecart can help, but then you'll need extra pressure plates after the dumping station. The weight of a full minecart is always unknown, so the best you can do is having a full and an empty cart in the system at the same time. The design of the loading system is also more complicated this way (PP2 goes into the common corridor, +100 tick reset delay...), and you need a logic circuit that can give 3 distinct signals: (full en route, empty returning, loading), and the number of possible hauling routes equals the number of minecarts with different weights. So I ditched that idea, but maybe you can come up with something...

Is this what you had in mind?
« Last Edit: June 10, 2013, 09:23:42 am by fricy »
Logged

anzelm

  • Bay Watcher
    • View Profile
Re: Minecart transportation schemes
« Reply #3 on: June 10, 2013, 03:35:18 pm »

@fricy, this is impressive. Suppose it's worthwile to build a test system even if only as proof of concept. Long routes can be divided into blocks with looping waiting areas in each one, so you can have more than one cart moving at once. Another problem is cart switching - there's no good way to filter carts with a switch without dwarves pulling levers (I mean a solution that makes steel bars from source A turn left at a switch, and stone from source B go straight ahead, automatically). The only way to do this is with pressure plates and weights, but that involves tedious calculations with every new cargo.

If you know the exact sequence of your different cargo shipments, some nice switching is possible with flip-flops, but then one delayed shipment makes all th other wait.
Logged
And they raise their wooden pints
And they yoik and sing
And they fight and dance till the morning!

Suoli

  • Bay Watcher
    • View Profile
Re: Minecart transportation schemes
« Reply #4 on: June 10, 2013, 05:23:45 pm »

I tried designing a system that can tolerate more then one cart in the sytem at the same time, but the logic circuit tends to get VERRY complicated.

What do you think about adding a pressure plate at the loading stop that triggers a timer when the cart gets pushed en route? When the cart gets close to it's destination, the timer opens a sidetrack that leads to the output stop. A pressure plate at the beginning of the sidetrack opens another sidetrack that will lead following minecarts around and back to the main track. After a hundred ticks, both sidetracks close, leaving only the main track. Here's a shoddy picture:
Code: [Select]
                   p2__destination
                 /
 loading->p1---21---------->main track
             |  \___/
             |
             ^
             |
          main track

So:
1. P1 triggers a timer, which triggers rail switch 1 exactly as the cart is arriving, which leads the loaded cart to the upper path.
2.  P2 triggers switch 2, which leads all the following minecarts around switch 1 and back to the main track.
3. Sidetracks close after 100 ticks.

Of course, the timer would need to be very precise and the lower sidetrack would need to have the same travel time as the main track. A lot of work but it could give you a super efficient track system.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Minecart transportation schemes
« Reply #5 on: June 11, 2013, 09:28:02 am »

Another problem is cart switching - there's no good way to filter carts with a switch without dwarves pulling levers (I mean a solution that makes steel bars from source A turn left at a switch, and stone from source B go straight ahead, automatically). The only way to do this is with pressure plates and weights, but that involves tedious calculations with every new cargo.

Well, this system is designed to do exactly that. You set one of the loading modules for steel bars to floor 2, another one for blocks to the surface. The switching logic takes care of the rest, no need to pull levers, manual labor is required only at the loading bay. In fact, the tracks on image 3 can be much simpler, the convoluted web of track that surround the staircase are not necessary, as long as you send the cart from the blue exit to the blue entry point it will find it's way back as long as the bottom and the top of the helix is connected in a loop. They are there to shorten the hauling route, so your cart doesn't have to make a full cycle to the bottom/top before returning. Complexity for the sake of speed. If your helix is like 40z level high, you're better with a simpler design, but with 120z levels to travel (twice!) those extra tracks can speed up the process.

I did some research on the workflows too, and my conclusion is that 8 loading station is more than enough to to transport away all the possible product from a burrow, and none of my burrows would have more then 6 (different) incoming raw materials. For example one route is enough to transport the flux stones and ores to the magma smelters, one for sand (clay), one goblinite, one for food and one for clothing. Outgoing routes would be weapons, blocks, trade goods, bins/barrels and maybe furniture. A strip mining floor would transport ores/flux to the smelters, and gems/stones to the crafters, so that's only 2 routes...
A lot depends on how you build your burrows, and where you put your workshops. Like does the cloth industry go to the food section to be close to the pig fiber industry, or do you choose to put into the crafting floor, and work on a silk farm? These details matter...

What do you think about adding a pressure plate at the loading stop that triggers a timer when the cart gets pushed en route? When the cart gets close to it's destination, the timer opens a sidetrack that leads to the output stop. A pressure plate at the beginning of the sidetrack opens another sidetrack that will lead following minecarts around and back to the main track. After a hundred ticks, both sidetracks close, leaving only the main track.
Of course, the timer would need to be very precise and the lower sidetrack would need to have the same travel time as the main track. A lot of work but it could give you a super efficient track system.

First problem I see is that if you have more than one cart in the system, you cannot know which cart will reach p1 first. If your full-to-the brim magma cart reach your booze dumper first, you're going to have a "slight" problem. :)
Weight adjust p.plates are only possible with empty carts, as there's no way to know the exact weight of a full minecart. A notable exception is a magma/water filled cart, so these routes MUST have weight adjust pressure plate separating the loading/dumping sections from the rest of the track system to minimize !!FUN!!.
It may be possible to make timers which open the sidetracks at exactly the right moment, but all the hauling routes will need to have a custom timer prebuilt. And if you have such a timer then sidetrack are not necessary: you just have the timer active the dumping station at the right moment.
However building a timer THAT precisely is out of my league. :(

The most precise timing is possible with gears/rollers: one plate switches it on for max. 100 ticks, and you can have another plate switch it off without delay. But you cannot get rid of the 100 ticks reset cycle, as when both plate reset you'll get a "phantom signal", which has a chance to screw with you.

Inspired by this idea, here's a rough mockup of an alternate design to the loading station: Instead of doors, this one uses powered rollers to pull/push the cart from the track into the station. G0 is always on, G1 is activated by LOOPSYS, and G2 is switched on with PP5, and switched off with PP2. PP5 is weight adjusted, so only the desired empty cart activates it. If we want to build a system which can have more than one active cart inside, this provides much faster switching, and doesn't block the main track with a closed door like the previous design.

Spoiler: Launching with rollers (click to show/hide)

But the main problem with having more then one cart is to do with dumping, not the launching sequence: You want to link your quantum dumps to your regular stockpiles, so you dwarves won't try to haul the contents back to the destination burrow by hand. Even if you confine you dwarves into burrows, you need extra haulers that can access any part of the fortress, and the masons and miners need to go anywhere too. That means, if you have a bad dump (for eg. wood got dumped into the ores stockpile because of a timing error) it will sit there, no dwarf will touch it because the linked stockpile won't accept it. That is only annoying, but things will start to get interesting when you manage to dump magma into a food stockpile, or a cart full of adamantine into a magma reservoir...

A possible solution is what I mentioned in my previous post: max. 2 carts in the system, one empty, one full, and only one active dumping trackstop. The sequence is almost the same as before, but you have a weight adjusted plate after the dumping station that triggers on the empty cart launching another full cart.

Complication no1: The changeover switch can only handle 2 states, so different logic is needed with three states:
full en route (Dx, Dy OPEN, TS1 ON, LOOPSYS OFF)
empty returning (Dx, Dy OPEN, TS1 OFF, LOOPSYS ON) -» second cart can launch
empty@home (Dx, Dy CLOSE, TS1 OFF, LOOPSYS ON)
I tried designing one with minecart logic, but couldn't come up with anything that uses less than 4 carts. That's 2 newton cradle just to build one hauling route. Not worth the trouble when you need to build at least 15-20... Fluid logic can be a solution, but I'm no expert on those. Plus building that many connections is PITA.

Complication no2: Suppose you have two active routes at the same time, and both of them return to the same floor. That means SYS1 and SYS2 will both want to open the same door (Dm). But when SYS1 is deactivated, it will close Dm despite SYS2 still needing it, so cart2 will get stuck in the system without a valid route back. Plus it's the same with LOOPSYS: both routes will want to keep it switched on, so you need a huge AND gate. (3 gears x number of routes)
(Or do I overcomplicate things, and will SYS2 be able to keep that door open despite it receiving a CLOSE signal? If yes, then ignore this. Although I have a few ideas on how to solve that, but I'll let it rest for now.)

Complication no3: Every hauling route must have a cart with unique weight. So unless you want to start modding the density of materials, you are limited to how many hauling routes you can have. I have not counted how many carts are possible, but the fact that iron is the same weight as steel means you have less then optimal solutions.

Damn, that's a long post. I guess I'll stop now. :D
« Last Edit: June 11, 2013, 10:34:07 am by fricy »
Logged

Suoli

  • Bay Watcher
    • View Profile
Re: Minecart transportation schemes
« Reply #6 on: June 11, 2013, 10:11:29 am »

First problem I see is that if you have more than one cart in the system, you cannot know which cart will reach p1 first.

To clarify, p1 should only be accessible from the associated loading area, so that it's only activated when you push a cart off to the main track.

Quote
It may be possible to make timers which open the sidetracks at exactly the right moment, but all the hauling routes will need to have a custom timer prebuilt. And if you have such a timer then sidetrack are not necessary: you just have the timer active the dumping station at the right moment.
Building it THAT precisely is out of my league. :(

Building the timers shouldn't be very difficult at all if you're using rollers instead of pushing to launch loaded carts. Just count the straight and curved track tiles on a given route and build an ever so slightly shorter copy somewhere with a pressure plate at the end. The loaded cart triggers the timer cart and they both should travel at the same speed. Ideally, the timer reaches it's pressure plate exactly one tile before the loaded cart reaches the dump sidetrack.

The sidetracks are necessary for eliminating the 100 tick delay. Exactly 1 tile of travel time after the off loading sidetrack is opened, the loaded cart will trigger p2, which effectively closes the loading sidetrack by re-routing any following carts back to the main track. The delay between opening the loading sidetrack and opening the re-routing sidetrack is 1 tile of travel time. If all your carts are moving at the same speed, it is practically impossible for an unwanted cart to squeeze in between opening and closing the off loading path. After a 100 ticks, the off loading path closes first and the re-routing path a few ticks after that.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Minecart transportation schemes
« Reply #7 on: June 11, 2013, 01:17:24 pm »

Hmm, so instead of building newton cradles you propose building an identical track to time the sequence. Difficult, but not impossible:
I'm thinking one long track with a couple of minecarts with different weight, and weight adjusted p.plates at the precise location. The  pressure plates at the loading stations can launch the corresponding cart into the timer, which can time the dumping sidetrack. If the sidetracks can only be accessed with the pulling roller design then we can overcome the 100 tick delay. Worth investigating.

EDIT: You still need the newton cradles to keep the doors open, but the dumping stop doesn't need to be switched. And you don't need the looping behavior at launch, any cart can enter.
Complication no.2 still stands though: the helix doors need to be kept open despite 2 (or more) conflicting signals. If you put those on the timing track you'll run out of tiles fast as you build the hauling routes.
EDIT2 !DAMN!: And still need to deal with the 100 tick delay, any cart entering an extra floor will mess up your timing.
So we are basically at square one: As long as you have more than one cart in the system, you can never know how long it takes to get from point A from point B, because new carts will open up new track sections borking your ever so precise timing. :(
I'm starting to understand what Erwin Schroedinger must have felt like. At least if we can solve this I get a new career option studying quantum physics. :)

MAYBE the helix can be redesigned, so instead of opening doors you use the pulling rollers to get carts on the intended floor. But that's going to be complicated, the current design does not make it easy to put gears/rollers on the even levels (the walls are in the way), so either a completely new helix is needed (and I suspect it won't fit an 5x5 area), or you need to get power from a different z level.
« Last Edit: June 11, 2013, 02:03:58 pm by fricy »
Logged

Suoli

  • Bay Watcher
    • View Profile
Re: Minecart transportation schemes
« Reply #8 on: June 11, 2013, 03:16:33 pm »

Hmm, so instead of building newton cradles you propose building an identical track to time the sequence. Difficult, but not impossible:
I'm thinking one long track with a couple of minecarts with different weight, and weight adjusted p.plates at the precise location. The  pressure plates at the loading stations can launch the corresponding cart into the timer, which can time the dumping sidetrack. If the sidetracks can only be accessed with the pulling roller design then we can overcome the 100 tick delay. Worth investigating.

I'm not terribly familiar with rollers so can't say which way is the best but you could very easily execute the track switches with doors or hatches. The wiki has pretty good illustrations, namely the second and third one: http://dwarffortresswiki.org/index.php/Minecarts#Switching. For the third one, I'd substitute the bridge with a hatch that covers the corner.

Quote
EDIT: You still need the newton cradles to keep the doors open, but the dumping stop doesn't need to be switched. And you don't need the looping behavior at launch, any cart can enter.
Complication no.2 still stands though: the helix doors need to be kept open despite 2 (or more) conflicting signals. If you put those on the timing track you'll run out of tiles fast as you build the hauling routes.

Yes, that's a tricky one. You'd need some kind of signal filter unit for each helix door that ignores pre-emptive close-signals when there's been two or more consequtive open-signals.

Quote
EDIT2 !DAMN!: And still need to deal with the 100 tick delay, any cart entering an extra floor will mess up your timing.
So we are basically at square one: As long as you have more than one cart in the system, you can never know how long it takes to get from point A from point B, because new carts will open up new track sections borking your ever so precise timing. :(

Nah, you just need to make sure that the re-routing tracks have the same travel time from the switch to the reconvergence point as the main track. This will require some calculations but it's nothing complicated.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Minecart transportation schemes
« Reply #9 on: June 11, 2013, 04:49:21 pm »

I'm not terribly familiar with rollers so can't say which way is the best but you could very easily execute the track switches with doors or hatches. The wiki has pretty good illustrations, namely the second and third one: http://dwarffortresswiki.org/index.php/Minecarts#Switching. For the third one, I'd substitute the bridge with a hatch that covers the corner.

Yeah, bridges are slow. But the main problem with precise timing is the 100 ticks the plate takes to reset the cycle. Your proposal to use two switches is an elegant solution to this delay, and that's what I'm trying to overcome with the pulling roller design too. Doors, bridges, etc. can't be closed with a secondary p.plate, you have to wait for them to close on their own, but a gear can be switched any time, so with 2 p.plates you can theoretically build a roller that is only ON for a tick making a much faster minecart switch. The catch is, it will have a "phantom signal" for the same length as the first ON signal, but it will emerge 100 ticks later when the 2 plates reset. AFAIK no one has tried it yet, but common sense says it should work. In theory. :)

Quote
Yes, that's a tricky one. You'd need some kind of signal filter unit for each helix door that ignores pre-emptive close-signals when there's been two or more consequtive open-signals.

I don't want to build dwarven computer, just a minecart system. :) But yeah, that can be done: an OR GATE with 5-6 inputs plus a latch to open a door in the helix. Great idea.


Quote
EDIT2 !DAMN!: And still need to deal with the 100 tick delay, any cart entering an extra floor will mess up your timing.
So we are basically at square one: As long as you have more than one cart in the system, you can never know how long it takes to get from point A from point B, because new carts will open up new track sections borking your ever so precise timing. :(
Quote
Nah, you just need to make sure that the re-routing tracks have the same travel time from the switch to the reconvergence point as the main track. This will require some calculations but it's nothing complicated.

Unfortunately this is serious problem:
Let's say Cart A goes from z+15 to z+5, while Cart B goes from z+10 to z0. You have a timer that knows the exact time it takes to get cart A to the drop-off point on z+5, you test it, it works. But when Cart B is activated it opens a valid exit point on z+10, so Cart A will need to go from z+15 to z+10 first, miss the timing, go back to the helix and continue to z+5, go back to the helix, go to the bottom, continue to the top, go to z+15, fail to exit the system due to being loaded, so in one word it will get stuck. And the same goes to Cart B, as it will too have to enter z+5, and miss it's exit point on z0.
And the biggest complication is that you can never know which of the routes will be active at the same time, some depart condition will be push when full, food should be pushed in 10 days or so, another condition for sand bags... Some routes will block each other, others will not.

Maybe I misunderstand what you propose to do with sidetracks, but I can't see how they would solve this.  :(
« Last Edit: June 11, 2013, 06:00:50 pm by fricy »
Logged

Suoli

  • Bay Watcher
    • View Profile
Re: Minecart transportation schemes
« Reply #10 on: June 11, 2013, 08:29:33 pm »

Unfortunately this is serious problem:
Let's say Cart A goes from z+15 to z+5, while Cart B goes from z+10 to z0. You have a timer that knows the exact time it takes to get cart A to the drop-off point on z+5, you test it, it works. But when Cart B is activated it opens a valid exit point on z+10, so Cart A will need to go from z+15 to z+10 first, miss the timing, go back to the helix and continue to z+5, go back to the helix, go to the bottom, continue to the top, go to z+15, fail to exit the system due to being loaded, so in one word it will get stuck. And the same goes to Cart B, as it will too have to enter z+5, and miss it's exit point on z0.
And the biggest complication is that you can never know which of the routes will be active at the same time, some depart condition will be push when full, food should be pushed in 10 days or so, another condition for sand bags... Some routes will block each other, others will not. But you never know which ones will be active concurrently.

Maybe I misunderstand what you propose to do with sidetracks, but I can't see how they would solve this.  :(

Ok, I think I see what you mean. This may or may not be helpful but I think there might be a way to activate a door for exactly x ticks, then close it for 99-x ticks, then open it for x ticks and so on. You just need a looping, symmetrical track with two pressure plates on opposite sides and 100-x ticks of travel time between them. For x=10 and a travel time of 90 ticks between plates, when a minecart is set to cycle the loop at a steady speed, the ON/OFF signals cycle as follows:

0      |ON    << The door receives two ON signals from two different plates,
90    |ON    <<opening it once and ignoring the second ON signal.
100  |OFF   << The first plate sends it's close signal, hopefully closing the door.
180  |ON    << Back to the beginning of the loop. First plate sends an open signal.
190  |OFF   << The second plate, triggered at 90 ticks, sends it's OFF signal, closing the door.
270  |ON    << The second plate triggers, sending an ON signal.
280  |OFF   << And so on.
ticks|

According to my napkin math, 4 pressure plates on a round loop, for x=10 and a distance of 45 ticks between plates gives a 10/35 tick ON/OFF cycle. As far as I can tell, you can use this principle with variable distances and pressur plates to produce just about any kind of cycle you want.

So, how does this help with the helix doors? When the cycle is started, there's a 100 tick period of ON signal before the first OFF signal, which makes it pretty useless if the cycle is triggered when a loaded cart is launched. Well, you could set the signal cycler to a 1 ON/98 OFF cycle and hope that a cart traveling slower than 1 tile per tick never tries to get through a door that is open for 1 tick. If it doesn't, then you basically have a device that sends an OFF signal every 99 ticks. The next step would be to restrict the launching of minecarts to a 99-tick cycle and synchronizing each launch point so that a cart traveling from there would arrive at it's destination helix door at the 99-n mark in the cycle, where n is the time it takes for the cart to travel one tile. Then, on the timer track that I proposed earlier, you would place a pressure plate that sends an ON signal to the helix door at 99-n, opening the way for the cart. At the 99 mark, there's an OFF signal from the signal cycler, closing the door exactly n ticks after it was opened. At 199-n, there's another OFF signal from the timer that basically does nothing.

Thus you have a door that always opens for 1 tick and on demand for n ticks, in 99 tick cycles. If a cart can squeeze through while the door is open for 1 tick, my next move would be to see what happens when two pressure plates send conflicting signals exactly at the same time.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Minecart transportation schemes
« Reply #11 on: June 12, 2013, 05:08:33 am »

 :D That is brilliant! That can be the Ultimate Minecart System. Hell of a project to design, but it can work. I need to wrap my head around the idea...

In the meantime here's an economical OR gate that can be used as the LOOPSYS and also to open the helix doors for the first design. This is a modification of Veylon's OR gate combined with the ramped power-to-signal converter, so it only moves when powered:

Spoiler: Ramped OR gate (click to show/hide)

The trick is to use the left roller to provide power to the input gears in the middle (Ga, Gb), that way you can build it with less components. Any hauling route would activate one of the input gears switching ON the roller on the right, sending a minecart towards the ramp to activate the p.plate. The design is quite flexible and cheap, for handling 10 inputs you only need 3 gears, 2 ropes, one plate, one minecart plus 2 gears/input signal.

EDIT:
When all inputs are OFF the cart travels in the right loop. When any of the input gears is toggled the right roller is switched off, so the cart can trigger the pressure plate. This design doesn't need pre-toggled input gears, so one gear/signal is enough, but the minecart is always moving, even in passive mode.

Now to build a logic that can handle 3 states, and we have a system that can contain one full and any number of empty carts reliably, although I think it would be wise to somehow reduce the number of doors used in the helix so less of these OR gates is needed. I guess it can work if we only use the upward spiral (pink) as an exit point, and substitute the downward spiral with a drop chute. That increases the travel time of an individual cart, but having more carts inside would(?) balance that out. That is more than I thought possible.
« Last Edit: June 12, 2013, 08:18:24 am by fricy »
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Minecart transportation schemes
« Reply #12 on: June 18, 2013, 12:59:09 pm »

Prototyping continues.

I made some extensive modification to my plans, now I'm working on a design that can have 1 loaded and any empty minecarts simultaniously in the system. Of course I ran into some issues:

Spoiler: Launching station v6 (click to show/hide)
I remodelled the launching stations with roller based designs. Possible to do, but the speed of the rollers and the positioning of walls is crucial. A dwarven push can be redirected with a low speed roller, going any higher will derail the cart to TS0. Then a cart kept moving with a  low speed roller can be switched with a medium speed roller IF the roller's exit point has a wall covering the direction a cart would follow naturally.

I ditched the double helix in favor of a simpler design with drop chute and an upward spiral, only to realize that rollers cannot give enough speed to carts to induce controlled derailing. Ouch. So I'm back to the first double helix idea, but now up stream is always an entrance, and when coming down the carts can reach escape velocity and exit. That means any cart will have to travel to the top before finding it's dumping stop. It also means that I'll need tons of track tops to regulate cart speed.

EDIT:
http://dwarffortresswiki.org/index.php/Minecarts#Switching. For the third one, I'd substitute the bridge with a hatch that covers the corner.

Yeah, retracting bridges/hatches to exit the spiral, this way I can overcome the lack of speed problem, oh yeah. :) Off to do some testing with delays/ derailing problems. Thx for the tip.

And finally: I made the math, and realized that there is only 10 (9?) possible empty minecart pressure plate triggers in the game (vanilla). (The pressure plate's sensitivity can only be adjusted with 50 urists steps, weight range is 0-2000 urist. It's hard coded :( ) So in theory we cannot go any higher then 10 automatic hauling routes. Modding the materials can expand that range somewhat, but the absolute limit you can have is 40 different weight triggers, and you arrive in dangerous territory around the weight of 1000 urists, as you won't be able to tell the difference between a heavy empty minecart or a loaded light one. I managed to solve this, but it introduced another level of complexity (~9 additional mechanism/route: PPa->GC, PPc->Local loop, PPd->G3) into the necessary logic circuit...

Hopefully next post will have all the details ironed out and I can give an estimates of the materials needed. It will be a lot, power needs for the logic board for one burrow (8 stations) is 300-400 with the additional scaffolding. Here's a how the driving logic will look like:
Spoiler (click to show/hide)
« Last Edit: June 19, 2013, 07:37:18 am by fricy »
Logged