CSXT1534

Hello all,

First time poster and a serial lurker to MRH, and I have begun to bite the bullet into getting my future big pike controlled. I recently watched Little Wicket Railways YouTube videos describing the aspects of using servos, JMRI/CMRI and all that. I recently purchased my first Uno, 10 SG90 servos, 2- PCA9685s, and assorted jumpers to begin some field testing. Currently, I model an HO Scale West Virginia coal hauler set in 1986, roughly 21x12' as my 1st Phase Build, with a NCE Pro for control. The includes what is essentially a loop, with a 9 track class yard, 4 track Arrival/Departure yard (end of which will continue onto future expansion) and 2 small branches, one in town and one industrial. I seem to hit a roadblock in my understanding of how the Arduino based JMRI/CMRI system works as well as mounting and assembly of the servos to the underside of my layout.

What my plan is to eventually do, is run my system such as mainline switches are controlled by a Dispatcher using Dispatcher Pro, however, I would like the local industry switches (and those in sidings) to be locally controlled by a panel assembled to the side of the facia. In order to do this, will each section that needs to be locally controlled, have to have it's own CMRI node and Arduino? I also want to tie these into a signal system as well (JMRI CSX/Chessie 2014 Rules), and I am a little fuzzy on how to accomplish that. What my thought is essentially, is to create a small test bed layout and begin to putz around with it as well as ask questions on how to accomplish what I'd like to do?

My other question is mounting the servos to the underside of the layout. Most of the designs I have seen for current SG90 servo holders for switch motor use a 2 piece design. While this is great, I am unsure my resin printer could handle making it accurate enough to make it work and not brittle. My base is 1/8" ply with a 1" foam top for sound deadening, and I haven't come across examples of how to accomplish this attachment. I use Peco Code 83 Electrofogs (not powering the frogs) as my choice of turnouts and again, YouTube and other data I've been able to find hasn't been as specific as I had hoped. Any pointers, or shoves in the right direction are very welcome.

Reply 0
earlyrail

My version Servo Mounting Block

ingBlock.jpg 

This was designed to mount the 9G Servos.  This is a friction fit and may need a shim.

Moderator note: Resized graphic, added link to full size version in new window.

Reply 0
HVT Dave

Servo Mount

I have used this method, similar to earlyrail's version above, but much simpler.  The wire should work fine thru your layer of foam.

 

 

Dave

Member of the Four Amigos

 

Reply 0
Ted Becker rail.bird

Servo mounting

Unfortunately I don't any decent photos but these should get the idea across.  Glue a pad of hardboard or other rigid material to the bottom of the turnout.  It is glued to the bottom of the ties, there are some missing ties in the photo.  Also this pad had to be trimmed to fit in a tight situation.

Precut a slot in the pad to align with the throw bar.  Keep the slot narrow so ballast doesn't fall through.  Cut the ear off the servo then glue the servo to the pad.  The brass fittings can be had from RC airplane suppliers.  I forgot what they are called.  The wire has a sharp 90 bend at the top and drops through a hole in the throwbar and the two fittings on the servo arm.  The setscrew can hold the wire down but is not allways needed.  No sharp point sticking up to snag on track cleaner or passing rolling stock.

Since the photo was taken the method has been refined.  The bottom fitting is in the end hole in the servo arm, farthest from the turnout.  The second fitting is on the same side of the servo arm.  Goal is to make the wire as long as possible for more spring flex in the wire.  This has been working well with 0.025" music wire.

The photo shows a FastTracks turnout.  I make sure the pad is glued to the PC ties.  I've used acrylic caulk but will be trying E6000.

Cut away the cork roadbed then cut a rectangular hole in the subroadbed.  The pad should be larger than the hole.  The servo is 1/2" wide, I cut the hole 5/8" wide.  The pads I use are 1 7/16" X 2 1/4".  Dimensions are not critical.  Mine are sized to cover the spacing of the FT PC ties.

Beauty of this approach is the servo is connected to the turnout and all adjustments can be done on the bench.

47-33(5).jpg 36-37(2).jpg 


Ted Becker

Granite Falls, WA

Reply 0
VSOTTO

Welcome to the deep end

Welcome to the rabbit hole, it can get quite deep here.  I too just watched the Little WIcket video and it has reenergized me to continue on using JMRI/CMRI using arduinos. 

Using a separate CMRI node & Arduino for each local section is probably a matter of preference and physical distance that separates each section.  IIRC, the max rated length of a servo wire is somewhat short  - it could work for longer distances, but you might begin to see intermittent problems (btw, intermittent problems are the hardest to solve).  You could locate your PCA9685 centrally between the local servos (to keep servo leads short) and have a longer lead from the arduino to the PCA.  Also, keep in mind that you can daisy-chain the PCAs from one to the next. 

If I can offer a suggestion, even if you want your local industry switches controlled from a panel on the facia, have the buttons on the panel "talk" to JMRI (via CMRI or another means) and then have JMRI actually control the turnouts.  The panel/turnouts dont need to be included in Dispatcher Pro (but the can!).  This will me much more robust in the future and software is much easier to change than hardware if you ever change your mind.  Also, depending on what you do with the signaling aspects, you already know the state of the local industry turnouts. 

Here is a mockup of how I attach my turnout servos.  Hopefully, it's clear.  The wood simulates the 3/4" plywood base.  I cut off one of the tabs on the side of the servos, and mount it into a 1/2" Aluminum U bracket.  A little glue works great.  The Arm on the servo pivots through a hole in the bracket (the same principle as a Tortoise) and through the hole in the throw-rod on the turnout.  The DPST micro switch is to route power to the frog. 

95705860.jpg 

Reply 1
Terry Chamberlain jterryc

Quad Servo DCC Decoder

You might find my article on a DIY servo decoder, which was published in the February and March 2020 editions of MRH Magazine, of interest and a possible starting point. I posted an improved version on this forum in February this year. All of the details are also available my own website from which you can download all the documentation and code listing. The code is fully commented and may give you a good idea of what you can do with an Arduino - although targeted at an Arduino Nano, it will run on any of the common Arduino modules.

Also made to accompany the original articles is a short video showing how the decoder is used to set up and adjust the servo throws to suit the turnouts in use, and the rate at which they are thrown. The video shows how I mounted the servos under the turnouts, using mounts which were 3-D printed by my brother Derek. These mounts were fairly basic, but have now gone through another 3 or 4 design iterations to produce a much better system.

The picture below shows the original (blue) design against the current model (green) -

ts_40(2).jpg 

The new design uses a slider (the red component) which is moved from side-to-side by the servo. The turnout actuating wire is fitted to the slider, either vertically as shown, or horizontally depending on your layout requirements. In either position the wire is held by screws which allow a wide range of adjustment, as shown in the front and top views below - 

nt_40(1).jpg op_40(2).jpg 

The mount incorporates space to fit a couple of microswitches which can be used to switch the polarity of the turnout frog and to indicate the current position of the turnout to whatever software you are using to run your layout. The microswitches are actuated by the "hammerhead" extension to the slider - 

ow_40(1).jpg 

I hope this gives you some ideas about what can be achieved.

Terry Chamberlain

Back_320.png    A Free Windows application for all NCE Systems

https://www.a-train-systems.co.uk/atrack

Reply 0
vasouthern

It works

I got into the arduino / CMRI world a few months back. Several good resources to look at and start learning.

The end result is a NANO based CMRI / JMRI signal system that I built custom circuit boards for and did a complete signal system with, including home built block detectors and signal masts. In short, these handy chips can create about anything you want. I also will use servos for turnout control in a staging yard.

Places to start learning, I think most of these can be searched as I dont have links handy:

Dronebot workshop, lots of great arduino how to on lots of topics, Bill has excellent videos

Utrainia has a section on CMRI and I learned from his code.

youtube has lots of videos on arduino programming and some on CMRI.

Geoff Bunza has alot here on MRH to look at too.

The code I created is very simple, and works. Its easy as set the node address, setup JMRI for your module inputs and outputs, then let JMRI do the work turning things on and off, reading inputs and work the logic of decisions. Think of a node as having inputs. These can monitor blocks, a switch or push button. JMRI reads that input and decides what to do with it, like on a busy block, set signal 1 to RED and signal 2 to YELLOW. The outputs are just as easy, a output can be low or high ( think TTL logic ) that can turn on a LED, drive a servo control to move a turnout, or change polarity on a bipolar switch motor. Its NOT that hard....

Let JMRI do the hard work, the arduino just connects to JMRI with a RS485 or some other serial network, which is easy to do. Then its whatever you can imagine getting them to do. For a few bucks and some time you have a system running anything.....

Randy McKenzie
Virginia Southern - Ho triple decker 32x38

DCC++EX, JMRI, CMRI, Digitrax,  DIY Electronics
On Facebook:   http://www.facebook.com/groups/485922974770191/

Proto freelance merger of the CRR and Interstate

Based on the north end of the Clinchfield.

Author: MRH Article:  June 2014 issue Fast and Easy Trees.

Reply 0
CandOfan

"protype" layout

In more or less your situation, but without the 21x12' set up, I literally did build a prototype layout, precisely to experiment with Dispatcher Pro, JMRI stuff, Arduinos, etc. I am REALLY glad that I did. I've learned A LOT building a layout where mistakes don't matter much. It is very liberating to know that if you build something and it doesn't work out, it just doesn't matter much because it'll just be torn down in a few months anyway. I experimented with a LOT of things, some of which I like (such as LCC, mostly) and some of which I'm less endeared with (simple signal logic in JMRI).

If you have the space, I'd still recommend building an experimental layout just for doing this stuff, particularly when you are exploring new territory such as the servo switch motors, etc. You can re-use most of the materials anyway, but having the freedom to experiment and NOT worry about messing up "the good stuff" is very much to be recommended.

Modeling the C&O in Virginia in 1943, 1927 and 1918

Reply 0
VSOTTO

home built block detectors

Randy, 

Quote:

including home built block detectors and signal masts

