My Modified DCC++ Base Station - Notes

Travis Farmer Jul 26, 2019

  1. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    A direct link to the layout notes on my website: http://tjfhome.ddns.net/train/my_layout.php
    or, from the start page (http://tjfhome.ddns.net), with a computer browser (no idea what it looks like on a smart phone or tablet), on the upper left, select "My Trains". brings you to my train start page. along the top menu items, select "LAYOUT" -> "LAYOUT NOTES".
    I just checked with my Samsung tablet (first time checking my own website on my tablet), and fortunately it isn't completely messed up. ;)

    ~Travis
     
  2. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    A direct link to the layout notes on my website: http://tjfhome.ddns.net/train/my_layout.php
    or, from the start page (http://tjfhome.ddns.net), with a computer browser (no idea what it looks like on a smart phone or tablet), on the upper left, select "My Trains". brings you to my train start page. along the top menu items, select "LAYOUT" -> "LAYOUT NOTES".
    I just checked with my Samsung tablet (first time checking my own website on my tablet), and fortunately it isn't completely messed up. ;)

    ~Travis
     
    IronMan1963 likes this.
  3. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    A direct link to the layout notes on my website: http://tjfhome.ddns.net/train/my_layout.php
    or, from the start page (http://tjfhome.ddns.net), with a computer browser (no idea what it looks like on a smart phone or tablet), on the upper left, select "My Trains". brings you to my train start page. along the top menu items, select "LAYOUT" -> "LAYOUT NOTES".
    I just checked with my Samsung tablet (first time checking my own website on my tablet), and fortunately it isn't completely messed up. ;)

    ~Travis
     
  4. IronMan1963

    IronMan1963 TrainBoard Member

    119
    128
    7
    I also have been following along on this thread. I don't post much but do lurk everyday. I am always watching DCC++ threads. Still trying to work a couple bugs out of my own setup.
    Richard
     
    Travis Farmer likes this.
  5. Jimbo20

    Jimbo20 TrainBoard Member

    274
    175
    9
    I too am following this thread Travis. Trouble is my small layout is still boxed up following my house move and subsequent building work. I can't wait til I can get it all out and start working on it again!
     
    Travis Farmer likes this.
  6. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    After reading some posts in other threads, with my DCC++ using IBT-2 motor drivers, with the included current sense, that i may not have enough resolution with the Arduino on-board 10-bit ADC for small current sense levels.
    My DCC++ prototype is currently out of service while i build it into an enclosure (waiting for parts). though i can still somewhat use it enough to test my current theory.
    I have a ADS1115 module from Adafruit, well, once i find it. but it is a 16-bit I2C ADC, so if my math is correct, the current resolution is 10-bit, or 5Vdc / 1024 = about 0.00488 volts per bit, or i think about 0.041A per bit. so, again, assuming my math is correct, if i solve for 16-bit, i have 5Vdc / 65536 = 0.00007 volts per bit, or about 0.0004A per bit. far better resolution, i think.
    Should be fairly easy to alter the code a bit, while still maintaining backwards compatibility for those that choose to use the Arduino 10-bit ADC inputs. i will likely only publish this change to my "personal copy" branch on my GitHub. mostly just to play it safe, until it can be fully evaluated.

    in other unrelated news, i installed a TCS WOW121 Diesel sound decoder chip (21pin) into my new (Athearn) EMD SD40-2 loco. still waiting on delivery of the little speaker, but this is my first DCC loco with sound, and i am eager to hear it! unfortunately, all the front LEDs are tied to the front headlight circuit, but i think i can rewire the ditch lights to function pins so they work properly. not sure how to get them to alternate flashing, though. unless they do it automatically when set as ditch lights...

    ~Travis
     
  7. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    very strange compile error while running a verify:
    Code:
    Verifying...
    C:\Users\travi\AppData\Local\Temp\ccYkXoes.ltrans0.ltrans.o: In function `SerialCommand::parse(char*)':
    <artificial>:(.text+0x5fb4): undefined reference to `SendExtInfo(unsigned char, unsigned char)'
    <artificial>:(.text+0x5fbc): undefined reference to `SendExtInfo(unsigned char, unsigned char)'
    <artificial>:(.text+0x6c8e): undefined reference to `SendExtInfo(unsigned char, unsigned char)'
    <artificial>:(.text+0x6c96): undefined reference to `SendExtInfo(unsigned char, unsigned char)'
    collect2.exe: error: ld returned 1 exit status
    the error seems to point to use of a function that has since been deleted (SendExtInfo), and the reference to it has also been deleted.
    I have restarted the Arduino IDE, and it still persists. (Arduino IDE 1.8.10) any ideas?

    ~Travis
     
  8. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    solved it... :whistle:
    error was in a completely different file than what was referenced by the error.

    ~Travis
     
    drbnc likes this.
  9. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    So, i was talking with a train friend on Facebook, and it was suggested i have a "backup plan" for my DCC++ setup. mainly because i like to tinker, make improvements, and yes, sometimes add some "unintentional features". ;)
    so i searched eBay, and found an MRC Prodigy Express (the older one, not "squared"). i am not worried about the limited power output, as i can add or make a booster if needed. besides, it is only a backup plan, if i unintentionally cook my DCC++. it wasn't too expensive, but i do have to find a power supply for it. shouldn't be hard.
    again, i am not giving up on DCC++. i am still working with it. i just needed a fail-safe.

    that being said, i am having issues with the steel enclosure i bought. it is far sturdier than i thought, and is more difficult to make holes in than i thought. i may end up using an acrylic panel to mount the various switches, LEDs, connectors, etc. maybe even an aluminum panel, as long as i isolate it from the steel. just kinda slows progress.

    ~Travis
     
  10. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    well, i tested my new loco out, using test leads with alligator clips, connected directly to the DCC input leads on the loco main board. still no programming on program track... so i guess i can rule out dirty track/wheels. it worked way back, so i don't know what the issue would be now.
    my best guess? i have the ACK_SAMPLE_THRESHOLD value set too low, perhaps. i don't have time this afternoon to poke around, but maybe this weekend. then i can slowly raise the threshold, to see what works.
    I still have the CT sensors to try as well. i will have to dig out my digital scope to poke around too. see what is up. i may even create some debug code to follow the threshold comparison to a digital output that i can connect my scope to. that way i can scope the analog in pin, as well as the comparison results. if nothing else, it will give me the ability to compare different current sensors. i can even pop a LED onto it later, for blinky-light eye-candy. ;)

    Happy New Year, everyone!

    ~Travis
     
  11. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    quick thought... i may end up using a Arduino motor shield, or clone, on my DCC++ base station, and use the big motor drivers for DCC boosters. that way i can have stable prog track programing, that is proven to work reliably, and large current for my layout.

    just a thought.

    ~Travis
     
    vasilis likes this.
  12. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    so, the above idea sounds pretty good, after thinking about it. and i can use a design similar to David Bodnar's DCC booster idea to boost up the layout power. the question though, anybody know where i can still get an Arduino motor shield? Arduino says they are unavailable, and eBay just has the china clones.

    ~Travis
     
  13. Softec

    Softec TrainBoard Member

    27
    9
    4
  14. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
  15. Softec

    Softec TrainBoard Member

    27
    9
    4
    It does work and all but the original come from china one way or another (maybe it too). The arduino web site does show it available at $22.00.
    I too try to order from a US vendor, but recently I bought several items from ebay listed as china, four days later i purchase items from someone on ebay listing "US ship". The china item got here two days before the US shipped. Go figure.
    Dan,
     
  16. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    Hmm, when i checked Arduino, they were unavailable. must have gotten a shipment in. anyway, i have some China boards coming.

    I have made a revised schematic of Dave's DCC Booster, and for simplicity, i left out the Arduino, and have it wired constant-hot. (to save components and money). i will use fuses instead. 15V psu will be fused, as will the master out of the booster, and each boosted lead to the track will be fused around 2A - 3A, or i will use the light-bulb idea to restrict current.
    with the build of my layout getting very near, i am trying to get my DCC++ up and running, fully. that way i can concentrate on the layout needs, as the money tree is getting a bit bare at this point, and i still have necessary purchases before the layout can be started.

    ~Travis
     
  17. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    ok, epiphany... no arduino to shutdown the booster = bad idea. i can however use a single Arduino Mega 2560 to control up to 16 boosters, and use a Nextion screen to provide a GUI. shouldn't add to much to the cost, as i have the Arduino, and the Nextion screen already. besides, i can add code to provide for auto-restore of power, with a counted limit. i still like the idea of a series light-bulb to limit current.
    the other advantage of the boosters with one arduino, is that i can use a single DCC input circuit, for all the boosters. it may even be advantages to include the booster right in the large enclosure i have for the DCC++ base-station. that way i can share the power supply for track power, and the regulated 5Vdc power for the Arduino. the benifit there, also, is that i can eliminate the DCC sensor circuit, and take the signal directly from the DCC++ base-station board.
    furthermore (another epiphany), the DCC++ code i have, supports multiple power districts. so i can eliminate the booster, and directly connect the power districts.

    the program track will still use the Arduino Motor Shield (clone), for reliability.

    with the exception of the program track circuit, my thinking seems to have wandered around a long meandering circle. but i do think this is the (so far) best route for me to take. it also requires the least amount of changes in hardware. besides, with a 42A capable motor driver, i shouldn't need too many power districts...

    ~Travis
     
  18. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    I was playing around with ACK threshold values, just for something to do, and while i haven't tested it yet with my scope, i think the IBT-2 has polarity issues. if i am correct, the Arduino style motor drivers sense current on the low side of the power supply. the IBT-2, i think senses from the output. i think this explains why i have had some results, as well as no results, without any changes.

    so i am still proceeding with the Arduino style motor driver for the program track, and probably for the main track too. i can't trust the current sense of the IBT-2 boards. then i will use a safe version of the DCC++ booster (with arduino current monitoring), and i will use a low-side power supply current monitor, as an experiment, and see how reliable the current sense is. but regardless of the results, i will still use the more reliable Arduino style motor driver. the Base-station alone will be enough for the beginnings of my layout, until the current (amps) needs are more than 2A.

    though i think this theory nearly explains why the IBT-2 current sense works sometimes, and not other times.

    ~Travis
     
    Sumner likes this.
  19. vasilis

    vasilis TrainBoard Member

    109
    37
    7
    Travis Farmer likes this.
  20. Travis Farmer

    Travis Farmer TrainBoard Member

    342
    312
    11
    i can not read much French, but what i could decipher is the use of a MAX471 (up to 3A sense), or the ACS712 (up to 30A sense).
    I have already planned on using the 30A version of the ACS712 for the DCC boosters. i checked earlier today, and i do have several clones of the L298 style motor shield, but none with current sense ability. that would put me in the exact same position i am already in. motor drivers without a reliable current sense. the Arduino motor shield clones i have ordered are already on their way from China, so that will fix the base-station situation.

    ~Travis
     

Share This Page