This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8871: Motor is pulsing without current regulation

Part Number: DRV8871

Tool/software:

Hello,

I am running into an issue when I try to run a motor without having it pulse, but as I increase the voltage it starts pulsing around 12-13V. I am using the Adafruit DRV8871 Brushed DC Motor Driver Breakout I have a 24V power supply connected to the power terminal of the DRV8871 and a microcontroller connected to IN1 and IN2. I also added a resistor to ILIM to change the max current rating from 2A to 3.6A. I'm not too familiar with how the motor driver board works but I have it running in forward direction (IN1 set to LOW and IN2 set to analogWrite as it gradually increases). I want to run the motor to run at 24V continuously without having it pulsate, how am I able to do so? I have a 30W motor which is well under the current the motor driver board can handle. I have attached the code I used that was provided from the Adafruit DRV8871 datasheet. 

Datasheet: cdn-learn.adafruit.com/.../adafruit-drv8871-brushed-dc-motor-driver-breakout.pdf

Code:

// Basic sketch for trying out the Adafruit DRV8871 Breakout
#define MOTOR_IN1 9
#define MOTOR_IN2 10
void setup() {
Serial.begin(9600);
Serial.println("DRV8871 test");
pinMode(MOTOR_IN1, OUTPUT);
pinMode(MOTOR_IN2, OUTPUT);
}
©Adafruit Industries Page 12 of 16
void loop() {
// ramp up forward
digitalWrite(MOTOR_IN1, LOW);
for (int i=0; i<255; i++) {
analogWrite(MOTOR_IN2, i);
delay(10);
}
// forward full speed for one second
delay(1000);
// ramp down forward
for (int i=255; i>=0; i--) {
analogWrite(MOTOR_IN2, i);
delay(10);
}
// ramp up backward
digitalWrite(MOTOR_IN2, LOW);
for (int i=0; i<255; i++) {
analogWrite(MOTOR_IN1, i);
delay(10);
}
// backward full speed for one second
delay(1000);
// ramp down backward
for (int i=255; i>=0; i--) {
analogWrite(MOTOR_IN1, i);
delay(10);
}
}

I would appreciate any assistance in this.

Thank you!

  • Hi Faras, 

    Thank you for posting in this forum.

    We're from the motor drive product and we do not look into the 3rd party sketch. That said we're happy to help you with the DRV8871. See below control table from the datasheet.

    When both IN1 and IN2 are 1 the motor will be in slow decay or brake mode. When one of the INx is 0 the motor will run with full speed (24 V continuous unless the current is chopped due to ILIM) in one direction and vice versa. If PWM control is required one of the INx must be held at 1 and the the other INy must be PWM input. Output will be active when PWM is LOW. PWM frequency is typically 20 kHz, duty cycle 0 to 100 %. I hope this helps. 

    Regards, Murugavel 

  • When I set one of the INx to 0 and the other to one with the maximum current (3.6A) the motor pulsates. What would be the reason?

    Also, when I directly connect the motor to the power supply, it runs continuously at 24V.

  • Hi Faras, 

    I think you may be experiencing a thermal shutdown or possibly an OCP condition. The driver is turning on and off to protect the IC. Can you check with an oscilloscope the current waveform is switching off and on in 3 ms intervals, tRETRY Overcurrent retry time is 3 ms TYP. ? Please share the current waveform. Thanks.

    Regards, Murugavel