| Electronics > Beginners |
| Impedance matching or not ? and choosing values for RC filter |
| (1/3) > >> |
| JeanF:
Hello, I’ve read these two rules of thumb, in different places over the internet but the context was not always clear: a) the input impedance of a device should be greater (around 10x to 100x is common) than the output impedance of the circuit supplying the signal, to avoid overloading the source and weakening the signal too much. b) when dealing with transmission lines, output and input impedances should be matched for best signal transmission When is one or the other most relevant? Is it only a matter of frequency? Thank you :) :-+ A bit more context: I have a signal coming from an optocoupler (a 6N137). I use a 1k pull-up resistor at the output. So the output impedance is 1k if I’m not mistaken. The signal was originally a 9600 baud stream, on-off modulated over a 50 kHz sine carrier, which I have full wave rectified just before the optocoupler. I want to filter that with a RC filter, then pass it through a schmitt trigger inverter to recover the data. How would you choose values for R and C ? I read on the Internet some conflicting advice: c) “the RC constant of the filter should be much greater than the period of the carrier, but smaller than the message signal period” d) “the RC constant should be smaller than the period of the carrier” I played around with LTSpice (I’m not very good a it yet) and apparently choosing RC = 10µs = the period of the carrier seems a good compromise, for example 10k/1n, 1k/10n, etc. according to a) I should use say R=10k and C=1n. I breadboarded all that, including the bridge rectifier (4*1N4148), the optocoupler, the filter and two stages of a 74HC14 for final cleaning. The signal then goes to a USB to serial adapter so I can see the decoded data in Realterm. I was looking at the signal at the output of the filter with an oscilloscope and at the same time I kept an eye on the error status lights in Realterm. With 10k/1n I found that it was really hard to adjust R to get reliable transmission, Realterm kept saying “framing error” or “checksum error” and if I moved an eyelash too fast, the connection would break. On the other hand, with 1k/10n, the transmission was perfect. And it was much more tolerant of resistor variation; using the same 10n cap I got good results with any resistor, from very low values to 1k5. on the scope "screenshots" 0V is the line at the bottom of the screen, it is set to 1V/div. With 8k2 (or 10k) and 1n, the signal has ripple up to about 2.5 volts, which is about the same as the positive-going threshold voltage of the 74HC14, giving false positives and corresponding to what I’ve seen in Realterm. On the other hand, with 1k/10n the signal is cleaner and the ripple stays below 2 volts and everything is fine. Some may say “well if you found OK values, go on, why bothering?” and they’d be quite right; but I would like to understand better what I observed. Any comments or explanations (or links to useful pages that I surely missed!) would be greatly appreciated. And also: - when is it OK,and not OK, to refer to rules of thumb a, b, c and d - with 1k and 10n the input impedance of the filter is about 2,6kOhms. Should I increase the value of the pull-up resistor to have a perfect match ? (I didn’t try yet because I was expecting rule a) to apply) Thank you :) |
| fourfathom:
You match input impedance to output impedance when you want to get maximum power transfer. Also, when dealing with electrically long transmission lines un-matched terminations will create reflections, or "standing waves", which can reduce power transfer, increase attenuation, and cause signal distortion. So matching impedance is a very important concept. But in your demodulator / detector you don't really care about maximizing the power transfer, as long as your recovered signal is big enough to give you acceptable performance. Other factors, such as the filter component values, signal-to-noise ratio, and perhaps minimizing power dissipation, are much more important. Your optoisolator output impedance is 1K Ohm when in the "high" state, but is much lower when in the "low" state (the low-state impedance is determined by the opto-transistor characteristics.) You can see this effect in the waveforms, where the rise and fall times of the filtered signal sawtooth (at the carrier frequency) are quite unequal in your 820-Ohm / 10n case. This isn't necessarily a problem, but you should be aware of the effect. Increasing the 1K resistor won't really give you a perfect match because of the varying output impedance of the optotransistor, and in any case a perfect match isn't particularly useful here. |
| JeanF:
Thank you very much, that makes perfect sense. In fact I had previously heard about this aspect of maximum power transfer, but I had forgotten about it. I'll read up on this, but while you are talking about signal to noise ratio, what do you generally recommend when choosing filter values in this regard? Thank you also for your other comments. |
| fourfathom:
--- Quote from: JeanF on October 05, 2019, 11:00:09 am ---but while you are talking about signal to noise ratio, what do you generally recommend when choosing filter values in this regard? --- End quote --- In this case, signal/noise benefits from a large-amplitude filtered waveform. It would be possible to optimize the low-pass filter at the expense of output amplitude (by using an excessively large series resistor or perhaps additional filter stages). Your current values are nowhere close to causing this problem, but it's worth mentioning in a general discussion. Also important is matching the filter output voltage to the switching threshold characteristics of your "slicer" (the 74HC14). Look at the possible range of threshold voltage and hysteresis region, and make sure that your filtered signal gives you a comfortable margin, and minimum pattern distortion. Look up "matched filter" and "eye pattern" to see how filters can be used to compensate for non-ideal channel characteristics such as intersymbol interference (ISI) and bandwidth. These probably aren't a factor in your current system, but the basic concepts are good to know. Back to your original issue, which is the selection of your RC components to minimize the 50 KHz carrier ripple on your recovered 9600 Baud signal, with your single-section RC filter you will get at maximum a 6dB per octave rolloff. Later I will have time to suggest some optimum values and circuits, but perhaps someone with more expertise will reply before then. |
| fourfathom:
As for filter optimization, you can go with a more complicated design, using active filters or even L/C filters, but you probably want to minimize the overshoot and phase or group-delay characteristics of the more aggressive filters. I believe that a "Bessel" response is often used. Or, you can go with a very simple 2-stage RC filter. You won't get a sharp corner on this kind of filter, but you also won't get ringing or overshoot. Here are some attached LTSpice simulations showing the difference that a second filter stage can make. I used no theory in the component selection, just rule-of-thumb and my eyeballs. I guarantee you that these can be improved. These simulations are showing the "eye pattern" I previously mentioned. (In the simulation with the 2-stage filter, the blue waveform is "Vout2" -- I cut off the legend when I cropped the screen-capture.) You can also get an improved filter response by putting a series resistor between the open-collector pull-up and the capacitor (say 10x the pull-up value). This gives you a symmetrical waveform with less carrier ripple. Unfortunately, this also cuts the output voltage swing in half, and not centered around the Schmidt trigger threshold. If you were using a diff-amp as a slicer you could bias the other input to compensate for the new center-voltage. I used a 15-stage LFSR (linear feedback shift register) to generate reasonably long runs of random bits. Testing with a simple 1010... pattern does not show you the effects of heavier filtering, although if the filter settles by the end of the symbol (as is the case with your filters) then this isn't such an issue. Is your carrier truly 50 KHz, or is it a multiple of the baud rate? If it is a multiple, then the eye patterns I show would be slightly cleaner. In my sim I used 9600 baud and 50KHz carrier. |
| Navigation |
| Message Index |
| Next page |