You could also try just sticking a 100n and 10n across the smps output too.
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.
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 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.
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_...
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".
That being said, I'm not 100% convinced this is a 20MHz++ noise issue.
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.
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).
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?
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.
I have a bunch of through-hole parts for these sorts of situations. There are plenty of small through-hole ceramics that have leads if you really want to go there.
https://www.digikey.com/en/products/detail/vishay-beyschlag-...
Like this or something similar.
Through hole parts cap out at maybe low MHz. Many electrolytic caps frankly cannot effectively decouple signals above 100s of kHz even. Above that value, capacitors become inductors due to lead lengths, parasitic resistance, and other details.
To make capacitors work faster, we make them smaller and smaller. Surface Mount Caps are the only way to reach 20MHz++ decoupling speeds, and you need crazier tricks if you need additional decoupling beyond that frequency.
I was very excited to get the latest version of my PCB from the manufacturer. This new version had a magnetometer on it, so that I could more accurately track the yaw angle of my drone.
The first thing I did was start to program it over USB. I added code for initializing and reading the magnetometer, and I got back some data that seemed correct for the X and Y axes, but the Z axis would read a constant value. I did some light debugging, and learned, among other things, that the Z axis has slightly different internal circuity, but eventually I decided to put a pin in it and focus on other things.
Eventually I had to plug my drone into the battery that would power it in flight, and all of a sudden the magnetometer stopped working completely. I pivoted back to it in an effort to debug it, but nothing worked. I tried to reset the board, I tried to add the code to automatically reset and reinitialize the magnetometer if I hadn’t heard from it for a while, but no matter what I tried it would stay dead when the battery was plugged in.
When I would unplug the battery and plug the USB back in, the magnetometer would recover and work just like it had before. So right away I have to start thinking about what the 3.3V line which powers the magnetometer looks like under USB vs battery.
A Qwiic connector gives me easy access to the 3.3V bus. Here you can see it’s reading a pretty steady 3.3V
Under battery it similarly reads about 3.3V, and the reading on the multimeter is steady
So does that mean it’s not an issue with the 3.3V bus? Well, not exactly. The multimeter is going to give you a bulk reading, but it’s possible that the line is noisy even though the average reading is 3.3V. The way we get to 3.3V from the initial 5V/8V is through a SY8113IADC voltage regulator. This is a modern switching regulator which is very efficient, but it achieves that efficiency by, you guessed it, rapidly switching the input supply on and off to effectively drop it down to the desired voltage (as opposed to the older kind of regulator which would just dissipate the energy as heat).
This switching causes ripples in the voltage line, and if we hook up an oscilloscope to the line we should be able to see these ripples in detail.
This means the 3.3V line ranges from 3.14V to 3.7V. The BMM150 magnetometer is rated for up to 3.6V.
This means the 3.3V line ranges from 2.74V to 4.34V! This must be why the magnetometer simply won’t work on battery power
To get this magnetometer to work on this board, there’s sadly nothing I can really do. At best I could try to solder some tiny wires to the vias on the board near the magnetometer and use those to attach a capacitor between 3.3V and GND as close to the magnetometer as possible but a) it’s likely I’d cause some damage in trying to accomplish this and b) it seems like it would be a very fragile solution.
Fortunately since I had a Qwiic connector on the board, I was able to purchase a magnetometer with a Qwiic interface and attach it. I lose out a little bit since the BMM150 on the board directly interfaces with the BMI270 IMU and synchronizes its readings with the gyroscope/accelerometer readings, but this isn’t critical for what I’m trying to do.
So we can’t exactly fix this, but we can take this as an opportunity to see how a decoupling capacitor cleans up a noisy power signal. The general idea with a decoupling capacitor is that it absorbs high frequency noise in the power line. Take another look at the pictures of the ripples above and notice the “M: 20ns” in the top left corner. This signifies that each vertical dotted line is 20ns apart, so the ripple you see has a frequency of something like 50MHz. This is the sort of noise that a small capacitor right next to the voltage and ground pins of an IC like the BMM150 is supposed to handle, if you put one into your design of course 😅.
I think the most instructive thing is to see in real time how a signal gets cleaned up when you add a decoupling capacitor.
I guess I can’t be sure that the lack of a decoupling capacitor is what kills the BMM150 when I go to battery power. After reviewing my schematic, I noticed I don’t have a decoupling cap for the BMI270, and that seems to work fine, despite also being rated up to 3.6V. That said it’s very clear from this experience that it’s good practice to add decoupling capacitors to all ICs on a board. One of the main reasons I’ve undertaken this project is to learn more about the world of PCBs and embedded engineering and so even though this was frustrating in the moment, it’s exactly the kind of mistake I was hoping to run into. I’ve definitely learned something from this experience and I hope you have as well!
No posts