DIGITAL COMMAND CONTROL ON THE

TETON SHORT LINE (Yard Cab Encoder)

Wayne Roderick, 3rd Division, PNR, NMRA (life)

03/18/98 rev 09/02/01

Everybody has his own idea about the CAB to HUMAN interface. Some want big knobs, pushbuttons, rotary encoders without stops, meters or digital readback et al. We have developed our preferances after trying just about everything imaginable, and have documented the Mainline Control System on the Teton Short Line, but we haven't mentioned the Yard cab at Malfunction Junction (MFJ) until now. With the advent of DCC, the old yard cab wouldn't do. It was an ancient MRC power pack, long ago converted to an SCR system for excellant low speed switching, It has a comfortable crank shaped handle so that you can feel as well as see the setting. We like it for yard switching, frequently leaving the speed set very low while just working the direction switch to separate magnetic couplers. It mechanically fits into the overall control system for MFJ.

When you got a good thing, why change it? Looking at it another way- If it's not broke, then don't fix it.

Ok, How do we make it run DCC. The rotary knob position must somehow tell the computer to generate the right DCC speed settings. This means we must generate a digital word (8bits) that equates to the shaft or knob position. We really need only 5 of those bits to resolve up to 32 positions and we run our decoders with 28 speeds. Even less than that because of the "Start Voltage" offset. Another 2 bits can be used for the direction switch and the emergency (panic) button. Got a bit leftover- Oh what to do with it?

To us electronic types, thoughts of stuffing the MRC case with a circuit card, Analog/Digital Converters (ADC/DAC) and electronic "glue" to tie it together, come to mind. But- You live in the sticks and the junk box doesn't yield a suitable ADC or DAC, now what? Wait a week and pay premium for small mail-orders? Back to the drawing board, think back to simpler times and recall the Gray code shaft encoders. We can build that from the junk box and have it running by the end of the day. We did it and thought you might be interested in a bit of old technology that still works very well. Like some "poor" railroads of the past. You just got to look around at the roundhouse rubble and find something that will do the job.


.

Gray Code encoder at MFJ
We used a salvage potentiometer to mount the code wheel on. The code wheel was drawn on CAD and printed on acetate, but you could do it by hand, or copy this one. The printer ink was not opaque enough, so I went over it with black acrylic paint using a small brush. The acetate was then laminated with clear plastic document protectors to make a semi- rigid (floppy?) disc. Mechanics of fastening to your pot' mechanism are unique. Scrounged around and found five photo-transistors; I believe I bought 'em in one of those 25/$1 deals a few years ago. Rigged up a holder for the devices and a lamp bulb. Add a CMOS 4050 chip configured as a Schmitt triggers and we're in business. Send the resulting bits to the computer and let it figure out what to do with the Gray code.

Hooked the Direction switch up to one of the 4050 gates, so that moving to neutral doesn't change anything. There really isn't any provision (or need) for "neutral" in DCC. A panic switch is handy- The computer software sends a BROADCAST EMERGENCY STOP that all locos will read and stop. We have this feature in the mainline cabs too.

GRAY CODE. Developed by Frank Gray back in the '50s to convert a rotary shaft position to a binary code, it has the advantage that only one bit at a time changes reducing the risk of ambiguities. There are many possible Gray codes but we used the popular "mirror" or "binary reflected" Gray code. If you can't read the Gray table in the .GIF, write your own. It's easy- "start with all bits zero and successively flip the right-most bit that produces a new string"

RELIABILITY? It's an optical system using a dim incandescent bulb much like our turntable at MFJ and that's worked reliably since 1978. I'm 66 (2001)! I should worry?

Click here to see a 41k picture of the innards.

Return to Teton Short Line DCC Page orTeton Short Line Home Page