Gantry crane for model railway

STEPPER MOTORS are to conventional DC motors as computers are to calculators – in other words, much moresophisticated. The ability of stepper motors to specify rotation precisely both by velocity and angle opens new doors for movement control. The downside is that to get the most out of these little beauties, you need ancillary digital-pulse control circuits, a fact which may deter some sheddies from exploiting their numerous advantages.

Getting a lift



Build a gantry crane for a model railway using versatile stepper motors



STEPPER MOTORS are to conventional DC motors as computers are to calculators – in other words, much moresophisticated. The ability of stepper motors to specify rotation precisely both by velocity and angle opens new doors for movement control. The downside is that to get the most out of these little beauties, you need ancillary digital-pulse control circuits, a fact which may deter some sheddies from exploiting their numerous advantages. This article outlines, in detail, a simple but practical stepper motor project. It uses mostly reclaimed parts as a way of demystifying the necessary control aspects. I hope it will encourage other people to experiment and use steppers in their own projects. Our project is a model gantry crane in approximately 1/32 scale, suitable for a G scale railway. Railway enthusiasts please note this does not claim to be prototypical, but serves simply as model to demonstrate the methods of basic stepper control. The motor we are using to drive the crane is a fairly typical 4-phase bipolar stepper, rated at 12 volts, 30 ohm / phase. It was obtained from a discarded dot matrix printer, which also provided the mechanical components. The size of these parts, particularly the gantry traversing bars, has largely dictated the overall dimensions of the model at about 600mm across and 450mm high. The supporting legs, crossmember girders and control house have been made from 3mm particle board painted to resemble metal. The controls are mounted on the back panel of the operator’s shack. Some suggested plans are shown but obviously can be modified according to what’s lying around the shed. Please note that these are not reproduced to scale.


Drill end-mounting plates simultaneously

The gantry

Once the various designs for the gantry, supports and housing have been marked out on the 3mm board, it can be cut out with a fret or scroll saw. I find it is easier to paint the individual parts before gluing them with white PVA. This also gives a neater end result. The quasi-dovetail design gives a very rigid structure and is self-aligning during assembly.
The only really critical step is the placement of the holes that fix the rods carrying the winch mechanism back and forth – they have to be absolutely parallel and correctly spaced if the carriage is to move smoothly. The easiest way to ensure this is to drill the holes through the two end mounting plates simultaneously.

Electronics

This is the real heart of the project. There are five main sections to the circuit, as illustrated. The 12v DC is provided by a commercial 240v AC adapter which is then passed via a simple regulation circuit to the logic elements and the stepper motor. The manual switch settings are in our case limited to left-right movement of the carriage at a selected speed and the detection of limit switches. The translator converts these manual switch settings into digital pulses that are fed to the driver stage directly, energising the stepper motor coils in the correct sequence. The component details and connections are laid out in the circuit schematic shown, with a parts list attached to this article.
The values chosen for this project have allowed for a morethan- reasonable safety margin in terms of power dissipation, with the thought that it can also be used with higher-rated motors without further modification. Be aware that the integrated circuits are of the CMOS type, which can handle the 12-volt supply, rather than TTL five-volt variety.
The circuit works in the following manner. A constant flow of square-wave pulses with a 50 percent duty cycle is generated by the LM555 timer integrated circuit. The pulse rate, hence the motor speed, is determined by the setting of the 4K7 ohm potentiometer, R3. A series of four dual input exclusive-or (XOR) logic gates on the CD4070 chip determine which direction the rotation is to be, whether or not either of the limit switches has been activated and if the MOVE button has been depressed.
The output is then passed to the CD4027 integrated circuit which turns on the TIP31c transistors in the appropriate sequence. The relative pulse timing of two of the four coils, showing the 25 percent offset of two consecutive pulses, is displayed on the oscilloscope screen inset, giving an idea of how the rotor is turned step by step. In pursuit of simplicity, the same supply voltage of 12v DC has been used both for the driving circuitry and the motor itself.
Often in real life, the motor supply may need to be quite different – anywhere between five and 30 volts. At that point, an additional regulated DC supply for this would be needed at the point indicated as V2 on the circuit schematic.




Consecutive pulses displayed on the oscilloscope screen


“bread board” mock-up of circuit


Cut copper strips with a twist drill

Veroboard

I confirmed the correct function of the circuit on a “breadboard” mock-up before I transferred it to Veroboard for the final assembly. As the actual arrangement of components on the Veroboard is largely a matter of taste and / or convenience, I have deliberately not specified any particular layout. It is a good exercise to work through the circuit schematic and transfer the parts to the printed circuit board, thereby gaining an understanding of how the various sections function.                                                                                                                          Veroboard is designed as a general purpose prototyping material and has standardised copper strips with predrilled holes for the placement of integrated circuits and other passive components The easiest way to cut the copper strips in the necessary places is with a 5mm twist drill held between thumb and forefinger, but be careful not to cut adjacent strips.
A word of caution for novices: be circumspect when soldering these types of boards, as overheating will quickly melt the glue holding the copper strips to the reverse of the board, not to mention destroying delicate semiconductor components. Remember to heat the wire and copper by applying the tip of the iron to each simultaneously, not just melting the solder. A wellsoldered joint should look like a miniature Mt Taranaki.
Use DIL IC sockets for the integrated circuits themselves, and ground yourself with a wrist strap when handling them to avoid static electricity charges which can easily fry CMOS chips. Traditionally, it is best to attach passive components like the resistors and capacitors before the more thermally fragile diodes and transistors. Make sure polarised components like the diodes, transistors and electrolytic capacitors are mounted in the correct orientation.

