Author Topic: Choice of R vs C values in op amp filter  (Read 1452 times)

0 Members and 1 Guest are viewing this topic.

Offline jmwTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: us
Choice of R vs C values in op amp filter
« on: September 17, 2018, 10:44:35 pm »
I'd like to take the PWM output of a microcontroller and use it to control an adjustable current source for LEDs or Nixie tubes. I'm doing this by filtering the PWM through a low-pass filter and using that signal to drive an op-amp & MOSFET combo in its saturation region to make a current source. For effect, I want smooth but just barely visible (50-100 ms rise time from 0-3.3 V) transitions, so I chose a cutoff frequency of 10 Hz in the filter.

Using this filter calculator http://sim.okawa-denshi.jp/en/OPseikiLowkeisan.htm, I tried a Sallen-Key design with Q=1/sqrt(2) and it gave me a design with R1,R2 = 30k,18k and C1,C2 = 1u,470n. I have heard that class I C0G/NP0 caps are superior in filter applications due to lack of voltage effects, but 1u is pretty big for C0G. So another design is R1,R2 = 300k,180k and C1,C2=100n,47n. I also remember that high resistances >100k in op amp circuits are more susceptible to noise. Can someone explain the relationship between high impedances and noise?



Finally, what are your opinions on what approach is best?

1. Use high-R and low-C parts in the filter so C0G caps are an option
2. Distortion from X7R/X5R etc. caps are fine for this application, so use low-R and high-C parts
3. Do ramping and smoothing in the MCU so the filter can have a higher cutoff frequency and lower-valued parts all around
 

Offline basinstreetdesign

  • Frequent Contributor
  • **
  • Posts: 466
  • Country: ca
Re: Choice of R vs C values in op amp filter
« Reply #1 on: September 18, 2018, 06:34:01 am »
Can someone explain the relationship between high impedances and noise?

Thermal noise is generated in any conductor or resistor at all times.  https://en.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_noise
It originates from the thermal agitation of the charge carriers (electrons) within the resistor.  Just sitting on a desk, a resistor is generating a wide-band, white noise called Johnson or Nyquist noise voltage with power equal to
P = v^2 = 4kTBR Watts where:
k is Boltzmanns constant, 1.38064852×10−23 J/K
T is absolute temperature in degrees kelvin above absolute zero,
B is the frequency bandwidth in Hertz that the noise voltage may be limited to by external circuitry, and
R is the resistor value in Ohms.

The noise voltage appears in series with the resistor if the resistor is considered as ideal and noiseless.
So a 100K resistor at room temp generates 128 nV RMS if limited to 10 Hz bandwidth.  A typical audio system with a 47K input impedance and 20KHz bandwidth has an input noise level about 3.9 uV RMS or -108dB with respect to 1V RMS.  https://daycounter.com/Calculators/Thermal-Noise-Calculator.phtml
Even if the system is absolutely noiseless (impossible) it can't get any quieter than that.
This is why wide-band transmission systems are designed around a low impedances such as 50 or 75 Ohms.
Since you are dealing with a BW of only 10 Hz and driving LEDs you should not be worrying about noise levels in op-amp circuits at all.  The noise voltages are just way too small to be bothered with.

Finally, what are your opinions on what approach is best?

1. Use high-R and low-C parts in the filter so C0G caps are an option
2. Distortion from X7R/X5R etc. caps are fine for this application, so use low-R and high-C parts
3. Do ramping and smoothing in the MCU so the filter can have a higher cutoff frequency and lower-valued parts all around

#1 - Sure - go for it.
#2 - Depends on the linearity you need.  If you are making a precision VU meter then I would worry about distortion.
#3 - Depends on your sensitivity to parts cost and how much spare MCU compute-bandwidth you have.  If doing that will allow you to use only a 1st-order filter and save 30 precious cents in parts in a high-volume device then there's that option, too.
Hope this helps
« Last Edit: September 18, 2018, 06:36:59 am by basinstreetdesign »
STAND BACK!  I'm going to try SCIENCE!
 
The following users thanked this post: jmw

Offline sdouble

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: fr
Re: Choice of R vs C values in op amp filter
« Reply #2 on: September 18, 2018, 09:20:24 am »
as already mentioned, going for such a low bandwidth system, I would not worry too much about thermal noise.
Go for your CGO cap specially if you'll have to deal with several volts in the 2-stage LPF.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Choice of R vs C values in op amp filter
« Reply #3 on: September 18, 2018, 10:35:51 am »
as already mentioned, going for such a low bandwidth system, I would not worry too much about thermal noise.
Go for your CGO cap specially if you'll have to deal with several volts in the 2-stage LPF.

Right. Much more important is choice of opamp. Note that output is connected to input through R1 and C1. In case of insufficient GBW or insufficient output drive, your lowpass Sallen-Key filter can start to act as notch filter passing through hi-frequency components. That's why it is advised to put in front of Sallen-Key filter one (buffered) RC filter stage, making 3rd order filter.

You are suggested to play with Analog Devices filter wizard. TI also have similar online tool.
« Last Edit: September 18, 2018, 10:38:52 am by ogden »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf