L298N chip exploded

Hello all. I have a L298n based motor driver (This one) that is being used to control a 24 volt gear motor (this one). This set-up is such that the motor rotates roughly 180 degrees, hits a sensor and reverses. I first tested this set-up with the pwm turned down to about 50% and it worked fine without issue. I then turned it up to 100% and it worked for a few cycles but one time, right when the motor hit the end stop and was supposed to reverse, it instead slowed down and looked like it was struggling for a moment before suddenly the motor driver chip exploded with a little pop and flash. Its worth noting that the motor was not under any load.

I was wondering if this might be because of the lack of flyback resistors in the circuit? Is it simply because the motor is drawing more amperage than its supposed to. Am I making a mistake by reversing the motor so quickly? Something else I might not be aware of? Thanks, any help would be greatly appreciated.

did you try to reverse it before stopping it ?

how is stop/reverse implemented ? in software or electronics

Edit

have you considered the effects of backlash in the gearing

"Hitting the endstop", "struggling" -- how do you then deduce the motor was "not under any load"?

Its clear the motor was under stall conditions and pulling many amps, causing the L298 to fail. A
motor with 1.1A full load rating is likely to pull around 5 to 10A when stalled, way beyond the 298's
ratings. You need to find the stall current of your motor and find an H-bridge that can handle that
level of stall current.

Thanks for the replies guys.

Boardburner,

I reverse it by software I guess? This is my function for reversing the motor

void MotorReverse()
{

  if(motorSwitch)
  {
    digitalWrite(motorReverse,LOW);
    analogWrite(motorForward,motorSpeed);
  } 

  else
  {
    digitalWrite(motorForward,LOW);
    analogWrite(motorReverse,motorSpeed);
  } 

  motorSwitch=!motorSwitch;


  cycle=!cycle;
  oldMotorDirection=motorDirection;
  if(cycle)
  {
    count++;
    EEPROMWritelong(0,count);
    //      Serial.print("Count: ");
    //      Serial.println(count);
    lcd.setCursor(6, 0);
    lcd.print("Count: ");
    lcd.print(count);


  }


}

I'm not sure if the issue might be that that I'm reversing without any delay or wind down? Is that what you mean by reversing it before stopping it? In terms of backlash I'm sure there is some but I don't see how that applies to this problem

Mark T,
I really don't think that the motor was any under significant load. There was really nothing attached to it. The end stop is actually an inductive sensor so it doesn't even touch (even if the motor turns past where its supposed to stop). The motor shaft is free to move 360 degrees at least in term of physical constraints. Also after the driver failed I hooked the motor up to the power supply directly with a multi meter in line and the motor started normally, didn't appear to struggle and only pulled .4 amps. Honestly I said struggling but that could have been the motor just slowing to a rest after the power was cut. I was expecting the motor to reverse direction and it all happened pretty quick.

That all being said, I didn't realize there was a different between full load and stall amps so thank-you for that information. I probably do need a bigger motor driver then.

Still though was there anything else I did that might have caused this to fail? I really dont't want to get another driver just to burn it.

Ok so I think I may have hooked the board up incorrectly. I had my pwm signals hooked up to IN1 and IN2 and nothing hooked up to ENA. Would this have caused my failure? Oddly the set-up worked just fine with this until I cranked up the pwm. It worked for quite sometime at the low power levels so I assumed it was connected correctly.

First thing I would suggest:
Pause before reversing directions.
When reversing directions, ease into the new start. PWM 20, then after a quarter second, PWM 80, or whatever.

rjames711:
Thanks for the replies guys.

Boardburner,

I reverse it by software I guess? This is my function for reversing the motor

void MotorReverse()

{

if(motorSwitch)
 {
   digitalWrite(motorReverse,LOW);
   analogWrite(motorForward,motorSpeed);
 }

else
 {
   digitalWrite(motorForward,LOW);
   analogWrite(motorReverse,motorSpeed);
 }

motorSwitch=!motorSwitch;

cycle=!cycle;
 oldMotorDirection=motorDirection;
 if(cycle)
 {
   count++;
   EEPROMWritelong(0,count);
   //      Serial.print("Count: ");
   //      Serial.println(count);
   lcd.setCursor(6, 0);
   lcd.print("Count: ");
   lcd.print(count);

}

}





I'm not sure if the issue might be that that I'm reversing without any delay or wind down? Is that what you mean by reversing it before stopping it? In terms of backlash I'm sure there is some but I don't see how that applies to this problem

Mark T,
I really don't think that the motor was any under significant load. There was really nothing attached to it. The end stop is actually an inductive sensor so it doesn't even touch (even if the motor turns past where its supposed to stop). The motor shaft is free to move 360 degrees at least in term of physical constraints. Also after the driver failed I hooked the motor up to the power supply directly with a multi meter in line and the motor started normally, didn't appear to struggle and only pulled .4 amps. Honestly I said struggling but that could have been the motor just slowing to a rest after the power was cut. I was expecting the motor to reverse direction and it all happened pretty quick.

That all being said, I didn't realize there was a different between full load and stall amps so thank-you for that information. I probably do need a bigger motor driver then.

Still though was there anything else I did that might have caused this to fail? I really dont't want to get another driver just to burn it.

more detail is needed.
circuit digram and detaails of motor etc.
when dealing with inductive loads including motors , strange stuff can occour.

A brushed dc motor also acts as a generator. When it is free running it will be generating nearly the full applied voltage (24 V) to oppose the applied voltage. If you suddenly reverse it by applying 24 V in the opposite direction you effectively have a 48 V supply for a short time. That could be causing you to exceed the the maximum current rating of the L298 chip. Better to switch to braking mode for a short time before reversing.

Russell.

rjames711:
Mark T,
I really don't think that the motor was any under significant load.

Its a geared motor, the gears have inertia, coupled with backlash the motor will see a large impulse load when it reverses.

An analogy, if you are free wheeling down a hill in a car (no load) , suddenly engaging reverse is likely to break something.

Thanks everyone for your replies, they were very helpful. I figured I'd update in case anyone is searching this topic at some point. I got a pair of replacement l298n motor drivers (since I figured there was a good chance I'd blow another and they're cheap). I fixed my wiring (took off ENA jumper and sent pwm to that pin and just controlled direction with the IN pins) and put some code in to stop and start the motor somewhat more gradually by increasing and decreasing the pwm in a for loop.

The first replacement motor driver broke under the same circumstances as the original one (worked when I had the pwm set low but when I increased the pwm it failed when it was supposed to reverse direction).

The second replacement motor driver I tried adding the brake function by writing ENA high and both IN pins low. This seemed to fixed the issue and the set-up now works even when the pwm is turned up to the maximum.

Thanks again everyone.

The problem is the motor datasheet only states 1.1A at full load, which is not very relevant for choosing
a motor driver.

You need to know the stall current (current with axle held stationary), in order to know the maximum current
the driver has to withstand as the motor starts or hits an endstop. This can be 5x to 20x the nominal full
load current (this ratio will be larger with more efficient motors and with larger motors)

There are two ways to handle stall current - one is to size the driver so it can cope with the maximum current
it can see (typically 2x stall current for a motor being hard-reversed, 1x stall current otherwise, unless the
supply is unable to provide this, then it is the supply's max current) - this is a peak rather than continuous
rating typically.

Secondly you can monitor the current with current sensor and implement a feedback loop to prevent
over-current in the first place. For large industrial DC motors something like this is always done because
the full stall current could physically disrupt the windings and destroy the motor.