DCC booster: IBT-2 schematic error?

Erik84750 Feb 25, 2022

  1. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    In 2016 David Bodnar published another groundbreaking design, the use of a 43A full bridge booster.
    However I think there is something odd in the schematic he did publish and which was widely distributed all over.
    If you look at the Pro Mini used, DIO3 (pin 6) is the output to the IBT-2 enable pins 3 and 4 (on the 8-pin connector on the IBT-2. This output would disable the IBT-2 in case of overcurrent detection from the IBT-2 pins 5 & 6.

    However, DIO3 is not only connected to IBT-2 pins 3 & 4, but also to IBT-2 pin 7, which is Vcc.
    And therefor the PRo Mini will in my opinion never be able to shut down the IBT-2.
    I searched everywhere looking for others to have perceived this, but nothing.

    Now is this a schematic error or not?

    upload_2022-2-25_15-0-56.jpeg
     

    Attached Files:

  2. Sumner

    Sumner TrainBoard Member

    2,845
    5,996
    63
    Have you considered taking this up directly with Dave? I've found him responsive to my questions. Not sure if he frequents this site any more.

    Sumner
     
  3. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Good idea, I just did,
    grts,
    Erik
     
    Sumner likes this.
  4. CSX Robert

    CSX Robert TrainBoard Member

    1,503
    640
    41
    It looks like instead of separately enabling and disabling the driver he's just powering the driver from the Arduino output pin, and to shutdown the driver, the Arduino would just set that output pin to low. That's not an uncommon method.
     
    Erik84750 and Sumner like this.
  5. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    don't know .. i did a pcb based on this schematic about five years ago, and it worked, shut down when needed...
    if it matters, mine is done on the NANO, and includes board and all...
     
    Last edited: Feb 25, 2022
    Sumner likes this.
  6. Ash

    Ash TrainBoard Member

    106
    67
    8
    The DCC signal, when high, sets IBT_2 pin 1 high and forces pin 2 low. When DCC signal is low, pin 1 is low and pin 2 is high -- provided that Dio3 and pins 3/4/7 are high. Looks like the standard inverter circuit. The only problem with this approach is if you attempt to read current sense while VCC is not powered. The current sense reading may not report the expected zero reading when logic circuit is not powered.
     
    Erik84750 likes this.
  7. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    I received a reply from David and it confirms CSX Robert's comments in post #4.
    But I agree with Ash that this poses an issue with correct reading of the actual current.

    What is more: in case of overcurrent, DIO3 brings down both enable pins AND Vcc, thereby giving wrong readings on the current sense pins, thereby probably bringing high again DIO etc.. ; result: oscillations.

    I would think it were logic to keep Vcc active.
     
  8. CSX Robert

    CSX Robert TrainBoard Member

    1,503
    640
    41
    True, but the processor knows if the IBT-2 is shut down and would have no reason to read the current.

    When you shut the booster down, there is no reason to read the current because it is necessarily going to drop to zero - that's the purpose of shutting it down, to limit current draw and possible heat damage from the short or overcurrent situation.

    Regarding oscillations - since the current is going to drop to zero when the booster is shut down, there is no way for the booster to know when the short or overcurrent situation is resolved, so you really only have two options: The first option is to have a "turn on" or "reset" user input and when it shuts down wait for the user to turn it back on. This is somewhat inconvenient so most DCC boosters use the second option, which is to wait a period of time, turn the booster back on, quickly check the current again, and turn it off if it's still too high. This would be the oscillations you referred to, the booster repeatedly turns off and back on until the short is resolved.

    Well, there is at third option that is really a combination of the first two: Turn the booster off and on repeatedly as above, but, if it shuts down a certain number of times within a certain timeframe have it not turn back on until it gets a user "turn on " or "reset" input. This would provide the convenience of the user not having to interact after every little temporary short but still provide extra protection if the user intervenes after a short occurs.
     
    Last edited: Feb 27, 2022
    Sumner and Erik84750 like this.
  9. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Great thinking!
    I currently am in the proces of automating a booster controller for 5 boosters at the time, your protocol is very useful in an automated proces. When ready I will publish the full schematics, pcb and software. Since I am not retired (yet) this may take several weeks/months but I keep you updated.
     
  10. Ash

    Ash TrainBoard Member

    106
    67
    8
    - - - why I noted the problem:

    I had used this inverter circuit with DCC++. It required updating for DCC++EX.

    DCC++EX takes an initial current reading at startup, to establish a baseline/offset. For IBT_2 the offset should be zero, but was found to be invalid/floating when the logic circuit was not powered.

    (Example of a non-zero offset: external current sensor, Pololu ACHS-7121 +/-10A, reports 2.5V at 0A.)

    The solution is to connect VCC to +5V on the Arduino, so the logic circuit will be powered whenever the Arduino is powered. Let the Arduino sketch control the Enable pins. Do not jumper VCC with Enable pins.

    Inverter circuit:
    https://dcc-ex.com/advanced-setup/high-accuracy.html?highlight=inverter#inverter-circuit

    IBT_2 wiring (without inverter) -- includes zener protection for Arduino analog input.
    https://dcc-ex.com/advanced-setup/s...-motor-board-setup.html#ibt2-wiring-schematic
    (Some IBT_2 boards can have different resistor values. It is good practice to calibrate sensor readings before connecting them to your Arduino.)

    I had to go back to the Erik's first post:
    "... the Pro Mini ... will never be able to shut down the IBT-2."

    My focus was on good current sense readings. Now, I understand his concern. Why not keep the logic circuit powered, until track power supply is off?
     
    Erik84750 and wvgca like this.
  11. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    In your url above I believe there may be a few mistakes:

    "Option - You may need to connect or solder a 10k or smaller resistor between pin 5 or 6 and ground on the IBT_2 (shown as R1 in Figure 49). There is already a 10k resistor on each chip, which gives us a resistance of 5k when we connect both current sense outputs together. See the notes below for more detail about current sense and a suggestion for using an external current sense board."

    1. According to the schematic and according to what I read on the onboard resistors their values (for pins and 6) are 1k.
    Connecting pins 5 & 6 together already gives 0.5k.
    Why not use the formule mentioned in the BTS7960 datasheet (4.4.4):

    Current sensing circuit:

    Current sense output is a current source. Nominal value for current sense ratio Load Current / Sense Out = 8500. So for example a 1kR gives V at current sense output = (Load current / 8,5) volts.

    If load current will not exceed 10A and if max current may give 5V then a resistor of 10A / (8500 / R) = 5V hence (10A x R) / 8500 = 5V hence R = 5V x 8500 / (10) = 4.250 Ohm.

    So why not replace the onboard resistors (for current sense outputs)? No need for additional zener nor extra parallel resistors?

    2. "R2 can be whatever you have on hand. We recommend 2k - 10k."

    Typical input impedance of an analog input is somewhere about 20k. "Whatever on hand" is nog good advice, and >1k is a bit high for a series resistor on an arduino analog input?
     

    Attached Files:

  12. Ash

    Ash TrainBoard Member

    106
    67
    8
    RE: Item 1.
    Do not assume the resistors on your board are 1k. Confirm the values. Calibrate prior to connecting to the analog input.

    While the schematic shows 1k resistors and some boards have 1k resistors, some boards have 10k resistors. You will notice that the Bodner booster circuit also uses a 10k resistor to GND. The three 10k resistors result in a combined parallel resistance of 3.3k. My testing shows that it results in a current sense of about 0.5 V/A. Some have reported 0.63 V/A. So we also need to consider the precision -- and these BTS chips can vary.

    Specifications are a starting point, but calibration is prudent.

    Why not replace the onboard resistors? Soldering equipment/skills for many of us DIY folks preclude attempting to do much with SMD.

    RE: Item 2 + zener.
    The ambiguous value for the resistor also made me ask the question. As I understand, the purpose of the resistor is to limit the current that the zener diode might attempt to pull. The analog input will only pull a very slight current, so the value of the resistor is not critical. I used a 5k resistor. And I found the zener protection circuit also works for other analog inputs; no noticeable difference in analog readings.

    The zener protection circuit will be included for every analog input where I am not fully confident that the voltage cannot exceed +5V. With a 10A power supply and a 43A motor board, my confidence level is far below 100%.

    If your board was 0.63 V/A, 10A is 6.3 volts into the analog input. You might want the zener and another parallel resistor.

    And I may have missed something.
     
    Erik84750 likes this.
  13. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    just as a matter of interest , the website shows two different versions, a 2001 and earlier, and a 2001 / later.... which version are you working with ?
     
  14. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    I fully agree.

    And it may be prudent too (in referenced url) for the author not to provide ad hoc advice re. resistor values for this specific subject.
     
  15. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    The Arduino ADC requires a source with "low" output impedance, in practice this would be less than a few kOhms. Its value is not without consequence if good results from its ADC are required.

    Stating "any value at hand" is plain wrong.
     
  16. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    A resistor 10k or more is fine for our use since the analog inputs are high impedance. The recommendation to use 10k comes from internal capacitance and the multiplexing done to poll the ports that feed to the sample and hold comparator. If the inputs switch when connected to multiple inputs with large differences in the values between pins, that capacitance (picofarads) has to charge or dump its charge through that resistance. If you take fast readings, that could lead to inaccurate readings until the port settles. But we are only using one pin, with another used rarely for programming.

    In any case, I don't know where those resistor values came from. There are always more considerations than you think, aren't there? Many of the 5.1V Zeners are 500mW, but one we list is 1W and there is a 5W available. So working with the smallest value, the current needs to be below 98ma (500mW/5.1V). But we also need 1mA of Knee Current to maintain the Zener breakdown when the voltage goes over the limit.

    So at 5.5V, .4V above 5.1 and a 220 Ohm resistor, we get 1.8mA. So far so good.
    If we want to protect up to 12V, that is 12-5.1 or 6.9V. 6.9/220 = 31mA.
    The resistor will use 6.9 x .031 = .214 Watts, so 1/4 Watt will do.
    In the Zener, 5.1 x .031 = 158mW, under our max of 500.

    So unless I missed something (check my math and circuit analysis) we can change the resistor to 220 Ohms. What voltage do we have to worry about on an IBT_2 current sense output? At the top end of the range for what it reports in volts per Amp, this would protect against the voltage delivered for something over 6A. If our design is for a max of 5 anyway and the CS cuts the power at 5, this should be good. We can up the voltage shunted to ground with a 1/2 watt resistor or increase resistance a bit to drop the current. Any way you look at it, you have to calibrate your board since not only is each board wildly different from another, but each half H-Bridge chip on the same board is different. Thoughts? Short of designing our own board and dumping all this nonsense ;)

    Fred
    DCC-EX
     
    Erik84750 likes this.
  17. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Hi Fred, thanks a lot for your input!
    And indeed I had not taken into account that only one analog input is used, so credit to you, my mistake.

    In conclusion from above discussion:
    1. changing the IBT-2 onboard resistors is not practical
    2. Onboard IS resistors for pins 5 & 6 may vary, sometimes 1kOhm, sometimes 10kOhm.
    3. These resistors should however be measured for the board at hand because if we want to limit the sense voltage to below or equal to 5V for a given maximum current then these values must be known.
    4. Given the IBT-2 specification for these resistors is based on this formula (ref spec sheet, post #11):
    a. Nominal value for current sense ratio Load Current / Sense Out = 8500.
    b. If load current will not exceed 10A and if max current may give 5V then a resistor R will yield this formula: 10A / (8500 / R) = 5V
    hence (10A x R) / 8500 = 5V hence R = 5V x 8500 / (10) = 4.250 Ohm. Instead of the 1kOhm or 10kOhm now in place.
    (PS: Ash uses a 10k for R1, giving 3.3k if onboard 2x 10k), giving according to him also 0.5V/A; this deviates from the IBT-2 spec sheet formula).
    5. Fred's calculations for R2: see his excellent post above. R2 may be 220 Ohms.


    [​IMG]
     
    FlightRisk likes this.
  18. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    I finished hardware for a 5 booster controller, with a microcontroller monitoring for overcurrent or short circuit. Software is in debugging stage, almost ready. Features:
    1. 5 ~20ms reaction time on short circuit or overcurrent above a set limit (depending on IBT-2 resistor value, a calibrating resistor value per booster on my board, and a set percentage above which activation occurs)
    2. a selectable amount of auto-resets, a selectable timing between auto resets
    3. manual reset (push button) avalable after auto-resets are exhausted
    4. LCD display of current and status of each booster
    5. external selection for track polarity reversal for each booster (TTL level)
    6. the DCC signal is taken from either the command station, or anywhere else on the tracks where DCC already is available. The signal is galvanically separated from the board (optocoupler).

    When I consider the software to be bug-free I will post it here. Platform: AVR (ie the board is designed to fit a Pro Mini).
     

    Attached Files:

    wvgca likes this.

Share This Page