Ah how things have changed. When I was learning electronics we mainly dealt with radio and TV circuits and just about the first lesson one learned was to keep leads short (reduce unwanted inductance) and use decoupling capacitors everywhere.
I recall some years later a young graduate engineer coming into my office with a rather involved circuit consisting of 30/40 TTL ICs and complaining that he'd double checked the circuit and it still didn't work. I took one look at his device then went to the draws of capacitors and handed him a handful of 0.1uF ceramic caps and told him to put them between the ICs' PS rail pins to ground which he did and to his amazement the circuit worked immediately.
He stood in amazement that I should have such insight so as to fix the problem at first glance.
How such critical knowledge can get lost in university training these days just amazes me.
My university made us use really crappy power supplies and dev boards. Nothing worked unless you first put a large bulk capacitor on the power supply's output, and small capacitors close to the components.
Also I got bitten by parasitics in capacitors very early in my career: capacitors of different face value will resonate with each other to effectively kill the decoupling network at a specific frequency (resulting, for me, in an amplifier with a nice hole in its frequency response).
> How such critical knowledge can get lost in university training these days just amazes me.
It will probably have been taught.... but very briefly. Before going go back to analysing circuit schematics, where connections between components don't show resistance or inductance, and the capacitance of two parallel capacitors sums.
This is why lab exercises are important. I remember first building some actual TTL circuits on bread board, I learned very quickly that this whole digital stuff is a lot uglier and messier than on paper or in the simulator.
With sharp rise times, synced up to a common clock, even after soldering in a whole bunch of capacitors, you can still stick a probe pretty much anywhere and see switching spikes all over the place, from power rails to completely unrelated signals that are supposed to be stable. Using actual TTL, there was another funny lesson what this weird "fanout" value in the datasheet meant.
A similar lesson I learned that way (and a very memorable one :-)) was about flyback diodes.
You learned when analogue circuitry was the norm. I learned when digital circuitry was simple enough that you could readily take something apart and understand it.
Now, EE courses often start with cad, simulations, digital electronics, and you end up with people building ziggurats atop an ocean of incomprehension.
It’s exactly the same thing with software.
I don’t scorn people for this, rather I see myself as fortunate for having learned in a time when the more fundamental knowledge was still worth learning - and that’s the rub - for a vast majority, it simply isn’t worth the time or energy to explore the full stack, when there’s so much to learn atop it.
"You learned when analogue circuitry was the norm. I learned when digital circuitry..."
What's not taught properly these days is that ALL electronics is analog at the physical/circuit level.
For you digital types that's OSI Model Layer 1 — Physical layer (look it up on Wiki). Nothing in electronics works unless that's working properly—ICs, tunnel diodes, transistors, inductors, resistors, capacitors, cables and antennas are all analog devices at that level. That includes the heart of the most advanced digital ICs. For example, the upper clock speeds in processors are limited by transit times/electron mobility, inter-electrode and stray capacitances, unwanted inductance, etc.—all of which are analog effects and they must be accounted for.
Like it or not, the physical analog world is alive and well! The Noughts & Ones Brigade unfortunately seems to have forgotten that fact.
I can see how that happens when people come at things from a conceptual digital side first.
It probably doesn't help when you have a circuit diagram that while topologically correct doesn't show the relative positioning between components. The first time I saw all the decoupling caps rendered in a single chain on the side of the diagram I was mightily confused. It seemed like utter nonsense until I realised where they actually went.
This is probably a good place to debunk the usual wisdom that "decoupling capacitors must be placed very close to the IC pins". If you're using a solid power plane, rather than routing power through traces (and honestly 4/6 layer boards are cheap enough these days) it really doesn't matter where you place decoupling capacitors for most uses - keep the via traces short or ideally in the pad, and you can put all your decoupling capacitors in one place on the boards a way away from the chip and focus on good routing of your signals. Figure 15 on this paper (and the whole paper!) explains it well: https://scholarsmine.mst.edu/cgi/viewcontent.cgi?article=221...
Loop inductance is what really matters with decoupling. Once you understand that, it becomes really easy to make good decisions. This article explains how you can approximate the inductance for a given layout, so it makes evaluating layouts much simpler. It actually used the data from the paper you referenced in example 3!
As you say, just having power planes and directly connecting to them is almost always going to be superior to using a trace, despite seeing this all the time, especially in datasheet example layouts. It made sense for 2 layer boards, but not today. Just think, the inductance of the planes is practically zero, and distance to the plane from the components is going to be on the order of 0.2mm, round trip 0.4mm. Is there any way I could place the capacitor 0.4mm away from the pins to achieve an equivalent inductance? And even if you could, you can't add extra vias to lower inductance, and you don't benefit from mutual inductance.
The ELI5 for decoupling capacitors is "imagine an energy storage for quick usage"
The ELI(tired EE student) is more like the explanation above
And this concept is ok for most of the 'low speed' circuits
in RF ranges, everything is a capacitor (except when you need one), everything is an inductor (except when you need one) and the intuitive explanations break down and everything looks like dark magic
For approximative simulation, any SPICE simulator works. You'll need to know your capacitors parasitics and power supply output impedance, find a typical via's impedance, and manually compute traces impedances and board capacitance.
For accurate simulation, the actual board geometry needs to be fed to a simulator that'll compute the actual impedances. Last I checked only Very Expensive Software could do that in a user-friendly way (I had to route a DDR3 bus. I ended up being very cautious so that all traces had the same topology and the same lengths, and cross my fingers. It worked).
If anyone knows of free alternatives for that, I'd be interested to hear about it.
This signifies that each vertical dotted line is 20ns apart, so the ripple you see has a frequency of something like 50MHz.
Unless you have a 50MHz buck converter (which would be very exotic --- the fastest common ones are around 1/10th that), that looks more like something may be inadvertently oscillating and/or you're picking up strong RF noise from possibly something in...
It's not oscillating at 50MHz. Look at the waveform, with the big spike in the middle. That's a spike at some lower frequency, wider than the screen, followed by ringing. Need to zoom out the time base some more to see the period of the big spikes. It's no higher than 4 MHZ (the screen is 12 units wide) and possibly much lower. (Assuming that M:20ns on the display means 20ns/grid division. The manual is a bit hazy on that part of the UI.)[1]
The power regulator IC mentioned is normally run at 500KHz. There's a reasonable chance that this is the power regulator spike not being damped out. Easy enough to check with a scope handy.
>And "leared" -- the (unintentional?) pun made me click.
I assume it's a reference to the "Quality Learing Center" in Minnesota, one of the questionable daycares at the center of the alleged Somali daycare fraud scandal. Ever since some of the expose videos about it came out it's become a meme to say "lear" instead of "learn".
Having 1.5V Vpp ripple on a 3.3V supply rail seems more like an issue with the regulator / bulk capacitance than a decoupling capacitor, I would think?
Yea since writing this I think it has more to do with the regulator circuit. I plan to do a small rewrite and change the title to something like "When 3.3V isn't actually 3.3V" to more accurately reflect the situation. A decoupling cap would probably still help, but there were some mistakes made on the regulator circuit.
Switching regulators (and even linear regulators!!) have maximum capacitance ratings.
Adding more capacitance could, in theory, further destabilize your regulator.
The overall tank circuit (the inductor + capacitor forming the bulk of the switching circuit) is incredibly fragile.
It's legend that some old switching designs stopped working as newer tantalum capacitors had less resistance, screwing with the stability of older switching designs. You kind of need to choose exactly the "expected" kind of capacitor (aluminum caps have more resistance, which increases stability of the feedback but slows down the feedback).
Some small switching regulators go into a low power mode when the output current goes below a threshold. The frequency drops to some "hovering just above zero" level. I've had to artificially load a power supply, to get it to be stable, e.g., with a shunt resistor. Naturally, that's inefficient, so it goes onto the TODO list to improve the design.
The capacitor doesn't have a concept of "fast enough", it's a passive component. The signal is what determines what it does when it encounters the capacitor. Non-linearities and capacitor species aside, a good ole x7r 100nF would clean this up.
In general you can just liberally dump 100nF caps all over your pcb power traces and quash most problems like this before even knowing they exist. I joke that you make a circuit then take out your 100nF salt shaker to make it just right.
It's an easy test though and it can be an SMD component and some PUR-coated magnet wire or 30 awg single stranded kynar hookup wire.
Use a small amount of glue from a hot glue gun to fixate it when done, or epoxy if that's your thing. Avoid cyanoacrylate. Not always needed but I imagine a drone moves around alot.
Bodge wiring is a good skill to acquire - PCBs will not always be perfect. Maybe practice on something else first?
If getting a cap on the input of the magnetometer is too challenging, a ferrite bead on the output of the caps fed by the switching supply might also do the trick.
You could also try just sticking a 100n and 10n across the smps output too.
leared = learned ?
The O'Reilly book "Designing Embedded Systems" covers this pretty well with a story very similar to yours.
Great to be able to learn something new.
Ah how things have changed. When I was learning electronics we mainly dealt with radio and TV circuits and just about the first lesson one learned was to keep leads short (reduce unwanted inductance) and use decoupling capacitors everywhere.
I recall some years later a young graduate engineer coming into my office with a rather involved circuit consisting of 30/40 TTL ICs and complaining that he'd double checked the circuit and it still didn't work. I took one look at his device then went to the draws of capacitors and handed him a handful of 0.1uF ceramic caps and told him to put them between the ICs' PS rail pins to ground which he did and to his amazement the circuit worked immediately.
He stood in amazement that I should have such insight so as to fix the problem at first glance.
How such critical knowledge can get lost in university training these days just amazes me.
My university made us use really crappy power supplies and dev boards. Nothing worked unless you first put a large bulk capacitor on the power supply's output, and small capacitors close to the components.
Also I got bitten by parasitics in capacitors very early in my career: capacitors of different face value will resonate with each other to effectively kill the decoupling network at a specific frequency (resulting, for me, in an amplifier with a nice hole in its frequency response).
Excellent training, especially the parasitic bit. Trouble is somehow many aren't taught that stuff nowadays.
> How such critical knowledge can get lost in university training these days just amazes me.
It will probably have been taught.... but very briefly. Before going go back to analysing circuit schematics, where connections between components don't show resistance or inductance, and the capacitance of two parallel capacitors sums.
This is why lab exercises are important. I remember first building some actual TTL circuits on bread board, I learned very quickly that this whole digital stuff is a lot uglier and messier than on paper or in the simulator.
With sharp rise times, synced up to a common clock, even after soldering in a whole bunch of capacitors, you can still stick a probe pretty much anywhere and see switching spikes all over the place, from power rails to completely unrelated signals that are supposed to be stable. Using actual TTL, there was another funny lesson what this weird "fanout" value in the datasheet meant.
A similar lesson I learned that way (and a very memorable one :-)) was about flyback diodes.
2 replies →
I feel it’s a function of abstraction.
You learned when analogue circuitry was the norm. I learned when digital circuitry was simple enough that you could readily take something apart and understand it.
Now, EE courses often start with cad, simulations, digital electronics, and you end up with people building ziggurats atop an ocean of incomprehension.
It’s exactly the same thing with software.
I don’t scorn people for this, rather I see myself as fortunate for having learned in a time when the more fundamental knowledge was still worth learning - and that’s the rub - for a vast majority, it simply isn’t worth the time or energy to explore the full stack, when there’s so much to learn atop it.
"You learned when analogue circuitry was the norm. I learned when digital circuitry..."
What's not taught properly these days is that ALL electronics is analog at the physical/circuit level.
For you digital types that's OSI Model Layer 1 — Physical layer (look it up on Wiki). Nothing in electronics works unless that's working properly—ICs, tunnel diodes, transistors, inductors, resistors, capacitors, cables and antennas are all analog devices at that level. That includes the heart of the most advanced digital ICs. For example, the upper clock speeds in processors are limited by transit times/electron mobility, inter-electrode and stray capacitances, unwanted inductance, etc.—all of which are analog effects and they must be accounted for.
Like it or not, the physical analog world is alive and well! The Noughts & Ones Brigade unfortunately seems to have forgotten that fact.
I can see how that happens when people come at things from a conceptual digital side first.
It probably doesn't help when you have a circuit diagram that while topologically correct doesn't show the relative positioning between components. The first time I saw all the decoupling caps rendered in a single chain on the side of the diagram I was mightily confused. It seemed like utter nonsense until I realised where they actually went.
https://xkcd.com/1053/
This is probably a good place to debunk the usual wisdom that "decoupling capacitors must be placed very close to the IC pins". If you're using a solid power plane, rather than routing power through traces (and honestly 4/6 layer boards are cheap enough these days) it really doesn't matter where you place decoupling capacitors for most uses - keep the via traces short or ideally in the pad, and you can put all your decoupling capacitors in one place on the boards a way away from the chip and focus on good routing of your signals. Figure 15 on this paper (and the whole paper!) explains it well: https://scholarsmine.mst.edu/cgi/viewcontent.cgi?article=221...
Loop inductance is what really matters with decoupling. Once you understand that, it becomes really easy to make good decisions. This article explains how you can approximate the inductance for a given layout, so it makes evaluating layouts much simpler. It actually used the data from the paper you referenced in example 3!
https://learnemc.com/estimating-connection-inductance
You can even use mutual inductance of vias improve performance, either by having vias spaced close together and in the right order (https://learnemc.com/decoupling-for-boards-with-widely-space...), or arranging capacitors in alternating or doublet layouts (https://incompliancemag.com/decoupling-capacitor-design-on-p...).
As you say, just having power planes and directly connecting to them is almost always going to be superior to using a trace, despite seeing this all the time, especially in datasheet example layouts. It made sense for 2 layer boards, but not today. Just think, the inductance of the planes is practically zero, and distance to the plane from the components is going to be on the order of 0.2mm, round trip 0.4mm. Is there any way I could place the capacitor 0.4mm away from the pins to achieve an equivalent inductance? And even if you could, you can't add extra vias to lower inductance, and you don't benefit from mutual inductance.
Yeah
The ELI5 for decoupling capacitors is "imagine an energy storage for quick usage"
The ELI(tired EE student) is more like the explanation above
And this concept is ok for most of the 'low speed' circuits
in RF ranges, everything is a capacitor (except when you need one), everything is an inductor (except when you need one) and the intuitive explanations break down and everything looks like dark magic
Great paper!. Anyonw know whether there are any modern tools/software that can simulate this during design?
For approximative simulation, any SPICE simulator works. You'll need to know your capacitors parasitics and power supply output impedance, find a typical via's impedance, and manually compute traces impedances and board capacitance.
For accurate simulation, the actual board geometry needs to be fed to a simulator that'll compute the actual impedances. Last I checked only Very Expensive Software could do that in a user-friendly way (I had to route a DDR3 bus. I ended up being very cautious so that all traces had the same topology and the same lengths, and cross my fingers. It worked).
If anyone knows of free alternatives for that, I'd be interested to hear about it.
This signifies that each vertical dotted line is 20ns apart, so the ripple you see has a frequency of something like 50MHz.
Unless you have a 50MHz buck converter (which would be very exotic --- the fastest common ones are around 1/10th that), that looks more like something may be inadvertently oscillating and/or you're picking up strong RF noise from possibly something in...
https://en.wikipedia.org/wiki/6-meter_band#Radio_control_hob...
And "leared" -- the (unintentional?) pun made me click.
It's not oscillating at 50MHz. Look at the waveform, with the big spike in the middle. That's a spike at some lower frequency, wider than the screen, followed by ringing. Need to zoom out the time base some more to see the period of the big spikes. It's no higher than 4 MHZ (the screen is 12 units wide) and possibly much lower. (Assuming that M:20ns on the display means 20ns/grid division. The manual is a bit hazy on that part of the UI.)[1]
The power regulator IC mentioned is normally run at 500KHz. There's a reasonable chance that this is the power regulator spike not being damped out. Easy enough to check with a scope handy.
[1] https://fotronic.asset.akeneo.cloud/pdfs/media/owon_hds242s_...
>And "leared" -- the (unintentional?) pun made me click.
I assume it's a reference to the "Quality Learing Center" in Minnesota, one of the questionable daycares at the center of the alleged Somali daycare fraud scandal. Ever since some of the expose videos about it came out it's become a meme to say "lear" instead of "learn".
> questionable daycares
If they don't find fraud, is it "questionable"?
Cannot it be a noise from imperfect switching? The switching occurs at lower frequency, and the noise is high frequency.
I guess he also believes that 50 MHz or so signals can be measured reliably on a 40 MHz (on paper at least) scope.
Having 1.5V Vpp ripple on a 3.3V supply rail seems more like an issue with the regulator / bulk capacitance than a decoupling capacitor, I would think?
Yea since writing this I think it has more to do with the regulator circuit. I plan to do a small rewrite and change the title to something like "When 3.3V isn't actually 3.3V" to more accurately reflect the situation. A decoupling cap would probably still help, but there were some mistakes made on the regulator circuit.
Switching regulators (and even linear regulators!!) have maximum capacitance ratings.
Adding more capacitance could, in theory, further destabilize your regulator.
The overall tank circuit (the inductor + capacitor forming the bulk of the switching circuit) is incredibly fragile.
It's legend that some old switching designs stopped working as newer tantalum capacitors had less resistance, screwing with the stability of older switching designs. You kind of need to choose exactly the "expected" kind of capacitor (aluminum caps have more resistance, which increases stability of the feedback but slows down the feedback).
Yeah. Decoupling capacitors are for smaller ripples than that.
There might be a resonnance point on that regulator, or maybe a maximum capacitance that was violated on the feedback.
There are a TON of ways to screw up your PDN on a PCB. It's nominally a master's degree level subject.
Some small switching regulators go into a low power mode when the output current goes below a threshold. The frequency drops to some "hovering just above zero" level. I've had to artificially load a power supply, to get it to be stable, e.g., with a shunt resistor. Naturally, that's inefficient, so it goes onto the TODO list to improve the design.
1.5 Vpp ripple measured on a 40 MHz scope - when the waveform is 50 MHz according to him...
decoupling is a real issue, but I think you are right in this case.
Seems like a missed opportunity to try adding a capacitor dead-bug style onto the board to see if it cleans it up.
If it's really 20MHz++ noise that's screwing him, you need something faster than a through hole capacitor IMO to deal with it.
That being said, I'm not 100% convinced this is a 20MHz++ noise issue.
The capacitor doesn't have a concept of "fast enough", it's a passive component. The signal is what determines what it does when it encounters the capacitor. Non-linearities and capacitor species aside, a good ole x7r 100nF would clean this up.
In general you can just liberally dump 100nF caps all over your pcb power traces and quash most problems like this before even knowing they exist. I joke that you make a circuit then take out your 100nF salt shaker to make it just right.
2 replies →
It's an easy test though and it can be an SMD component and some PUR-coated magnet wire or 30 awg single stranded kynar hookup wire.
Use a small amount of glue from a hot glue gun to fixate it when done, or epoxy if that's your thing. Avoid cyanoacrylate. Not always needed but I imagine a drone moves around alot.
Bodge wiring is a good skill to acquire - PCBs will not always be perfect. Maybe practice on something else first?
2 replies →
> If it's really 20MHz++ noise that's screwing him, you need something faster than a through hole capacitor IMO to deal with it.
That's always worked well enough in the past.
4 replies →
If getting a cap on the input of the magnetometer is too challenging, a ferrite bead on the output of the caps fed by the switching supply might also do the trick.
You could also try just sticking a 100n and 10n across the smps output too.
leared = learned ? The O'Reilly book "Designing Embedded Systems" covers this pretty well with a story very similar to yours. Great to be able to learn something new.
Meta; typo in title, should be "learNEd".
Quality *Learing* Center 1-800-FRAUD
> How I leared what radial magnetic emissions are, the hard way
Another lesson waiting in the wings from mounting a magnetometer in plane and right next to four BLCD motors, lmao.
The first time I saw a complex number used with units of resistance, I was like, huh?