Check

When everything has been assembled, meticulously check all the joints and connections with a multi-meter and a magnifying glass. Gently score the gaps between the copper strips with a scribe to break any inadvertent solder bridges between adjacent strips. Then check everything again! The most common reason circuits don’t work is because of poor or incorrect connections, not dud parts.
MOLEX pins provide an easy way to attach the motor and other wires so that the Veroboard can be mounted in the operator’s shack in small grooves and removed later if needs be. Identifying which motor leads are which can be a bit of a hassle. In a bipolar motor, the common lead for each phase will have an equal resistance through the coils – and in our motor the common wires are both red. It is then simply a matter of trying various combinations until the motor turns smoothly. If it vibrates rather than turning, swap the coil leads over. Note that the output transistors are grouped fairly closely together.


MOLEX pins provide an attachment


Serrated belt salvaged from a printer


Simple, reversible 3v DC motor working through a planetary gear

Crane mechanism

The mechanical parts act in two ways. The winch carriage is pulled back and forth along two metal rods by the serrated belt salvaged from the printer. The effective range of travel is determined by limit micro-switches, also courtesy of the dead printer. Two switches on the back of the shack control the direction and the start / stop. The movement range is just over 350 mm, being more than enough to cross two sets of 45mm G scale tracks. In the interests of simplicity, as the lifting winch I used a simple reversible 3v DC motor, working through a planetary gear, although a second stepper could obviously be used here. A DPDT switch mounted on the roof of the winch house controls the lifting motor. Power comes from a rechargeable battery pack in the top part of the housing, avoiding the need for any flexible connections to the moving parts. A pulley block and hook assembly was purloined from a Meccano set.

The future

This is very much a basic stepper motor project, aimed at getting something off the ground (sorry!). Two obvious adaptations or enhancements spring readily to mind: replacement of the translator segment by PC software and/or microprocessor control for more sophisticated functions; and the use of dedicated driver integrated circuits, rather than discrete transistors. Direct interaction between DCC control of the model train and the translator has clear appeal. The Internet is a veritable mine of useful information and a quick Google will yield endless details about specifications, applications and circuitry.
The main message is experiment, experiment, experiment. The circuit described will drive a wide range of steppers, but ultimately if it blows up or melts down, it simply means that more shed time is needed to get it right, and that’s never a bad thing. 

Veroboard

The famous Veroboard, which is described as the fastest and easiest permanent method of assembling electronic circuits, is according to Vero Technologies also known as stripboard, prototyping board, electronic prototyping board and breadboard





Share:

More Posts

Hammering history

You can probably count on the fingers of one hand the number of Kiwi women who have become blacksmiths in their 60s. Judy Waterston of Livingstone, inland North Otago, is one of them.
As a child Judy spent hours in her engineer-father’s workshop sorting nuts and bolts, tidying away his tools, sweeping up, and watching him make things. She says her love of tools and machinery came from her dad.
The blacksmithing seed was sown in 1972 when Judy first saw Nicol’s Blacksmith Shop in Duntroon, some 40 km from Oamaru up State Highway 83. The building was being devoured by periwinkle planted 100 years before to act as a fire retardant. Most of the windows were smashed and it was draped in cobwebs.
“I looked through the broken windows and when I saw the anvil and bellows they took my breath away,” she remembers. “I’ve loved this building ever since.”

Metal and wood shelving

No matter how much storage space you have, there is always a need for more. One solution is to make better use of existing cupboards and wardrobes. In my own house the third bedroom is used as an office, so the built-in wardrobe was an obvious target for conversion into a storage place for files and computer supplies.
I had already tackled one shelving upgrade. We have a hallway cupboard used for many things that don’t have a place anywhere else, including toys for the grandchildren when they visit. The space was not used well. My solution was homemade shelving using frames of steel with plywood shelves.
For this cupboard, we had to allow for a basket of toys and chillibin on the floor level and picnic items and other bits and pieces on other levels. Once the shelves were installed, better use of space meant more room became available. One of Murphy’s Laws soon came into play and other items found their way into the open spaces, making good use of the variety of shelving.

A Legend Returns

A Legend Returns
A Historic Ferrari Monza 750 Joins the 2026 Ayrburn Classic Line-Up – 20-22 February 2026
The Ayrburn Classic, one of the most anticipated motoring events on the New Zealand calendar, is set to take things up a gear in 2026 with a line-up that promises to captivate enthusiasts and the general public alike. Following the success of the inaugural event, the Ayrburn Classic returns with a recently confirmed feature that is nothing short of extraordinary: the historic Ferrari Monza 750 – a masterpiece of motorsport and one of the most significant vehicles to race on New Zealand soil.
Legendary status
This particular Ferrari Monza 750, which arrived in New Zealand in 1957 and has remained here ever since, holds a legendary status in motorsport history. It competed in the Mille Miglia, Le Mans, and the Targa Florio – the ‘Big Three’ of European endurance racing during the golden era of the sport. Few cars can claim such provenance, and even fewer have such a deep and poignant connection to New Zealand’s own racing legacy.
Tragically, the Ferrari Monza 750 was involved in a fatal accident at Ardmore in 1957, marking the final moments of British driver Ken Wharton, whose last photograph was taken next to this very car. The vehicle has since been meticulously preserved, with images from the aftermath of the crash etched in motorsport history. Today, it stands as a symbol of both the bravery of that era and the enduring beauty of Italian automotive craftsmanship.