My Experience with Adding LocoFi to a G Scale Locomotive
Around Christmas time of 2019 while putting up the Christmas Tree, I dug out of the closet an old G Scale starter train set from LGB to setup around the tree. It look really nice, as I hadn’t had it out of the box for a couple of years. So while enjoying the ambience of the tree and little train circling about the tree, I decided to look on the internet to see if there were some other accessories that could spruce up the Christmas display. That was my downfall. While searching I discovered the rest of the world about G Scale model railroading. At the time I had also been thinking about revising some of the plantings in front of the house and putting in a new garden. Well, I think the reader will get the idea of what is going to happen next.
In my internet search I came across a couple of auction sites that had what appeared to be some pretty good bargains related to G Scale locomotives. I decided to bite the bullet and purchased a USA Trains model GP38-2 diesel locomotive. When it arrived here I was amazed at the detail that could be designed into such a unit. Well now, since I still had the Christmas display up, I put the new loco on the track and behold it ran flawlessly.
Now the thoughts turned to the new garden. I was wondering that I wouldn’t want to sit in front of a manual transformer and try to control operation at a distance where I might not be able to see what was going on. So my investigation turned to remote control. Since I am a retired Electrical Engineer, and have some pretty good experience with hardware and software design, my thoughts turned to, “why not design and build my own”. The investigation turned somewhat serious at this point, and I quickly discovered that there were quite a few “Off The Shelf” solutions to my proposed project. So I decided to change directions a bit and explore some of these solutions. Being retired my budget is critical to the possible solution that I might settle with.
I did look briefly at DCC but I found that there isn’t a really good simple explanation of how this system works. Especially at the level of understanding the basics of the system.
Maybe I wasn’t looking in the right places. Since I have had a tremendous amount of experience with communications and networking I decided to look at RF or radio control of G Scale locos. It was then I discovered LocoFi, in addition to a couple of other sort of proprietary schemes. LocoFi looked to have many of the more detailed questions answered for me.
So, off to the races. I ordered two of the LocoFi modules and downloaded the app to my cell phone. Probably one of the very few new apps that the phone has on it. Anyway, I have a pretty good lab setup at home, and when the LocoFi modules arrived I powered them up on the bench with a resistor for the motor load. I didn’t know what power requirements where going to be for the USA Trains GP38-2 with regard to current. I knew that the LocoFi module would operate on 24 volts DC which would be compatible with the GP38-2. Bench testing the LocoFi module proved very satisfying, as it gave me the chance to test its functionality without fear of blowing anything up.
The next step I thought would be to put the LocoFi module in the G Scale locomotive and try it out for real. This was not so good. At first try I had to have the throttle setting almost all the to maximum to even the get the GP38-2 to move. Then after fiddling with it a bit I could at least start and stop the GP-38-2. But soon the locomotive would not even move at all. I might mention that before I put the LocoFi module in the GP38-2 I did measure the running and starting current of the GP-38-2. It has two can type motors and the running current measured around 600 milliamps with about 18 volts applied to the motors. Staring current measured around 2 amps. So looking at the data sheet for the motor driver chip used in LocoFi, it stated a peak current limit of 2.8 amps. So I thought I was safe. However, the motor driver chip does have some built in safety features that will limit current and voltage to the motor if the internal temperature of the chip exceeds certain values. This exercise lead me the fact I needed an external H-bridge or equivalent to have any success with using LocoFi to run a G Scale locomotive.
I discovered a couple of online hardware vendors selling pre-assembled functional modules that would suffice for an H-bridge motor controller. I ordered a couple of them.
My initial trials with these modules proved a bit disappointing, as I couldn’t get either one of them working on the bench. So I put them aside and decide to design my own.
Since I have access to PCB fabrication and 3D cad design, I completed a design and ordered boards and components. Everything went together pretty smoothly, but when I got to the point of powering up my H-bridge design, I realized I had made a serious mistake in the interface with LocoFi. So back to the drawing board. I decided to drag out the original off the shelf H-bridge devices I had ordered previously. This time I managed to get them working with a test load. So I thought why not see if the entire combination of my custom design and the off the shelf H-bridge could be made to work together. They could and the did work together.
Here is what the final arrangement looks like.
There are three circuit boards that fit inside the GP-38-2. I wanted to retain the ability to return the GP38-2 to stock configuration just by selecting either LocoFi/H-bridge, or normal track power operation by moving the four switches used in the USA Trains model.
Board 1 – larger base main board to accommodate plug in boards for lighting
control and different H-bridge boards.
Board 2 – Relay/Lighting board to control more than the two lamp settings from
the LocoFi app.
Board 3 – H-bridge, either custom design or off the shelf.
The larger base main board contains the four switches for Smoke, Lights, Track, Sound that USA trains designed into their locomotives. I repurposed the Sound switch to use for selecting either LocoFi control or standard track power by routing track power through a relay. The custom Relay/Lighting board uses some logic and some small signal relays to control power to front, rear, and cab lighting independently of each other. The H-bridge board was originally a custom design by me, but it was replaced with an off the shelf commercial device labeled “XY-15AS”. You can Google this name to get specs.
So the final arrangement was able to be installed inside the main shell of the USA Trains GP-38-2. It should be noted that the XY-15AS control interface cannot be driven directly from LocoFi. There needs to be a transistor level converter interface from the motor pins on LocoFi to the control pins on the XY-15AS. At startup the current draw from a 18 volt 35 amp supply is about 2 amps. This is reasonable at the applied voltage at a throttle setting of 2 or 3 on the LocoFi app, is about 3 to 4 volts, just enough to get the GP-38-2 moving. This also confirms the measured locked rotor resistance of about 2 ohms. After a bit of fiddling with the LocoFi app I managed to settle on settings in the Configuration screen which seem to suffice to get the speed readout reasonably close. I can control the lighting, direction, speed of the GP-38-2. I also downloaded a new diesel horn sound and installed it in the SD card.
The result of all of this effort can be seen in the G Scale video on the wifimodelrailroad website.