timing and decoupling

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

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

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)

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.

treebykooba:
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.

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

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:


2 of the .1 caps next to the motors are actually soldered onto the body of the motor. i got that idea from here: Pololu - 9. Dealing with Motor Noise

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, :slight_smile:

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

treebykooba:
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?

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?

treebykooba:
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...?

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

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

Or even 4.7uf?

Why Smaller?

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

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 ?

Docedison:
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.

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

Not really. Decoupling requires fast capacitors. Large electrolytic capacitors are not fast at all.

Good quality decoupling requires both large and small capacitors.

dhenry:

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

Not really. Decoupling requires fast capacitors. Large electrolytic capacitors are not fast at all.

I never said they were. I'm wondering if the 5V line is taking a while to rise at power-on because of that huge capacitor.

That's unlikely the problem: even at 1000u, to generate a time constant of even fractions of a second requires output impendance improbably high for any power supply / regulator.

The issue here is likely something else. For example I have a crystal oscillator with Rf that takes 5 - 7 seconds to start, longer in a clean environment.

As to decoupling, many people confuse bulk decoupling with (local) decoupling. They are so different that what works for one almost surely don't work for the other.

Once again, we see why Fritzing is not the tool used by engineers to convey designs and concepts. No offense intended, but it kinda falls flat in the clarity department.. I understand you are new... so i'm trying not to sound like a jerk... but that drawing really did not really lift any fog, at least for me.

True schematics are how ideas and solutions are shared. Worth learning about.