Shop OBEX P1 Docs P2 Docs Learn Events
Model Railroad DCC Loco Decoder — Parallax Forums

Model Railroad DCC Loco Decoder

sswcharliesswcharlie Posts: 7
edited 2014-03-12 14:32 in General Discussion
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

Comments

  • FranklinFranklin Posts: 4,747
    edited 2014-03-09 17:46
    What price were you thinking? I see decoders on ebay for $20. Not sure they are what you are talking about though.
  • sswcharliesswcharlie Posts: 7
    edited 2014-03-09 18:02
    Hi

    Somewhere under $15, my own time costs nothing. Need to about 30+ so price is important.

    Than

    Charlie
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-03-09 18:07
    Is there a specification for the DCC control functions?

    What is a CV?

    Duane J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-03-09 18:09
    Isn't this an easy thing to do in software? The preamble supplies the bit timing to decode 1's and 0's after which it's a simple matter. I think even Spin could keep up with decoding this.
  • FranklinFranklin Posts: 4,747
    edited 2014-03-09 18:11
    Somewhere under $15,
    Props and stamps themselves cost more than that.
  • Desy2820Desy2820 Posts: 138
    edited 2014-03-09 20:10
    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
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-03-09 21:29
    I've seen this mentioned several times on the forum. I'd suggest checking the links below under "Similar Threads".

    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.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-03-10 07:30
    I the Lego train setup didn't use DCC. They just controlled the power to the tracks.

    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.
  • TtailspinTtailspin Posts: 1,326
    edited 2014-03-10 07:43
    This site might help...
    NMRA DCC standards.




    -Tommy
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-03-10 09:37
    I'm pretty sure in the BASIC Stamp Manual V1.9 there is an AppNote controlling a train using DCC with a BS1.

    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.
  • Clock LoopClock Loop Posts: 2,069
    edited 2014-03-11 02:46
    Dcc is nothing more than taking a serial signal output from the prop/stamp, and feeding it to a h-bridge, the h-bridge, is always on, 1 = forward 0=reverse, polarity on the two tracks.

    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.
  • Clock LoopClock Loop Posts: 2,069
    edited 2014-03-11 03:17
    Here you go, $15 / unit.


    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
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-03-11 09:37
    I think you've talked me out of trying DCC on my Lego trains.

    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.
  • DaveJensonDaveJenson Posts: 375
    edited 2014-03-12 14:32
    http://dcctrains.netne.net/Dcc%20Decoder_eng.html

    Yes you can "roll your own" but I don't think you'll get the savings you are looking for...
Sign In or Register to comment.