Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Help Me Simplify My Minecart logic  (Read 1483 times)

Ravendarksky

  • Bay Watcher
    • View Profile
    • DFMon.exe - Get rid of DF SPAM
Help Me Simplify My Minecart logic
« on: August 06, 2013, 11:51:38 am »

Hi all,

I've made a few minecart logic parts and I'm not sure if I can simplify them any further, or if indeed they do anything new.
Can someone take a look and tell me what is comparable on the wiki and if I could simplify them any further? I will post the finished articles to the wiki if they are indeed useful.

My only rule is that I don't want to use impulse ramps.

Machine 1: Sends an on signal (like a pressure plate) when a lever is switched on: (Optionally send second on signal when lever is turned off)

Basically two rollers powered by gears. Connect common gear to a a switch.

When switched on: Mine cart will go clockwise over the pressure plate (output signal) and then get caught in a clockwise loop on the four end squares until power is turned off.

When switched off: At this point it breaks free of the loop and continues clockwise back to the starting position. You can add a second pressure plate for the off path if desired.



Machine 2: Sends an on switch (like a lever) when vertical bars are toggled by a pressure plate (option of having an off switch by adding a second pressure plate under the starting minecart position)

Basically two minecarts are sitting blocked by vertical bars, with the second minecart powered by fast rollers. When the bars are toggled the second minecart pushes the first minecart and they both travel around to the second lot of vertical bars. The first minecart then sits on a switch holding it ON until an off signal is sent and it returns to the start.



By connecting each pressure plate to the vertical bars in front of it you also have a fairly nice repeater. You can chain as many of these together as you want for an accurate clock timer.
« Last Edit: August 06, 2013, 11:54:39 am by Ravendarksky »
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Help Me Simplify My Minecart logic
« Reply #1 on: August 06, 2013, 03:06:09 pm »

General tips for simplification:
Feed the switching gears off a side of a roller. Much easier to build multiple logic cells that way, then using gears and axles.
There's a modified pressure plate in Dfhack that doesn't need minecarts to send a signal. It just detects power in the gears that are next to it.

And for the first design: have you tried ramped power-to-signal converters?
wall_roller_pressureplate_upramp_wall

Larix

  • Bay Watcher
    • View Profile
Re: Help Me Simplify My Minecart logic
« Reply #2 on: August 06, 2013, 04:01:09 pm »

The way you build your devices depends much on what kinds of signals you have, and which you want to generate. If you want to send a 'constant' signal (actually not constant, just a single 'on' not accompanied by an 'off'), you need to hold the pressure plate down. If you want to send a 'pulse' signal (an 'on', followed by an 'off'), you must make sure that the cart passes over the plate only once (or at least doesn't keep it constantly activated).

For a device that sends a signal as long as it's provided with power, the power-to-signal converters offer several options.

I'd recommend either the ramp-based one, the one with two opposing rollers or my improved circular design:

   

There are two converters in the picture, below only the paths are shown, above the basic installation with roller (pushing north) and pressure plate. It has the advantage that it can be extremely space-economical, because gear assemblies can be placed on top of the track without hindering the cart.

If you want to e.g. convert a lever flip into a short 'on' signal, the easiest approach would be to use a pair of alternating rollers:
Code: [Select]
#R-R#
.G.G.
The 'R'ollers push against each other and the 'G'ears powering them are linked to the same lever, but one is pre-toggled, so that one activates when the lever is in the 'on', the other when it's in the 'off' position. Each lever flip will thus send the cart to the other roller _once_, and a pressure plate between the two rollers will send a signal. A handy trick when you want to start a process that actually needs devices to 'cycle' and not set to a single position (which is what levers normally do).

Using the activation delay of some buildings as a timing mechanism for minecart processes is a pretty neat idea. You can forgo the second minecart by putting the pressure plate _before_ the roller pushing against the door/floodgate etc., the 'open' signal will still process; although this will slightly increase your repeat period. You can deliberately lengthen the period by using the different behaviour of bridges:

Conservative power-based bridge repeater:

 

A raising bridge, roller pushing west, two pressure plates: the one directly west of the bridge is linked to the bridge, the one north of the roller is linked to the gear providing power. The passing cart switches the roller off and comes to rest on the roller. ~100 steps later, the roller reactivates, but by now the bridge has processed its 'on' signal and is raised, blocking passage. Another ~100 steps later, the bridge lowers again and lets the cart through, which passes over the pressure plate sending another 'on' signal, ordering the bridge to raise 100 steps later, and cycles around over the roller-deactivating plate. It's probably possible to run it off a single pressure plate, but getting build/activation order wrong could mean the cart gets its push off the roller before the bridge has raised, causing the cart to either pass through early _or_ get crushed by the bridge raising while the cart's trying to pass.
Logged

Ravendarksky

  • Bay Watcher
    • View Profile
    • DFMon.exe - Get rid of DF SPAM
Re: Help Me Simplify My Minecart logic
« Reply #3 on: August 06, 2013, 05:04:26 pm »

The way you build your devices depends much on what kinds of signals you have, and which you want to generate. If you want to send a 'constant' signal (actually not constant, just a single 'on' not accompanied by an 'off'), you need to hold the pressure plate down. If you want to send a 'pulse' signal (an 'on', followed by an 'off'), you must make sure that the cart passes over the plate only once (or at least doesn't keep it constantly activated).

For a device that sends a signal as long as it's provided with power, the power-to-signal converters offer several options.

I'd recommend either the ramp-based one, the one with two opposing rollers or my improved circular design:

   

There are two converters in the picture, below only the paths are shown, above the basic installation with roller (pushing north) and pressure plate. It has the advantage that it can be extremely space-economical, because gear assemblies can be placed on top of the track without hindering the cart.

If you want to e.g. convert a lever flip into a short 'on' signal, the easiest approach would be to use a pair of alternating rollers:
Code: [Select]
#R-R#
.G.G.
The 'R'ollers push against each other and the 'G'ears powering them are linked to the same lever, but one is pre-toggled, so that one activates when the lever is in the 'on', the other when it's in the 'off' position. Each lever flip will thus send the cart to the other roller _once_, and a pressure plate between the two rollers will send a signal. A handy trick when you want to start a process that actually needs devices to 'cycle' and not set to a single position (which is what levers normally do).

Using the activation delay of some buildings as a timing mechanism for minecart processes is a pretty neat idea. You can forgo the second minecart by putting the pressure plate _before_ the roller pushing against the door/floodgate etc., the 'open' signal will still process; although this will slightly increase your repeat period. You can deliberately lengthen the period by using the different behaviour of bridges:

Conservative power-based bridge repeater:

 

A raising bridge, roller pushing west, two pressure plates: the one directly west of the bridge is linked to the bridge, the one north of the roller is linked to the gear providing power. The passing cart switches the roller off and comes to rest on the roller. ~100 steps later, the roller reactivates, but by now the bridge has processed its 'on' signal and is raised, blocking passage. Another ~100 steps later, the bridge lowers again and lets the cart through, which passes over the pressure plate sending another 'on' signal, ordering the bridge to raise 100 steps later, and cycles around over the roller-deactivating plate. It's probably possible to run it off a single pressure plate, but getting build/activation order wrong could mean the cart gets its push off the roller before the bridge has raised, causing the cart to either pass through early _or_ get crushed by the bridge raising while the cart's trying to pass.

Thanks for this very useful reply!

The design I'm setting up is as follows:
A Lever, should send a short pulse signal to turn things briefly on , and then keep something ON until an OFF is received
When turned off I want it to send a DIFFERENT signal and not toggle the ON again..

After thinking about it a bit more I think my machine 1 will cover this, with three pressure plates. One on the ON circuit (ON briefly only once), One on the OFF circuit (Off briefly only once) and one on the loop (ON until OFF).

I like the idea of your repeater as it provides twice the delay, but I think I will stick with my one as it can be quite compact when done in sequence: Roller,Plate,Bars,Roller,Plate,Bars etc.

You are right that you could use one mine cart instead and have the rollers AFTER the pressure switch... but this way you can get plates to stay pressed until the bars open, which can be useful for some things. I don't understand the appeal of logic circuit bridges, I always end up crushing things :(

Definitely going to use your circular converter design. Thanks :)
Logged