DCC++ Hardware - Motor Shields

KE4NYV Jan 25, 2016

  1. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    You could also try the DCC++ Controller on the GitHub; that has an option to draw a simple realtime graph of the current consumption. If that works then at least you know the current monitoring hardware works?

    https://github.com/DccPlusPlus/Controller

    Jim
     
    Scott Eric Catalano likes this.
  2. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    So I finally hd some free time yesterday and got the 43A motor bridge up and running both through the original motor shield and directly to the uno. Everything worked well with the exception of current sense.

    It shows ~10% with nothing running or on track then even when running 2 locos still 10ish%

    I also have built the DCC booster by Dave Bodnar and again things work except current sense is showing 3ish amps with nothing hooked up. I have tried putting pin 5/6 of the motor driver directly to pin A0 and same thing so its not a other interference issue.

    Any ideas where to start the troubleshooting process here?
     
    Scott Eric Catalano likes this.
  3. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Same here...but mine shows 89% on one IBT-2 module and complete shutdown on the other. Got to be a I sense issue but I have a clue what!
     
    Scott Eric Catalano likes this.
  4. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Scott Eric Catalano likes this.
  5. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Dave, would you be so kind as to explain how you are using the CurrentPinReading and how you derived the formula. I can't for the life of me see where the 0.014A per digit comes from nor indeed the 0.0105 used in the formula.
    If you have the time then a fuller explanation of the problems I'm having is here DCC++ and BTS7960B 43A motor driver

    Thanks.
     
    Scott Eric Catalano likes this.
  6. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    I haven't touched this project in the better part of a year so my recollection is not very clear but I expect that I did measurements with an ammeter and used those values & the analog readings to derive the formula

    dave
     
  7. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Thanks for the reply Dave.
    It's definitely something to do with the current sense. I have 3 ITB-2s now and 2 of them perform as described in the other thread but the one that arrived this morning works exactly as your prototype. All I did was disconnect one module and connect the next and it works perfectly! This proves every other link in the chain is working properly.
    The anomaly is that all the IBT-2s work exactly the same if the current sense is taken out of the equation.
     
    Scott Eric Catalano likes this.
  8. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    That is strange but still good information to have - do you recall where you purchased those that properly report current and those that do not?

    Also, have a close look at the two different boards, perhaps a current sense component (resistor) is not installed on the odd ones

    dave
     
    Scott Eric Catalano likes this.
  9. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Keith/hexadec
    I am gathering supplies necessary to build Daves booster ... I have studied his photos and schematic but would love to have some additional photos to work from ..... any chance you could put some up on the board (or send to esfeld@cyberdude.com) .... any hints or problem areas you had that might be of help would also be welcomed. Thanks
    Steve F
     
    Scott Eric Catalano likes this.
  10. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Hi Steve,
    I'll do some detailed stuff for you at the weekend but to be going on with I attach a copy of Dave's schematic built in Proteus (for the component IDs) and a picture of my layout on 24x37 Veroboard.
    Cheers,
    Roy


    Layout.jpg DavesBooster.jpg
    [​IMG]
     
    Scott Eric Catalano likes this.
  11. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Hi Dave,
    Yes, a puzzler indeed! I'm going to spend some (more) time on this at the weekend, I'm determined to crack it. All the boards have the same resistors on them and the only difference is that 2 boards have the later 47A BTN version of the chips and one has the 43A BTS. It is , of course, one of the BTNs that is working so that's another theory out the window.

    All modules came from the same place on eBay.

    Anyway, I'll keep you informed.
    Cheers,
    Roy
     
    Scott Eric Catalano likes this.
  12. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    I will do some more experimenting this weekend. I need to rebuild the circuit and do some retesting and I now have a couple of the motor driver 43A modules from different sources, will try with a pro mini and a nano, etc.

    This weekend I will document and play and post pictures, voltage readings, etc, etc of my results but I'm glad to know someone else has the issue so at least I'm not just crazy :)
     
    Scott Eric Catalano likes this.
  13. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Roy
    I am still waiting for some components from China to complete a booster but so far your schematics have helped tremendously .. Thank you
    Steve F
     
    Scott Eric Catalano likes this.
  14. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Hi Steve, I still haven't got much further with this as I've pulled my back somehow and am currently acting like a knackered 96 year old. LOL
    I managed to do a few measurements and it does appear that Dave's formula works and produces a linear graph I just haven't got to finding out why only one of my modules produces the expected results.
    Anyway, when you get your bits I'll (hopefully) be back on my feet again and willing to assist.
     
    Scott Eric Catalano likes this.
  15. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Just a note, you may notice I've changed the pullup resistor on the optocoupler output to it's recommended minimum (330R) because I was only getting 3.8V out using the 4K7 Dave used. I've also used a different 5V regulator for no other reason than I had some. I may also try a Schottky diode on the 5V output (less V drop) although it works fine as is.

    Cheers,
    Roy
     
    Scott Eric Catalano likes this.
  16. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Hi, could you please post a schematic for the shield you made?
    Thks,
    Erik
     
    Scott Eric Catalano likes this.
  17. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Here is a copy of a post I wrote about current sensing, in the generic DCC++ thread, but it may be of interest here (for the drawings in my original post, click on the following link):

    http://www.trainboard.com/highball/...tion-and-interface.84800/page-84#post-1018413

    Ok, finally I looked it up myself.
    In the schematic you see R1 = 0.15ohm. Here the current for the main track passes, and is amplified x10 at opamp IC4A.
    This value is converted by the Arduino ADC to a value between 0 and 1023.
    So, the standard DCC++ value for current sense and short circuit trip = 300. This corresponds to 300/1023*5/10/0.15=0.9775A.

    If you want a 3A limit, increase the 300 to 900.

    When using David Bodnar's high power booster (http://www.trainelectronics.com/DCC_Arduino/DCC_Booster/) the the datasheet p17 shows that the sense current is 1.2A with a value of 300 in the DCC++ sketch current sense part.
    This value is otained as follows: see page 17, Ris in the module is 10k, not 1k as in the spec sheet. Therefor 300/1023*5*0.85=1.24A.

    If you want the latter module to go up to 10A then value 300 needs to be changed to 10/1.24*300=2419 which is impossible because the max value can be 1023 (max adc output value).

    So the max current that can be allowed with the power booster is 1023/300*1.24=4.22A.

    If you want the power booster go to higher currents you need to remplace the sense resistor on the module with a lower value, ie 1k as descirbed in the spec sheet attached p17.
    Or use R5 as David has done with a 10k in parallel, giving 5k effective. This results in a max current detectable (if you raise 300 to 1023) of 1023/1023*5*8500/5000=8.50A.

    EDIT: David connects both Is outputs together effectively placing the 2 10k onboard resistors in parallel creating a 5k resistor sensor; then externally he adds a 10k resistor R5 creating a 3.33k sensing resistor. The resulting maximum current with a 1023 value is 1023/1023*5*8500/3333=12.75A. If you leave the DCC++ default value at 300 then the max current is 300/1023*5*8500/3333=3.74A
     
  18. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    HI Roy
    Hope you're on the mend ...... got all my bits and wired up. Everything seems ok with one exception ... at first I get straight DC output from the track side of the IBT-2 not DCC and then after a bit I get no output at all. I have traced my wiring numerous times and all seems in order. I think that my best bet would be to get another IBT-2 ...... if that works I'm good .. if not then it's something amiss with my wiring or perhaps the transistor ... still having fun though.
    Steve F
     
    Scott Eric Catalano likes this.
  19. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    Hi Steve,
    Good news you're getting somewhere.
    Back has improved quite a bit and I'm £220 poorer after buying one of those chairs that have lumbar support and posture adjustment. So far so good and at least I'm back at my desk/bench!

    Do you have or have access to an oscilloscope? One of the problems I had was that I wasn't getting enough voltage out of the regulator due to instability and the drop on the diode. This resulted in a very low drive to the transistor and consequently not a good logic level to the 74244 on the IBT-2. This was very obvious on the 'scope trace.

    It's also very strange that of my 3 IBT-2s only one works correctly with Dave's driver board but they all work perfectly well if the current sense is taken out of the equation. I still haven't had time to find out why.

    Anyway good luck with your experiments.
    Cheers, Roy
     
    Scott Eric Catalano likes this.
  20. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Roy
    Sounds like it might be a problem ..... I will check it out when I can .... my scope showed a small peak but the output ran a loco in one direction until I reversed the track leads ( loco ran in reverse) leading me to believe that it was outputting DC ..... at least you gave me something to play with before looking into an IBT-2 replacement. I am not that familiar with transistor logic levels and so you have given me a place to start. Thank you
    Steve F
     
    Scott Eric Catalano likes this.

Share This Page