KEYSTONE FARMS - SD45 CAB SIMULATOR PROJECT - JMRI Throttle Development - January 2018

SD45 full size cab with AAR control stand - new HD video live from camera car upstairs
This YouTube video shows the view from the full size SD45 cab while Ken controls the consist over a portion of his HO scale PRR Buffalo line upstairs on a 3100 square foot layout room.  The JMRI controlled system has separate throttle controls for the sound loco and the motive power, including an AAR control stand with 8 notch throttle and working brake levers.  Of course the horn and bell function as well.

SD45 Simulator HD Video

HD Video is now in place - 1080P camera and HDMI transmitter have improved the displayed picture quality
Pardon our enthusiasm in this YouTube video as we enjoy the enhanced video quality with the new HD camera for the first time.  This second video shows the 1080P image  projected on a  8 foot high by 16 foot wide screen in front of the  simulator.

SD45 HD Video on YouTube

YouTube video showing the SD45 cab and the original video camera

This older video shows the results using the original lower resoltion camera.  This was the first time the video, audio and basic controls came together.

Link to You Tube video

In 2005, my friend and modeler Ken McCorry purchased a PI Engineering replica of an AAR control stand.  This is the big brother to the PI Engineering desktop Rail Driver and uses similar technology to turn voltages from the throttle and brake potentiometers and input from the digital switches into a USB signal that can  be sent to a JMRI computer.  

In 2010 or 2011 and with the assistance of Juan Carranca and Bob Jacobsen, I was able to connect the AAR control stand to JMRI and control  a loco on an NCE powered track.  With that success in the background, Ken started construction of a full size cab in  August of 2015.  Construction is of wood framing, Masonite sheathing and some PVC details.

Super Cab 6206 under contruction 

Ken is modeling everything an engineer can see from his seat.

Cab nose framed out

The nearly completed cab is quite impressive and includes a number of detail parts purchased from locomotive scrappers.

Cab nearing completion

The cab controls are very realistic being cast in metal and housed in a fiberglass replica of the control stand.  The Rail Driver has now been removed from the cab.  The seats were purchased used from a retired Conrail loco.

AAR control stand and Conrail seat

The original HO scale camera equipped loco on the layout upstairs sent a radio signal which was displayed by a projector on a 8 foot high by 16 foot wide screen in front of the cab.  The low resolution analog camera had a lot of brief dropouts on Ken's large layout but provided a basic video system.

Camera Loco

Ken has purchased a 1080P video camera with HDMI output that connects to a higher power transmitter.  This combination radically improves the projected picture quality, taking full advantage of the 1080P short throw projector over the cab.  I constructed a bridge rectifier to take DCC track power and provide regulated DC power for both the camera and transmitter.

.HD Camera Consist

So the engineer and fireman now see their travel across the layout from a realistic perspective.  Here is a view approaching Mill Street.

Projected camera image

Ken has modified the flatcar camera car consist to mount the camera on a short wheelbase platform to allow it to better follow  the relatively tight curves of the model railroad. 

Short platform camera car

Ken installed a 500 watt home theater sound system with 5 surround speakers and a sub woofer.  He attached it to a sound decoder using an audio transformer.  Loksound has donated a decoder to the simulator project and Ken reports the bass is better and the horns are very "playable".  I am looking forward to working with Matt Herman of Loksound to make the simulator sounds operate as realistically as possible.  But the stock Loksound already sounds great through the home theater sound system.

Sound Decoder setup

Fireman side

Once Ken had the project under way in 2015, I pulled out the old files and attempted to setup JMRI to once again communicate with the AAR control stand as it had in 2011.  Lots had changed in the five year period, including Windows version, PC update and several JMRI versions.  Try as I would, I could not get JMRI to recognize the electronics in the control stand.  Ken bought a desk top Rail Driver so I could explore its abilities and I was able to make that work with JMRI.  We even purchased a spare ReDAC IO Module from PI Engineering to see if we could crack the code.  I constructed a simple throttle to replicate the control stand pots and switches and sent it off to Bob Jacobsen to see if he and his west coast JMRI gurus could make it work.

Desk top Rail Driver by PI Engineering

Simple ReDAC throttle

After months of struggling, Bob Jacobsen gave up and constructed a serial Arduino interface to replace the PI Engineering electronics.  This was accommodated with some new software added onto JMRI to accept serial input from any similar device.  Bob sent me the appropriate files that were first available in test version 4.7.1 of JMRI.  A newer serial interface was added and is now being used in JMRI production version 4.10.  I like the Arduino input approach even better as it has truly isolated the throttle and three brake lever signals from each other, an issue the PI Engineering board had exhibited.

Arduino throttle interface

The new Arduino interface has 8 analog inputs and 24 digital inputs, more than enough to handle all of the AAR control stand features.  Bob sent me a simple throttle script to get started.  I installed it on Ken's new Windows 10 PC for the loco simulator and fired it up  first time on 12/28/16.  The throttle pot has a smaller range than permitted by the Arduino and the sound decoder went to run 8 RPMs at 35% throttle.  After some tinkering with the throttle calculations, I was able to get the sound decoder to respond from shutdown in the STOP position to full RPMs in RUN8.   I called this the Basic throttle.

Ken at the controls

Ken ran this basic throttle script for 10 days while I worked on the next version.  With Bob Jacobsen's syntax correction, the next simple throttle was run on 01/07/17.  This simple throttle had horn, bell, forward, reverse and 10 position throttle - STOP, IDLE, and Run1 through Run8.  The SD45 sound decoder responded to all 10 steps and the loco upstairs does as well.  Ken had a lot of decoder momentum dialed in for this version and it worked well.  The loco will sound at idle and sit still upstairs.  Moving to run 1 causes it to start to move at idle RPMs.  The sound decoder responds with a very slight delay from the throttle lever.  Perhaps almost prototypical. When I showed Ken the control stand operation in this second version, he found a big grin.  The January op session had been canceled because of a snow storm, but there were 5 of us in the building.  Once they heard the sound system, all of them ended up in the cab enjoying the sight and sounds.  I shot some video and posted it on you tube as in the third link at the top of this web page.  The video sent via the original  camera from the loco upstairs was still a bit choppy.  The picture from the new HD camera is rock solid with no dropouts or latency and a much improved resolution.

With this version of the script in operation, we have claimed the title for the largest JMRI throttle in use.

Ken recently completed the electrical panel which is located on the back wall behind the engineer.  With the addition of windshield washer arms and front platform stanchions, the look from inside the SD45 cab is very realistic.

Electrical Panel

Ken has now constructed a dedicated SD45 loco for the camera car.  It includes a NCE non sound decoder for 6200 motive power and a Loksound decoder on address 6206 which replicates the sounds played in the cab downstairs.  So you can hear the horn and bell used at grade crossings and stations.  Once consisted with other non sound locos, it should prove quite capable.  Ken added power trucks under the gondola and MU cables between it and the SD45.  With 10 axle pickup, there seems to be no power issues for the camera and transmitter.  Ken is planning an inaugural run in revenue service at his March 2018 operating session.  It will likely be assigned to a freight BF3 or BF5 from Enola to Buffalo with work at both Northumberland and Hinsdale.

SD45 6200 Powered camera consist


SD45 Simulator panel in JMRI


The Arduino hardware has now been made part of a more permanent installation and has permitted connection of the three brake levers and additional switches.  The latest  script improvement use these lever inputs to control the horn, bell and engine RPM sound from the Loksound decoder played in the cab and to then set internal sensors displayed on a JMRI panel.


This third version of the throttle now includes a second script which calculates train speed, direction, acceleration and deceleration sent to the consist upstairs, giving the simulator real braking ability.  With the new script in place, most momentum has been removed from the loco consist and is provided by the speed calculation of the JMRI script.

The train brake and dynamic brake levers are now functional and the script can modify speed at a rate of (for example) 1 mph per second.  The effect of grade from plus or minus 1 to 3 percent is now part of the script enhancement.  Hitting a three percent uphill grade requires additional throttle and the dynamics work downhill.  Ken found the train will roll backward if you stop on the uphill grade and do not apply the brakes.  Grade is manually entered from the JMR panel for now, but an inclinometer telemetry car is under consideration.

Bob Jacobsen and I will later turn attention to the speedometer, amp and brake pressure gauges which are part of the AAR control stand..

And all this in JMRI is still free.  But donations to JMRI are always welcome. 


Thanks again to the JMRI developers, especially to Bob Jacobsen for not giving up on this crazy long term project.  Ken Cameron has also been helpful in polishing my use of jython syntax in the developing scripts.



Web page updated by Bob Bucklew on January 22, 2018

Quaker Valley Home Page

Quaker Logo