Pages: [1]   Go Down
Author Topic: DC Motor crashes cpu when it nears full speed.  (Read 873 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've confirmed that this happens with my Arduino Mega 1280, Uno and a breadboard atmega328 running standalone. Sometimes after it crashes the cpu the only way to recover is to reflash my program. I thought it may have been my code so I setup a simple pwm output with a potentiometer program and it still crashes when the motor is approaching full rpm. Sometimes it does not crash right away, But it usually doesn't last more than 30sec at high speed.

for the motor power I've tried two power supplies, one 18v and another 14v. On my breadboard arduino this power supply is also powering the atmega328 chip with a 7805 regulator, on my mega and uno the power supply is only powering the motor, The DC motor can support up to 18v. It's just a off the shelf toy dc motor that I got from "The Source" (canadian radioshack) I'm using a TIP120 transistor to control it with a 2.2k resistor (I've tried other combinations) between the output pin of the arduino and the base of the tip120. I've put a 0.01uf cap between the power legs on the motor as well as a 1n4004 diode. I've also extended the wires and moved the motor further away from the breadboard where the arduino is and it's still locking up the atmega chip.

I believe I've tried everything except more 0.01uf caps between the power legs of the motor to the motor case to further cut down on interference so I'm currently at a loss as to why this is happening.

In my searching I can't really seem to find anyone else with this issue that couldn't solve it by doing at least one of the things I already have tried.
« Last Edit: January 29, 2013, 08:56:23 pm by compubob » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Typically one could start looking with an oscilloscope to see what the Vcc voltage looks like and possibly how you have the arduino and motor ground wires routed to the negative terminal of the power source, they should not share the same conductor anywhere and be connected together only at the power supply.

 It can be solved but you have to have good tools to see what you are up against and what effect any changes you make have on the situation.

Lefty
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6619
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

Chances are you have a common ground wire or ground loop or similar issue. Post a photo of your setup.
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.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Typically one could start looking with an oscilloscope to see what the Vcc voltage looks like and possibly how you have the arduino and motor ground wires routed to the negative terminal of the power source, they should not share the same conductor anywhere and be connected together only at the power supply.

 It can be solved but you have to have good tools to see what you are up against and what effect any changes you make have on the situation.

Lefty

it's pretty much setup like this
http://bildr.org/blog/wp-content/uploads/2011/03/tip120-solenoid.png

my power connections for the motor are connected to the dc supply, before the 7805 regulator. Maybe I'll rip it apart and start from scratch with the uno, then move to the breadboard arduino when that's functioning, Although I've done that already a few times.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Chances are you have a common ground wire or ground loop or similar issue. Post a photo of your setup.

I'm creating what I currently have in Fritzing. I'll post that when it's done, my breadboard is a mess of wires and you wouldn't be able to tell where anything is going.
Logged

The Netherlands
Online Online
Edison Member
*
Karma: 50
Posts: 1666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can't figure this out, you could try separating the motor from the Arduino.
You could use an optocoupler, as the control signal is digital.
In this case, to have 100 % isolation, you should also use a different power suply to the motor.

So it can be solved anyway, but it's always good to know what causes this so you (as well as us) can avoid this in the future.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12179
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can the motor supply drive the motor at full speed (ie directly connected, no transistor) without the
voltage falling below the nominal value?  (ie is the power source up to the job?)

Have you ensured _both_ power and ground wires to the motor circuit branch off before the 7805, that the 7805
has suitable decoupling right next to it?
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can the motor supply drive the motor at full speed (ie directly connected, no transistor) without the
voltage falling below the nominal value?  (ie is the power source up to the job?)

Have you ensured _both_ power and ground wires to the motor circuit branch off before the 7805, that the 7805
has suitable decoupling right next to it?

I ended up swapping over to a different brand of motor and I don't seem to have this issue now.
But yes, the motor positive and negative are connected to the power supply before the 7805, and at the 7805 I have a 10uf cap before and after it as per the instructions found here: http://arduino.cc/en/Main/Standalone
maybe the caps need to be larger?

I read the motor running at full speed and it was drawing around ~400MA, both the power supplies I tested could support 900MA and 1000MA
« Last Edit: February 03, 2013, 09:47:20 am by compubob » Logged

Pages: [1]   Go Up
Jump to: