Scary IBT-2 Current Measurement (Video

  Рет қаралды 4,377

IoTT

IoTT

Күн бұрын

Пікірлер: 34
@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 2 жыл бұрын
Thank you for your efforts on this matter -- provides insight into just how software needs to understand the different hardware "personalities"
@IoTT
@IoTT 2 жыл бұрын
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.
@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.
@CornishMiner
@CornishMiner Жыл бұрын
Very useful discussion. Thank you.
@IoTT
@IoTT Жыл бұрын
Glad it was helpful!
@talibhussainanjum
@talibhussainanjum Жыл бұрын
thanks for share fruitful knowledge
@cvrailroadinhoscale8338
@cvrailroadinhoscale8338 2 жыл бұрын
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 2 жыл бұрын
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.
@sewingmachinesindetail
@sewingmachinesindetail Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
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 Жыл бұрын
@@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.
@kiwi64ajs
@kiwi64ajs 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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.
@robleathley6024
@robleathley6024 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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.
@rhbsd3441
@rhbsd3441 2 жыл бұрын
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 2 жыл бұрын
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.
@dodekaedrikosaedr3321
@dodekaedrikosaedr3321 2 ай бұрын
Hello! My IBT-2 module, when no current, has 1.8V on L_IS and 2.2V on R_IS. When I put 10Ohm resistor - it increase to 2.3 and 2.7V. So command station shows 2-3Amp. I put capasitor 10nF but it doesn't change situation. Maybe it's bad module?
@IoTT
@IoTT 2 ай бұрын
I have seen some BTN chips that give an output current on IS as soon as voltage is applied. Is the 10 Ohm resistor your output load? The BTN chips I had with that problem at least had a linear error, so it is easily possible to compensate in the software by just deducting a constant value to the measured input. Are you using an external IBT-2 module with the 10k resistors to convert sensor current to voltage? I would try a different IBT-2 module and compare the results.
@dodekaedrikosaedr3321
@dodekaedrikosaedr3321 2 ай бұрын
​@@IoTT Of'course I have seen your video with maximum attantion. And ofcourse my module has 10kOhm resistor to convert sensor current to voltage. I check it many times. And i put capasitor 10n (and try 0.1mk and 1mk). I even order ASC724 current sensor 50A - but it has the same 50% voltage with 0A current. What is the way to deducting a constant value? And Yes a order another one IBT-2 to compare.
@IoTT
@IoTT 2 ай бұрын
If you get the same results with the ASC724 I would check if there maybe is a problem with the GND potential that would lift the sensor voltage. To compensate for the offset, you would deduct a constant value from the value you read from the analog input and then use the result for the TrueRMS calculation.
@dodekaedrikosaedr3321
@dodekaedrikosaedr3321 2 ай бұрын
@@IoTT If you check ASC724-50A manual - you can find that it has 0V in -50A and 5V in 50A and 50% (2.5V) in 0A
@matthewesler8379
@matthewesler8379 2 жыл бұрын
Is their any way to have moment contact dowlpole down though contact switch to trigger points on dcc boar
@IoTT
@IoTT 2 жыл бұрын
Hmmm, I don't think I understand this question. Any more information?
IBT-2 Power Shield (Video#107)
24:28
IoTT
Рет қаралды 3,1 М.
Current Measurement Techniques in AC Drives
27:06
Sandun Kuruppu
Рет қаралды 1,9 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 19 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 56 МЛН
How To Use This High Current Motor Driver | HW-039 or BTS7960B Motor Driver
10:31
DCC Power Supply Short Circuit Testing (Video#141)
27:58
IR2110 Based High Voltage H-Bridge Motor Control
11:46
Lewis Loflin
Рет қаралды 29 М.
Flawless PCB design: RF rules of thumb - Part 1
15:45
Hans Rosenberg
Рет қаралды 84 М.
Control Large Gearmotors with PWM & Arduino
34:34
DroneBot Workshop
Рет қаралды 262 М.
Huge Current MOTOR DRIVER BTS7960
7:27
Saravanan AL
Рет қаралды 68 М.
Measure DC Voltage and Current with Arduino
37:29
DroneBot Workshop
Рет қаралды 203 М.
LocoNet to MQTT Gateway (Video#1)
13:29
IoTT
Рет қаралды 4,7 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 19 МЛН