N Gauge Herkat Traverser

In a fit of enthusiasm I purchased a manual Traverser for use as a "base station" on my railway layout. The very next thought in my head was how to motorise it. After a superficial scan of various model railway forums I came to the conclusion that the way to go was an Arduino kit incorporating a stepper motor. Initially I was hopeful that a contact supplied to me would result in detailed help but in the end I decided to bite the bullet and see how far I could get with going at it alone. So my question is very very basic. What elements do I need to get this project off the ground. An Arduino Uno seems a first step, along with a motor shield, a stepper motor, a power supply and some programming sketches. Can anyone out there lend a hand and giude me through my very first project. I have photos I can supply and would gladly respond to any suggestions or supplementary questions which anyone might have

Hi the9libraries, welcome to the forum.
Post the pictures here. Follow this handy guide to posting images. As a new forum member, you might be limited on what you can attach.

One of my first questions is how does the manual mechanics move the traverser? That would likely be the first step in deciding what hardware you need to purchase.

It might be as easy as having an appropriately sized stepper motor spinning a threaded rod that runs a nut back and forth. That nut would be attached to your existing mechanics. There are a lot of suppliers that make low friction, high accuracy pieces like this.

To illustrate the meaning (I think): Model railroad traverser project.

These links may help

Stepper Motor Basics
Simple Stepper Code

How will the motor cause the traverser to move?

Getting a computer to provide the precise positioning to align N gauge tracks can be tricky. The human eye or the gentle touch of a finger have a very high level of subconscious precision.

...R

Many thanks for the replies and for the welcome to the forum given to a total novice. My enthusiasm has been kindled in applying arduino solutions to the more difficult aspects of a model railway layout! As has been suggested, I am being limited at first as to the file size I can upload so I will have to restrict myself to just the one for now, but this should nicely illustrate how my impulse Ebay purchase arrived with me. It will almost certainly need some mechanical adjustment anyway but, in answer to the question posed, it is goverened at the moment by applying pressure to the rod that you see to move it between the "home" track and the six "exit" tracks. The positioning is governed by the indentations that you see at regular intervals. It just drops in and out of them to regulate the movement. The cut off wiring indicates that it was once powered, of course. I can attach a further photo of the top side in a later post.
ANYWAY, I have knuckled down to teach myself the Arduino way of doing things at the age of 67 and I know I am going to enjoy myself. First off I have ordered a UNO 3 and breadboard and that should arrive this week whereupon I will install Arduino for Windows which I have already downloaded. I am really looking forward to experimenting with sketches. One basic question. I presume I can easily delete sketches as and when I need to? As far as further hardware is concerned, I have ordered(from China, where else!) a drive motor shield and a stepper motor that I think will suit the UNO. Any advice on that front will be gratefully accepted. Presumably, also, a dedicated transformer as power source would be best, but can it be shared with other aspects of the layout? i have four tranformers available so either way it is not a problem

I looked at you initial post and got wondering about this sort of device.
Of course, it led me down a rabbit hole :slight_smile:

One which might be of interest was this record of Cramdin Yard.

He has a transverser in his layout (does not make an appearance until quite a ways into the project) and by the sounds of it, does not have as many tracks to cope with.

However, it is a nice build that you might enjoy looking at.

As to your particular project, your last post did not have any pictures attached, and a link to the particular transverser you purchased would be helpful.

Deleting sketches is no problem at all. Although I do suggest that you maintain some backup copies. Each time you make a significant change to the code and/or design, rename that sketch with a new version number. That way you can 1) Keep track of your progress and 2) Go back if a particular idea does not work

Looking forwards to seeing the transverser you got :wink:

the9libraries:
Iam being limited at first as to the file size I can upload so I will have to restrict myself to just the one for now,

You don't seem to have uploaded anything.

whereupon I will install Arduino for Windows which I have already downloaded

You can install the IDE without having any Arduino board and you can play around with the example programs. You will be able to compile (verify) programs but obviously you won't be able to upload them until your Uno arrives.

...R

Thanks again for the advice, guys. I DID actually (or thought I did) add a new post saying that I was barred at this stage from uploading unverified images. So i am working around this by uploading to my site and can now give these two references

http://the9libraries.org.uk/test/418.JPG

http://the9libraries.org.uk/test/419.JPG

My actual site is http://the9libraries.org.uk/template/indexDesktop.php and I will eventually be including content on the whole of the N Gauge layout

Some JPG images are not accepted and I think that is because they contain EXIF data from the camera. Converting them to PNGs is probably the simplest solution.

Images from Reply #7 so we don't have to download them. See this Simple Image Guide

...R

I cannot tell from the images how it is supposed to be controlled. Are those things with red ends push-rods for the human hand?

...R

In looking around, I came across this thread. There are a couple of interesting pics there. Including one of the underside of a motorised version of your transverser.
The pic of the motorised version indicate that you would probable need to replace the two rods you currently have.

There is also a link to a turntable project which could be bent to your needs.

Yes, the rods certainly seem to indicate that they were the means to mechanically adjust positions. The thread on the N gauge forum was actually posted by me originally though under a different username so how would you know! It gave me the idea to embark on Arduino. The "objective" is to match the motorised version that someone on THAT forum found for me. I did not know that it was a Herkat traverser until then. I am thinking that I will have to install wiring to each of the stop positions before I go any further

Steve

Looking at that motorised version, they used brush contacts to determine when the trolley was in position.
You could go that way, which would mean using at least 7 digital inputs on the Arduino.

An alternative is to do something similar to the project that was linked in that thread.

You essentially program each stop by manually positioning the trolley. The controller will then know where each position is by counting the number of steps it takes to get from one point to another.
This means that you can do away with most sensors, apart from one limit switch which can define the 'home' position.

There are two downsides to that approach. Using a threaded screw to drive the trolley will suffer from what is known as backlash.
It is only small (also depending on the pitch of the thread and size of drive cog) but will over time throw the positioning out. Which means that the controller will have to be calibrated occasionally.

The other downside you'd have to 'park' the transverser before turning the unit off, and ensure that it is in the same state when you turn it back on again.

darrob:
This means that you can do away with most sensors, apart from one limit switch which can define the 'home' position.

There are two downsides to that approach. Using a threaded screw to drive the trolley will suffer from what is known as backlash.
It is only small (also depending on the pitch of the thread and size of drive cog) but will over time throw the positioning out. Which means that the controller will have to be calibrated occasionally.

Backlash in a screw system should be predictable and by adding a few extra steps when the motor changes direction it can be overcome. Some experiments will be needed to figure how many extra steps are required. I have done this with a small CNC lathe and it works very well.

The other downside you'd have to 'park' the transverser before turning the unit off, and ensure that it is in the same state when you turn it back on again.

If the OP has HOME or ZERO switch then there is no need to park in any particular place. Just get the Arduino to move to the HOME position at startup.

...R

Well, that just cleared up all downsides quite nicely :slight_smile:

Brilliant contributions. Thanks to all. NOW, I am going to need ANY really basic pointers you can give me. I am going to make a start today on understanding how to use the Arduino but I need to get my head around the setup first. I get the part about transferring sketches onto it while connected to the pc. Next I need to understand the layout I will heve to put together in order to programme the Traverser. The Arduino will operate a stepper motor and the latter, I think, will need a motor shield. All of this will need a power source so presumably a transformer will supply that. Can I use ANY transforner that will connect to the UNO on its power inlet? What are the recommendations for inline connection? The Traverser, as you can see from the photo above has two wires coming out of it. These would go to a stepper motor which is then connected to the UNO? And the power source would be last in the line to power the arduino?

This forum has some good posts, like this one that assist in planning your project.
Once you have the IDE up and running, work through some of the example sketches (File->Examples)
They will get you started on the basics and introduce some important concepts (Blink without delay is one such). This post is introduces a very important concept, but I'd only tackle that one after working through the Basic, Digital and Control examples included in the IDE.

Spend a bit of time playing with the IDE and the Arduino (once you get it) and get yourself familiar with it. Take your time over this.

Then sit down and think of how you want to control your transverser. I'm talking about the way you want physically control it. A knob? A slider? a single button? A control panel with buttons and flashing lights? (not really a silly suggestion.). Create some drawings of how you envisage the 'control box' will look, and what each button/knob/dial whatever will do.

From that drawing, you can generate wiring diagrams for the hardware and derive a design for the sketch which will (eventually) do the job.

As for the hardware side, it is easier to use a stepper shield. They often come good documentation and example sketches. I'm hoping that Robin2 might give a recommendation here. I've only used one driver (a very cheap and nasty unit that will only drive a 5V motor) and one shield, a very nice unit indeed, using a TMC260 chip but it is possibly overkill for your application (and the docs/examples are terrible).

Finally, I would not use those wires to power the controller. I think that those wires power the rails, and they should remain separate from the additions you're about to make.
The Uno has 3 ways of getting power.

  • The USB port. A computer (or plugpack, like an iPhone charger) delivers the power.
  • The VIN pin on the board. Will accept 7 ~ 12Vdc
  • The DC power jack. Will accept 7 ~ 12Vdc and also has a Reverse Protection Diode (in case of wiring mishaps

If the output is around 7~12Vdc, use a transformer to power the UNO. Depending on the size and power requirements of the motor, you would probably use the same transformer to power it as well.

For what you want to do one the cheap 28BYJ stepper motors should be fine. You can buy them with a ULN2003 driver as a package from a wide range of suppliers.

You will need a 5v power supply for the motor and that could also be used to power the Arduino when the project is disconnected from the PC. (By the way, don't try to power the motor from the Arduino 5v pin - it cannot supply enough current).

You will also need some buttons or a switch to tell the Arduino which road the traverser should line up with. I think my preference would be a rotary switch. You can get them with up to 12 positions. Alternatively you could have two buttons for next road and previous road.

And you will need a limit switch (probably a microswitch) that is triggered when the Arduino moves the traverser to the HOME or ZERO position. You have to do that when the Arduino starts so that it has the correct base from which to count steps to the different positons.

That should be enough for now.

...R

Excellent additional (and encouraging) advice. I had already anticipated the part about the stepper motor and driver board and it arrived from China two days ago, though I have to say the link given shows you CAN get the same stuff almost as cheaply in the UK-faints. I think I will aim for the rotary switch concept and will start experimenting with the Arduino this week so as to get used to it. One additional purchase might be an optoisolator??

It's not a bad idea to use an opto-isolator, but I don't think it's necessary either. If you look at the RAMPS boards commonly used to run 3D printers, there's no isolation on them. Personally, in this case, I wouldn't bother until it became obvious that I had to.