Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

H-bridge/LM324 vs relay control of Tortoise

9149 views
47 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    January 2009
  • From: Maryland
  • 12,859 posts
Posted by ATLANTIC CENTRAL on Monday, September 2, 2019 9:52 PM

Randy,

I only paid a $1 or $2 for all my relays.

I use one relay for each turnout roughly, they provide route selection, interlocking signal logic, and power routing.

I use Dallee inductive detectors which have an output relay onboard.

I use about 13 relays per block for DC cab selection and route verification. Without the route verification cab selection only takes 8 relays.

Those 8 relays are on a circuit board I had made.

Interlockings are actually automated X sections of all the converging blocks, so the number of actual assigned blocks is about half what you would normally think necessary.

There are no drivers for the signals, the actual signal power goes thru a simple logic chain - permission, detection, route - like the prototype they are red unless all three condtions are met. They are all interlocking signals, there are no intermediate blocks between interlockings. There are approach signals before each interlocking.

Relay boards, for turnouts or cab selection, are near the track work they serve, and a few cat5 cables daisy chain them, and connect them to the local towers and CTC panel.

Non CTC areas are even simpler, turnouts are manual but relays are still used for power routing and cab selection.

And remember, nearly 20 years ago when I developed this, much of what you are using did not exist.....

So the one button per route turnout controls with unlimited remote locations, frog power and interlocking logic only require one relay per turnout and the push buttons. That and the signals are fully DCC compatible.

Sheldon 

    

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, September 2, 2019 8:59 PM

ATLANTIC CENTRAL

Randy, the trick is to de-centralize the relay logic.

Sheldon

 

 Now there might be something - replicate the protype in all respects. Though with modern subminiature relays, no need for those big slow moving types used by the railroads, and since lives aren't at risk, the spring in the relay should be fine, no need to rely on gravity to drop out the signal. With dead rail, you could even use a prototypical track circuit for detection, though doing so would render your dead rail locos incompatible with anone else's layout. 

 Still - it is just SO much easier to adjust logic by editing a line or two of code than it is to rewire a chain or relays. There's a reason all-relay l;ogic has pretty much disappeared, and that's just one of them. Even if you get the relays for under $1 each, it will cost a lot more than using one of the $2 microcontrollers, given that hundreds of relays can be replaced by one - and OK, so it's $5 once you add the required supporting components to make it usable. 

 It's all a tradeoff of course, modern components make it almost silly to distribute things too much, but I am not a fan of many of them. Having one board detect 16 blocks may be economical in terms of component cost, but on a decent size laoyout, how close are any 16 blocks? You end up with lots of heavy lines running all over the place. At least the transformer type detectors allow you to just run thin low power signal lines from the detection area back to the control board. Same with signal drivers, the cost difference between one that can drive 4 signal heads and one that can drive 32 heads is nearly negligible. So you can sell a $50 product that runs 4, or a $100 product that runs 32. The only problem is - how often is there an area on a decent size layout that would have 32 signal heads close together? More bundles of wires running all over so you can get 8x the outputs for just 2x the cost.

 I thought about making my servo controller run more than 2. But 2 is a good number - both ends oof a passing siding, or a single direction crossover. I have considered an alternative version for yards or other areas where there will never be remote control, only local buttons, but at best, I can control 3. It dooes use a relay for frog power - that's STILL the easiest way to have a low current device switch a high current.

                               --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, September 2, 2019 7:36 PM

Sheldon
 
I designed and started construction of my current (and last) layout in 1988 before I had any experience with DCC and or the Tortoise so all my track is of that era with the exception of replacement pieces.
 
I never liked the Atlas #65 under layout switch machine from the get go but that was all that was available to me at that time.  Over time I experimented with several Mel Mods which helped the #65 but never made them work like I would have liked them to work.  The thing that worked the best was driving the #65s with 19 VAC. 
 
I converted several Atlas turnouts to the Mel Mod Peco PL-10 switch machine and those work perfect but it requires a huge hole for the PL-10 (2¼”), the g3.7 servo only requires a 1½” hole.  Adding the Peco spring to the Atlas turnout is a real plus.  The combination of the PL-10 and the spring makes a 30 year old Atlas turnout work like new, actually better than a new Atlas.
 
 
I prefer the Peco mod over the servo but the servos are much cheaper than the modification.  About $3 for a working servo turnout against $12 for the Peco mod plus a lot of work per turnout.
 
I only have two Tortoise, one is powering my double crossover the other operates two sets of crossing gates (both soon to be replaced with servos).  The Tortoise is too large for me, especially compared to a g3.7 servo at ” x ¾” x ¾” or even the larger g9 servo ½” x ⅞” x 1⅛”.
 
 
 
Mel
 
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    January 2009
  • From: Maryland
  • 12,859 posts
Posted by ATLANTIC CENTRAL on Monday, September 2, 2019 5:55 PM

Randy, the trick is to de-centralize the relay logic.

Sheldon

    

  • Member since
    January 2009
  • From: Maryland
  • 12,859 posts
Posted by ATLANTIC CENTRAL on Monday, September 2, 2019 5:52 PM

RR_Mel

Sheldon
 
I’m in the process of cutting over to servos to operate my turnouts because my 30 plus year old Atlas #65 under the layout switch machines are failing, I’ve had three in the last year quit.  By quit I mean they won’t cut the mustard anymore.  They get to the point that they won’t hold the point rails to the outside rails, mainly because of plastic throw arm fatigue.
 
I’ve been replacing the Atlas #65s with Peco PL-10s but the cost of the PL-10s has increased and using servos is overall cheaper in quantity than the PL-10s.  The SG90 servo is $1.50 and a good price for a PL-10 is $10.  An $8 Arduino Mega will easily control the 21 turnouts on my layout.  The wiring to the switch machines for the servo is also 3 conductor.  The MEGA will control my turnout indicator LEDs as well as the servo.
 
The servo speed is also controllable by the MEGA.
 
The servos do not take a lot of current to control, less than 2ma per servo.  The control current isn’t a concern when using servos.  The operating current of a servo can go quite high but it isn’t switched, the servo power remains a constant 5 volts.
 
The Arduino (processor) will except any type of input (switched high or switched low) to operate the servo, push button, toggle switch or from a DCC controller.
 
Greg
 
For the cost of an Arduino to operate the servos I wouldn’t attempt making a controlled servo driver.
 
The ability to control the speed of the moving rails and movement with a $8 processor is much easier.
 
 
Mel
 
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
 

Mel,

I understand, but I have not used a twin coil machine in 25 years or more, and I have plenty of tortoise machines.

But mostly, I have no interest in using anything that requires learning/writing code/software.

Did that kind of stuff years ago for work, not interested now.

Since the hobby should be fun, I like working with relays, and they are cheap these days. So is the CAT5 wire to connect my various relay boards and control panels.

Most of my CTC turnouts are controls as whole routes, so for example, it only takes 4 lighted pushbuttons, and 3 conductors (plus the control power feed/common to the whole panel) to control the remote location of a double crossover or a pair of crossovers.

Back at the local panel, another set of push buttons, and those same three conductors, tie into a relay panel that uses three relays, one for each possible route.

The relays are located near the interlocking to minimize wire runs to/from the local panel and the switch machines. The relays drive the Tortoise machines with a single form C contact set and a common ground +/- power supply.

The relays also direct track power, eliminating intermediate blocks, power frogs, and provide signal logic for the interlocking signals.

Signal logic is also simple. I use only interlocking signals and their approach signals.

A detector for each block, and the above mentioned turnout route logic provides the whole signal system.

All hard wired logic, most on bench build relay boards, with no more under layout field connections than solid state would require.

Sheldon 

 

    

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, September 2, 2019 5:50 PM

 I don;t really want a computer screen either - it doesn;t fit witht he 50's era. But the realities of building a layout get in the way, so having a USS CTC panel represented on the computer screen is a reasooonable compromise until the layout is fully fleshed out, at which point a physical CTC machine can be built - it's MUCH easier to modify a few items on a screen when you realize that for proper operataion, another crossover is neeeded at a spot. If it were a physical CTC panel, yoou'd have to shoehorn in another column with signal and switch levers and a code start button.

 On any sort of layout of reasonable size, it becomes impractical to run wires back from every turnout to the dispatcher panel. The real railroads didn;t do this, neither have many model railroaders at least since the late 70's when Bruce Chubb first started talking about the CMRI system. Surely there may have been others also on the bleeding edge as well, althought he original CMRI was highly centralized as well, with the IO motherboard connected usually via prallel IO to the host computer, and then packed full of cards with wires running all over the layout to block detectors, signals, and switch motors. Very messy, even with neat wiring practices. It was the later distributed multidrop serial nodea that made it more like the prototype systems, and even then, the nodes all required talking back to the main computer for logic, even for local function. That's sort of the point of the Arduino based nodes from MRCS - in fact they actually call it the cp-node, and there are some demos on their site of it handling the local logic internally, and only using remote inputs to line routes and for DS override. 

 As for commercial servo controls - there are several, Tam Valley isn't the only one, there are a few other vendors offering servo control systems ready to use, and now Walthers has gotten into the act as well. Even with the cost of an 8 bit microcontroller (depending oon how many pins you need, generally under $2 and sometimes under $1, and how inexpensive servos are, it's a very economical alternative to the classic Tortoise. And WAY less costly than adaptations of the Tortoise that allow you to just plug the parts together like servos do - there's no soldering with most any of the servo control systems, just plug the cables together. Once you start adding the cost of edge connectors for the Tortooise so the wires just plug in, and few of them actually properly fit (I always wondered what they were thinking with the Tortoise, they could have EASILY use a completely standard spacing AND drilled the holes through in a nice parallel row so the user could fit something like a Molex header but instead, all the holes are staggered), you really start getting up there in price. And still have to solder the wires to the edge connectors, though at least you don't have to do that under the layout.

Yes, for local control only, say turnout controls in the fascia for operation by users walking around following their train, a simple toggle switch is absolutely the easiest way to run a Tortoise. But if you need remote control, or computer control, or want to use momentary buttons - you need some sort of driver.

 Another source for circuit ideas is on Rob Paisley's page, he has some Tortoise drivers using 555/556 timers. He also has some circuits to operate solenoid machines with a non-momentary toggle and also have position indicator lights. Tortoises are extremely easy to drive electronically, because the 20ma maximum current is well within the range of the output drive of all but the lowest power logic chips. Another reasoon to avoid those knockoff types that have been appearing lately, nearly all of then are 5-10x the current draw, and so can't be driven with the same sort of electronics. 

                                   --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, September 2, 2019 5:21 PM

ATLANTIC CENTRAL
I can see the reasoning on a layout that size, but I personally don't want any computer screens on my layout.

the interlock doesn't use a screen.   It's a foamboard panel with momentary switches and LEDs indicating turnout position.

I got involved because it wasn't doing what was expected.   After we sorted out the issues, i was able to plug a 15' USB cable into the Arduino under the layout and reprogram it.   No rewiring or soldering.   

Later they wanted some special cases where just one button press would do something.   Changed the code and reprogrammed the Arduino.

greg - Philadelphia & Reading / Reading

  • Member since
    January 2009
  • From: Maryland
  • 12,859 posts
Posted by ATLANTIC CENTRAL on Monday, September 2, 2019 4:58 PM

Ok, makes more sense now. If you are dispatching and signaling with a PC, then driving the switch machines that way makes perfect sense.

I can see the reasoning on a layout that size, but I personally don't want any computer screens on my layout.

Thanks,

Sheldon

    

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, September 2, 2019 4:49 PM

Sheldon
 
I’m in the process of cutting over to servos to operate my turnouts because my 30 plus year old Atlas #65 under the layout switch machines are failing, I’ve had three in the last year quit.  By quit I mean they won’t cut the mustard anymore.  They get to the point that they won’t hold the point rails to the outside rails, mainly because of plastic throw arm fatigue.
 
I’ve been replacing the Atlas #65s with Peco PL-10s but the cost of the PL-10s has increased and using servos is overall cheaper in quantity than the PL-10s.  The SG90 servo is $1.50 and a good price for a PL-10 is $10.  An $8 Arduino Mega will easily control the 21 turnouts on my layout.  The wiring to the switch machines for the servo is also 3 conductor.  The MEGA will control my turnout indicator LEDs as well as the servo.
 
The servo speed is also controllable by the MEGA.
 
The servos do not take a lot of current to control, less than 2ma per servo.  The control current isn’t a concern when using servos.  The operating current of a servo can go quite high but it isn’t switched, the servo power remains a constant 5 volts.
 
The Arduino (processor) will except any type of input (switched high or switched low) to operate the servo, push button, toggle switch or from a DCC controller.
 
Greg
 
For the cost of an Arduino to operate the servos I wouldn’t attempt making a controlled servo driver.
 
The ability to control the speed of the moving rails and movement with a $8 processor is much easier.
 
 
Mel
 
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, September 2, 2019 4:35 PM

ATLANTIC CENTRAL
Remote operation? What kind of processor and why is it needed?

much of the Pacific Southern Railway (PSR) is controled by a dispatcher using custom software on a PC to control turnouts and signals and read occupancy detectors and turnout position using C/MRI-like nodes and the above mentioned latching relays.

 

the New Haven RR uses an Arduino to control Tortoise machines to establish a route thru an interlock using momentary switch at either end of a route to select the route (i.e. diode matrix-ish).

ATLANTIC CENTRAL
Even if one is going to use a processor for signaling, just as much wiring is required with or without processor to control the switch machine.

the PSR is 90x45'.   It is impractical to route wire from all turnouts controlled by the dispatcher to the dispatcher hut, not to mention use panels to mount them.

the PSR has separate graphic displays (above) for monitoring and controlling different sections of the layout.

the C/MRI-like nodes on the PSR provide as much as 24 inputs and outputs.  Nodes are connected using a duplex 3-wire RS-422 bus requiring a single serial interface to the PC in the dispatch hut.

 

ATLANTIC CENTRAL
The processor must control some second level circuit to handle the current - why not just switch that current directly?

the PSR is 50+ year old and uses dual coil machines in the older sections of the layout which are driven using capacitive discharge units (CDU).  The CDU inputs are remotely pulsed from C/MRI nodes.

It also uses relay boards (mentioned in the OP) to control tortoise machines.   Yes, the latching relay coils require ~200ma to control 20ma thru the Tortoise, are pulsed using drive transistors from the nodes.   The I/O node as designed are unable to change the polarity required by the Tortoise machines.

multichannel signal driver boards which minimize I/O by translating 3 I/O per signal aspect to individual LEDs outputs on multiple signal heads.

multi-channel (6) block occupancy detectors outputs connected to  I/O nodes

ATLANTIC CENTRAL
Why are we concerned about current useage? It's a model railroad, not the space shuttle?

you always need to meet the current restrictions of the tech being used.  One reason for using latching relays to drive the Tortoise machines is so that they can be pulsed (200ma), rather than have to maintain that current.

greg - Philadelphia & Reading / Reading

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, September 2, 2019 3:58 PM

RR_Mel
I’m surprised that Atlas or other major manufacture hasn’t come out with a servo type switch machine

would it be integrated into the switch plastic or have to be mounted separately under the layout.

would Atlas marker something similar to TAM Valley driver?

could you drive a servo to either extreme simply by having two pulse generators: 1ms and 2 ms, and use a switch to route on the other to a servo to push from one position to the other?

greg - Philadelphia & Reading / Reading

  • Member since
    January 2009
  • From: Maryland
  • 12,859 posts
Posted by ATLANTIC CENTRAL on Monday, September 2, 2019 3:48 PM

I don't really have any thing to offer here except a question.

Remote operation? What kind of processor and why is it needed?

Every CTC turnout on my layout is controlled both on the CTC panel and at a local tower panel....without any processors, just simple ice cube relays.

Position is reported, and position status is used for signal logic.

Even if one is going to use a processor for signaling, just as much wiring is required with or without processor to control the switch machine.