I would be very interested in seeing more info about the home built block detectors that you used.  Most of my experimenting has been with Bruce Chubb's DCCODs connected to the arduinos through a custom PCB that I designed.  I've purchased a couple "arduino modules" that utilize the "donut" current transformers, but as of yet, haven't gotten satisfactory results. 

Reply 0
vasouthern

Shorted bridge

My circuit is a shorted bridge rectifier, which means it uses the 4 diodes, getting  a voltage drop across them, roughly 1.2 volts. I take that drop and turn on a transistor, which turns on a optocoupler. The opto then is "active low" to the input of the arduino.

Sound trickier than it is, and I built a circuit board that holds 6, 8 or 12 blocks. 

I dont have a image handy, but if you look up my facebook page for the layout, I have some pics there.

I am working on creating a presentation on my system for a RPM meet this fall.

Randy McKenzie
Virginia Southern - Ho triple decker 32x38

DCC++EX, JMRI, CMRI, Digitrax,  DIY Electronics
On Facebook:   http://www.facebook.com/groups/485922974770191/

Proto freelance merger of the CRR and Interstate

Based on the north end of the Clinchfield.

Author: MRH Article:  June 2014 issue Fast and Easy Trees.

Reply 0
CSXT1534

So, I am unsure if I want to

So, I am unsure if I want to actually incorporate DCC accessory decoders into my set-up. I get they are great if you wanna switch stuff via your DCC controller, but I prefer the old panel idea. Like I said, is I'd like to have dispatcher only control of the mainline switches (double track), but the local industry tracks off sidings, and in the the arrival and departure yard to be controlled by the operator working them.

I am also a little uneasy on using the aluminum channel idea for holding the servos, so I guess I am going to have to really dig in and figure out what I am doing, as most of the tutorial videos I've seen seem vague on mounting the servos. I had thought about mounting them horizontal instead of vertical as a space savings. What my original plan was, was to essentially mount the servo under the layout and run the rod up thru. Guess I'll have to look around a bit and start playing with stuff. My Ardunio arrived, but my PC9685s are lost in the mail at the moment.

Reply 0
vasouthern

A byte or bite at a

A byte or bite at a time.

Start with the arduino and learn about the servo control, Dronebot workshop has some excellent tutorials.

Then you can work on mounts and wiring, then expand as you learn.

As for DCC accessory, I prefer to use DCC only for train control, everything else is run by its own system. Keeps it simple and easier to figure out problems. KISS????

Enjoy the ride, you have a learning curve coming but its honestly not bad. The arduino can do alot, for a few dollars, and was fun to build. 

Randy McKenzie
Virginia Southern - Ho triple decker 32x38

DCC++EX, JMRI, CMRI, Digitrax,  DIY Electronics
On Facebook:   http://www.facebook.com/groups/485922974770191/

Proto freelance merger of the CRR and Interstate

Based on the north end of the Clinchfield.

Author: MRH Article:  June 2014 issue Fast and Easy Trees.

Reply 0
Ron Ventura Notace

Would these mounts be useful

Hi.

I’ve mounted my servos using some mounts I found on Thingiverse, and subsequently adjusted to my own needs. Here are the Tinkercad links to them.

https://www.tinkercad.com/things/hvXbvUeq30a-servo-mount-four-slots

https://www.tinkercad.com/things/i3V7yM75xVL-servo-mount-snap-in

Both of them mount the servos horizontally. The first requires the mounting screws that typically come with servos. If you print these, print them standing up, or drill out the mounting holes before screwing them in. Printed flat, the layer lines go across the screw holes, which is a possible failure point if you create too much stress when screwing in the screws.

The second mount is a snap in which doesn’t need any screws. Sorry I don’t have any photos. 

Ron Ventura

Melbourne, Australia

Reply 0
VSOTTO

Kiss mounting servos

It sounds like you've put a lot of thought into mounting the servos, which is good.  But don't make it more complicated than it needs to be.  Back when I was flying RC airplanes, I sometimes just used hot glue to attach the servos to whatever surface was convenient.  And looking closer at my test setup, I did indeed use hot glue to attach the servo to the Al U channel.  I yanked on it a bunch, and it's not going anywhere!

Reply 0
jdetray

Hot Glue for Servos

I, too, built and flew RC aircraft.

Hot Glue does a fine job of holding servos in place on the bottom of my layout. For extra security I add a styrene strap, also secured with hot glue. In a couple of hard-to-reach locations I took the further precaution of fastening the ends of the strap with small wood screws (not pictured here).

 - Jeff

bottom_a.png 

Reply 0
Erik A. Erik84750
VSOTTO wrote:

home built block detectors

Randy, 

VSOTTO wrote:

I would be very interested in seeing more info about the home built block detectors that you used.  Most of my experimenting has been with Bruce Chubb's DCCODs connected to the arduinos through a custom PCB that I designed.  I've purchased a couple "arduino modules" that utilize the "donut" current transformers, but as of yet, haven't gotten satisfactory results. 



I made the DCCOD detector. It can detect in my case DCC currents down to about 10mA.

If you use the 3-stage opamp circuit and 5000:5 CT's available on AliExpress it works well in my opinion.
Reply 0
Reply