VNH5019 motor driver does not work for reverse direction

Hello,
I am using a single VNH5019 motor driver carrier for controlling a linear actuator.
Motor driver gives OUTA and OUTB values to linear actuator when PWM value is positive, but not when it is negative.

I took the code from motor driver shield. It worked fine and suddenly it does not work anymore.
Please anyone let me know how to save my motor driver or troubleshoot this… :frowning:
Thanks in advance.

[code]void initMotor3(){
_PWM5 = 5;
_INA3 = 3;
_INB3 = 11;
pinMode(_PWM5, OUTPUT);
pinMode(_INA3, OUTPUT);
pinMode(_INB3, OUTPUT);

}

void setM3Speed(int speed)
{
unsigned char reverse = 0;

if (speed < 0)
{
speed = -speed; // make speed a positive quantity
reverse = 1; // preserve the direction
}
if (speed > 255) // Max
speed = 255;
analogWrite(_PWM5,speed); // default to using analogWrite
if (speed == 0)
{
digitalWrite(_INA3,LOW); // Make the motor coast no
digitalWrite(_INB3,LOW); // matter which direction it is spinning.
}
else if (reverse)
{
digitalWrite(_INA3,LOW);
digitalWrite(_INB3,HIGH);
}
else
{
digitalWrite(_INA3,HIGH);
digitalWrite(_INB3,LOW);
}
}

void loop() ={
for(int i=0; i<=10; i++)
{
setM3Speed(-100);
delay(2);
}
}
[/code]

Hello.

I am sorry you are having trouble with your VNH5019 carrier. I think the best way to locate the problem is to simplify. Can you first verify your actuator is working in both directions by disconnecting it from the motor driver and powering it directly from your supply? Similarly, can you disconnect the driver from your Arduino and hard-wire the inputs high and low to see how the driver behaves under known conditions? Specifically, put a steady 5V on PWM and then see what happens with INA high and INB low (and vice versa).

-Jon