Go Down

Topic: Adafruit motor shield [Arduino Mega 2560] (Read 4358 times) previous topic - next topic

panosip

Mar 21, 2013, 01:09 am Last Edit: Mar 21, 2013, 01:11 am by panosip Reason: 1
Hello.
Probably I should post this topic on adarfuit forum, but if anyone knows - please help:)

I want to use motor shield for a project.
I'm using an arduino mega 2560.

I notice that the speed of the motors is different so the robot turn to the left instead of going in straight line :(

Here is an example code

Code: [Select]


#include <AFMotor.h>

AF_DCMotor motorL(1, MOTOR12_64KHZ);         // Create motor #1, 64KHz pwm
AF_DCMotor motorR(2, MOTOR12_64KHZ);         // Create motor #2, 64KHz pwm

void setup() {
 
  motorL.setSpeed(50);
  motorR.setSpeed(50);
 
}

void loop() {
motorL.run(FORWARD);
motorR.run(FORWARD);
}



I use a multimeter to measure the output voltage of motor 1 and motor 2. On motor 1 voltage output was 6.50v and for motor 2 output voltage was 8.10v
I thought that my motor shield may be broken, but when I test it on arduino with the same code, output voltage was approximately 6.60v in both motors

Is the motor shield not compatible with Arduino mega?
Or is it a bug of AFMotor library?

P.s: Driver chips are piggybacked

Thanks in advance

elranon

Try to remove MOTOR12_64KHZ from code

And try connect motor to battery pack directly, and test the speed

Erdin


panosip

Hey!
I tried on 1khz ,8khz, 16khz modes and the problem remains.
There is still a voltage difference on motor terminals

On arduino uno all modes seems to work fine.:(


miguelangelwww

Hi,


I have the same problem with the mega . It was working on top of an UNO R3 Saint Smart and then I got an Original Arduino MEGA and the motor goes fine when in backward mode but the RIGHT one does not move or move really slow. It happens the same with every mega I tried.

Did you find any solution for this?

panosip

#5
Feb 11, 2014, 12:16 am Last Edit: Feb 11, 2014, 12:21 am by Jek90 Reason: 1
Hello dude

First of all try to do this on your motors
http://learn.adafruit.com/system/assets/assets/000/003/642/small360/motor_capacitors.jpg?1358023820
This will be prevent your  arduino to restart itself if the motors drain much power  (3x0.1μF capacitors)

Then try to connect the motors to M3 and M4 terminals @ 64khz instead of M1/M2
Ps: I think that Adafruit says that M3/M4 do not support 64khz, but I have not problem when I used this setting

Let my know if this works for you!

Go Up