Model Railroad DCC Loco Decoder
sswcharlie
Posts: 7
Hi
Who have done work on using a Stamp or Propeller for making a locomotive dcc decoder for a model railroad locomotive. (HO)
Only need the basic motor controller with reverse, with few CV's. No additional function required. Cost of commercial products are becoming too expensive!
Your comments will be appreciated.
Charlie Harris
Who have done work on using a Stamp or Propeller for making a locomotive dcc decoder for a model railroad locomotive. (HO)
Only need the basic motor controller with reverse, with few CV's. No additional function required. Cost of commercial products are becoming too expensive!
Your comments will be appreciated.
Charlie Harris
Comments
Somewhere under $15, my own time costs nothing. Need to about 30+ so price is important.
Than
Charlie
What is a CV?
Duane J
The DCC standards can be found on the National Model Railroad Association (NMRA) website. This link for the entire standards page, you will need to scroll to section S-9. There is both an electrical standard, and a protocol standard.
http://www.nmra.org/standards/sandrp/consist.html
I have a bunch of Lego train parts (from before they switched to battery operated trains). I've often wondered about making some sort of DCC encoder and decoder.
One of the main problem I have have is such system would require modifying the train motors.
I think I saw some electric train project recently on Let's Make Robots. I'll try to find the project again and post a link here.
Varying the power to the tracks would be an easier method of controlling the speed of a Lego train than using DCC but controlling speed this way greatly limit the types of layouts one could use. In order to control the speed of individual trains, the trains would need to be on electrically separate loops.
I'd rather be able to have multiple trains on a loop and use switch points to route the trains various directions.
I think I'll look through some of the links below to see what sort of hardware is required to implement DCC.
NMRA DCC standards.
-Tommy
Hah! Found it! See page 171 of the following PDF. http://www.parallax.com/sites/default/files/downloads/BS1-IC-BASIC_Stamp_1_AppNotes.pdf
Hmmm, no mention of DCC though. But for some reason this thread reminded me of that AppNote.
The signal format is serial, as the NMRA standard speaks, but you don't necessarity need to follow the standard if you plan to make the h-bridge and engine circuits.
Getting the signal into the engine or other dcc reciever is simple also, the engine circuit is going to need a large capacitor to store the motor energy, and you will want to regulate the power from the rails(you will push the rails to a higher power than 3.3v) , so I used a 3.3v ldo to-92 regulator for the prop, with a large cap for the prop.
You need to take both rail signals, and put them through a rectifier, which feeds a large cap, which supplies the engine motor with juice. No need to regulate the motor voltage, as this will run at the rail voltage. But you will need to provide a large cap after the rectifier so you can smooth out the track intermittent connections. You also need another smaller h-bridge circuit inside the engine to control the motor.
You also need to take a signal from one of the rails, and also regulate it through a seperate 3.3v ldo to92 regulator with no capacitors at all, this is the input rx into the engine prop, using a pull down and series resistor is needed to prevent floating and parasitic power.
You can even get smart with it all and make one rail for rx and one for tx, but that would require some serious track communication management.
(you would need to pass a token ring around to each dcc device to allow it to talk back to the h-bridge track master control.)
The NMRA standard and technology behind it, is well thought out in both hardware and software, you can program engines on a special strip of track, etc,..
Unless you want to reinvent the wheel, and spend more money overall in the long run, just buy a dcc system KIT. The larger kit you buy, the better price you will get so you can get that many engine units.
Any dcc like system cannot be had for cheap, due to the dcc system needing polarity monitoring/multiple h-bridge "switches". (dead shorts from engine wheels between zones, cause issues without proper h-bridge track power management.)
You can't do it that cheap, unless you buy in such large volume that you will be stuck with a dcc inventory you can't sell.
http://acculites.com/index.php?main_page=product_info&cPath=1_4&products_id=97
AND, DCC is a rich old mans toy, its not for the poor. Sorry kids, you are just gonna havta use ZONES to control multiple engines.
Most kits don't even inclue enough h-bridge power to push more than a few engines.
After 30 dcc units, you will need so many h-bridge power units and auto-reverser/short protectors,
that you will bust the budget on track power devices alone.
http://acculites.com/index.php?main_page=index&cPath=16
After reading what's involved with DCC, I'm inclined to just leave the track at full power and use wireless communication to the various trains. I'll still need a h-bridge on each engine but I've done that kind of stuff before.
I think I'll use the inexpensive Nordic nRF24L01+ transceivers for the wireless communication. I used multiple transceivers in a project before and I just gave each device a unique ID. The devices used their ID number to schedule outgoing messages. This kept multiple transceivers from transmitting at the same time.
The nRF24L01+ transceivers are a little over $1 each if you purchase several at once.
I wonder about using a Wii camera to monitor the trains. An IR LED could be added to each train engine and the Wii camera could keep track of where they are within its field of view. I think the Wii camera is limited to four IR spots, but that's about as many trains as I'm interested in running at once anyway.
Thanks for the information about DCC.
Yes you can "roll your own" but I don't think you'll get the savings you are looking for...