Ok I will give this a shot. My old Imac does not accept some non Mac software to make diagrams so I hope these are readable. This is for a trolley that travels in both directions across an oncoming train. A uni directional trolley only requires one relay.
Here is the track configuration,click to enlarge
IR1 and IR2 are outside insulated rails on the trolley line. The dots represent plastic pins which isolate it from the rest of the rail. They need be only 1 track section long but 1 trolley length before they cross their respective insulated center rail stop blocks. Their purpose is to latch or unlatch a logic relay (relay 1 and relay 2) which determines direction.
A train moving across IR1 will energize relay 1 and latch it electrically. A train moving across IR2 will unlatch it.
Block 1 and Block 2 are isolated center rails also made with plastic pins or gaps cut in the rail. They should be at least the minimum trolley stopping distance. Trolley power is always on in the crossover section between block 1 and 2. This allows the trolley to make it through if it is on the crossover mid section when the train arrives on IR3.
IR3 is on the train track.
IR1,IR2,and IR3 are connected to their respective relays. The train wheels complete the circuit to the coils when the blocks are occupied.
Here is the relay diagram,click on to enlarge. Relay 1 is 3PDT,relay 2 and relay 3 are SPDT. All relays have DC coils. A capacitor and diode is across each coil in proper polarity,the capacitor to make filtered DC and reduce chatter. The diode is for spike suppression.
A separate transformer is used to power the relays. The bridge rectifier converts AC to DC. The minus shares a common with the track. This can also be done with AC current with an unused tap of a track transformer where each relay has its own bridge rectifier. Relay 1 latches electrically in series with the C-NC contacts of relay 2 and in series with the left set of its own C-NO contacts.
A trolley moving from the far left to right will cross IR1 and energize relay 1 and it will latch electrically.
A trolley coming from far right to left will break the electrical latch of relay 1.
The rest of the contacts determine which block will be shut off by the train depending on the trolley direction.
If relay 1 is latched, Block 2 will have power and block 1 will have power unless relay 3 is energized because block 3 is occupied. The trolley will have moved from the far left to right and will stop on block 1 if the train is on block 3.
If relay 1 is unlatched,block 1 will have power and block 2 will have power unless relay 3 is energized because block 3 is occupied. The trolley will move from the far right to the left and will stop on block 2 if the train is on block 3.
When the operating session is over the trolley can be left anywhere but on block 1. The system does not have memory. If memory is desired a twin coiled mechanical latch relay can be used. These are a bit expensive so the relays are cheaper.
If a DPDT relay is used for relay 3,the extra contacts can be used for a crossing flasher or block signal.
The parts to do this cost maybe $25. Relays would be 24VDC coils,10 amp contacts. Capacitors 100uf 35 volt for relay 1, 220uf 35 volt for relays 2 and 3. Diodes 1n4001 or better. A 4 amp bridge rectifier and maybe a barrier strip for easy hookup. 18 gauge wire for track power hookup,22 gauge for relay power. Good to color code to avoid confusion. Use 18VAC for 24VDC relay power. For 12 volt DC relay use 10 VAC.
Clean track and pickup rollers,and thoughtful placement of the blocks and insulated rails are needed to make this work.
C= common on relay contact set
NO= normally open (Connected to common when relay coil is energized)
NC= normally closed (connected to common when relay coil is not energized)
Make sure polarity is correct on capacitors and diodes across the relay coils. A backward capacitor will explode and a backward diode will cause a short in the relay circuit.
Dale H