What is the Speed of Your Layout? – Part 3, Automation Solution


I had used Arduino microcontrollers for some animation and lighting effects on the basement HO layout at our last house. These are great little devices designed in Italy which are intended for hobbyists and artists who need a simple way to translate some sort of input (push button, switch, accelerometer, thermometer, light sensor, GPS sensor, etc.) into some sort of output (LED or light bulb to flash, DC motor, servo, sound to play, LCD display, etc.).

To get started with Arduinos I purchased an excellent kit for around $100 from Canada Robotix which contains about 15 separate projects and all the necessary electronic parts, as well as very clear instructions and the basics of the programming language C++ which tells the device how to behave. I have no computer programming experience, but it was easy and a lot of fun to learn the Arduino. Programming is done on your personal computer using freeware and the code (“sketch” in Arduino parlance) uploaded to the Arduino through a USB cable. There are thousands of people around the world who offer solutions to problems and advice on Internet forums and even share the code they have written for their projects.

There are several Arduino models suitable for various applications but the model I used for this application is the Pro Mini which can be purchased for as little as $5 a copy if you shop around online. The following picture is enlarged - actual dimensions are 33 millimeters (1.3 inches) by 18 millimeters (0.7 inches).


I used two Arduino microcontrollers for my automation solution. One Arduino controlled the motor speed using outputs from the other which identified where the train was on the layout.

I first buried several light sensors in the ballast between the rails at intervals around the track. Each sensor was about 4 millimeters (1/8 inch) wide, so they were easy to hide. When a sensor was shaded by the presence of a train, the Arduino mounted under the layout powered by a 9-volt battery caused an LED mounted immediately beneath the layout, thus under the train, to shine on the ground. If the layout was turning exactly in sync with the train each LED shined on one spot, as if stationary. By way of analogy, if you walk on a treadmill and shine a flashlight on the ceiling above you, the beam remains in one spot – until you stare at the ceiling too long, making you disoriented, which causes you to fall off the back of the treadmill and hit yourself in the face with the flashlight.

I then acquired two inexpensive camera tripods and mounted a PVC electrical box on each. I put a light sensor in the top of each box. These are wired to the second Arduino microprocessor housed inside one of the electrical boxes which was then wired in series with the electrical supply to the motor described above. One tripod was positioned under the layout just ahead of the desired position of the locomotive and the other just behind the desired position of the caboose.

As the layout turned, if no LED shone on either tripod it meant that the train was located correctly because it was between the two tripods. If the layout was going slower than the train (which always travels at a constant speed), the train would drift ahead, causing the LED under the locomotive to shine on the front tripod. The Arduino would then slightly increase the speed of the motor turning the layout which, in turn, caused the train to drift backward. Conversely, if the layout was going faster than the train, the train would drift backward, causing the LED under the caboose to shine on the rear tripod. The Arduino would then slightly reduce the speed of the motor turning the layout which, in turn, caused the train to drift ahead.

When the layout and the train were first turned on, the train “hunted” back and forth for a few minutes between the tripods and would even overshoot as the Arduino adjusted the speed of the layout to match the speed of the train. Once at equilibrium, at train shows the layout would run with the train in the correct place for the entire six to eight hours of the show without any attention or need for adjustment.

I have an old notebook computer that I can plug into the stationary Arduino located in the tripod. Using Microsoft Excel I was able to depict in real time the speed of the layout in scale km/hr, the average scale speed and the times when the front and rear tripod sensors detected the light of the LEDs from under the layout. This helped me explain to guests what was going on when they showed more than a passing interest. The real-time data feed to the Excel graph was by way of the Arduino’s serial port.

This was a fun problem-solving exercise and a great learning experience. The layout was entertaining at train shows because of the conversations I had with inquisitive children and interested adults; there were occasional squeals of delight – from the children, that is. I have no training in human psychology, but I found it fascinating to observe the reactions of various people – some had no clue as to what was going on before their eyes, while others figured it out quickly.

Note: you may have noticed that the above post is written in the past tense. I completed the layout in 2016 and had a lot of fun with it at train shows. However, after becoming an active participant in our Free-mo group I lost interest in the rotating layout. It sat on a top shelf in our garage under a dust cover. Over the 2018 Christmas season I reached the inevitable conclusion that the space could be freed up for other things so dismantled the layout. It was fun while it lasted and a great learning tool.


What is the Speed of Your Layout? – Part 2, Operation by Gravity?

In Part 1 I described the concept and construction of my layout. Now, how to make it work?

My original idea was to have the layout tilted slightly at an angle, as the Earth is tilted on its axis. A train would start out on the low side of the tilt and once it had climbed a certain distance up the “hill” the layout would turn on its own and the train would stay in one place. This proved impossible to execute. The train would climb and, as expected, reach a point where gravity took over. The layout would gather so much momentum that it spun the train around backwards to the down slope of the “hill”. This repeated surging was not pleasing to watch.

I decided that I needed a motor drive to turn the layout at a constant speed. Scrounging through the small motor bin at Princess Auto I found the solution. It was a 12-volt motor mounted into a gearbox (about $15). I rigged up a mechanism to mount the motor on the tripod shaft just beneath the bottom of the hollow centre core. This device doubles as the mounting platform for the electrical contacts described above. I cut the bottom off a metal coffee can and hot glued the resulting tube around the base of the hollow centre core of the layout. This particular coffee can was made with several grooves molded into its circumference which formed perfect pulleys. I then positioned a rubber drive belt around the coffee can “pulley” and the output shaft from the gearbox which, as luck would have it, was knurled and provided good traction. Power for the motor was supplied from the variable DC output of an old model railroad power supply. Here is a close up of the motor and the mechanism to hold the electrical wipers against the turning circuit board disc.

This powered design worked very well – the layout speed could be set to match the speed of the train running in the opposite direction, thus keeping the train in one spot all the time. However, glee quickly turned to disappointment when the two would become unsynchronized in less than a minute. The problem was with subtle variations in the speed of the layout motor as well as that of the train. These variations are not noticeable to the eye, but they exist. To get the desired effect, the speed of the train or of the layout had to be repeatedly adjusted – not much fun doing that all day long at a show! I needed to devise a way to automate the adjustments.

To be continued…

What is the Speed of Your Layout? – Part 1, Concept and Construction

In model railroading articles there are occasional comments about the scale speed of models and people’s perceptions of what best portrays the prototype. A few years ago, I built a layout in which the speed of the train was not the issue as much as the speed of the layout itself. Huh?

Concept

My goals for this layout included:

  1. HO scale;
  2. transportable in an SUV;
  3. light weight;
  4. quick setup and take down;
  5. viewing height suitable for all ages;
  6. capable of continuous running at train shows; and,
  7. made from relatively cheap components so if I hit a dead end there wouldn’t be much pain upon throwing it out.

Did I achieve my goals? You be the judge...

The layout was a circular contraption approximately 1 meter (39 inches) in diameter and 60 centimeters (24 inches) high with a central mountain around which there was a circle of HO code 83 Micro Engineering track. The track traversed two wood trestles, one of which spanned a small creek and the other a gorge which was home to an aspen grove. There was a pond, a waterfall and a handful of people, animals and assorted railway debris occupying the scenery.

When operating, the train ran at a constant speed and the layout moved at the same speed but in the opposite direction – causing the train to remain in place and always within sight of the viewer. It would do this for hours on end. This is analogous to walking on a treadmill. I thought this approach would be more interesting at shows than a train running around a stationary circular layout. I always ran the layout with steam locomotives because the motion of the connecting rods and valve gear exhibits more activity than a diesel locomotive which looks rather static, even when running. In this application it was particularly important for viewers to be able to see that the locomotive was running.

Here is a picture of the completed layout operating at a train show:



Construction

The layout structure was 100% pink Styrofoam insulation panels roughly carved and hot glued together in layers. It was hollow a few centimeters beneath the surface. The faux-rock surface was a mix of cellulose insulation, wallpaper paste and powdered black clothes dye – this creates an inexpensive grey finish which adheres well to the foam and is easy to paint (kind of a home-made Sculptamold). When it inevitably got knocked during transport no white plaster showed through.

There was a hollow central core inside the Styrofoam, as follows:


Secured into the top of the central core and hidden beneath a removable panel was the rim from a lawn mower wheel which has a very robust and free-spinning ball bearing assembly. The hollow central core accommodates a 2.54-centimeter (1 inch) diameter wood dowel with a spike sticking out the top mounted vertically into a tripod (Figure 3). The entire layout was suspended from the inner race of the ball bearing assembly which sits on the spike. I found the tripod at Canadian Tire – it was intended to support halogen workshop lights, not a layout. The whole lighting fixture/tripod assembly was about $60 on sale.


Setup was very simple: first the tripod with the vertical wood dowel was set up; the layout was then lifted shoulder-high with the hollow core lowered over the dowel; electrical connections are made with quick-connects; finally, black skirting material was mounted around the base to hide the tripod, wiring, etc.

The locomotives I ran on this layout were  all DCC and sound equipped, controlled with a Digitrax Zephyr system. In order to get reliable connectivity from the DCC system to the rails I built a system of stationary wipers mounted on the tripod, just beneath the bottom of the hollow core. The wipers were made from the contacts found in a common household light switch (cheap, sturdy and designed to conduct electricity) which have been affixed to a home-made spring-loaded device to ensure that they make good contact. Hot glued to the bottom of the hollow centre core was a copper-surface circuit board – what one looks like before the copper is etched to create circuits. I cut the circuit board to roughly the dimensions of a DVD disc but with a hole in the middle to accommodate the wood dowel which passed through the disc. Using a Dremel tool to make a circular groove in the copper layer, I created two electrically-independent concentric “tracks” which are soldered to two wires leading to the HO rails. When the layout turns, the copper “tracks” drag across the two electrical contacts thus connecting the DCC controller to the locomotive.

To be continued…

Moose Jaw Train Show - 2019

Following is a selection of photographs of the excellent modelling work on display at the Moose Jaw train show, March 23 & 24, 2019. The show was held at the Western Development Museum, Moose Jaw.