Go Down

Topic: Trouble with Pololu DRV8835 driver motor shield (Read 2674 times) previous topic - next topic

Darzang

May 31, 2016, 11:07 am Last Edit: May 31, 2016, 11:15 am by Darzang
Hi everyone

As the title says, i'm having trouble with my polulu DRV8835  ( https://www.pololu.com/product/2511 )

The problem is that only one motor is working (motor 2), I tried several codes including the examples code provided with the library, I've checked my solders and they seem fine. Also, i've switched the two motors to get sure they're working well and, even with other motors that works perfectly fine, i'm still having the same issue  >:(

I'm going to do some measurements this afternoon in order to check if the pins receive the correct current and voltage, that i'm gonna add to this thread later.

Do any of you have had the same issue with this shield (or another one) and know how to solve this ?
Or if you have any information that could help me understand my problem i'd be grateful :)

Also, if you have some pictures reclamations or questions i'll take them as well.

Thanks in advance and have a great day  :)

ps : Feel free to tell me if i've done any english errors, it's not my native langage so i may have done some of them :)

edit : I almost forgot, the motor who's working should be going forward, then backward but only goes one way, any idea about why is it that way ?
Rule #32 : Enjoy the little things

Robin2

You need to post the program you are using.
And please use the code button </>
Code: [Select]
so your code looks like thisand is easy to copy to a text editor

How are you powering the motors?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Darzang

#2
May 31, 2016, 11:51 am Last Edit: May 31, 2016, 12:30 pm by Darzang
Here is the example code provided by the libraby :

Code: [Select]


#include "DRV8835MotorShield.h"

/*
 * This example uses the DRV8835MotorShield library to drive each motor with the
 * Pololu DRV8835 Dual Motor Driver Shield for Arduino forward, then backward.
 * The yellow user LED is on when a motor is set to a positive speed and off when
 * a motor is set to a negative speed.
 */

#define LED_PIN 13

DRV8835MotorShield motors;

void setup()
{
  pinMode(LED_PIN, OUTPUT);
  
  // uncomment one or both of the following lines if your motors' directions need to be flipped
  //motors.flipM1(true);
  //motors.flipM2(true);
}

void loop()
{
  // run M1 motor with positive speed
  
  digitalWrite(LED_PIN, HIGH);
  
  for (int speed = 0; speed <= 400; speed++)
  {
    motors.setM1Speed(speed);
    delay(2);
  }

  for (int speed = 400; speed >= 0; speed--)
  {
    motors.setM1Speed(speed);
    delay(2);
  }
 
  // run M1 motor with negative speed
  
  digitalWrite(LED_PIN, LOW);
  
  for (int speed = 0; speed >= -400; speed--)
  {
    motors.setM1Speed(speed);
    delay(2);
  }
  
  for (int speed = -400; speed <= 0; speed++)
  {
    motors.setM1Speed(speed);
    delay(2);
  }

  // run M2 motor with positive speed
  
  digitalWrite(LED_PIN, HIGH);
  
  for (int speed = 0; speed <= 400; speed++)
  {
    motors.setM2Speed(speed);
    delay(2);
  }

  for (int speed = 400; speed >= 0; speed--)
  {
    motors.setM2Speed(speed);
    delay(2);
  }
  
  // run M2 motor with negative speed
  
  digitalWrite(LED_PIN, LOW);
  
  for (int speed = 0; speed >= -400; speed--)
  {
    motors.setM2Speed(speed);
    delay(2);
  }
  
  for (int speed = -400; speed <= 0; speed++)
  {
    motors.setM2Speed(speed);
    delay(2);
  }
  
  delay(500);
}


And here's the link to this library, so you can look into .h and .cpp file if needed.
Library
First I tried to power the motor with a classic 9v lithium battery:
And then with 4 of these 1.5V batteries :


I get the same results with the 2 powering options.



Rule #32 : Enjoy the little things

Darzang

Ok so i've done my measures,

I've got the same signal on both motor for the direction ( switching between 0 and x V (I don't remember the exact amount) ) which is good.

But on the PWM pin i've got two identicals signals expect that one (which doesn't work) is receiving half the voltage sent to the other motor so I think this may be causing the problem.

Does anyone know what could be causing this halved voltage ?


Thanks in advance and have a great day  :)
Rule #32 : Enjoy the little things

bodmer

#4
Jun 01, 2016, 11:11 am Last Edit: Jun 01, 2016, 11:11 am by bodmer
The symptoms indicate a wiring problem. Maybe the motors are not connected correctly.

Post a picture of your setup so we can see the wring.

Darzang

Rule #32 : Enjoy the little things

Robin2

That looks like a little PP3 style 9v battery. They are useless for powering motors. Try a pack of 6 AA cells.

Is the "shield" correctly connected to the Arduino?

Do both halves of the Shield work if you only connect a single motor? if not maybe the shield is damaged?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

bodmer

#7
Jun 01, 2016, 02:27 pm Last Edit: Jun 01, 2016, 02:31 pm by bodmer
Your shield is clearly not plugged in to the right pins. It should connect to pins 6,7,8,9,10 on one side, and the corresponding position on the other side.

Reposition it and it will probably work fine.

Darzang

I forgot to mention something, my motors come from this pack, so i tried with 4 AA 1.5V cells ( so that i get 6v voltage, like written in the "max voltage" section on the link i gave) and i get to the same results.

About the shield connection, my picture is kinda misleading but it is on the right pins, since there is a space between pin 7 and 8 of the arduino and on the shield as well, i cannot put the shield on a wrong pin position.
I also to try to plug the shield fully into the arduino, then putting it off a little bit, waiting, a little bit more, waiting etc until the shield was out of the arduino board, but i still have the same issue

If i connect only one motor and test the same measures as i did earlier, i still get the same results ...  :(

PS: the results and issues i'm talking about is one out of two motor not working and the signal sent to it is halved compared to the signal of the working motor.

Since the shield is not brand new, i don't know what have been done with it or by whom before, and the problem was here as soon as i tried to make the motors turn, i'm starting to think, as Robin2 told before, that the shield may have been damaged.

I've ordered a new one so i'll be able to know if it was damaged or not.
If you have any ideas left of what i can test during the time my order is on the road i'll take them.

Anyway, thanks for your help :)
Rule #32 : Enjoy the little things

bodmer

OK

Have you checked the blue terminal block pins have good solder joints to the board on the underside.

Robin2

If i connect only one motor and test the same measures as i did earlier, i still get the same results ...  :(
That is not clear enough.

There are connections for 2 motors on the shield - let's call them A and B.

If you have one motor connected to A and nothing connected to B does it work?

If you have one motor connected to B and nothing connected to A does it work?

If you have a motor connected to A and to B which one works?
Is it always the same one that fails to work?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Darzang

Hi guys,

I've finally received a new DRV8835 shield and it worked like a charm at first attempt, i'm sure now that my old shield have been damaged.

Thanks for you help :)
Rule #32 : Enjoy the little things

Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up