The Truth of Ringing and Impedance Matching - Page 1
Forum section: electronics / projects

author: Oleenick
author_rank: Contributor
timestamp: July 14, 2021, 02:31:36 am
content: Hi all,I've been doing quite a bit of research into ringing and what it's causes are, specifically with the example of a square wave.Recently I was working on a lighting project with WS2812B's (how unique), and started having real signal integrity issues with ringing over long data-line distances in the final product (high inductance?).In the attached image the pink trace is a raw 3V3 signal output from an ESP8266, the blue is after the 5V output signal from a 74HC125N buffer, and the yellow one is after the buffer through a 390 Ohm resistor. The pink trace has a lot of ringing, the blue trace has similar ringing, when the 390 Ohm resistor is added, it disappears.This is all probed with short ground loops on a prototype with no long data-lines.In the final product I ended up having to add more resistors throughout the data-lines to reduce ringing along the way, which worked perfectly and solved my problem. I just want to understand a little more of why that worked.I think I practically understand why a resistor eliminates the ringing. My understanding is that it limits the rise time, and thus reduces the high frequency content given the general rule of Fknee = 0.5/Trise (https://youtu.be/MJpDFnRQw8s?t=216). I understand that the fundamental frequency has less to do with this ringing when compared to Fknee, but that concept is merely a practical estimate, not the real mechanism. I did experiment with FFT and found that most situations are covered by the Fknee rule-of-thumb, so now I understand where the high frequency content comes from.What I don't understand yet is why the high frequencies cause ringing.I read on Wikipedia " happens when an electrical pulse causes the parasitic capacitances and inductances in the circuit to resonate at their characteristic frequency".https://en.wikipedia.org/wiki/Ringing_(signal)This seems to be congruent with my long data-lines which I'm certain would have a lot of parasitic inductance and capacitance. So as the rise time increases, the practical Fknee increases, changing the line impedance with higher inductive and capacitive reactance? But when they say that this causes the LC components to resonate, how is that frequency calculated, and is the resonance what I see as ringing?Then comes the other definition that I see all the time, impedance matching. I mostly understand the reasons for matching impedance in source, line, and load; but I don't know how that is achievable in this situation.How do I find the source impedance of my ESP8266 and 5V Buffer?How do I find the distributed impedance of my transmission line?How do I find the impedance of my load (WS2812B LED Data-IN)?I've seen people describe ringing by saying its a reflection from an impedance mismatch, but I haven't been able to experimentally recreate this type of ringing with just an impedance mismatch between my function gen and scope. I would think an impedance mismatch would show more signal distortion given the theory of superposition of reflected waves.Then I found this article:https://www.nwengineeringllc.com/article/why-impedance-matching-is-important-in-a-transmission-line.php"Many designers state that transmission lines should be impedance matched to the source and driver because removing reflections prevents transient ringing. Nothing could be more incorrect. The transient response in a transmission line is not caused by signal reflection, it is caused by a sudden change in the signal level in any circuit,regardless of impedance matching."At this point, I'm confused. Some say its due to impedance mismatch like Jack Ganssle but this article says its not about the impedance mismatch at all?Who am I to believe here? And which parts of all this are truly the cause of this ringing I'm seeing?Apologies for the very long and probably incohesive post. As you can tell I have just enough knowledge to be dangerous, but enough curiosity to keep digging deeper.Any help with what the actual cause of ringing is, will be very much appreciated.

author: TimNJ
author_rank: Super Contributor
timestamp: July 14, 2021, 04:01:53 am
content: I can't give much insight from a physics perspective, but if you understand Bode plots and Fourier, you can at least understand ringing analytically.1. Combination of L and C gives rise to resonant peaks (at certain frequencies) in the Bode plot (AC response) of a network. When these peaks have magnitudes greater than 0dB, this implies that the LC resonance causes some amount of voltage or current "gain" at certain frequencies.2. If you inject a stimulus waveform into the network that has frequency content that matches the resonant peaks on the Bode plots, the circuit oscillates at the resonant peak. The resonant peak must be above 0dB for oscillation to occur. In a circuit with no resistive losses, this oscillation never dies out. In a real circuit with resistance, the oscillation is damped out after some time. Oscillation which is damped out after some time is usually called *ringing*.By intentionally adding resistance to a circuit, you lower the "Q" of the resonant circuit...which basically means you flatten out the sharpness of the resonant peaks. The lower the Q (higher the resistance), the more mound-like they become. In your case, adding series resistance (in series with parasitic inductance) squashes out the effect of the inductance, and you are mainly left with an RC circuit. Increase the value of R too much and now you've lost your fast switching edge, and you may not be able to meet the signaling requirements of a high speed protocol.I ran a quick simulation in the frequency and time domains. In the time domain, the base switching frequency of the square wave is a fraction of the the 3.1MHz resonant peak. But, it still has frequency content up at 3.1MHz. See how the resonant peaks in the frequency domain relate to the ringing in the time domain.

author: Oleenick
author_rank: Contributor
timestamp: July 14, 2021, 04:42:35 am
content: Wow! This is exactly what I needed.So in this case, it would be best practice to flatten the frequency response as much as possible? I can see that 390 Ohms is probably overkill but it works in my system given the sluggish maximum rise time spec of WS2812's.I've done some preliminary research into Q factor, thank you for pointing that out to me!Am I correct in saying that the resonant peaks in the frequency domain represent where the stored power is greater than the dissipated power?Given Q = Pstored/Pdissipated when Pstored > Pdissipated, Q > 1 giving a resonant peak.Is Pdissipated, the power dissipated in the resistive element? And Pstored what is stored via the capacitive and inductive reactance components?If so, does that mean I should aim to increase Pdissipated by increasing the resistance, and thus making Q approach 0 until I only get diminishing returns?How would you describe the 33Ohm bode plot's shape? I suppose negative Q can't be possible, so would that be such a high resistance that it is a low-pass filter? Where 3dB point is at F = 2piRC?I somewhat understand what you mean by:Quote from: TimNJ on July 14, 2021, 04:01:53 amBut how exactly is the inductive part reduced? I'm thinking XL increases given XL = 2pifL, and as XL increases its effect on the circuit decreases?Thank you once again, this is really starting to make sense now. And what program are you using for that simulation, LTSpice?

author: RoGeorge
author_rank: Super Contributor
timestamp: July 14, 2021, 06:05:13 am
content: Quote from: Oleenick on July 14, 2021, 02:31:36 amIt all depends. First, how you prefer to explain it, in time domain, or in frequency domain, or maybe in terms of electromagnetic fields? Any of these explanations are equivalent, they are the same explanation about the same thing, just that they are using different viewpoints.Then, there is more than one phenomena at play, so how deep do you want to go into the rabbit hole? Eventually you'll need to switch from electronics to Maxwell's equations, and to switch from thinking in terms of lumped circuits to thinking in terms of fields and rotors, and divergence, and alike.- If you just want to tame those ringing WS2812 signals, just put a series resistor.- Impedance matching is a must when one must transfer the most possiblepowerfrom a source to a load.- Impedance matching affects ringing, too, but that's rather a side effect, IMO.- Ringing can happen on other circuits, too, it is not something specific to transmission lines only.- Explaining in terms of impedance and frequency domain might be easier, but once we switch from time domain to frequency domain, other concepts like time and causality are lost, so again, it depends what you are after.If you have more time to put into it, maybe watch these lectures first:Time Domain Transmission Lines, by Prof. Greg Durginhttps://www.youtube.com/playlist?list=PLULkq8AIoZ7zDTvbaWW9RvXR8Ngnpe0s8I'll prefer to start with the time domain (as opposed to thinking in terms of impedance and resonance and frequency response, etc.) because this is the most intuitive way, IMO. His classes helped me a lot about getting a better grasp of what's happening in a transmission line. See if you find that useful, as a first step into the rabbit hole.

author: jonpaul
author_rank: Super Contributor
timestamp: July 14, 2021, 06:26:26 am
content: Hello all, we work on broadcast and digital audio with signal rates to 25 MHz.We tested many cables bal and unbal with legnths up to 100m.Zmatch is Classic network theory, no mystery, all was done at bell Labs in 1920s..1930s.A transmission line has distributed L and C, measured in nH and pF per ft or per m.Suggest to read a few text books. ARRL has a lot on this subject.If Zout = Zo xmission line = Zload, there is HF atten but no ring.Most coax is 75 or 50 ohm.Most twisted pairs are 100-150 ohm.Check the mfg specifications of the cables used, for the lengths required, and the RS-485 standards for typical termination vlaues.CAT5 or 6 UTP and TP is 110 Ohm Zo average.Bon chance,Jon

author: AndyC_772
author_rank: Super Contributor
timestamp: July 14, 2021, 07:42:45 am
content: Quote from: Oleenick on July 14, 2021, 02:31:36 amhttps://cawteengineering.com/design-focus-high-speed-digital-design-and-termination/

author: tggzzz
author_rank: Super Contributor
timestamp: July 14, 2021, 09:44:53 am
content: The OP would help everybody if they stated the "ringing" frequency and the length of the line. The clock frequency/period is, of course,completelyirrelevant.There are many tutorials available on transmission lines, especially in application notes from digital IC manufacturers.For many rules of thumb related to high speed signals, seehttps://www.edn.com/bogatins-rules-of-thumb/

author: David Hess
author_rank: Super Contributor
timestamp: July 14, 2021, 07:06:01 pm
content: Most test instruments will not show it because of limited bandwidth, but the ringing, including the exponential RC curve when source termination with a series resistance is used, is composed of steps from the energy reflecting back and forth through the unterminated transmission line. A high bandwidth sampling oscilloscope will show the individual steps.If the transmission line were infinitely long, or properly terminated, then it would appear as a resistive broadband load of its characteristic impedance forming a voltage divider with the source resistance. With a large source series termination, a short unterminated transmission line appears capacitive with so many picofarads per foot and forms a single pole low pass filter which is what is commonly seen unless you have fast enough test instruments to show the steps making up the exponential curve.If you have a Tektronix mainframe oscilloscope you can see what happens by using its vertical output which is source terminated with 950 ohms. When this is connected directly to the 50 ohm input on another oscilloscope, full bandwidth is provided with an attenuation of 20x, but when this is connected to a 1 megohm input of another oscilloscope, there is no attenuation, but the bandwidth is limited to the time constant produced by 950 ohms and the total capacitance of the cable. The distributed capacitance of the cable is cancelled by the distributed inductance of the cable, but the reflections result in the same waveform as if the cable was acting as a capacitor.

author: TimNJ
author_rank: Super Contributor
timestamp: July 14, 2021, 07:36:58 pm
content: Quote from: Oleenick on July 14, 2021, 04:42:35 amThe term you may want to google is "critically damped". It means that the overshoot and ringing is removed, but the switching edge is not significantly rounded-off or slowed down. It is the happy medium. In the frequency domain, the 33-ohm case basically represents a critically damped network. It's the point at which the spikes are flattened to 0dB, but the effective bandwidth of the network is not reduced uncessarily.I'm wasn't trying to say that the inductive part goes away. It's still there, but if you increase R such that R >> X(L), then you might say that the circuit is less of an LC circuit and more of a RC circuit. It's just a way to think about it. You basically said it.And yes, LTSPICE.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 14, 2021, 07:39:58 pm
content: Quote from: David Hess on July 14, 2021, 07:06:01 pmYep, though this will probably just add confusion unless the transmission line behavior in time domain is already understood.However, in that playlist about transmission lines recommended a few post ago, one of the problems to solve was if a capacitor charges/discharges continuously, or in stairs!Well, it's in stairs, and not the smooth exponential curve we know from the ideal lumped capacitor.rhbmade some beautiful screen captures with a Tektronix 11801 and a 20 GHz SD-24 sampling head, captures illustrating the stairs:https://www.eevblog.com/forum/chat/does-a-capacitor-charges-smooth-or-in-stairs/msg3093058/#msg3093058https://www.eevblog.com/forum/chat/does-a-capacitor-charges-smooth-or-in-stairs/msg3093173/#msg3093173

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 14, 2021, 08:52:21 pm
content: This is up in the domain of spooky action, so beware everything about your circuit and probing -- the scope's step response may not be great (I don't know offhand which scope that is, and how fast and clean its response is). The probe might not, either.Circuit grounding is paramount! Build on solid ground plane, and make very good grounds to everything you're connecting to. One wire is not enough! Ribbon cables for instance, do anokayjob with every other wire grounded. PCB traces should run over, or adjacent to, ground, and make sure the ground isn't being cut up by other traces running within the same layer (add stitching vias around traces to ensure good ground connectivity). For breadboarding, working on copper clad (Manhattan or deadbug style, or carve it up by hand even) is best; solderless breadboards are difficult to get good grounds on, making the equivalent circuit far more complex (you have to understand the ground loop exactly as much as the signal, trouble is, grounds are going everywhere, good luck with that).And you need good supplies. VCC and GND act together, at AC, or, they very much are supposed to at least. A reactive supply will show ringing when switching to it; this can explain asymmetrical responses. The solution is bypass caps, near the power pins for the respective signal pins.Scope probes have a frequency response, which is why they're rated by frequency, and need to be matched to the scope (same bandwidth is preferable). The ground clip and tip make an inductive loop, which acts in series with the signal, and the probe's capacitance and resistance. As seen from the circuit being probed, at high frequencies, the probe itself looks something like 500 ohms in series with 10-20pF. (And 10Mohms to GND, but that's only sensible down in the DC-kHz range; at high frequencies, tip and cable ESR dominate.) That inductive loop amounts to, on the order of 0.2uH. And let's say it's a 100MHz probe. Which means, just from this guess, we can immediately expect the inductive reactance is 2*pi*(100MHz)*(0.2uH) = 130 ohms at rated frequency. Which is less than the expected resistance, so we expect the Q should be low, and the frequency response fairly flat (but beginning to peak or droop here, and by 300MHz+ say, it should be dropping off).Likewise, 10pF is 1 / (2*pi*(100MHz)*(10pF)) = 160 ohms, a similar value; so we should expect the resistance to dominate at this frequency.As noted by others -- there's an RLC equivalent circuit in play here, and its response depends on the relative value of reactance and resistance at any given frequency. Zo = sqrt(L/C) and Fo = 1 / (2 pi sqrt(L C)) are the important relationships to mind here.Note that, because the ground clip has inductance, some of the signal you're probing, drops across the clip, and thus creates a ground loop signal between circuit ground and scope ground. And vice versa, ambient interference (or other common-mode sources) through the same path, will drop voltage across the ground clip, adding some of that source to your measurement.A consequence is, by probing a fairly fast signal, you may see reflections from the probe cable itself -- that is, ringing on the order of its physical length.Which, for a typically 1m or so cable, at 0.3 m/ns (speed of light, give or take -- it'll be a bit lower in practice, though not by a whole lot because the cable is mostly surrounded by air), or 3.3 ns/m, and the round-trip reflection is twice that, or ~6.7ns.This probably isn't what you're measuring, as it looks that your ringing is a bit slower. Or your probe is much longer (~2m?). But also, because the reflected signal is tapped off (and then back in again) by the ground clip in this scenario, its amplitude should be only a fraction of the total -- you seem to have more ringing than this, which lends more credence to it being something about the circuit, that isn't obvious from the description so far. (Send layout pictures?)Faster probes are made smaller, with shorter ground clips, to reduce these reactances. The probe is generally made to peak the frequency response a bit (i.e. give a little boost to frequencies near cutoff), which usually helps to extend the scope's own bandwidth a bit (at least, when it has a well-behaved response). So they should be matched, the probe and scope bandwidths. Not all probes are equal!Some resources:Linear Tech AN-47, specifically Appendix A (p.69):https://www.analog.com/media/en/technical-documentation/application-notes/an47fa.pdfthe full version of which is here:https://www.mouser.com/pdfDocs/abcs-of-probes.pdfAnd check out low-Z probes and how to use them. With everything on common ground plane (including shielded connector(s)), a resistor of 9*Zo from trace to connector, gives a 10x probe gain, with only modest loading on the circuit (in particular, it's resistive, not very reactive). (This is also called an L-pad, or impedance matching attenuator.) The connector needs to be close by the probed signal, to avoid stubs (the resistor leads are ultimately sections of transmission line, with impedance lower than the 450 ohms or whatever the whole resistor is supposed to be -- keep them short!).The best concept to understand -- as long as you can make assumptions about stable grounds, or good shielding -- hence use lots of solid ground planes -- is signal ports. RF port theory or whatever. A port is simply a point in a circuit, which has signals flowing back and forth through it. Note, rather than just measuring instantaneous voltage or current, we consider the waves flowing in both directions through this point. This seems like more work, and well it kind of is, but by defining the magnitude and phase of those waves, we can describe the circuit in a relatively simple way, without loss of generality.Typically, the point is in the middle of a transmission line, so that its impedance is well defined. (A cable is a 2-port network, the network being a reasonably ideal propagation delay, at the characteristic impedance.)Another property of the port, is being an ideal two-terminal device, isolated from anything; we may or may not make use of this depending on what we're doing. For example, if all ports are referenced to ground (as in a ground-plane circuit), it doesn't matter, common mode is defined as zero either way. This is important in some models, like SPICE transmission lines are the ideal kind -- a real transmission line of course has wire between its ports, so has some common mode impedance; the ideal case is infinity (isolation). We can approximate an isolated (floating) port, by raising the common mode impedance with an isolation transformer, or by adding common mode chokes to a transmission line. I won't go into more detail on this here; just to say that a complete description is a bit more than a point above a common ground, but it often reduces to that case in practice.Tim

author: EPAIII
author_rank: Super Contributor
timestamp: July 15, 2021, 03:55:14 am
content: I think one point that you need to realize is that real world components; resistors, capacitors, inductors, and transmission lines (every conductor IS a transmission line); are not simple, one value items. A resistor also has capacitance and inductance. A capacitor also has resistance and inductance. An inductor also has resistance and capacitance. And a transmission line has all three of these characteristics.And it is worse than that. The values of each of these components for each real world part can, WILL, and DO change with frequency. An inductor may have a very low capacitance value at 10 kHz but at 1 gHz it can effectively become a capacitor with a capacitance value much greater than it's inductance. And have you ever heard of a "wire wound" resistor? Guess what happens there at higher frequencies.According to Fourier analysis, a square wave IS a superposition of an infinite number of sine waves. So a 1 kHz square wave has a fundamental frequency (a sine wave) of one kHz. But then it has ALL the odd harmonics (again sine waves) of that fundamental frequency. What this means 3 kHz, 5 kHz, 7 kHz, 9 kHz, etc. sine waves are also present in that ONE square wave. This is not some obscure, mathematical point: ALL of them are really and truly there. And each one of them will react in it's own way, have it's own frequency response to a given circuit. The frequencies that comprise the ringing are ALREADY present in a square wave.If you want a simplistic analysis of a circuit, then you should, at the very least, start with ONE frequency. That means a SINE wave, not a square wave. Then, one by one, add the harmonics that are present. This may be tedious, but it will handle almost any circuit analysis when a sufficient number of harmonics are analyzed and added into the final result.When you add to that idea the idea I presented above that real world components have all of these various characteristics which can actually have different values at different frequencies, it is no wonder that funny things (ringing) can happen when you combine a source circuit, a transmission line, and a load circuit.The biggest saving grace here is that the infinite number of harmonics will have decreasing amplitudes as their frequencies increase. So the 5th harmonic will be a lot lower in amplitude than the fundamental frequency. And the 7th harmonic will be lower yet, etc. The higher you go in frequency the smaller each harmonic will be as compared to the fundamental and, therefore the smaller will their effect on the final waveform be.Stating it in the simplest language that I can, what we call ringing is simply a combination of the circuit elements' characteristics (R, C, and L) that happen to combine to accentuate the harmonic frequency components which are already present in any square wave through resonance or near resonance. These harmonic frequency components are simply following the frequency response curve of the overall circuit.If you look into the idea of the Q of a resonate circuit you will find that adding resistance to such a circuit will decrease the peak gain and increase the (-3 db) bandwidth. So the ringing, which is simply the following of that frequency response, will have a decreased amplitude. The ringer (pardon the unintended pun) here is that such added resistance usually can not be made to act only on the frequencies near that resonant peak. That added resistance will have an effect on all frequencies, including the fundamental.Generally we only need to concern ourselves with the first few harmonics. Most of the circuit design methods, no matter how mathematically complex they may be, will take advantage of this idea.Now, with respect to the idea of matching the source, line, and load impedance, someone said that the elimination or minimizing of ringing via that impedance matching is only a minor or side effect. While it is true that this impedance matching is a result of solving for maximum transfer of power in any circuit involving a source and a load, the elimination of ringing does go hand-in-glove with that maximization of power transfer. The simplest and most often used solution to this calculation is where the impedance values involved are all strictly resistive. In other words, a solution where no inductive or capacitive components are present. You can see this with the often quoted impedance values of 50 or 75 or 600 Ohms. There are NO imaginary terms, which would represent capacitive or inductive components, in these values (50 + 10i or 75 - 14i). Signal sources are optimized to be purely resistive. Transmission lines are physically constructed so that the capacitive and inductive components cancel and what remains is a simple resistance value. Loads are often built with a resistor to ground followed by a very high impedance amplifier input, which is negligible. And whenever possible, these purely resistive impedance values are maintained for the full bandwidth needed, if not much wider.What this means is that, with only resistive values that need to be taken into account, the generally used, maximum power transfer transmission line WILL, OF NECESSITY have no resonance areas in the operational bandwidth and this eliminates any chance of ringing.With a career in TV engineering I have seen this in action with the transfer of power levels of tens of kWs at VHF and UHF frequencies. Any irregularities in the impedance match anywhere from the high power amplifiers to the antenna would result in not just ringing, but hot spots in the transmission lines, those high power amplifiers, and/or in the antenna. That translates to extreme heat, high power shorts, and melted copper or other elements. That ringing can have real energy in it. VSWR meters were permanently installed in the transmission lines and read regularly and I spent many an hour on a ladder, running my hands over large diameter coaxial lines looking for hot spots.

author: Oleenick
author_rank: Contributor
timestamp: July 15, 2021, 04:06:05 am
content: Thank you all for your replies, each one has been truly insightful in its own right.Quote from: T3sl4co1l on July 14, 2021, 08:52:21 pmGood guess! I'm using 100MHz probes with a SDS1104X-E.I'm pretty certain now that the ringing effect that I am observing is from a combination of bad probing (I did not doubt that from the beginning) as well as a circuit with high parasitic inductance and capacitance thanks to the breadboard. You can find a picture attached of the monstrosity of a probing mess that I was working with here. My intention with this thread was to get to the root cause of ringing, not good probing technique, which I recognised this is certainly not an example of. Probing technique is still critical and thank you for all the probing tips.EDIT: Forgot to attach image...

author: Oleenick
author_rank: Contributor
timestamp: July 15, 2021, 04:19:39 am
content: Quote from: EPAIII on July 15, 2021, 03:55:14 amAh what a beautiful explanation!I've recently watched Dave's Mysteries of the X1 probe and so this makes sense from that context also.That makes sense that there cannot be any ringing at a given frequency if there are no (or very insignificant) parasitic LC elements, which is the goal of transmission line matching.The insight that I was missing before was that the capacitive reactance formula is not just Xc = 1/(2pi*fC), but in the complex domain is actually Z_C = -j/(2pi*fC).So is this how we are able to cancel the positive imaginary impedance caused by inductive reactance Z_L = j*2pi*fL ?Thank you all!

author: gcewing
author_rank: Regular Contributor
timestamp: July 15, 2021, 07:35:52 am
content: Quote from: Oleenick on July 15, 2021, 04:19:39 amYes!

author: tggzzz
author_rank: Super Contributor
timestamp: July 15, 2021, 08:54:07 am
content: Quote from: Oleenick on July 15, 2021, 04:06:05 amI was mislead by your first post, which stated "This is all probed with short ground loops on a prototype with no long data-lines."Rule of thumb: with solderless bread boards you will spend more time debugging the board than your design. Manhattan techniques are much betterhttps://entertaininghacks.wordpress.com/2020/07/22/prototyping-circuits-easy-cheap-fast-reliable-techniques/Realise that even with everything else perfect, your probe will "oscillate" at ~100MHz.https://entertaininghacks.wordpress.com/2015/04/23/scope-probe-accessory-improves-signal-fidelity/

author: Oleenick
author_rank: Contributor
timestamp: July 15, 2021, 09:38:35 am
content: Quote from: tggzzz on July 15, 2021, 08:54:07 amYou're absolutely right, in hindsight what I considered to be small ground loops are gigantic at high frequencies.That's a really cool probe mod as well, but yes as you mentioned if I need to do any high-fidelity measurements I should really not be using a breadboard.Afterall...

author: tggzzz
author_rank: Super Contributor
timestamp: July 15, 2021, 11:44:06 am
content: Quote from: Oleenick on July 15, 2021, 09:38:35 amI learned the effect of the ground probe the hard way mumble decades agoAs I taught my daughter, "let's make new mistakes"He used new decent solderless breadboards. Then add in all the problems that arise with use/age and random stray inductance and capacitance, and you are lucky to get anything working at all!IMNSHO they are usually a waste of time, especially when better cheaper breadboard techniques are available.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 15, 2021, 03:40:37 pm
content: Quote from: Oleenick on July 15, 2021, 04:06:05 amAh yes, all those jumper wires flying through the air, no ground plane in sight -- that'll do it.Probably the jumpers are the inductance, and the capacitance is the parallel combination of probes, IC input pin and breadboard (about 4pF between adjacent positions, which shouldn't mean much to the right of that input pin, but the other IC pins will couple in, maybe doing little, maybe acting to AC-ground it -- is the neighboring pin an input or output?).The ground bounce doesn't seem to be terrible, but I would guess that's the residual wiggle on the yellow trace for example. Similarly there's trash on the purple trace, which is probably a combination of supply bounce (no bypass cap in sight!) and that.Quote from: Oleenick on July 15, 2021, 09:38:35 amIndeed, as a general rule, dimension scale is proportional to frequency -- that proportion being the speed of light, of course. So you can quickly check whether something is significant or not, based on that.There's also a significance factor due to impedance mismatch; if a random wire through space is in the 100-200 ohm range (as a shitty transmission line), but you hook it into a circuit with 10 ohm impedances (like would be found in a switching power supply), its length is effectively 10-20 times more significant. A converter with 20ns switching edges (again, it's the harmonics that matter; the switching frequency itself might be only a few 100 kHz), has harmonics up to 40MHz (and dropping sharply above there... hopefully). With circuit impedances around 10 ohms, that 40MHz harmonic is significant for wire lengths of say 7cm.Which means it might be practical to breadboard such a circuit, for example (and indeed I've certainly done so). Note that 10 ohms switching impedance, corresponds to, say, a supply of 10V and peak current 1A, so, maybe 5-10W total converter output. Note it's the impedance that matters; if you don't mind running upwards of 50V and 5A on your breadboard, you could easily do the same at 250W.Quote from: EPAIII on July 15, 2021, 03:55:14 amThis is correct, the only thing I would add is to soften it a bit -- it's not so much physically correct, as mathematically equivalent.So, given a signal, we can represent it however we like. A transform is an alternative, equivalent representation, given a few minor restrictions (e.g., the Fourier transform doesn't perfectly reproduce discontinuous waves like the ideal square or sawtooth wave (Gibbs phenomenon)).There's also the Laplace transform, a kinda simplified version of Fourier most often used for lumped element (RLC circuit) analysis; or the Hilbert transform, effectively measuring the signal's amplitude and phase with respect to time; etc.The reason why Fourier and Laplace are so important to electronics, is because we have so many linear time-invariant (LTI) systems (like lumped element RLC networks, or transmission lines or other structures that can be reasonably approximated as such) which are far, far easier to model in the frequency domain.Whereas we need to solve differential equations in the time domain (for which we'll likely give up on the exact solutions, and plug everything into a numerical simulator like SPICE instead!), we only need to solve rational polynomials in the frequency domain.Or to pass a signal through a filter, we need the diff eq solution again, or a convolution (the filter's response is separable in the time domain, but this more complex operation is required to apply it to a signal); whereas in the frequency domain it's simply multiplying the two together.What is a signal, anyway? It's a variable as a function of time. It might be just the voltage on a point, or current through a wire, or other things. Generalizes to mechanical and other systems too, position is a signal; pressure is a signal; etc.An important fact about real signals is, they are, well, real valued; and band limited, and bounded -- not just for level, but all derivatives exist and are also bounded.So a mathematical square wave, with perfectly discontinuous edges, cannot physically exist, and the harmonics will drop off at some point (say with an exponential cutoff).This is basically why, no matter how sharp your square wave is, you'll never see light (~300THz) emitted from it...(There's not really any physical process by which to make a signal, that travels in a wire somehow, that also changes that fast. It can be done with optics however!)Tim

author: RoGeorge
author_rank: Super Contributor
timestamp: July 15, 2021, 05:08:01 pm
content: Quote from: T3sl4co1l on July 15, 2021, 03:40:37 pm@EPAIIIExactly that.T3sl4co1l's observation that those sinusoidal components are not really there is an important and correct one. At some point I was convinced, too, just like you are now, that those harmonics predicted by Fourier are really there, but then I changed my mind. All kind of contradiction arises if it were for those harmonics to exist for real.Then, I found "The Wavelet Tutorial" by Polikar, which tries to build an understanding about what a transform is in general, what the Fourier transform is/does, then finally he shows how instead of those constant and sinusoidal harmonics, one can use other kernel functions than sin and cos to represent the same original signal, and he teaches how the same signal can be decomposed, for example, using wavelet functions instead of sinusoids, and how this different type of transform (the Wavelet Transform) comes with its different set of advantages than the Fourier Transform set of advantages.If you have time, see the links from this post, and parse the classes, it was worth it:https://www.eevblog.com/forum/chat/fun-for-nerds/msg3554257/#msg3554257

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 15, 2021, 07:22:56 pm
content: You could even put it in a, I guess more cynical way, and say that the Fourier transform is just a fiction -- if a useful one.* A true sine wave exists for all time,negative and positive, so is obviously nonphysical. True also of the DC term, which you similarly need forever to measure exactly.But we're not screwed. We can take FTs of real (causational) signals too. Signals of finite duration, with zero value for negative times, merely have the effect of phase-shifting and broadening the spectrum. Instead of perfect spectral lines, they have finite width, that width depending on the duration of measurement.Which indeed flows neatly into a study of wavelets. If you consider sinusoidal waveforms with finite width windows, you're done -- and the shape of that window describes the shape of the spectrum.There are some special types of windows, like the Gaussian window e^(-t^2), which is self-identical -- that is, its FT is also a Gaussian, give or take width and height. Such a function is called an eigenfunction: it's the same before and after the transform. (These are not difficult to find, in part because the Fourier transform is self-inverse: ℱ{ℱ{f(t)}} = f(t). For example, you can take any function plus its transform, and the transform equals the sum of its transform plus the function, again give or take width and height.)So, this property is... rather abstract (though it makes a lot of sense when you see the pairs plotted, and play with their parameters -- check out some plotting/calculator/solver websites to see this), but it generalizes to the fact that, the more precisely defined a spectrum is (narrower line width), the more loosely defined its corresponding time event is (longer, softer wavelet).And this is true of any system that an FT is useful on. Not just EM waves, but gravity waves (ripples on a pond), even matter waves (e.g. electrons in a crystal). In fact, applied to matter waves specifically, it has a special name: the Heisenberg Uncertainty Principle. But it's not so special after all, it's just a fact of Fourier analysis. So, now you know something about quantum mechanics. How about that?*This really isn't a very interesting or deep statement, by the way; the same is true of pretty much the entirety of mathematics, not just a handy transform. Math is abstract after all, and exists as a set of concepts, independent of the physical world; we just happen to find it manifestly useful to describe our observations of it.Tim

author: 2N3055
author_rank: Super Contributor
timestamp: July 15, 2021, 07:31:44 pm
content: Quote from: T3sl4co1l on July 15, 2021, 03:40:37 pmHahahaha Tim, that is precious....

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 15, 2021, 08:02:12 pm
content: Quote from: 2N3055 on July 15, 2021, 07:31:44 pmI will admit to wondering about that, ever so many years ago... on a similar level to this, which some may have wondered about once upon a time:("Unlimited power!")The exact details are of course a bit hard to convey and understand, so a lot of introductory materials may say the square's harmonics go as 1/N and leave it at that. Which implies a nonzero amount up there, like maybe it's just a few photons so you can't really see it. But there are, in fact, several reasons why not.Tim

author: TimNJ
author_rank: Super Contributor
timestamp: July 15, 2021, 08:07:36 pm
content: I would say that it's not even cynical, just the reality. The Fourier transformer is just a convenient way to make an arbitrary signal fit within the confines of the sine-wave-based mathematics most of us are familiar with. And, then if you go down the rabbit-hole further, you realize that in a different world, we could have taken some other arbitrary signal (not a sine wave) as the basis of all of our math, and that the Fourier transform could've been with respect to a triangle wave in some alternate universe. But, as Tim notes above about eigenfunctions, there are some nice properties of the sine waves that basically boil down to: If you apply a linear operation to a sine-wave function, the resulting function is still a sine wave in shape and form.Alas, that is the extent of my ability to talk about math.And, a square wave is notreallya sum of sine waves...If you pick up a pencil and draw a square wave, you move your pencil directly to the right, then directly up, then directly to the right, down, and so forth. Not once do you have to think about an infinite sum of sine waves. Just connect the dots!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 15, 2021, 08:13:30 pm
content: But... if you really wanted to, you could.

author: TimNJ
author_rank: Super Contributor
timestamp: July 15, 2021, 08:55:08 pm
content: Sure if you have infinite compasses and infinite hands!

author: TimFox
author_rank: Super Contributor
timestamp: July 15, 2021, 09:07:48 pm
content: Another way of treating the Fourier series for a square wave, an infinite series of odd-order sine waves, is to consider de-constructing a square wave with an ensemble of narrow-band filters tuned to each of the odd harmonics, and you will find that each of the harmonics is there, at the appropriate amplitude. That's the difference between analysis and synthesis.By the way, R N Bracewell's well-known textbook "The Fourier Transform & Its Applications" on the Fourier transform has an appendix on the life of Jean-Baptiste Joseph Fourier, who invented the Fourier series to solve problems of heat distribution in solids. (It was generalized by others to produce the transform.) Apparently, M. Fourier became obsessed with heat and overheated his rooms, while wearing excessively heavy clothing, to the distress of visitors to his home.Before I retired, I found that younger engineers thought that the Fourier transform was spelled with a double-F, because they only said "FFT". When I started grad school, the re-discovery of the FFT by Cooley and Tukey was considered to be modern mathematics. F S Acton's 1970 book "Numerical Methods that Work" stated categorically that calculating a Fourier transform was never worth the trouble (considering the slow methods to directly calculate a discrete Fourier transform, or DFT), except maybe in spectroscopy. Progress continues.

author: Oleenick
author_rank: Contributor
timestamp: July 15, 2021, 11:58:21 pm
content: Thank you all for your insight! Fantastic learnings all round.I do just have one more question to pose. How would I go about impedance matching a line in my application?How would I find the source impedance?How would I find the distributed line impedance?How would I find the load impedance?My best guess is a VNA to frequency sweep and identify parasitics that way. Or am I missing something else?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 16, 2021, 01:49:22 am
content: That's a pretty "enterprise-grade" solution; it certainly works...For a simpler approach, there's TDR from a step source, assuming you have a fast enough source and scope; the half-step voltage corresponds to the ratio between line and source impedances.Heh, give or take the value of "simple". Capable VNAs are rather affordable these days after all!For an even simpler (and cruder) approach, just wing it. Impedances aren't that crazy, wires in free space ca. 100 ohms when near surfaces (esp. ground) to 200+ ohms. Like, think of 300 ohm twin lead, and that's 300 ohms differential so effectively 150 per wire and they act in series when wired differentially.Impedances on board tend to be lower, you can only get a trace so far away from others, or from ground; and the dielectric loads it down. Though also maybe not too low, as it takes wide trace widths, and low dielectric height, to get low impedances like 50 ohms. On 2-layer boards with ground poured both sides, 70-130 ohms is more typical; on 4-layer boards with thin outer dielectric above inner planes, 50-100 ohms is typical.You can calculate most of these impedances, and get a pretty close value (better than mechanical tolerances will allow, anyway). Standard formulas are approximations, making some assumptions about the ratios of dimensions (which calculator tools don't always make note of, sadly..), so do be mindful of that. Common examples: round wire over plane (typical of chassis wiring, or routing in conduit/raceway/metal framing/etc.), microstrip (flat conductor over plane, with dielectric), stripline (flat conductor surrounded by dielectric, and planes), CPWG (coplanar waveguide with ground: microstrip with top side ground pour).And as long as you have enough bandwidth (between source and scope) to measure the ringing, you can determine if the termination is doing its job or not. If your source doesn't have enough, no problem, that means its harmonics are lower, i.e. the critical length is higher -- fantastic. If your scope doesn't have enough... maybe just put in best practices?As for the rest -- source impedance in the given example, is basically typical of CMOS output pins. Pullup is a bit weaker than pulldown, but the average is around 30-70 ohms. This isn't a bad match (as source termination) as is, and may benefit from some added resistance (at the transmitter pin) when transmission line impedance is known to be higher (e.g. 2 layer board, or free wiring).With typical 30/70% logic input thresholds, you have a fair tolerance on mismatch (i.e., about 30% before any kind of bounce is going to double-tap an input), so controlled-impedance PCBs aren't really a big deal. If you're going for speed and sharpness, being a little under (Zs < Zo) is better; there will be some loss in the PCB, and due to dispersion from input capacitance(s). If you don't need the speed, Zs > Zo is better, as it acts as a partial RC filter, slowing edge rates. (Use this carefully; often, CMOS inputs have a specified maximum input transition rate. Schmitt trigger inputs may be helpful, to provide some noise immunity on slow edges, or to sharpen up the inputs, as a receiver at the end of a cable.)CMOS input pins are typically a few pF, with clamp diodes (either clamping to VDD/VSS, or for "5V tolerant" or "doesn't load bus when unpowered" types, a zener diode from VSS) and not much resistance. So, not too much effect on the transmission line, but they do add up if you have a lot of them (like for big parallel buses).Because CMOS inputs are lightly capacitive, source termination is effective with them. Note that, as the wave is launched down the transmission line, with source termination, first the driven end goes to VDD/2, and that wavefront propagates; it reflects off the end, delivering the full VDD/VSS swing, and this propagates back up to the source, where it's absorbed by the terminator, and then, after two electrical lengths (a round trip), the line is fully charged. So, any inputs midway along the line, see an indeterminate level for between zero (at the end) and (EL*2) (at the source) duration.Which means source termination is best suited to point-to-point connections, so keep that in mind if you need absolute speed.There are real-world consequences of this, like the PCI bus being limited to 66MHz due to the electrical length of the traces on the motherboard, from Southbridge, across expansion slots (including up and back down expansion cards), to the far end. In contrast, PCI-e is point-to-point serial (with a modest impedance driver and a termination resistor at the load, as it happens).Load termination is impractical for general CMOS, due to the wide input range. With specific receivers, it can be effective however. Old school TTL isn't bad with a load termination (the driver does up to 3.5V of swing, though it may be only 1.5-2V under this kind of load -- but the input has a 1.2V indeterminate range, so it's alright), and there are a few receiver chips with well-defined input thresholds (74HC7014 is a particularly neat one), or you can always use comparator arrays, or even LVDS receivers (which are basically comparators as well -- protip).Source-load termination is kinda unavoidable for CMOS -- because of the comparable internal resistance, hence the big voltage drop; it's also not usually rated for continuous load, so YMMV / be careful. Bus drivers, and families with extra output capacity, are available to handle this.LVDS, CML and other low-voltage differential types, are usually shown as a current-sourcing H-bridge, but actually I think they have fairly modest output impedance. In particular, the common mode impedance is fairly well defined, important for keeping CM reflections down on an otherwise completely floating bus (reflections which could easily build to input-CM-range-violating levels if undamped). It's more like, a shitty H-bridge, with current sourcing perhaps, but made with source followers or limited drive voltage or something, so that the current doesn't really stay constant outside of the nominal voltage range. Anyway, I'm just guessing; no one reveals very much about their output structures unfortunately.Oh and ECL, it's kind of like LVDS in voltage swing, but more like TTL in drive level; it's a low impedance source, typically used with load termination. It can be used single-ended, which is easier to implement logically of course; or differentially but if you're going true differential you need to implement complementary logic which seems maybe a waste(?). Can always add a diff receiver of course.Oh, and since load termination absorbs the transmitted wavefront, the waveform is correct at all points along it, no intermediate step like with source termination alone, just pure delay. Same for source-load termination.Tim

author: bson
author_rank: Unknown
timestamp: July 16, 2021, 12:24:54 pm
content: I find it easier to reason around overshoot in the time domain, even though it's a resonant transmission line effect. Basically, when you output a high transition, you pulse a current to charge the downstream input gate(s). This current is limited only by the driver output impedance (single, double digit ohm) and parasitic loop inductance. The loop inductance depends on the area enclosed by the current as it goes out and returns on ground (or a lead). When the capacitor is charged, the inductance is admitting a peak current, which wants to continue. This produces the spike as the loop inductor discharges to continue the gate-charging current. Inserting a damping resistor limits this current.When working with LVCMOS you really only care about the transition time from a little over ground potential to Vdd/2. You don't need sharp edges on a square wave, and it's pretty easy to calculate the damping resistance based on the desired transition time.

author: jonpaul
author_rank: Super Contributor
timestamp: July 16, 2021, 02:51:44 pm
content: Tim suggest to read the original papers of Joseph Fourier, the choice of sinewave was not arbitrary!The Fourier analysis 1807 and fourrier transform (NOT TRANSFORER) of1811 were milestones.Subsequent work at MIT/BTL in 1960s by Cooley-Tukey invented the Fast Fourier Transform in universal use today.Jon

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 16, 2021, 03:16:19 pm
content: Quote from: jonpaul on July 16, 2021, 02:51:44 pmAs an exercise, I once tried it with an easier-to-generate kernel (Hadamard sequence); which I believe gives a spectrum ofsequency? It's kind of right, but it has harmonics and stuff that aren't supposed to be there, and for obvious(?) reasons. And I don't think there's any obvious way to transform it into the Fourier domain, except maybe a convolution or something, which is going to be as much work as the DFT in the first place, so, y'know...Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 16, 2021, 07:38:00 pm
content: Oh yeah I was looking for this doc, couldn't seem find it, has a little more detail on probe design:https://www.eevblog.com/forum/rf-microwave/shunt-capacitance-of-1206-smd-resistors-jeroen-belleman-december-2010/?action=dlattach;attach=1236740Tim

author: EPAIII
author_rank: Super Contributor
timestamp: July 17, 2021, 01:25:04 am
content: I would agree with this affirmation but with the condition that it would always be for some, limited bandwidth. A coaxial cable may have C and L values that work together for some bandwidth, but when the frequency goes beyond that limit, that coaxial cable no longer exhibits the rated impedance.Real world is a bitch.Quote from: gcewing on July 15, 2021, 07:35:52 am

author: Oleenick
author_rank: Contributor
timestamp: July 17, 2021, 01:33:53 am
content: Quote from: bson on July 16, 2021, 12:24:54 pmI'm guessing you're talking about calculating the transition time using T = RC ? If so, how would I find the capacitance of the system?I tried to find the capacitance by going backwards by knowing the time constant upfront from the scope measurement using this technique:That gave me approximately 85pF which sounds reasonable. But how would I go about measuring the capacitance to get the time constant (and then rise time)? Or is there another way?Thank you!EDIT: I swear I don't only watch Keysight videos, just happens to have great resources

author: EPAIII
author_rank: Super Contributor
timestamp: July 17, 2021, 01:43:00 am
content: Thanks for the further insight. I am going to try to find time to look into it.I think it was a Clint Eastwood character (Harry Callahan) who said, "A man needs to know his limitations." I would paraphrase that, "An electronic designer needs to know the limitations of everything he/she is working with." That includes both the parts and the theories used to predict what those parts will do in a circuit. Limitations are everywhere.I only hope we have not confused the OP to the point of giving up on electronics altogether.Quote from: RoGeorge on July 15, 2021, 05:08:01 pm

author: Bud
author_rank: Super Contributor
timestamp: July 17, 2021, 02:28:42 am
content: But you Can synthesize a signal by combining the Fourier components back together. That means they ARE there physically in the signal

author: EPAIII
author_rank: Super Contributor
timestamp: July 17, 2021, 03:04:43 am
content: I think you may be over-thinking this. I looked up the LED controller you want to use:https://www.vipfactoryprice.com/index.php/ws2812b-ws2815-sk6812-sk9822-led-light-controller-k-1000c-computer-programmable-5-24v.html?gclid=EAIaIQobChMIyZaFi4Hp8QIVhorICh3oSgeKEAQYAiABEgIfh_D_BwEAnd according to the scope image in your first post, the square wave involved is about 800 kHz.Other details are missing. What kind of line are you using? How long is it?It has been my experience that with line lengths that are only a fraction of the wavelength, much of the impedance matching and ringing considerations are often not needed. 800 kHz = 0.8 MHz and the wavelength is around (I say around because different types of transmission line will have different transmission speeds) 375 meters. So if your transmission line is only a few meters long, it's characteristic impedance is probably your last concern.The LED controller uses some kind of screw terminals for connections. They also are not normally specified for things like characteristic impedance like coaxial and wave guide connections are.Many low frequency lines for signal transmission are not designed with matching impedances in mind. Professional audio equipment often uses a very low impedance source (1 or 2 Ohms) that feeds a twisted pair transmission line which terminates in a high impedance load (10 KOhms). This is a brute force approach to signal transmission, but it works quite well. The low source impedance overcomes any stray signals picked up by the line and the high impedance at the load end of the line allows multiple devices to be connected in parallel. A load resistor can be added at the far end of the line. These types of signal transmission are routinely used with few problems.I do not know what your source impedance is, but I would bet it is under 10 Ohms. A twisted pair's characteristic impedance can vary but is usually between a few tens of Ohms to several hundreds. And I would bet your LED controller has a somewhat high input impedance, probably 10K or more. The web page I cited says they can be wired in parallel. If you wire it and find that you have trouble I would try adding a (JUST ONE) line termination resistor (50 to 1000 Ohms) at the far end of the line. That should help it to work properly.As for actually measuring those impedances, I would say it would be an expensive and time consuming task that would yield no useful information. You talk about using 100 MHz scope probes and you and others here seem to think they may be causing the ringing you are seeing. I do not think so, but a better probe could be made with a length of coaxial cable, a BNC Tee connector, and a BNC termination. The BNC tee would be attached to the scope input and the BNC termination and coaxial cable attached to the other two ports on the Tee. Then the other end of the coaxial cable would be stripped with a minimal length of the center conductor protruding and a minimal pigtail attached to the shield. Use those short conductors to probe your circuit. If you are probing a known low impedance point in the circuit a series termination resistor can be added to the center conductor of the coax and used as your probe. That series resistor, the BNC termination, and the coaxial cable should all have the same impedance. If you are being a complete perfectionist, the BNC connectors and Tee should also be rated for that same characteristic impedance.But frankly, I would just hook it up and try it before going to any more trouble. It will probably just work.The manual for that LED controller should also have useful information. But then, it was probably made in China and the manual is probably very minimal.Quote from: Oleenick on July 15, 2021, 11:58:21 pm

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 17, 2021, 03:27:46 am
content: Quote from: EPAIII on July 17, 2021, 01:25:04 amIt's the jist of it, but the real implementation is a little more complicated, yes.For example, at low frequencies (f << 1/(electrical length)), we can approximate it as an L or C section, or maybe both in series or parallel as the case may be. This gives us our first clue that the idea basically works. But clearly, such a case will have one resonant frequency, and that's it; the transmission line has, well, an ideal one has infinite resonances, though a practical one will fall over at some point (as the TEM gives way to higher order TE and TM modes, and the velocity and impedance go all over the place -- this happens on the order of the electrical width of the transmission line).We can extend the model a bit by adding additional LC stages. In general, we can create a lowpass delay network, with equal L's and C's in a ladder (and half at the ends), with a bandwidth of 1/sqrt(LC) and delay of N sqrt(LC) (give or take proportions, there's some pi in there for s/Hz of course).If we go all the way, taking the limit as N --> infty and L, C --> 0 (keeping their ratio constant, Zo = sqrt(L/C)), we end up with an infinite network with infinite bandwidth, and finite delay. This is one way to model a transmission line: infinite repeated poles at infinity.Understandably, the method is rather cumbersome for much delay * bandwidth, so we tend not to build delay lines this way. But it is nonetheless a correct way to model a transmission line. We can take a differential segment of the transmission line, and understand its characteristics in terms of the series and shunt impedances in that segment. This is one way to derive the Telegrapher's Equations.Tim