DCC++ Hardware - Motor Shields

KE4NYV Jan 25, 2016

  1. french_guy

    french_guy TrainBoard Member

    628
    374
    28
    Scott Eric Catalano likes this.
  2. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    I had to shelve my DCC++ specific board design for a while due to other pressing projects. I had a lot of problems with getting the current sensing working correctly. Part of the point behind my design was giving you direct (easy) access to the additional I/O that was planned to be used within the DCC++ environment. Also, my board was pinned specifically for DCC++ defaults and wouldn't require you to cut jumpers, create jumpers to get the pin assignments working. That part works. I'm still fighting a few things. I realize by now many who were interested in my board might have given up and just bought an eBay board to modify. That's OK. When I get some time, I want to start working on it again and see if I can come out with a working board that is ready for the market. I'll see when I can get to that...

    EDIT: Forgot to mention my board has an on-board 9VDC regulator that feeds to the VIN pin on the Arduino Uno. This means you can feed your system power (12-18VDC) to the interface board and it will power the Arduino for you. If you're running headless with ethernet, you don't even have to have a USB connected to the Arduino.
     
    Last edited: Feb 16, 2017
    Scott Eric Catalano likes this.
  3. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    personally, i like my BTS7960 based motor drivers from ebay. mainly for the current capacity, so i don't have to worry about future upgrades overloading my MD. but as i am brainstorming some ideas for more I/O options, i will see what you develop.

    so far, my latest brainstorm consists of using an arduino as a sort of router (separate so as to keep top performance of the DCC++ base station), and it will have either an ethernet shield, or a wi-fi shield to connect to the network. then each remote I/O module connects to the network as well, and they all talk to each other, with any luck. when i get some sort of working protocol, i may include the option of an ESP8266 module (once i figure them out).

    the problem is, due to higher priority space requirements for another project, my DCC++ test base is temporarily boxed up for safe keeping while i save up money to build an actual layout.

    ~Travis
     
    KE4NYV and Scott Eric Catalano like this.
  4. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    I am still interested in your board development...keep me posted....I'd be inclined to beta test too.
     
    KE4NYV likes this.
  5. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    I'd like to see what you come up with as well... if nothing other than the academic value :)

    I'd be willing to beta for you, too...
     
    Scott Eric Catalano and KE4NYV like this.
  6. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    I made the same changes and things work. I got the same problem with the power being on all the time. Until I realised that I had the power jumpers on the Velleman board wrong. They were on 5 (for PWRA) and 10 (for PWRB). Those were the wrong positions as I saw in the DCCpp_Uno.h file. It should be 3 for MAIN (PWRB) and 11 for PROG (PWRA). Repositioned the jumpers accordingly and now it works. I can switch power on and off, the main track works, programming track works in principle (I can see and hear the commands going to the engines) but not able to program the somewhat more power hungry H0 decoders yet...

    I'm one happy railroader...

    Gerard
     
    Scott Eric Catalano and Atani like this.
  7. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Hi,
    I am using the Arduino Mega and a L298N L298P 4A Dual Channel Motor Driver Module Motor Shield R3.
    Out of the box it works fine with the standard dcc++ code and I am able to program my H0 decoders. The changes are stored in the decoder (when I program a CV the engine pulses) but when I try to read CV's I get back random numbers but most of the time the read CV value is 255. No idea why this happens. Do I also have to make any changes anywhere?
     
    Scott Eric Catalano likes this.
  8. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    Hi Peter,

    Would you have an address (URL) for that shield?

    I will try again to program the decoders on the programming track. I have hooked the DCC++ to JMRI in the meantime. Will report back about that.

    As far as programming, related to this programming, I don't think it's a programming issue. I use a mix of US sound decoders (CSI, Tsunami, etc). Even on my Digitrax commend station they need an amplifier to program them.

    Gerard
     
    Scott Eric Catalano likes this.
  9. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    Okay, I hooked up my PowerPax programming track booster and still can not read the most basic things, like address and manufacturer info.

    I'm convinced - after this test with JMRI Decoder Pro - that it is not a hardware issue. The PowerPax has "Umph" enough for even the most stubborn decoders. It's probably something in the programming software (timing or ?).

    Anyone ?

    Gerard
     
    Scott Eric Catalano and Grantha like this.
  10. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Hi Gerard,

    I have bought the shield I am using on Aliexpress:
    https://nl.aliexpress.com/item/New-...32772727515.html?spm=2114.13010608.0.0.msxsq8

    When I came across dcc++ I wanted to try it and I have made a small shuttle layout which I want to control with Rocrail. I am waiting for reed-switches to arrive to operate the occupancy of blocks and hence the feedback to Rocrail.

    I can also control this layout using only the Arduino+shield. I have turnouts operating with relays and with a DCC decoder. I can run the locomotove using the commands via the serial monitor, I can program CV's (I mostly use Digitrax decoders) but -as I said- I cannot read the CV's.
     
    Scott Eric Catalano likes this.
  11. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    Peter, thanks for your link. This shield operates with the same chip, the LN298P. This chip can supply max 2 Amps per channel, that means 2 Amps for the main, and 2 Amps for the programming track. They advertise it with 4 Amps, which is technically correct, but a bit misleading.

    Has Rocrail already made programming efforts to accommodate for DCC++ ? If not, you could consider JMRI as well.

    Gerard
     
    Scott Eric Catalano likes this.
  12. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Hi Gerard,

    I have tried JMRI, but I cannot get the hang of it; I find it very complicated and frustrating. Besides I want to automate my shuttle layout and let the computer run the locomotives.

    Rocrail is -as far as I know- the only software program to run trains on dcc++.
    With JMRI you have to operate the trains yourself and that is not what I want.

    Rocrail has dcc++ built in and at first there was a problem with outputs controlling e.g. relays which control turnouts, but after some testing Rob had made some alterations in Rocrail and now it operates perfectly. When I receive my reed-switches I can automate my little layout.

    I have a spare BDL168 but I don't know and haven't searched yet whether the Arduino and dcc++ will work with Loconet.

    The 2 Amps are more than enough for me, I want to run a little shuttle layout, with only 2 diesel engines, so this is more than adequate.
     
  13. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Besides all this, I still don't know why I cannot read CV's. Changing them on the programming track works, but reading them gives all random figures.
    Anyone?
     
    Scott Eric Catalano likes this.
  14. chi.sp

    chi.sp New Member

    7
    12
    7
    Hi Peter,

    There are some posts related to this issue on the "Introducing DCC++ ..." thread.
    On post #1162, page 59, Gregg talks about Current Sensing aspects within DCC++ software.
    On the last line of the post may be the solution for your issue (ACK_SAMPLE_THRESHOLD) .

    Regards
     
    Scott Eric Catalano likes this.
  15. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    Hi Chi,

    I'm having CV read problems as well and followed Gregg's lead. I tried lowering this value, first to 25, later to 20. The loc on the programming track seems to "stutter" a little bit more (can also be my hopeful imagination), but no dice reading the CV...

    Do you know wether it's a good idea to lower this value even further? (asked Gregg the same question in the other thread)

    Gerard
     
    Scott Eric Catalano likes this.
  16. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    I have found on my N-gauge system, that with one of my loco's I have to gently apply a bit of downward pressure while I try to read the CV, otherwise it gets errors. Maybe too much wheelspin while it 'stutters'?

    Jim
     
    Scott Eric Catalano likes this.
  17. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Hi,

    1. Thanks for mentionning this post; I'll have a look. I'll try to find some more, but 82 pages.... ;-)
    2. Maybe Gerard gets a satifying answer from Greg?
    3. I have taken care that the programing track is very clean. When prgramming or reading CV's you can hear the engine pulsing but it is not moving, so with me there is no speak of wheelspin.
     
    Scott Eric Catalano likes this.
  18. chi.sp

    chi.sp New Member

    7
    12
    7
    Hi Gerard,

    The best person who could answer this question is really Gregg.
    I think if there was any risk of damage on lowering ACK_SAMPLE_THRESHOLD procedure, Gregg would have warned us in that same post.
    So if I were you I would give a try with smaller values and also with different loco/decoders. But, I can not assure you it is 100% OK.

    Good luck!
    Chi
     
  19. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    As Gerard said that lowering the value to 25 and then to 20 and did not help I changed it to 15, but reading the values again came up with random values. So this also does not produce the proper values.
     
    Scott Eric Catalano likes this.
  20. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    You may need to confirm that the motor board supports current sense on A0 and A1. You can do this with a multimeter to check connections from the L298 to the pins above. I don't know which pin on the chip to check but a read of the data sheet should help.

    Sent from my ONE E1005 using Tapatalk
     
    Scott Eric Catalano likes this.

Share This Page