Wiring and Circuits

The objective up to this point is to get enough of the engine and track built that I can run some hill-climbing tests.  The results of these tests will determine how I build the track.  Now that the running gear (axles and wheels) are in place, it’s time to install the motors and drive chains, and then to wire it up to see if it runs.

IMG_1181Here’s a look at where the motors will mount on the underside of the chassis.  The first drive chain I purchased was too wide to fit within the tight clearances required.  This is the replacement chain that’s more narrow in width.  There are several different sizes of roller chain that vary in pitch and width; mine was determined by the size of the sprockets on the motors I purchased.  I had to find drive sprockets to match.

Chassis Underside
Chassis Underside

This is a look at the underside of the chassis (with everything removed for painting).  Note the stiffening ribs on the right; also note the eight slotted holes for mounting the motors.  Mounting the motors here will make the visible on the underside of the carriage when the train is running, but there’s nowhere else to put them without interfering with either cab space or the brake and throttle linkages.



I’ve reassembled the underside of the chassis, including all of the running gear (wheels, axles, motors, and drive chains).  Next step is to figure out where and how to install the batteries and electronics.

Engine with steam cylinders
Engine with steam cylinders and boiler attached

There’s lots of room inside the boiler (steel drum).  But I’d have to cut holes in the steel to pass the wires.  I’d rather keep the drum intact as much as I can to prevent flexing and rattling down the road (or track).  Plus, wherever I mount the batteries, it needs to be reasonably accessible so I can remove them for recharging.  This picture shows how the mock-up is shaping up.

There’s enough room under the catwalk to position the batteries, one on each side.  This would make them fairly easy to remove for recharging.  I can also cut a plywood mounting board for the electronic components to fit in the space under the catwalk.  So that’s my plan (for now).

Next steps: Install the batteries and control unit, and run the wiring harness to get everything wired up!

Electrical and Wiring Harness

The two motors are mounted to the underside of the chassis and the roller chain drive is installed.  Although it’s not marked, it looks like the wire leads coming from the motors are 10 Gauge wire.  I purchased a ten foot length of 10 ga wire in red and another in black.  It’s important not to get the polarity reversed accidentally when connecting to the Sabertooth control unit, as it can damage a component that costs over a hundred dollars.  For that reason, I’m color-coding all of the wires to help prevent an incorrect installation.

And on that note, when looking at example wiring for the Arduino programmable chip, it seems to be a convention that the ground wires are white.  The ground wires in automobiles are by convention black.  So I’m using black for the ground, because that’s what I’m accustomed to.

I installed wire disconnects between the motor leads and the wiring harness to make it easier to remove the motors at some point for maintenance or repair.  I had to ensure that the crimp-on disconnects were rated for 10 ga wire so I don’t overload them.  Then I ran the wire from the motors to the Sabertooth control unit, ensuring that I didn’t get the polarity reversed.  So the motors are wired in and ready to go.

The next step was to wire the batteries together in series and connect them to the power terminals of the Sabertooth.  I’ve been waiting on the delivery of a fuse link component before wiring in the batteries.  If something goes wrong, I want the circuit to blow a fuse instead of frying something expensive.

Wiring the batteries
Wiring the batteries

Well, the fuse link finally arrived, so I wired it into the battery circuit.  You can see it in the picture between the two batteries on the red wire.  It contains a 40 amp fuse to protect the circuit.  The Sabertooth control unit has the six wires (three red, three black).  There is a red/black pair on each side that feed the two motors (one pair per motor), and the red/black pair in the middle provide the power from the batteries.

The loop of red wire is there to eventually connect to the kill button that hasn’t yet arrived.  When it arrives, I’ll mount it on the firewall in the cab and splice it into the red wire.  That way, hitting the stop button will interrupt the power flowing from the batteries, effectively turning everything off.  Because the amperage of the circuit exceeds the amp rating of the stop button (29 amps vs. 10 amp rating), I’ll also have to install a relay.  So the button will actually control the relay, and the 40 amp relay will control the circuit power.

One other note about the control wiring:  the previous version of the circuit included both a radio receiver, from which I can control the motor remotely with an RC control unit, and an on-board potentiometer allowing me to control the motors on board.  For now, I’ve removed the potentiometer from the circuit and simplified the computer code to listen only for the RC signals.  I’ll add the on-board control back when I get the control levers installed and replace the potentiometer with a slider pot.

Running the Tests

Just to be sure I assembled all of the moving parts correctly, I ran some test to see if the power and controls actually work, and to see if the motors are wired backward.  I lifted up the cab to get the wheels in the air and wired the unit using just a single battery at twelve volts.

Power Testing
Power Testing

The first thing I noticed was that when I inserted a fuse into the fuse link, the wheels started turning.  That’s not supposed to happen.  When I turned on the RC unit to control the motors, everything stopped, as it should.  So there’s something missing in my control code that I’ll have to track down and correct.  I’m guessing that when I took out code related to the on-board potentiometer, I either removed something that should have initialized the state of the motors, or should have added something to do the same.  I’m sure it will be an easy fix when I open the code.

Using the RC controller with the wheels off the ground, I cranked it up to full power.  I counted the number of revolutions of the wheel during a thirty-second period to see how fast it ran.  Without boring you with the math, it works out that the wheels were turning fast enough to run the train at 1.67 mph.  Then I turned everything off and wired in the second battery.  Running the same test, the wheels turned nearly twice as fast, running at 3.2 mph.  I don’t know how much slower this will be under load, but it’s nice to see that the reality is so close to my original calculations.  I had sized the sprocket to get a gear ratio that would run at about 2 mph with the motors at about half speed.  So that’s encouraging.

