Pages: [1] 2   Go Down
Author Topic: Arduino resetting when running 2WD platform, why?  (Read 3179 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have this 2WD Platform: http://www.robotshop.com/dfrobot-2wd-mobile-platform-for-arduino-4.html
It comes with 2 DC Motors: http://www.robotshop.com/dfrobot-6v-180-rpm-micro-dc-geared-motor-with-back-shaft.html

I am powering the 2 DC Motors with five regular AA Batteries.
I am powering the Arduino with one 9 Volt Battery.

The Arduino sends data to the H-Bridge from Analog-In ports (8,9,10,11).
The H-Bridge is powered by the five regular AA Batteries and connected to the motors.
The grounds from the 5 AAs, Arduino, and H-Bridge are all connected.

Intermittently, the Arduino will reset if the Arduino is telling the motors to spin.

Why is this happening?

Is it because 5 AA batteries is not the correct amount of voltage for the DC motors?  Do I need capacitors?

Thanks.
« Last Edit: April 22, 2011, 05:22:27 pm by MonroeD » Logged

St. Louis, Missouri
Offline Offline
Sr. Member
****
Karma: 1
Posts: 279
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What H-bridge are you using? A schematic would be helpful also.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34174
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Intermittently, the Arduino will reset if the Arduino is telling the motors to spin.

The oldest problem in the book. You need supply decoupling:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
and a common ground between the two supplies.
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've added in two K5M 104 capacitors (.1uF, nonpolar).
They are placed between the H-bridge and the motors.

I checked again, and all of the grounds are connected.

Unfortunately the Arduino still is resetting.

Is that where the capacitors should be placed?
Am I using the correct capacitors?

Thanks.
Logged

0
Offline Offline
Tesla Member
***
Karma: 143
Posts: 9601
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd say the resetting of the arduino is due to somehow your motors are dropping the voltage supply to the arduino rather than elecrtical noise that caps are normally used for. Measure the voltage on the arduino 5v pin and the 9v battery while the motors are starting to see if there is a voltage drop.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe there is a voltage drop.  How do I go about solving this problem?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok let make a trouble shooting
1_ Disconnect the both motors cables and use there a resistance with one LED, check one by one and see
if the problem is there.
2-If the problem is persist check another  H bridge board (connect your resistance with one LED to the arduino directly)
in this way you will know who reset your arduino)


·why did you not post the full diagrams ?
Logged

San Diego, California
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Since you're already running the motors from their own supply I'd look at these things:

1. Noise from the motors. Try adding .1 uF caps across the motor terminals (right AT the terminals).

2. Verify that your bridge can provide enough current to the motors. (Please indicate the bridge you are using so folks don't have to guess whether that's the culprit.)

3. You should have a shared 5V line between the Arduino and the bridge (that provides logic power to the bridge), and a shared ground. Ground from your 5 AAs should connect to the bridge, not to the Arduino. Some bridges will parasitically draw current from the motor power for their logic supply if the V+ logic line is left unconnected. That can cause weird behavior.

4. Use a fresh 9-volt battery for the Arduino. When these things deplete they can put out some volts, but very little current.

A full diagram of the connection you're actually using would be helpful.

-- Gordon
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I have purchased the same 2WD arduino chassis. I am facing a problem which i was hoping you guys could help me with.

I am using 6.5V 2700mAh rechargeable batteries. The datasheet for the motors says that at 3V the maximum speed is 90rpm. I use a linear regulator to step down my battery voltage from 6.5V to 3V. When i apply the 3V to the motor from the regulator output the motor spins well.

From the same battery pack i am powering the microcontroller. Another regulator steps down the voltage to 5V.

I am using an L239E motor driver which is capable of supplying 1A to the motor. When i connect up my entire circuit, the motor does not spin at the rated speed. It spins very slowly.

I believe the motors are not getting enough of current.

What do you think could be the problem?

Best Regards,
Yuveer
Logged

United Kingdom
Online Online
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

MonroeD, without a schematic we can only guess at what is wrong.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

United Kingdom
Online Online
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I have purchased the same 2WD arduino chassis. I am facing a problem which i was hoping you guys could help me with.

I am using 6.5V 2700mAh rechargeable batteries. The datasheet for the motors says that at 3V the maximum speed is 90rpm. I use a linear regulator to step down my battery voltage from 6.5V to 3V. When i apply the 3V to the motor from the regulator output the motor spins well.

From the same battery pack i am powering the microcontroller. Another regulator steps down the voltage to 5V.

I am using an L239E motor driver which is capable of supplying 1A to the motor. When i connect up my entire circuit, the motor does not spin at the rated speed. It spins very slowly.

I believe the motors are not getting enough of current.

What do you think could be the problem?

Best Regards,
Yuveer

1. I can't find a datasheet for L239E motor driver. Can you provide a link? or did you mean L239D?

2. The specification of the motor says that the locked rotor current is 1.5A at 3v. The L239D has an absolute maximum peak current of 1.2A. So you risk burning out the L239D if the motor stalls.

3. The L239D data sheet says it drops typically 2.7v at 0.6A (source output saturation voltage + sink output saturation voltage). So you need to supply it with about 3 + 2.7 = 5.7v to get 3v at the motor.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5578
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I have purchased the same 2WD arduino chassis. I am facing a problem which i was hoping you guys could help me with.

I am using 6.5V 2700mAh rechargeable batteries. The datasheet for the motors says that at 3V the maximum speed is 90rpm. I use a linear regulator to step down my battery voltage from 6.5V to 3V. When i apply the 3V to the motor from the regulator output the motor spins well.

From the same battery pack i am powering the microcontroller. Another regulator steps down the voltage to 5V.

I am using an L239E motor driver which is capable of supplying 1A to the motor. When i connect up my entire circuit, the motor does not spin at the rated speed. It spins very slowly.

I believe the motors are not getting enough of current.

What do you think could be the problem?

Best Regards,
Yuveer

1. I can't find a datasheet for L239E motor driver. Can you provide a link? or did you mean L239D?

2. The specification of the motor says that the locked rotor current is 1.5A at 3v. The L239D has an absolute maximum peak current of 1.2A. So you risk burning out the L239D if the motor stalls.

3. The L239D data sheet says it drops typically 2.7v at 0.6A (source output saturation voltage + sink output saturation voltage). So you need to supply it with about 3 + 2.7 = 5.7v to get 3v at the motor.

It's not "L239"; the motor driver is an "L293".

Something you could try (I've heard it works) is to piggyback a second L293 on the first (if they are DIP ICs) - soldering the legs together.

Better would be to use an L298 h-bridge (which can supply up to 2A per channel - or 4A in bridged-mode to a single motor, if needed). If you do decide to use an L298 - make sure to add a heatsink if one isn't included with the driver board (ie, if you are homebrewing an L298 driver)...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

United Kingdom
Online Online
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

cr0sh, thanks for that. If it's a L293E then it drops typically 2.6v at 1A. So yuveer needs to supply it with about 5.6v to get 3v at the motor.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi dc42, thanks for your prompt reply. It appears that the sink output saturation voltage was the problem. I am using the L293E motor driver and not the L298, but anyway, I simply increased the voltage to 4.2V (the L293E datasheet says that it drops typically 1.2V) and i manage to get 3V at the output of my motors. The speed looks good and i am satisfied.

Now i have a few questions with regard to this particular set of motors and chassis:

1) If i am measuring a DC voltage of 3V at the motor terminals can i assume it is running at 90rpm as the datasheet explains? Also, at this voltage am i supposed to read a current of 60mA (no load current at 3v as per datasheet). I need to robot to travel slowly such that it will not spill a cup of coffee, thus i wanted to use PWM to drop the speed to about 30rpm.

2) My goal is to make the robot travel as "straight" as possible. Like in a straight line, without line following software and hardware. It merely needs to go straight, but for like 12 meters. Now it appears that 90% of enthusiasts on the net seem to suggest using wheel encoders together with a PID controller. I have purchased a set of wheel encoders designed for this particular chassis. I found a good tutorial and some code on how to implement a PID controller: http://letsmakerobots.com/node/865#comment-72386 . My question is whether this is the most suitable method?

3) Once i get the robot to go "straight" i would like it to turn 90 degrees (it can stop, turn on the spot, then go on). I know that the robot uses differential drive so its a matter of spinning the wheels in opposite directions. But i am having trouble estimating how much to turn the wheels. This one is a bit tricky. Any ideas?

Best Regards,
Yuveer
Logged

United Kingdom
Online Online
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1) If i am measuring a DC voltage of 3V at the motor terminals can i assume it is running at 90rpm as the datasheet explains?

If the motor is under no load and the bearings are good then the rpm should be close to the 90rpm specified. Speed will drop under load.

2) My goal is to make the robot travel as "straight" as possible. Like in a straight line, without line following software and hardware. It merely needs to go straight, but for like 12 meters. Now it appears that 90% of enthusiasts on the net seem to suggest using wheel encoders together with a PID controller. I have purchased a set of wheel encoders designed for this particular chassis. I found a good tutorial and some code on how to implement a PID controller: http://letsmakerobots.com/node/865#comment-72386 . My question is whether this is the most suitable method?

I don't have any direct experience of this, but you will certainly need wheel encoders to make the motors run at precisely the same speed, and PID controllers (= Proportional Integral Differential) are fairly standard for servos. Also, PID controllers will enable you to maintain 30rpm with variable load (e.g. slope). So I would say yes.

There is another solution based on measuring the back EMF of the motor while compensating for its resistance, but it will only give you the speed, and is difficult to use with PWM. Wheel encoders will give you the number of rotations as well, which enable you to measure distance travelled more accurately (assuming the wheels don't slip).

3) Once i get the robot to go "straight" i would like it to turn 90 degrees (it can stop, turn on the spot, then go on). I know that the robot uses differential drive so its a matter of spinning the wheels in opposite directions. But i am having trouble estimating how much to turn the wheels. This one is a bit tricky. Any ideas?

That's down to simple geometry, if you can assume that the wheels don't slip. The radius of turn will be half the distance D between the wheels, so to turn 90 degrees each wheel must move distance pi * D / 4. If the radius of the tyres is R then each wheel needs to rotate N turns, where N = D / (8 * R).
« Last Edit: August 31, 2011, 12:43:21 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1] 2   Go Up
Jump to: