Pages: [1] 2   Go Down
Author Topic: timing and decoupling  (Read 1906 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 142
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello,

i think i just successfully decoupled my first circuit but am still trying to wrap my head around the whole thing. I put a 47uf polarized cap on the + and - rails and some .1uf caps on the atmega328p and 3 .1uf caps each on two DC motors. Everything seems to be working great except the timing of everything is a little bit off from how it originally was. (I know there are still a few more things I could do to decouple it better as well and I might do those things later)

So my question is...will the off timing be consistent? So I can just adjust the code accordingly? My loop probably takes about half a second longer now or so it seems. Or would it be less predictable? I assume it's because of the 47uf cap on the power rails...it's taking a bit of time to charge/decharge. Would the .1uf caps also need to be considered?

Thanks for any advice
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If your timing is changing due to decoupling, there is something serious wrong.
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1664
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If your timing is changing due to decoupling, there is something serious wrong.

I also agree with this.

To me...   A 47uF cap on a power rail feed to a motor would discharge MUCH faster than you indicate with a motor as a load.

0.1uF Caps are all about really short spike/dip (aka noise) control.  47uF *is* about power rail smoothing... but from what you describe you would have needed to add a value closer to the thousands of uF not a relatively small 47uF.  You can often find 47uF in the back end of regulator circuit to stabilize the regulator itself and it would technically not change how much stored voltage is available to your circuit much beyond your source voltage being removed. (IE, a period only measurable with a O-SCOPE, in my opinion)
« Last Edit: October 12, 2012, 09:36:44 am by pwillard » Logged

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

Decoupling will have no effect on timing at all.
If you think it is then there is something going on that you are not aware of.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5761
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So my question is...will the off timing be consistent? So I can just adjust the code accordingly? My loop probably takes about half a second longer now or so it seems. Or would it be less predictable? I assume it's because of the 47uf cap on the power rails...it's taking a bit of time to charge/decharge.

It's not supposed to charge/discharge under normal use.

If it is charging/discharging then it's either not in the right place for a decoupling capacitor or your power supply isn't supplying enough current for whatever it is you're building.

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1664
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Time to *show* us what you really did with a picture or schematic I think.
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 142
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey thanks for all the replies. ok so i fixed the timing...but i don't understand why it works. basically the startup time changed by 2 seconds after I put in the decoupling capacitors. in the startup() i had a delay of 5500 to allow a digital video frame to boot up....now i changed that 5500 to 3500 and everything is rock solid.

but i'm timing this all based on how the atmega circuit is in sync with a digital video frame. it's very cold in my studio now...could the cold have anything to do with startup time? maybe it was the video frame that started up faster and the arduino was actually the same the whole time? unlikely i know....but just thought i'd ask. anyway...everything seems to be running very smoothly now. here is a terrible fritzing of my circuit...i still haven't got down the schematics view section of fritzing:

http://www.jeremycouillard.com/circuit2.jpg

2 of the .1 caps next to the motors are actually soldered onto the body of the motor. i got that idea from here: http://www.pololu.com/docs/0J15/9
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
everything seems to be running very smoothly now. here is a terrible fritzing of my circuit

Sounds like your "running very smoothly" isn't exactly smooth, smiley

Low temperature will greatly impact the oscillator (internal rc or crystal) but that's in matters of ms, not seconds.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5761
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey thanks for all the replies. ok so i fixed the timing...but i don't understand why it works. basically the startup time changed by 2 seconds after I put in the decoupling capacitors.

Only the startup? It's fine after that?
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

0
Offline Offline
Full Member
***
Karma: 1
Posts: 142
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yeah oddly enough the startup code was the only thing I had to adjust by 2 seconds and then everything worked better than ever. I have no idea why that is. Anyone have any ideas?
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5761
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yeah oddly enough the startup code was the only thing I had to adjust by 2 seconds and then everything worked better than ever. I have no idea why that is. Anyone have any ideas?

Can you try something smaller then 47uF...?

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 48
Posts: 2935
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why Smaller?, If anything at all a bigger cap... 100 - 470uF would be better and probably as big as is required. anything larger would serve little purpose. If you have the board wired Exactly as shown (A Star topology) then the only other thing I might suggest would be 1N4004 diodes across the motors cathode to the positive side, anode to ground. The star wiring method insures that all currents return INDIVIDUALLY to a common point so that ground current isn't "Shared" along with the noise due to "Daisy Chained" grounding. Because I am rather conservative (from painful experience) I develop all my circuitry on breadboards, a practice I've used for 40 years... All of what I design works right when I make a PCB from my final breadboard design. I use breadboards for design not so much because they are easier but because they are about the worst possible device to use for low noise high current loads... If I can make it work there I know (Again from painful experience) it will work about 99.5% of the time. Murphy is always present... And he was an Optimist.

Bob
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can you try something smaller then 47uF...?

Or even 4.7uf?

Quote
Why Smaller?

We covered that in the 1st day of the class.
Logged

0
Online Online
Shannon Member
****
Karma: 223
Posts: 12746
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The timing change suggests something different is happening at power-up-reset - the bootloader looks at the serial to check for an upload, potentially this could be affected by noise on that line, which in turn might be affected by capacitance, ground-plane, etc.

If you are using the 328p standalone it won't have anything connected to the RX pin (pin 0), so it will be floating and sensitive to the environment - try a 10k pull-up resistor from pin 0 to +5V maybe ?
Logged

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

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5761
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why Smaller?, If anything at all a bigger cap... 100 - 470uF would be better and probably as big as is required. anything larger would serve little purpose.

To see if the start-up delay is proportional to the size of that capacitor.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Pages: [1] 2   Go Up
Jump to: