Scary IBT-2 Current Measurement (Video

Поділитися
Вставка
  • Опубліковано 11 лип 2024
  • On paper, the IBT-2 H Bridge module looks very attractive: Plenty of Amps, simple control interface and a very attractive price. But then, there are numerous reports from people running into problems when using the device for current sensing. Time to find out why that is and what can be done about it.
    If you like my work, please consider supporting it with a donation:
    www.paypal.com/biz/fund?id=Y2...
    Tindie page for IoTT Stick, Interface Boards and Function Hats: www.tindie.com/stores/tanner8...
    MyIoTT.org (landing page under construction): myiott.org/
    Table of Content
    0:00 Start
    0:43 Test Modules
    2:30 IBT-2 Schematics and Differences
    6:15 Wiring the IBT-2
    9:00 Track output test
    10:15 Current sensor test ohmic load
    11:30 Testing decoder current
    12:45 ACK pulse detection problem
    14:45 Adding a capacitor
    17:10 Ground noise problem
    18:45 DCC EX modification
    20:20 Programming Test
    22:42 Summary
  • Наука та технологія

КОМЕНТАРІ • 29

  • @antonkishchenko292
    @antonkishchenko292 Рік тому

    Thank you for such thorough coverage. Much needed digest of the current measurement essentials for the active project.

    • @IoTT
      @IoTT  Рік тому

      Glad it was helpful!

  • @tz3p9v0
    @tz3p9v0 Рік тому

    Thank you for your efforts on this matter -- provides insight into just how software needs to understand the different hardware "personalities"

    • @IoTT
      @IoTT  Рік тому

      Thanks, yes, that sort of details is a lot of fun. But there is no way around it if you want things to work reliably.

  • @talibhussainanjum
    @talibhussainanjum Рік тому

    thanks for share fruitful knowledge

  • @CornishMiner
    @CornishMiner 10 місяців тому

    Very useful discussion. Thank you.

    • @IoTT
      @IoTT  10 місяців тому

      Glad it was helpful!

  • @donaldwright2426
    @donaldwright2426 Рік тому

    Thanks for the video. Indeed, the analog reading of the pins of the BTS7960 is catastrophic. In addition, the analog signals at the same period as the PWM. Since I fixe the frequency at 16Mhz, reading analog signals is not easy. And to close it all, the analog signal has a sinusoidal signal that resamble to a amplitude modulation.
    I added a 15µF /25V electrolytic capacitor in parallel with this 10k resistor for each of the analog pins IS_R and IS_L before routing the signal to the analog pins of the Arduino board. This gives me a clean analog DC values with 90-95% noise removed and that can be read very quickly. The disadvantage is that I have negative pulses of -540mV. Higher the PWM duty, the lower the négative pulse.
    I do not combine the analog outputs because I prefer to read them independently.

    • @IoTT
      @IoTT  Рік тому

      A capacitor is for sure a good idea. I am using 10uF and it works quite well. The resistor is chosen so that the output voltage is not exceeding 5V for the current range I want to use. For safety, I am also using a zener diode, but within the normal current limits it is not used.
      In an H Bridge application, only one sensor is active at any point in time, so even if you combine the outputs, you can always tell based on the control signals, where the current information is coming from. Combining safes one analog input.

  • @kiwi64ajs
    @kiwi64ajs Рік тому

    Another great video Hans. I've been hoping someone would make an MRR DCC-specific Arduino Shield that took care of all the signal inversion and other passives to produce reliable operation and it looks like you're doing it which will be awesome. Looking forward to giving this a go some time. I think I have some of those IBT2 modules so need to wire it up sometime.

    • @IoTT
      @IoTT  Рік тому

      Thanks, Alex. Yes,, that's the idea: Arduino Uno, 2 x IBT-2 Motorshield, RedHat on top, makes a Loconet command station with two 5Amp tracks, one of which can alternatively be used as programming track. Plus WiThrottle, Loconet over TCP, MQTT built in by default as it is part of the IoTT Stick anyway. I probably will call it "The IoTT Cube" ;-)

    • @kiwi64ajs
      @kiwi64ajs Рік тому

      @@IoTT Awesome roadmap Hans!
      I'm looking forward to seeing it all working and ordering some boards. The need for a simple and reliable >2A capability has been around for a long time and has undoubtedly proved the concept and made it easy to get started, but the original Arduino L298* boards are a bit limiting for anything more than small layouts.
      The capability for multiple 5A drivers will undoubtedly be another game-changer for DCC-EX.

  • @sewingmachinesindetail
    @sewingmachinesindetail 8 місяців тому

    Thank you very much for this video. I have been searching for more information on this current sensing feature of the rather cheap module for control of a size of motor of about 300 W for sewing machine.
    1) You say, that the current from the "current source" is measured. Could you be a bit more specific here? Is it the current through the transistor to the + supply or the current to the transistor in the negative supply or somewhere else?
    2) When you turn off the digital inputs, I guess that both transistors becomes off, and that the only way some current may be through free wheeling diodes. Is the free wheeling diodes part of the transistors and is it safe to rely on them?
    3) I have read, that the transistors may not withstand a continuous current above 15 A. If the application only require the DC motor to run one way, you may be interested in running the two pairs of transistors in parallel. It could make problems, if shifting time delays are different. What do you think about that?

    • @sewingmachinesindetail
      @sewingmachinesindetail 8 місяців тому

      I think I found the answer to question 1 in the data from Infineon for the BTS 7960. It is the active positive current in the upper transistor, that is measured. So if you drive a motor having its inductance, the actual motor current should be corrected in accordance with the PWM value, because the current continues in the motor in the lower transistor or free wheeling diode, when the upper transistor is off.

    • @IoTT
      @IoTT  8 місяців тому +1

      1) The IS pin is the current source. It is fed to a resistor, which converts it into a voltage that is measured. There are current sensors on both, the hi and low side for protection reasons, but for current measuring only the hi side is used.
      2) Yes, when the enable pins go low, the device goes in high impedance mode. Any inductive load will discharge via clamping diodes. If you want to use it for braking, you put both bridges to high, so one is conducting, the other conducts via clamping diode. Putting both to low has the same effect, essentially shorting the output for braking.
      3) No idea, but I did a load test with 5 and 8 Amp (video 121) and the chips got pretty hot. Plus the pins in my opinion are not made for the 43 Amps the device is supposed to do. Maybe for a few secs, but not longer. That is probably the main reason why the successor of the chip has 2 pins for feeding instead of one.

    • @sewingmachinesindetail
      @sewingmachinesindetail 8 місяців тому

      @@IoTT Thank you. Am I right to assume, that one PWM input control the left side of the H bridge and the other PWM input controls the right side of the H-bridge?
      I read, that the IS pins are only affected by the positive current in the upper transistors. In order to measure the motor current you need the Arduino AD-converter sample hold circuit to sample the current signal the right time. With a switch frequency of 20 kHz it is not trivial. But I think it is possible to use Timer1 of the normal Arduino Uno to start the AD-converter at right time. Otherwise you need to low pass filter the analog signal significantly.

    • @IoTT
      @IoTT  8 місяців тому +1

      Yes, each PWM controls one chip. The need opposite signals to make it work.
      Yes, with 20kHz PWM frequency, the Arduino AD converter is too slow, and also, you would get garbage anyway because of the fact that you either read PWM ON or OFF, but you don't get the impact of the duty cycle. So, low pass is the correct answer.
      Or what you also can do is sampling at a constant rate and do an RMS calculation. That way you get ON/OFF samples with a probability proportional to your duty cycle, and the RMS calculation will make the result right.
      In a DCC application it is different as it is always 100% duty cycle, but the polarity changes with 11kHz average. At that rate it is possible to sync the ADC with the timer interrupt.

    • @sewingmachinesindetail
      @sewingmachinesindetail 8 місяців тому

      @@IoTTThanks. It is a bit difficult to explain everything here. And I am new to Arduino, so it is a part of the problem. I have tried to open a thread for comments in the Arduino Forum on motors. I am "Backflip". I do not know yet, but I guess it would be in order to sample and measure the current signal for every 0.5 ms or something like that and then calculate a mean value for a control loop, that might run for every 5 ms. With a 125 kHz ADC-clock, the signal can be read after 104 micro seconds. But sampling of signal takes much less time.

  • @robleathley6024
    @robleathley6024 Рік тому

    Scary indeed! Congratulations on such a thorough analysis of the IBT-2. Your plans will certainly make this a better option for higher current needs with DCC-EX. I like your idea for a small daughter board but, without a heat sink, would the setup run too hot? As most people limit their DCC current to 5amps, is this well below the threshold we should concern ourselves with? This latest video again makes me think that my NCE system just might be up for sale. Great stuff Hans! Keep them coming!

    • @IoTT
      @IoTT  Рік тому

      Thank you. Up to 5 Amps temperature is not a concern. The On resistance is 16mOhms, resulting in a power dissipation of about 200 mWatts per chip, which is not a problem for a device that size, it pretty much stays at room temperature.

    • @robleathley6024
      @robleathley6024 Рік тому

      @@IoTT Hans, thank you for your answer. I doubt that there is a need for more than 5amps for any N-scale layout and with a decent circuit breaker, I won’t have any worries. My Red Hat DCC-EX just moved up in priority.

  • @cvrailroadinhoscale8338
    @cvrailroadinhoscale8338 Рік тому +1

    Hans, Thank's for this info. I recently built a booster board that is Dave Bodnar design and IBT-2 ( w/cooler) for use with my DCC++ system. the system works good. After adding IBT-2 my Digitrax AR-1 auto reversers trips the "SHORTCIRCUIT" . Digitrax info says .25 to 5 amps trip current is adjustable with a POT. but clearly the current sense shuts down the system when it see's the condition. I was able to use the AR-1 with the Base Station prior to the booster. Is there a safe way to implement the AR-1? Thanks for any advice you could offer, Dave...

    • @IoTT
      @IoTT  Рік тому

      Most likely DCC EX sees a huge current spike when the locomotive bridges the track gap.
      - adjust the settings in the motordriver.h setup. I don't know who came up with the default values, but they are ways off. Use 8.3 for senseFactor and 7000 for tripMilliamps.
      - add a small capacitor, e.g. 100nF between Arduino GND and the analog input you are using. This slows down how fast the sensor voltage can raise, so the spike might be gone before the value gets critical.

    • @cvrailroadinhoscale8338
      @cvrailroadinhoscale8338 Рік тому

      @@IoTT Thank you very much, I am waiting on a makerfab wifi shield to complete my EX station and I will implement the changes when complete. thank you for all you do. I do not believe motordriver.h is in basic DCC++ base station I am currently using, just current monitor.h. The Booster Board has it's own little sketch with if statements, for current sense analog pin if : > greater than pin current booster board shuts down. It is so satisfying , exciting and rewarding when this stuff works as intended, Have a safe and happy holidays.

  • @rhbsd3441
    @rhbsd3441 Рік тому

    Maybe more of a follow on to Rob's comment. Are the two types cooler vs non-cooler pin compatible? I use the cooler version and under normal usage use 8 to 10 Amps. Could I just run jump wires from the daughter board to the pins on the cooler version?

    • @IoTT
      @IoTT  Рік тому

      8-10 Amps? sounds like Lionel ;-) But yes, both use the same pins. The layout is different, though. 4x2 on the Standard, 1x8 arrangement on the No Cooler. Not a problem if you use Jumper wires.

  • @matthewesler8379
    @matthewesler8379 Рік тому

    Is their any way to have moment contact dowlpole down though contact switch to trigger points on dcc boar

    • @IoTT
      @IoTT  Рік тому

      Hmmm, I don't think I understand this question. Any more information?