The processor must control some second level circuit to handle the current - why not just switch that current directly?

A simple motor starter push button circuit allows unlimited sets of push button stations with status lights. 

Why are we concerned about current useage? It's a model railroad, not the space shuttle?

Sheldon

    

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, September 2, 2019 3:35 PM

I’m surprised that Atlas or other major manufacture hasn’t come out with a servo type switch machine, that’s surely the way technology is headed.  The TAM Valley servo drivers work great.   They should be able to compete with the Tortoise in price.  The eBay import cost of a 7g servo is under $1 and has plenty of power, much more power than a Tortoise.
 
 
Mel
 
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, September 2, 2019 3:13 PM

nothings seems simpler for non-remote operation of Tortoise machines than a dpdt switch wired as a reversing swtich.

remote operation of dual coil machines would need higher current and the ability to turn off which could be done w/ an h-bridge.

greg - Philadelphia & Reading / Reading

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, September 2, 2019 2:30 PM

I’ve used momentary toggles to control my Atlas turnout switch machines since the early 60s so when I got my first Tortoise I went with a matching DPDT toggle.  Everything matches and the operation is the same with the Tortoise toggle staying in the position as the turnout.
 
Pretty simple.
 
I have to admit I did go with latching relays for my Atlas turnout visual indication about 20 years ago (DS2Y-S-DC12V), again simple and they never fail.  When the power is turned off the turnouts and indicators are correct when the power is turned back on.
 
I found a seller that didn’t know what he was selling and I bought a box of 24 relays for $15 and back then S&H was about $2.
 
KISS, and I'm stupid when it comes to turnout control.
 
EDIT: 
 
I guess you could put me in the Stupid Category, I’m working on replacing all of my switch machines with servos and a processor.  I wouldn’t be cutting over to servos if my 30+ year old Atlas switch machines weren’t crapping out.
 
 
Mel
 
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, September 2, 2019 1:50 PM

what is normal (remote) wiring?

how is polarity controlled with op-amps? now i see.  why aren't they wired as inverting drivers?

is complexity measured by the circuit in the chip or the number of chips, relays?

greg - Philadelphia & Reading / Reading

  • Member since
    December 2004
  • From: Bedford, MA, USA
  • 21,345 posts
Posted by MisterBeasley on Monday, September 2, 2019 1:39 PM

I have to wonder if adding so much extra complexity to save a few milliamps is worth it.  What will this do BETTER than normal Tortoise wiring?

It takes an iron man to play with a toy iron horse. 

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, September 2, 2019 1:31 PM

 I don;t think you even need to go as complex as a H bridge driver - the SMC12 stall motor driver that's part of the CMRI system uses an LM324 quad omp amp, each LM324 drives 2 tortoises. It's only possible because the Tortoise current draw is so low. They're just used as inverters - an LM339 would probably work as well, but me and LM339s don;t get along for some reason (I think the school lab had a batch of bad ones, had to go through dozens to get my senior project to work)

https://cdn.shopify.com/s/files/1/0947/9088/files/SMC12_Parts_List.pdf?10562711970168125787

                                             --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
H-bridge/LM324 vs relay control of Tortoise
Posted by gregc on Monday, September 2, 2019 9:08 AM

one approach for remote (processor) control of Tortoise switch machines uses a latching relay and relay driver (ULN2803) (relay coil requires ~200 ma).   A latching relay avoids the need to constantly drive the relay, minimizing relay coil current.   The relay and driver boards may be separate commercial boards.

i think a more economical and spacewise alternative is to use an H-bridge (L293).

an H-bridge can be driven with lower current digital outputs and with two outputs, reverse the polarity allowing a single 12V supply to be used to drive the tortoise (two outputs are required for a latching relay as well).

an L293 is a dual H-bridge that can support two Tortoise machines.   If an MPC23017 16-Bit  I/O expander were used along with four L293s, eight Tortoise machines could be supported.   Of course an H-bridge could be used in other applications requiring higher current or polarity reversal, as well as simply on/off.

greg - Philadelphia & Reading / Reading

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!