Still to do:

Now I’m at the point that I can build a few feet of test track and run the hill climbing test on the ground.

I’m also getting to the point where I need to do some metal work.  I have some steel rods (two for the piston rods, one for the control levers in the cab, and one to connect the two brake shoes).  I’ll need to cut some threads on the ends of the rods so I can attach brackets with half inch nuts.  Also will need to fabricate some brackets for the siderods and control levers.

Before I can install the siderods, I’ll need to cut the axle for the drive wheels so they don’t protrude.

Kill Switch

Emergency Stop button from Amazon
Emergency Stop button from Amazon

The kill button finally arrived from China via Amazon.com.  It’s a big red button on a yellow faceplate that can mount against the firewall.  In the meantime, a friend gave me a surplus Emergency Stop button that he had on hand.

The button my friend gave me is a surface mount instead of a flush mount.  I’d rather have the flush mount in the cab so that it doesn’t intrude quite as much.  Fortunately, the other button is a flush mount, so that’s the one that I’ll install in the firewall.

Since I now have two Emergency Stop buttons, I can wire them in series so that either button will interrupt the flow of power to the motors.  I’ll put one in the cab for the operator, and the second  “under the hood” next to the batteries.  That way I can more conveniently disengage the circuit when charging the batteries.

E-Stop buttons with relay and fuse link
E-Stop buttons with relay and fuse link

Since both buttons are rated for only ten amps, and the circuit potentially can pull twenty-nine amps, I also installed a forty-amp relay.  So the e-stop buttons control the relay, and not the actual circuit.  The relay does the heavy lifting for handling the higher amperage.

Most relays that are readily available are for automotive use and are rated for twelve volts.  My circuit has two twelve volt batteries in series, so will be pushing twenty-four volts.  I wasn’t sure that I could tap into just twelve of the twenty-four volts to power my relay (turns out that I can, I now know), and didn’t know what problems I might have if I tried to power a twelve volt relay with twenty-four volts.  But I was able to find a relay that’s rated for twenty-four volts, so it wasn’t an issue.

Or at least, that’s what I assumed.  It turns out that, when I was testing the circuit with just one battery installed (running twelve volts), there wasn’t enough juice to power the relay.  So I couldn’t even get the circuit to close with just twelve volts.  So now I have to run the circuit at the full twenty-four volts, or not at all.

Circuit with E-Stop buttons
Circuit with E-Stop buttons

Here’s what the wiring looks like with the E-Stop buttons installed.  Notice bundle of wires that are routed up the firewall so they can sit inside the steel drum.  I’ll eventually drill the hole to mount the button through the firewall, once I get the firewall controls laid out, and attach the relay to the firewall so it doesn’t hang down.



The smokestack is one of those components I’ve been putting off, mainly because I didn’t know how I was going to construct it and attach it.  The original plans call for a six inch metal duct – the same duct work that’s in the HVAC system of your house.  Attached to the top of the duct is a milk strainer.

I don’t know what a milk strainer is, and I’m sure I’ve never seen one.  A quick Google search shows some strainers used in the dairy industry.  But they’re very expensive, and I couldn’t even find one that was radially symmetrical.  But I did find a duct reducer as part of the Google search.

The duct reducer is just a specialized fitting for HVAC ductwork that connects a larger diameter duct to a smaller diameter one.  I ordered one from an online source that would attach a ten inch duct to a six inch duct.

The plans called for attaching the duct to the steel drum by cutting some compound curves in a couple of wood blocks.  After cutting the blocks twice, I realized I could never get it right.  My solution was to cut a pair of half-round shapes from scrap two-by-four blocks so that they fit inside the six-inch duct.  I glued these in place using clear silicon at the bottom of the duct piece.  Helpful tip: every handyman’s toolbox should include a tube of clear silicone and a roll of duct tape.

Then I inserted four long screws into the blocks of wood and drilled holes in the barrel for the screws to attach.  The last step was to install some automotive rubber weatherstripping around the bottom of the duct to create a cleaner look.

Here’s what it looks like:


Hill Climbing Tests

The area I have for the track comprises a racetrack oval pattern with about 275 feet of track.  Since the track route isn’t level, I need to know if the engine will have the power and traction to climb a slight grade.  If not, then I’ll have to figure out something else for the track.  So design and construction of the track is waiting on the results of a hill-climbing test.

I built four sections of straight track using eight foot lengths of lumber to use as a test bed (I’ll reuse these sections in the final version of the track, as well).  I put the track sections on a relatively level portion of the backyard, set the engine on it, and had the first outdoor run just as a test.  I controlled the engine with the remote control and was able to make it go forward, backward, speed, slow, and stop.

Now that I know the engine can power itself and stay on track (pun intended – did you see what I did there?), the next test was to see if it could climb a hill.  I repositioned the track on the steepest slope in the yard, which measured at a 15% grade.  That’s pretty steep for a train track.  If it can handle this slope, then it will be able to handle any slope in the eventual track bed.

The first test of the engine trying to climb the slope had the engine sliding backward down the hill, even while the wheels were spinning trying to power it forward.  So the limiting factor was traction, not power.

I added my weight to the engine by standing in the cab, hoping that the extra weight would improve the traction enough to move it forward.  Here’s the video of that test:

So now I know the engine can handle the steepest slope that will be in the eventual track route.