BTS7960 Burnout second time

Hi Everyone!
I'm on my way to do a lawnbot using wheelchair motors. Steel frame is ready, arduino is wired but during tests I burned 2 BTS 7960 and I do not know realy why. I have a suspicion, but I'm a civil engineer, not an electric specialist, so I would like to share my problem with You.


2 arduinos connecting each other by nrf24L01. Steering is a joy with a potenciometer - working as power limiter. I have tested communication before, everything worked pretty ok. Lawnbot will be powered by 2 car batteries in series. For now, I have tested it using my laboratory power source.
First of all, I tested BTS using car bulb - it worked. After connecting wheelchair motor and a few tests (10 times forward and backward) in minimal power (2A -3A max) BTS burnout - a lot of heat from BTS without motor moving.
I have some ideas, but maybe somebody could help me before I check all of them and burn a box of BTS.

  1. Not enough power after motor starts from my laboratory power source. Not stable voltage in arduino can get errors during operations. - after using car battery or independent power source to Arduino it can be fixed?
  2. Wrong code - see below.
  3. Changing directions in motor rapidly causes cross conduction. Someone mentioned this problem here: IBT-2 H-Bridge with Arduino – Dr Rainer Hessmer : "The H-bridge does provide a delay (switch on/off delay / slew rate), which would prevent the cross-conduction issue if you could send both PWM signals at the same time. But because of the time arduino takes to process the line of code (analogWrite in this case) it will still cause cross-conduction.
    I don’t have the exact numbers anymore, but the build-in delay is about 4/6 ms (depending on resistance and temperature) and the delay time between the 2 lines of code is about 4-8 ms. This sometimes causes an overlap, resulting in crossconduction."
  4. Have to use soft start code.

I have spent a lot of time looking for solutions but still nothing.

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
 
#define S1F 5
#define S1B 6
#define S2F 9
#define S2B 10

RF24 radio(8, 7); // CE, CSN
const byte address[6] = "00001";
int data[3];

unsigned long lastReceiveTime = 0;
unsigned long currentTime = 0;

int xAxis = 510; // Forward/backward, 1023 - full forward, 0 - full backward
int yAxis = 510; // Left/right, 0 - full left, 1023 - full right
int lAxis; // limiter
int motorSpeed1F = 0;
int motorSpeed1B = 0;
int motorSpeed2F = 0;
int motorSpeed2B = 0;

void setup() {
  
  pinMode(S1F, OUTPUT); // PWM motor 1 Forward
  pinMode(S1B, OUTPUT); // PWM motor 1 Backward
  pinMode(S2F, OUTPUT); // PWM motor 2 Forward
  pinMode(S2B, OUTPUT); // PWM motor 2 Backward
  
 
  radio.begin();
  // radio.setChannel(81);
  radio.setPALevel(RF24_PA_HIGH);
  radio.setDataRate(RF24_250KBPS);

  radio.openReadingPipe(0, address);
  radio.startListening(); 
  
  Serial.begin(9600);
  }

void loop() {
     currentTime = millis();
     if ( currentTime - lastReceiveTime > 1000 ) {
     resetData();
     }
  
    if (radio.available()) { 
    radio.read( data, sizeof(data) );
    xAxis = data[0];
    yAxis = data[1];
    lAxis = data[2];
    Serial.println("xAxis:");
    Serial.println(xAxis);
    Serial.println("yAxis:");
    Serial.println(yAxis); 
    Serial.println("lAxis:");
    Serial.println(lAxis);
    lastReceiveTime = millis(); 
    }

  // OŚ X - BACKWARD < 490 (set medium = 510 +-20)
  if (xAxis < 490) {
 
    digitalWrite(S1F, LOW);   // disable forward motor 1
    digitalWrite(S2F, LOW);  // disable forward motor 2
   
    motorSpeed1B = map(xAxis, 490, 0, 0, 255); // set pwm backward motor 1 
    motorSpeed2B = map(xAxis, 490, 0, 0, 255); // set pwm backward motor 2
  }
  // OŚ X - FORWARD > 530
  else if (xAxis > 530) {
    
    digitalWrite(S1B, LOW);   // disable backward motor 1
    digitalWrite(S2B, LOW);   // disable backward motor 2
  
    motorSpeed1F = map(xAxis, 530, 1023, 0, 255);
    motorSpeed2F = map(xAxis, 530, 1023, 0, 255);
  }
  // else do nothing, set zero all PWM
  else {
    motorSpeed1F = 0;
    motorSpeed1B = 0;
    motorSpeed2F = 0;
    motorSpeed2B = 0;
    
   digitalWrite(S1B, LOW);
   digitalWrite(S2B, LOW);
   digitalWrite(S1F, LOW);
   digitalWrite(S2F, LOW);
   }
     
  // OŚ Y - TURN RIGHT, LEFT
  
  if (yAxis < 490) // turn LEFT
   { int xMapped = map(yAxis, 490, 0, 0, 255); 
  // Backward - motor 1 minus
  if (xAxis < 490) {
     motorSpeed1B = motorSpeed1B - xMapped;
     motorSpeed1F = 0;
     motorSpeed2F = 0;
     if (motorSpeed1B < 0 ) {
         motorSpeed1B = 0;}
      }
  // Forward - motor 1 minus
  if (xAxis > 530) {
    motorSpeed1F = motorSpeed1F - xMapped;
     motorSpeed1B = 0;
     motorSpeed2B = 0;
     if (motorSpeed1F < 0 ) {
         motorSpeed1F = 0;
              }
       }
   }
    
  if (yAxis > 530) // turn RIGHT
   { int xMapped = map(yAxis, 530, 1023, 0, 255);
    // Backward - motor 2 minus:
     if (xAxis < 490) {
    motorSpeed2B = motorSpeed2B - xMapped;
    motorSpeed1F = 0;
    motorSpeed2F = 0;
       if (motorSpeed2B < 0 ) {
           motorSpeed2B = 0;}
           }
    // Forward - motor 2 minus  
     if (xAxis > 530) {
    motorSpeed2F = motorSpeed2F - xMapped;
    motorSpeed1B = 0;
    motorSpeed2B = 0;
       if (motorSpeed2F < 0 ) {
           motorSpeed2F = 0; 
              }
       }
  }

  if (lAxis < 1024) // limiter
   { int lMapped = map(lAxis, 0, 1023, 100, 0); 
    motorSpeed1F = motorSpeed1F * lMapped/100;
    motorSpeed1B = motorSpeed1B * lMapped/100;
    motorSpeed2F = motorSpeed2F * lMapped/100;
    motorSpeed2B = motorSpeed2B * lMapped/100;
   }
    
    analogWrite(S1F, motorSpeed1F); 
    analogWrite(S1B, motorSpeed1B); 
    analogWrite(S2F, motorSpeed2F);
    analogWrite(S2B, motorSpeed2B);  
   
    Serial.println("motor A:");
    Serial.println(motorSpeed1F);
    Serial.println(motorSpeed1B);
    Serial.println("motor B:");
    Serial.println(motorSpeed2F);
    Serial.println(motorSpeed2B);
}

void resetData() {
  xAxis = 510;
  yAxis = 510;
   Serial.println("resetData");
}
 

Can you post a schematic, the frizz thing is missing a lot of details. Show all interconnections and links to the hardware items will also help a lot. Does your buck converter control the high or low side, I have seen both. Leaving pins on the 7960 bridge open is asking for problems. If you check the data sheet on the BTS7960 It has minimum voltage requirements, if you violate them that could also destroy it. Trying to suck 16 Amps from a 3A supply is like trying to empty the pacific ocean with a tablespoon. How do you know it burnt out and what part of it fried?

Hi,
Where is your fuse to the motor power supply.
If you short out a car battery 100s of amps will flow and destroy any wiring/components in its path.

Can you post a link to the motor driver boards.
I notice the motors are 24V 8A, that means that from stop to run you will need to supply at least 16A per motor, as you are trying to start a stalled rotor.
For testing are you using the batteries or a lab power supply?

Tom.. :grinning: :+1: :coffee: :australia:

Hi,
Can I suggest you use switch.. case function to do the final output to the motor driver input pins?
case both fwd
case both rev
case turn left
case turn right
case stop

This will save you using if and else if statements.

Write your code to first read all your inputs, then code what you need to do on the results of your inputs, then use switch.. case to accomplish the motor control.

Can I suggest you forget about the IMU for the moment as just get the motor control working.
Even if it means writing code just to control the motors from joystick connected directly to the robot Nano.
Forget NRF and IMU, get the bugs out of your motor first, including code to prevent direct transition from fwd to rev on the motors.

Tom... :grinning: :+1: :coffee: :australia:

  • buck converter: XL4015 5A DC (red one) - set CV 10V
  • fuse - it will be, 30A
  • BTS7960 - IBT-2 from most selling auctions from Ali... 3,3V - 5V logic voltage, operating voltage 5,5-27V

I have tested this using DC lab power supply. Minimal power was set on radio control (potenciometer)- 2 Amps constantly with 24V.

After few attempts and set LOW signal on LPWM and RPWM BTS7960 was getting hot, and no motor movement.

This is my first big project on arduino so I know, this code is not beautiful. But this worked! I checked every direction few times and no issues.
Have I checked project BT-2 using fully charged car batteries (with fuse of course) without NRF? This code looks good for You?

Update. Something is wrong with my code. Below is my "screenshot" during changing directions. RPWM and LPWM in the same time - one of them has to be "0" but it is not...

Hi,
I would first suggest you change serial speed to 115200 instead of 9600.

Tom... :grinning: :+1: :coffee: :australia:

In receiver and transmitter code, or just in serial port?

Serial port...

Tom... :grinning: :+1: :coffee: :australia:

It works fine on 115200....

10:06:30.692 -> xAxis:
10:06:30.692 -> 1
10:06:30.692 -> yAxis:
10:06:30.692 -> 516
10:06:30.692 -> lAxis:
10:06:30.692 -> 0
10:06:30.692 -> motor A:
10:06:30.692 -> 0
10:06:30.692 -> 254
10:06:30.692 -> motor B:
10:06:30.692 -> 0
10:06:30.692 -> 254
10:06:30.692 -> ----------ND CODE-----------
10:06:30.692 -> xAxis:
10:06:30.692 -> 450
10:06:30.692 -> yAxis:
10:06:30.692 -> 516
10:06:30.692 -> lAxis:
10:06:30.692 -> 0
10:06:30.692 -> motor A:
10:06:30.692 -> 0
10:06:30.692 -> 20
10:06:30.692 -> motor B:
10:06:30.692 -> 0
10:06:30.692 -> 20
10:06:30.692 -> ----------END CODE-----------
10:06:30.738 -> xAxis:
10:06:30.738 -> 520
10:06:30.738 -> yAxis:
10:06:30.738 -> 516
10:06:30.738 -> lAxis:
10:06:30.738 -> 0
10:06:30.738 -> motor A:
10:06:30.738 -> 0
10:06:30.738 -> 0
10:06:30.738 -> motor B:
10:06:30.738 -> 0
10:06:30.738 -> 0
10:06:30.738 -> ----------END CODE-----------
10:06:30.738 -> xAxis:
10:06:30.738 -> 534
10:06:30.738 -> yAxis:
10:06:30.738 -> 516
10:06:30.738 -> lAxis:
10:06:30.738 -> 0
10:06:30.738 -> motor A:
10:06:30.738 -> 2
10:06:30.738 -> 0
10:06:30.738 -> motor B:
10:06:30.738 -> 2
10:06:30.738 -> 0
10:06:30.738 -> ----------END CODE-----------
10:06:30.738 -> xAxis:
10:06:30.738 -> 845
10:06:30.738 -> yAxis:
10:06:30.738 -> 516
10:06:30.738 -> lAxis:
10:06:30.738 -> 0
10:06:30.738 -> motor A:
10:06:30.738 -> 162
10:06:30.738 -> 0
10:06:30.738 -> motor B:
10:06:30.738 -> 162
10:06:30.738 -> 0

So now we come full circle back to that...

Maybe changing directions (full forward to full backward) in < 1 second is too much for BTS7960.

Hi,

Yes it will be, those motors have some inertia, how long does it take for the motor to stop if you connect the motor to the power source, then disconnect?

Can you post a picture of your motor H-Bridge modules please?

Tom. :grinning: :+1: :coffee: :australia:

Hi,
I have just had a close look at images of the motor drivers, have you got the motor and the powersupply connected to the correct terminals?

Look at the bottom of the PCB, I'm not sure if yours looks like this, but all circuits I see have the motor and battery/suppy pairs the other way around.

Tom... :grinning: :+1: :coffee: :australia:

1 Like

Set 24V, 5A on lab DC power source:

  • start time ~0,7 s
  • brake time ~1,0 s
    Idle amperage - 2,1 Amp (without wheel)

Yes, correct terminals.

Data sheet: BTS7960B Arkusz danych(PDF) - Infineon Technologies AG

Picture of my not working IBT-2

Hi,
I had to get your diag into electrical symbols.

I think it gets all your connections.

Tom... :grinning: :+1: :coffee: :australia:

2 Likes

Wow! :+1: Yes, this is exactly what I want in the end (+ F2 fuse that i don't have, but it is good idea).

I have tested this project again. Arduino was powered by USB port, wheel motor was powered by DC lab supply.
What I have seen, when I inserted brand new IBT-2:

  1. DC lab ON, USB power ON, button in the middle - nothing happens - OK.
  2. DC lab ON, push button forward - motor is running (2,2 Amp, 24V)- OK.
  3. button in the middle - motor is still running - !
  4. DC lab OFF and after a while ON - BTS getting hot, DC lab is delivering full power (5A, 24V), motor is not running - !
  5. Push button forward - motor is running again (2,2Amp,24V) - ?

Hi,
It sounds like you are not turning ALL the H-bridge inputs OFF when you return to central position.
Use of switch.. case would help I think.

Use DMM to monitor the inputs and find out which one is still ON.
All that current means that one or mor 1/2 H-Bridge is turned fully ON, both top and bottom MOSFETs.

Tom... :grinning: :+1: :coffee: :australia:
PS. Sorry at work, will check at lunchtime.

Hi!

I will study this function - new for me. It is strange for me, because I set in my programs "rescue function "(If LPWM > 0 && RPWM > 0 set digital low on outputs ) and it is not protect to burn IBT-s.

Everything seems good. 5,16V on VCC, R_EN, L_EN always. Voltage on RPWM when button is forward, LPWM when backward, 0V in the middle.
5,16V is not too high? My other arduinos keeps ~4,9 V.
Maybe I need to change wires diagram? R_EN,L_EN connect together to digital pin PWM, RPWM and LPWM connect to other digital pins ?

I checked it also using color diodes connect to RPWM and LPWM. Everthing looks ok, always one is off.

Good Schematic! I would suggest using 10A - 12A slow fuses for the motors. A 30A will not protect the motor and probably the wiring. With a 30A you need something in the range of 10 AWG wire. 14 AWG wire is rated at 15A. These are by the US NEC, depending on length, insulation, temperature rating etc you have a large choice of wire size. This also helps in fault isolation. You can pinout R_IS and L_IS and read the current or fault condition with your meter.