Pages: 1 2 3 [4] 5   Go Down
Author Topic: Diecimila resets easily when controlling a motor  (Read 5282 times)
0 Members and 1 Guest are viewing this topic.
USA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 452
Freeduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe it varies from PTC to PTC.  The ones I used and tested, tripped very quickly and recovered very quickly as well.  I didn't do any resistance measurement.  I tested by shorting +V with GND, and what I could see was that on the USB side, there was a small fluctuation, but once the PTC tripped, it went back to normal in less than 1 second (I recall seeing a recovery of milliseconds).  And on the shorted side of the PTC, the short lasted until I released the short, of course... and then the PTC recovered in less than 1 second as well.

I don't remember storing any scope screens, but if anyone is interested how the PTC reacts, I can rerun the tests and post some scope pictures.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Everybody that has worked with DC motors has seen this from time to time.

If you take apart some toys  you will often see the standard industry motors fixes of .1 (104) caps between both motor terminals and more caps between each motor terminal and the motor body.

I would second everything Daniel said about diodes to the power supply lines and and some big caps on the power supply too. Try some different sizes of caps in parallel such as 1000 ufd electrolytic, 1 and 10 ufd tantalums, and 104 ceramics. In theory the capacitance adds up, but in practice each cap is good at killing a unique set of noise frequencies.    

Also try twisting together the supply lines, and the motor lines, (but don't twist the supply lines With the motor lines) instead of running them individually. And then look at the thing on a scope, so you'll really know what's going on.

Paul
Logged

USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to lower the PWM frequency and see how it behaves?






Logged


USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

eighthave,

We spoke about this problem at the recent Arduino hacklab (which was awesome, btw). I wanted to make some suggestions which might give some insight as to what's happening here. I wrote a writeup on another blog because I could upload images there smiley-wink

Here is the link,
http://antipastohw.blogspot.com/2008/01/arduino-motor-driving-discussion.html
Logged


0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think we have to file this one under "red herring". I just tried the setup and it works, no reset.

I had it driving a gear motor powered from 12, 24 and 32V, at currents up to 500ma, and not a reset in sight.

I also tried powering it on the 5V Arduino line, no resets.

Disconnecting and reconnecting the motor wire to the transistor while powered by 32V: blue sparks, but no reset.

Doing all of the above on the first Diecimila and on the Diecimila marked "prototype, limited edition": no resets.

Doing the above while eating linguini, listening to Louis Armstrong and drinking an inexpensive but well-reviewed burgundy: no resets.
( I did not try Jazz- that may indeed be the problem.)

I imagine the reset in the original post was caused by the type of motor (small wires, many turns== high inductance) and the PWM frequency interacting to send some nasty noise into the Arduino. In that case, a few simple capacitors on the power and/or logic lines is the obvious solution.
  
D
« Last Edit: January 22, 2008, 06:11:14 am by Daniel2 » Logged

Brooklyn, NY, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 115
arduino for all
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I imagine the reset in the original post was caused by the type of motor (small wires, many turns== high inductance) and the PWM frequency interacting to send some nasty noise into the Arduino. In that case, a few simple capacitors on the power and/or logic lines is the obvious solution.
  
D

As I mentioned before, I was deliberately using a crappy circuit and a noisy motor to illustrate the difference between the Arduino NG and the Arduino Diecimila.  Watch the video that I posted near the beginning of this thread, it illustrates the difference well:

http://dropbox.at.or.at/dropbox/diecimila_motor_problem.mov

I tested this on about 6 or 8 different Arduinos and it seemed pretty clear that only the Diecimilas were affected.  There is a key difference between the NG and the Diecimila: the RESET pin is connected on the Diecimila.

If you want to reproduce this, find a noise source, like a really crappy motor in a super basic circuit and make sure you have enough current to supply the motor.  Then once you get the Diecimila resetting, try the same circuit on the NG.

Logged

USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It doesn't matter if your using a Diecimila, NG, STK500 Dev Board, or just have your own Atmel in a circuit.

Unless you can observe the reset pin with a O-Scope, then we can't really solve this today.

However, it can be stated that if your circuit produces a characteristic on the reset line that brings the voltage down below 0.2*Vcc =1V and does so for >=2.5microseconds, then we can say the Atmel is being reset.

See the following image for reference,



Also, if your supply voltage goes below brown out voltage AND brown out detection is turned on, then your Atmel can reset. Does anyone know if the brown out fuses have been set on the Diecimila? on the NG? It would have been done with an in-circuit programmer.

If you can verify that the brown-out detection is turned on, then consult the following table when you find out at which voltage,



Other questions which I'm not sure are answered (or completely answered):

1.) How much power is your motor taking to run (full speed RIGHT before shut off)?
2.) Are you overloading the voltage regulator (some linear regulators can have thermal shutoffs)?
3.) What are the O-scope plots between the following points: RESET - GND, and 5v-GND right near the Atmel when your motor is running AND right before your Atmel resets?
4.) Are you creating EMI that is propagating through your circuit causing havoc at multiple places?
5.) Did you try carefully wrapping the Arduino in some kind of metal shield for EMI protection?

It's not as straight forward as saying that one is more sensitive than the other.

Characterize FIRST how your electrically stressing your Arduino. THEN, apply the appropriate measures to fix the problem. Otherwise aren't we all just shooting from the hip with guesses to fix the problem? If we have the data, then we can make a correction.

All this talk has made me really interested in getting that motor that you used. I would love to characterize the circuit more. Where did you buy that exact motor? If you're unsure, then maybe we can play with this at the next Arduino hacklab?
Logged


Brooklyn, NY, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 115
arduino for all
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


While I didn't test all of the current-related possibilities, since the NG would not reset while using USB power while the Diecimila would reset when using external power, it seemed to me relatively safe to assume that the resets were not being caused by current-related issues.  It would be good to test to make sure.

I think this would be a good thing to try at the next hacklab so we can get to the bottom of it.  I'll bring that little motor.  I don't know the exact specs of the motor, it doesn't have any markings on it, but it looks almost exactly like this one:

http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=154915&pa=154915PS
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PS: I put a scope on the reset line, the 5V Vcc and the motor power- no significant fluctuations or anything out of the ordinary.

@eighthave, you never said if the problem is solved by using a larger power supply capacitor on the Arduino 5V supply- is it?  

Several people made suggestions in the posts above about how to solve the problem, so I'd be curious to know if any of them worked. I know you are after the "core issue", but sometimes solving the issue leads to that answer.. sort of troubleshooting by induction.

D
« Last Edit: January 22, 2008, 05:34:09 pm by Daniel2 » Logged

Brooklyn, NY, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 115
arduino for all
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did try adding a biggish cap, like 10uF, from the motor's Vcc to ground.  I don't think it helped, but my memory is hazy.  I think the scope is the way to get to the bottom of this.

.hc
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

10UF is tiny in terms of a motor- try 220UF, on on the Motor VCC an done on the logic Vcc and let us know if it works!

D
« Last Edit: January 23, 2008, 12:28:57 am by Daniel2 » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just discovered that according to the Diecimila schematic, when you are running from USB power, there is only about .2Uf of power supply filtering. The 47UF filter cap is only connected to +5V when you are running from external power! At least according to the published schematic.

D
Logged

USA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 452
Freeduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The latest Arduino boards come with 22uF caps
Logged

Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The latest Arduino boards come with 22uF caps

Those would be C6 and C7 on the Diecimila schematic? They're only in the dc input circuit. When running from usb power, only C1 and C4 provide filtering for a total of 200nF. This means plugging is very easy on the usb port's fuses and I actually like it that way.

Keep high and low power electronics properly isolated, filtered and snubbed, plain and simple. One board being more susceptible to noise than another is irrelevant to me, as long as the required noise level for a fault is reasonably overt which in this case it is.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the only problem with having .2Uf/200nF filtering on a board like this is when... somebody plugs in a motor. smiley
I've never seen a motor close to a processor without lots of power supply bypass.

D
Logged

Pages: 1 2 3 [4] 5   Go Up
Jump to: