DCC++ and BTS7960B 43A motor driver

erweka Jun 14, 2017

  1. erweka

    erweka New Member

    4
    3
    1
    A few weeks ago I was Googling on the combination of both DCC and Arduino and found the DCC++ project. I also found Dave Bodnar's website with some interesting projects on it. Since we have an old LGB 55000 base station for our G-scale layout, which is quite limited in the current it delivers, apart from some other things, and since I already had some good experience with Arduino, I decided to build the high power DCC++ base station as described on Dave's website. I ordered the components, soldered the litle circuit together, hooked the things up and ran into trouble... enough to write an email to Dave.

    So what is the problem?
    After I loaded the software onto the Arduino and hooked everything up, I tried running the Controller software via Processing. And everything is working fine as long as I don't put input power on the motorshield. However, if I do so and try to get power onto the piece of track (without any locomotive, just a piece of track), the power immediately shuts down and the Controller keeps giving one of the following errors:
    - "PROG Track Current Overload - Power Off"
    - "Main Track Current Overload - Power Off"

    So, I don't get power onto the track... I used an old Fleischmann Transformator 6750 for the DC, but no matter what I use as voltage, it keeps giving the overload message. So, I thought maybe the DC is not clean enough or so and tried the LGB 5006 power supply which I wanted to use anyway. I hooked it up, tried it and.... same troubles.
    Then I wrote an email to Dave and got two replies.
    Today I tried the same old Fleischmann Transformator with an DC-DC Adjustable Voltage Step Down Module LM2596S from Velleman in the hope to have some nice clean DC power. Same problems....
    I also tried the Arduino Serial Monitor, but am not sure if that works correctly.

    I hope you guys have some ideas on what is going wrong. I read something about the way this motor driver is sensing current and thought that something might goes wrong there.
    Also I need to say that I don't use the standard motorshield, so just the 43 Amps shield and accordingly NO programming track is connected at all, but still I get the error...

    Hopefully everything is clear. In case it's not, let me know!
    Thanks in advance!
     

    Attached Files:

    Scott Eric Catalano likes this.
  2. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    I am not familiar with this motor shield (IBT-2), nor do I recall anyone having it interfaced with DCC++. The only two shields I know of are the Pololu (which I use) and the Arduino one.
    I hope this helps, or can help me also by having another motor shield in the DCC++ options, if you can make it work, or someone else has already done so.
     
    Scott Eric Catalano likes this.
  3. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    I've found by doing a search that the IBT-2 driver board uses a pair BTN7970 chips. Looking at the data sheet for this chip suggests to me that the over current signal is a logic level (high or low) and not an analogue level like the arduino motor driver provides and what the DCC++ arduino is expecting on A0?

    I think this is an area that needs further investigation?

    http://wiki.ardumower.de/index.php?title=Motor_driver_ru#IBT-2_.28BTS7960.2FBTN7960.29
    http://www.infineon.com/dgdl/Infine...n.pdf?fileId=db3a304316f66ee80117642373746a89

    Jim
     
    Scott Eric Catalano likes this.
  4. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    If the inverter circuit that you built isn't working correctly, and both halves of the h-bridge were not inverted relative to each other, it's possible that an over-current condition would be created as soon as you enabled the motor driver........just a possibility.
     
    Scott Eric Catalano likes this.
  5. w8one

    w8one TrainBoard Member

    89
    109
    5
    Somewhere in the source code for the base station you need to change the values for what a overcurrent event is.

    here it is.
    From http://trainelectronics.com/DCC_Arduino/DCC++/

    Power Tests

    I tested the H-Bridge when pushed to high power and when shorted. Under both conditions it should shut down. In order to get it to respond properly I changed the value of CURRENT_SAMPLE_MAX in the CurrentMonitor.h tab from 300 to 500.

    A dead short on the motor (not the DCC that would be on the track) shut the throttle down (via DCC++) when power was at 50% throttle or more. A dead short on the DCC that would be on the track shuts down the power immediately - note that this shutdown is performed by the DCC++ controller. The chips in the H-Bridge also have a current limit at which point power will shut down but the lower limit of that value is 33 amps!

    If the value of CURRENT_SAMPLE_MAX is less than 500 it would trip at lower throttle settings.
     
    Last edited: Jun 17, 2017
    Scott Eric Catalano likes this.
  6. w8one

    w8one TrainBoard Member

    89
    109
    5
    It's analogue if you look at the block diagram in section 2.1 of the infineon data sheet it shows a pic of a variable resistor on one end of the current sense line, it is however also hooked to a diagnostics line at the other side. Here is the excerpt telling you how it works

    5.4.4 Status Flag Diagnosis With Current Sense Capability The status pin IS is used as a combined current sense and error flag output. In normal operation (current sense mode), a current source is connected to the status pin, which delivers a current proportional to the forward load current flowing through the active high side switch. If the high side switch is inactive or the current is flowing in the reverse direction no current will be driven except for a marginal leakage current IIS(LK). The external resistor RIS determines the voltage per output current. E.g. with the nominal value of 19.5k for the current sense ratio kILIS = IL / IIS, a resistor value of RIS = 1 kΩ leads to VIS = (IL / 19.5 A)V. In case of a fault condition the status output is connected to a current source which is independent of the load current and provides IIS(lim). The maximum voltage at the IS pin is determined by the choice of the external resistor and the supply voltage. In case of current limitation the IIS(lim) is activated for 2 * tCLS.

    w8one
     
    Scott Eric Catalano likes this.
  7. erweka

    erweka New Member

    4
    3
    1
    First of all, thanks for all the input regarding my problem with the IBT-2 motorshield!

    @crusader27529 : It is indeed possible that I made a non working inverter circuit, but I checked everything at least 5 times and in my opinion everything is hooked up as in the drawing. Still that is far from a garantee that it is indeed correct :whistle:
    I found that there are multiple versions of the 2N2222 transistor available, but since my knowledge of that kind of electronics is pretty limited, I have no idea if that would make any difference in this case... The one I have reads N2222A.

    @w8one : Good point you came up with, the CURRENT_SAMPLE_MAX! I saw it one Dave's website, but didn't do anything with it, except for thinking about it. The reason is that I thought that the number actually limits the maximum current that can be drawn before the system thinks that there is an overcurrent situation. Since I still only have a rather limited power supply, e.g. 2 Amps max (officially), I thought it wouldn't be a good idea to even further increase the limit. Also I thought that there shouldn't be any problem with overcurrent if there is only a piece of track connected without any single locomotive on it, so just the tracks...
    But maybe I am thinking in the wrong direction, so I would be pleased with any thoughts regarding this. :)
     
    Scott Eric Catalano likes this.
  8. w8one

    w8one TrainBoard Member

    89
    109
    5
    You should first test for a inverter short by powering on the power supply with Nothing hooked to the outputs. If this works without error then change the CURRENT_SAMPLE_MAX.

    If it does not work then recheck the wiring from the arduino to the shield, there are different pins used for uno and mega.

    Read this page https://github.com/DccPlusPlus/BaseStation/wiki/Diagnostics---D---Command

    CURRENT_SAMPLE_MAX was put there as to not burn up the h-bridge, the code is based on the original arduino shield using its data sheet and specs. What your changing with CURRENT_SAMPLE_MAX is the point it shuts the DCC++ base off, but if you have a shield that gives one value for 1 amp and another has a different value for the same 1 amp then you need to change the CURRENT_SAMPLE_MAX to match. Dave did all the work to figure out how to make that shield work you just need to apply it.
     
    Last edited: Jun 19, 2017
    Scott Eric Catalano likes this.
  9. SP_fan_1951

    SP_fan_1951 TrainBoard Member

    93
    86
    6
    Your schematic includes a pinout for a BC547C transistor, which is looking at the flat of the TO-92 package with the leads down is CBE left to right. In the same orientation the 2N2222 is EBC. Verify you have the transistor installed correctly.
     
    Scott Eric Catalano likes this.
  10. hexadec

    hexadec TrainBoard Member

    18
    18
    4
    I'm having a similar problem.

    I have a Mega and Arduino motor shield setup for DCC++ which works perfectly and has been running trains for a year now. Everything works as it should.
    I then bought 2 IBT-2s one with the BTS 43A version of the chip and one with the BTN 47A version.

    I built Dave Bodnar's driver circuit hooked it up and found that as soon as a supply voltage is hooked up to the IBT-2 the LCD shows C=330 (ish) and the current percentage as >89%

    I then tried the IBT-2 with the BTN chips and on connecting power the Arduino shuts down the drive to the module and the LCD reads "PWR Off 2 Secs" as it would for a current overload.

    I've checked that I'm getting a clean supply voltage from the bridge circuit to the Arduino and that there is a good DCC signal coming from the 6N137. The 2N2222A is also supplying both the inverted and non-inverted DCC at 5V to the chips on the IBT-2 board. Checking was with a 200MHz 'scope.

    If the power supply (separate ATX 12v 30A) is switched off the the LCD reads as it should C=0 Percentage 0. I am absolutely certain that the driver board for the IBT-2 is working properly and is wired exactly as Dave's design.

    I even disconnected the A0 line and measured the resistance of the paralleled 10K resistors without the external current sense resistor (Dave's R5) and got a 5K reading, then reconnected the external R5 and got 3.33K reading which should be pretty close to what Dave was getting (as it works out mathematically correct.)

    I'm now at a loss as I don't really understand how Dave is scaling the current sense reading to get a percentage reading. I don't get where the 0.014A per digit comes from and even less clue where the 0.0105 that is used in the formula comes from!

    I am just about convinced that this is an issue with the current sensing as I have set up a test circuit with an UNO providing PWMs and the IBT-2s both work perfectly.

    I'd REALLY appreciate any thoughts/help on this as I've spent over 2 weeks on this now and have run out of ideas.

    EDIT: I forgot to mention that the IBT-2 module is not drawing any current.
     
    Last edited: Aug 22, 2017
    Scott Eric Catalano likes this.
  11. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    I use the IBT-2 MD, and use a simple 74LS04 inverter instead of a discrete transistor inverter......not saying that it's better than the transistor version, but it's simple to breadboard and/or layout a PCB.

    I have no issues with the IBT-2, and to my understanding, the current sense voltage is proportional to the current draw. The IBT-2 has an onboard resistor to create the voltage that you sense.
     
    Scott Eric Catalano likes this.
  12. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    Did you resolve the issue? What was the solution?
     
    Scott Eric Catalano likes this.

Share This Page