Go Down

Topic: Diecimila resets easily when controlling a motor (Read 5698 times) previous topic - next topic

Daniel

#15
Oct 20, 2007, 01:17 pm Last Edit: Oct 20, 2007, 01:24 pm by Daniel Reason: 1
I just looked at your video, which I hadn't looked at previously.

You have no additional filtering.. that is almost certainly the problem. Motors make noise, and you need to add filtering to ensure the logic supply stays clean. The "Diecimila difference" is not really a bug but is more likely caused by the fact that the FTDI is always powered in the Dieci, and might be interacting with the new reset mechanism when it gets a little blast of the noisy DC you're injecting into the power supply with that motor.

In any case it is really obvious that you need filter caps! Add some and it will be fine. I up my bet to a a truckload- no, make that an ocean liner- of grommets, especially because it is frequency related, and capacitors (i.e. the onboard Dieci filter caps)  have different filtering abilities at different frequencies.  

You can't add noisy motors like that without additional filtering- there is only 47Uf before the regulator and 47uF after, which is woefully inadequate.

D

nkcelectronics

I tested eighthave's motor circuit with a Freeduino, which is a Diecimila compatible board, and it doesn't reset.  Freeduino has the same FT232RL powered all time, like the Diecimila.  So maybe you have a faulty Diecimila??

eighthave

Quote
I tested eighthave's motor circuit with a Freeduino, which is a Diecimila compatible board, and it doesn't reset.  Freeduino has the same FT232RL powered all time, like the Diecimila.  So maybe you have a faulty Diecimila??


Are you sure it doesn't reset at all?  What I've found in further testing is that they all reset with this circuit (it has no noise reduction whatsoever).  My particular Diecimila seems to reset noticeably easier than my Arduino and my NG, but all of them reset.  It's not so noticeable on most boards, because the PWM keeps running.  Set up a test LED to watch for resets, and watch it carefully.

nkcelectronics

#18
Oct 25, 2007, 04:18 am Last Edit: Oct 25, 2007, 04:20 am by nkcelectronics Reason: 1
Are you sure it can be called a reset?  When Arduino resets, PWM stops for 1 sec (diecimila) or 3 sec (NG).  Sure the power lines and any output suffers some fluctuation, but I don't think it is a reset unless the Arduino bootloader gets invoked again.  

I am testing using a Freeduino, better Arduino than Arduino  ;)

nkcelectronics

Quote
Quote
Set up a test LED to watch for resets, and watch it carefully.


Hmmm, it may be you are blinking your eyes...  

Seriously, I tested with a scope.  As I said before, there is some fluctuation that causes some LEDs to dim, but it is within a tolerable range and the atmega168 doesn't reset.

Daniel

@eighthave,

did you try any of the suggestions that people made in this thread, e.g. adding a capacitor?

D

Cheater

Just for comparison purposes, my FT232 loses power when I hook up a 220uf capacitor to 5v and GND and the ATmega168 also loses power.

How can I tell? The RX and TX lights flash as the computer talks to it and the pin 13 LED also goes through the boot loader routine.

So it appears relatively easy to reset the Arduino with power fluctuations.

nkcelectronics

Quote
Just for comparison purposes, my FT232 loses power when I hook up a 220uf capacitor to 5v and GND and the ATmega168 also loses power.

How can I tell? The RX and TX lights flash as the computer talks to it and the pin 13 LED also goes through the boot loader routine.

So it appears relatively easy to reset the Arduino with power fluctuations.

OK, this is a reset.
Cheater, can you provide more detailed information about your environment?  Are you powering the Arduino board from USB?  external power?  what can you tell us about the power supply?  What are you "loading" to make it reset?

Please, remember that all the posts are being read by many people and trying to learn something.  If we provide more complete information, we can make every Post a better Post.

eighthave

Quote
@eighthave,

did you try any of the suggestions that people made in this thread, e.g. adding a capacitor?

D



Yes, adding filter caps definitely helps.  I am not troubleshooting this circuit though, what I am trying to do it map out the difference in behavior between my Diecimila and my Arduino and NG.  I think it would be useful to find the exact mechanism that is causing the reset to see if there is something that can be done to make the Arduinos less sensitive to noise.

This stuff can really stump newbies since it's quite unpredictable.  Also, I plan on writing an Arduino-focused tutorial about dealing with noise.

Daniel

#24
Oct 25, 2007, 07:13 pm Last Edit: Oct 25, 2007, 07:14 pm by Daniel Reason: 1
hey

I don't understand why you would want to 'map it out', as obviously the motor is injecting noise. There are only two ways for it to get in: through the base pin of the transistor (unlikely as it is a diode effectively), and through the power supply. Adding capacitors and other techniques to reduce the noise is the expected design solution. The proper way to spec this is to just say "add a capacitor".  I can make my Arudino malfunction too, just by adding a large enough inductive load that contaminates the power supply. This is just a characteristic of electronic design: if you add inductive, noisy loads to low-power digital logic, you have to be prepared to have to clean up the power supply.

D

nkcelectronics

Quote
Quote
@eighthave,

did you try any of the suggestions that people made in this thread, e.g. adding a capacitor?

D



Yes, adding filter caps definitely helps.  I am not troubleshooting this circuit though, what I am trying to do it map out the difference in behavior between my Diecimila and my Arduino and NG.  I think it would be useful to find the exact mechanism that is causing the reset to see if there is something that can be done to make the Arduinos less sensitive to noise.

This stuff can really stump newbies since it's quite unpredictable.  Also, I plan on writing an Arduino-focused tutorial about dealing with noise.

If you want to write a tutorial on what can cause noise and how to make the Arduino more noise resilient, then it is fine.  If you want to see what can destroy an Arduino, then there are millions of possible ways to do it... it can be fun, but nothing else.  I recommend you do the mapping to many Arduinos, because doing the map with YOUR Diecimila, with YOUR Arduino with YOUR NG, then the information is only useful to you and nobody else.

Have Fun!

eighthave

#26
Oct 25, 2007, 10:54 pm Last Edit: Oct 25, 2007, 11:11 pm by eighthave Reason: 1
Ok, here's my final testing, hopefully someone will find this interesting :).  I got some other boards from Tom Igoe to test with.  I added a reset count to the EEPROM so I can see whether it's actually reseting or not.  It prints out the count upon restart.  To eliminate brownout as a cause, I ran these from a [link=http://www.elexp.com/tst_4303.htm]GP-4303D[/link] bench power supply @ 12V, current turned all the way up (it never got above 0.2A).

Like I said before, running the power to the motor totally separately reduces (but does not eliminate) the resetting.  Also powering the Diecimila itself from the bench supply also makes the resetting more frequent.

Here are some results of my testing:

my Diecimila
------------

Resets with certain speed of the motor, the reset count is incremented, and reads the analogIn upon reset.

When the motor and Diecimila is powered only by USB, then is actually resets much less.  The motor doesn't get going very fast ever.


my Arduino NG
-------------

doesn't reset with this circuit/motor, even when powered from USB


Tom Igoe's Diecimila #1
-----------------------

acts like it's resetting, the motor interrupts the built-in pin 13 flashes, but the reset count is NOT incremented, and doesn't read the analogIn upon reset.  It gets caught in a loop of resets and running the motor.


Tom Igoe's Diecimila #2
-----------------------

Same as my diecimila, resets with certain speed of the motor, the reset count is incremented, and reads the analogIn upon reset.


Tom Igoe's Arduino NG
---------------------

doesn't reset with this circuit/motor


Tom Igoe's Arduino ATMEGA8 with capacitor added between ATMEGA pin1 and X3 port #4
-------------------------------------------------------------------------------

doesn't reset with this circuit/motor


mellis

Hmm, maybe the FTDI chip is resetting, toggling DTR, and therefore resetting the ATmega?

Daniel

#28
Oct 26, 2007, 06:19 am Last Edit: Oct 26, 2007, 06:35 am by Daniel Reason: 1
At this point I think we only have two options:


  • we start a new category in the forum called Hardware> Zen Speculation.  
  • You could get out that oscilloscope thing, connect one channel to the reset line and the other to the +5 supply,  and do some actual troubleshooting. :)


D



nkcelectronics

I used a scope and with some serious fluctuations, the reset pin goes low and the whole board resets.  But I mean "serious" fluctuations, like grabbing the motor cable and connecting it and disconnecting it by just touching the contacts.  I could not make MY FREEDUINO and MY USB 2.2 board reset using the circuit presented by eighthave, or the type of reset that he shows in the video, by moving the pot and changing PWM, no way.  

Eighthave: in your last comprehensive test, did you use the same circuit as you show in the video?  How did you generate the "noise" or "fluctuations"?

Go Up