DFROBOT 4WD behaves strangely on battery

I purchased the DFRobot 4WD Arduino Mobile Platform which includes the Arduino Uno USB Microcontroller Rev 3, and the "
SainSmart L293D Motor Drive Shield For Arduino Duemilanove Mega UNO R3 AVR ATMEL".

I put it together last night and ran some test sketches via USB power, and everything seems to be working fine. I’m using the Adafruit motor shield library.

When I run the microcontroller and motor shield on battery, I’m seeing strange behavior. The delay(8000) is behaving like a tenth of a second instead of 8 seconds, and randomly only 1 motor spins and the code clearly shows all 4. This seems to be some kind of power issue as the sketch runs fine via USB power.

Please help, thanks

Hi,

To provide you support we will need more information:

  1. Could you provide us with a link to the specific product you purchased from RobotShop or the product code (RB-xxx-nnn)? This would help us identify the issues you are experiencing.

  2. Please post one or more pictures (check here to see how to make an attachment) clearly showing your setup and all connections, wires, jumpers, etc. We recommend that you do this for both when it is USB powered and when it is battery powered.

  3. Please attach a copy of the Arduino sketch that you used that works properly on USB power but not on battery power. Please use an attachment instead of pasting it into the post itself directly.

Sincerely,

The link is not working and not sure how to get a picture attached.

Models are:
RB-DFR-15
RB-ARD-34

Also using SainSmart L293D Motor Drive Shield.

It continues to work fine when powered by USB, but battery causes the motor to behave strangely. For example the sketch has a 5 sec wait, but the motor only runs for tenth of second. Like it’s getting overloaded and doing some kind of auto shutoff?

[code]
//Using the Adafruit library to move 4 DC motors
//in one direction on the DFRobot 4WD Mobile Platform

//We need the Adafruit Library.
//There are two versions, this was written for the first version of the library
#include <AFMotor.h>

// Create Motor objects and assign them to the correct motor termnials
AF_DCMotor motor_Back_L(1);
AF_DCMotor motor_Back_R(2);
AF_DCMotor motor_Front_R(3);
AF_DCMotor motor_Front_L(4);

void setup() {

//We can asjust the speed for the motors here
//the range is 0 to 255
motor_Front_R.setSpeed(200);
motor_Front_L.setSpeed(200);
motor_Back_R.setSpeed(200);
motor_Back_L.setSpeed(200);

Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println(“DCmotor test”);

}//close setup

void loop() {

Serial.println(“Start loop”);
motor_Front_R.run(FORWARD);
motor_Front_L.run(FORWARD);
motor_Back_R.run(FORWARD);
motor_Back_L.run(FORWARD);
Serial.println(“1a”);
delay(5000);
Serial.println(“1b”);
motor_Front_R.run(RELEASE);
motor_Front_L.run(RELEASE);
motor_Back_R.run(RELEASE);
motor_Back_L.run(RELEASE);
Serial.println(“2a”);
delay(5000);
Serial.println(“2b”);
motor_Front_R.run(BACKWARD);
motor_Front_L.run(BACKWARD);
motor_Back_R.run(BACKWARD);
motor_Back_L.run(BACKWARD);
Serial.println(“3a”);
delay(5000);
Serial.println(“3b”);
motor_Front_R.run(RELEASE);
motor_Front_L.run(RELEASE);
motor_Back_R.run(RELEASE);
motor_Back_L.run(RELEASE);
Serial.println(“4a”);
delay(5000);
Serial.println(“4b”);

}//close loop[/code]

Hi,

It is possible the battery pack / batteries you are using are not providing enough power for the motors. This would cause the voltage to lower and possibly reset the Arduino (brownout) and therefore not running your code properly.

What kind of power source are you using for your robot? Could you please post one or more pictures of the setup?

Sincerely,

P.-S.: Here is an image showing how to add an attachment.
https://www.robotshop.com/forum/download/file.php?id=5834

I see the attachment bar now, thanks. I’m using the battery case that came with the RB-DFR-15 kit.


Here’s a 30 sec video of the correct motor response with USB power:
youtube.com/watch?v=OcQALyCkAnc

Same sketch, but with battery. Motor response is only a short burst.
youtube.com/watch?v=CSuL92yIx70

Hi,

The power pack in your picture allows you to connect 4x AA batteries in series. This will result in ~6 V DC (4 x 1.5 V). As you can read on the Arduino website under “Summary”, the minimum input voltage is (recommended) is 7 V DC and the absolute minimum is 6 V DC. This is because the on-board voltage regulator (5 V) requires some power itself to perform the regulation. Therefore, a higher voltage than the 5 V DC required by the Arduino is needed at the input.

In the case of the Arduino Uno, > 6 V DC is required. Since your 4x AA batteries (when brand new) provide around 6 V DC, your issue is quite probably a power issue from the batteries not providing enough power for both the motors and the Arduino simultaneously.

Many possible solutions could fix this issue, such as adding another battery pack for the Arduino (to prevent brownouts), such as this one. You can also use a more powerful battery for the entire setup, such as our 6 V DC NiMH battery packs (we use some of those for our Lynxmotion kits). You can find those here. If you use one of these, make sure to obtain the proper battery pack charger. You can browse some here.

Sincerely,

I’m using the battery case that came with the kit that I bought from (you) Robot Shop, which has 5 batteries…

Hi,

You are right, it is indeed x5 AA batteries and not x4. But, some of the points made before may still be valid. The nominal voltage with x5 1.5 V DC batteries would be 7.5 V DC but when all 4 motors start moving, the batteries might not be able to provide enough power for the system to function (too high current draw) which could cause a voltage drop.

Would it be possible to try a modified version of your sketch where you only move one of the motors/wheels instead of all four at once? This would help determine if it is a power/current issue.

Let us know if this works.

Sincerely,

Same behavior with one DC motor. Runs fine with USB power, but with Battery it just does a short burst, waits for the delay, then another short burst etc.

Hi,

This behavior seems to indicate a power issue with the connection between the Arduino and the shield. Since the Arduino and the motors run fine when USB powered, they do not seem to be defective and the issue most likely lies with the shield.

We recommend that you contact the shield’s manufacturer for more support.

Sincerely,

Hi there, just FYI as I was wiring this up, I tested each component and no issues.
I used 5x lithium ion (I was half suspecting to require the higher voltage camera batteries, but all seems ok)

I did manage to accidently blow up a power switching supply in trying to use the port to recharge the batteries somehow (I think I blew up the diodes
with incorrect current direction/voltage)
.
Would be good to know what charger to use - I don’t think a lipo charger will work without switching out the supply to lipo)
Do I need to rewire to accommodate a charger also?

Thanks!