0
\$\begingroup\$

This is regarding the biasing of a second order Sallen-Key low pass filter. The filter seems to work fine when I use a sinusoidal input in LTSpice and produces an output centered around 1.65 V. However when I give it some random test data (top right image), the output waveform is not centered around 1.65 V, but is rather shifted downwards.

Why does this happen with my test data and not with the sinusoidal input functions in LTSpice?

enter image description here

\$\endgroup\$
8
  • 6
    \$\begingroup\$ Your circuit has no DC return path for the MAX74821's "+" input bias current. It's very tiny, but nonzero, and this will create an offset. \$\endgroup\$ Commented Nov 17 at 22:44
  • \$\begingroup\$ You've also likely built an oscillator. Do your research on maximum gain for a sallen key filter. Also, what is your "test data"? \$\endgroup\$ Commented Nov 17 at 22:50
  • 4
    \$\begingroup\$ Not your immediate problem, but you can simply the circuit a bit by making R5 & R6 twice the value R4 should be if returned to a solid ground. For example, if R4 would be 50k, make R5/6 100k and replace R4 with a short. \$\endgroup\$ Commented Nov 17 at 23:32
  • 1
    \$\begingroup\$ I see a gain magnitude of \$K\approx 3.4\$ (due to the voltage divider's Thevenin), \$\zeta\approx 0.7\$, and \$f_{_0}\approx 200\:\text{Hz}\$. Given your capacitor ratio, C3/C2, then \$1.5 \le K\le 6.4\$. Given your resistor ratio, R1/R2, then \$0.74 \le K\le 5.6\$. No obvious problems so far. But one of those two ratios must exceed 3 if you want \$K=3.5\$ and exceed 2.89 if you want \$K=3.4\$. And both ratios are too low, either way. What was your design process? I can't reach it, which may be my mistake. (Also see my answer for details.) \$\endgroup\$ Commented Nov 18 at 5:55
  • \$\begingroup\$ @periblepsis Thank you for checking the math. I followed a textbook I found online, called "Active Filter Design " by Allan Waters. The procedure in it was as follows - Specify the gain, frequency of interest, etc. Then choose a capacitor and then work out the resistance values. I don't think the book mentioned the calculations you mentioned above. \$\endgroup\$ Commented Nov 18 at 6:53

3 Answers 3

4
\$\begingroup\$

The reason I'm writing below is because you've not discussed your parameters nor how your part values were developed. Perhaps the approach will allow you to double-check your own process and you may find something that helps from that re-check.

Overview

There are only three things to know about a 2nd order low pass filter:

  1. The critical frequency, \$f_{_0}\$ (which informs the position in frequency for the 2nd order filter); and,
  2. The \$Q\$ or else the damping factor \$\zeta\$ (which informs the shape of the 2nd order filter); and,
  3. The gain magnitude, \$K\$ (or \$A\$, which informs the desired gain for the 2nd order filter).

Your topology is found as the first of many in Sallen & Key's papers:

  • MIT Lincoln Labs Technical Report Number 50 (TR-50) on May 6th, 1954, which is only available by request by contacting MIT's Lincoln Labs (from my experience, at least); and,
  • Their IRE Transactions article in March 1955, about a year later, providing an abridged version titled "A Practical Method of Designing RC Active Filters".

This is from their TR-50 paper:

enter image description here

(I circled the little 1 to show this is the first of many.)

The transfer function details for this topology are these:

  • \$\omega_{_0} = \frac1{\sqrt{R_1\,C_1\,R_2\,C_2}}\$
  • \$\zeta=\frac12\omega_{_0}\left[R_1\,C_1\left(1-K\right)+R_2\,C_2+R_1\,C_2\right]\$

Note that Sallen & Key suggest four different design approaches. There's good reason for this. Despite this being a paper from 1954, when they could not possibly have known about modern inexpensive precision resistor value (E192, for example) and various types and value ranges for modern capacitors, their paper remains relevant today.

Design example

Today, resistors sport high resolution and high accuracy all of which can be had for very low prices. Capacitors, on the other hand, have lower resolution and lower accuracy. So it is more advisable to concentrate first on the capacitors, and then let the calculations tell you what resistor values to find, from there.

Further, \$R_1\$ is often a focus in design. So the approach I'll take will be to pick the \$\gamma, \tau_{_1}\$ approach suggested by Sallen & Key. (Filter capacitors can be very expensive for low tempco and better accuracy. Also take note, when reading Sallen & Key that they've standardized on \$\omega_{_0}=1\$. I'm skipping that approach and dealing directly with the desired angular frequency from the start.)

Substituting \$\gamma\$ and \$\tau_{_1}\$ into the above equations and solving, gives \$\tau_{_1}=\frac{\zeta\pm\sqrt{K-\gamma+\zeta^2-1}}{\omega_{_0}\left(1-K+\gamma\right)}\$.

Right away, since we don't want an imaginary component, we know that \$\gamma\le K+\zeta^2-1\$.

Suppose I want a critically damped 2nd order low-pass (\$\zeta=\frac12\sqrt{2}\$ -- Butterworth) filter with \$f_{_0}=1\:\text{kHz}\$ and \$K=3.5\$. Then \$\gamma\le 3\$. Looking at Digikey for some expensive capacitors, I select \$C_1=3.9\:\text{nF}\$ and \$C_2=10\:\text{nF}\$ and find that \$\gamma=\frac{10\:\text{nF}}{3.9\:\text{nF}}\approx 2.564\$.

I want \$\tau_{_1}\$ to be the lower value because it uses the lower valued capacitor, so I now compute \$\tau_{_1}=\frac{\zeta -\sqrt{K-\gamma+\zeta^2-1}}{\omega_{_0}\left(1-K+\gamma\right)}\approx 116.3982\:\mu\text{s}\$ and that implies \$R_1\approx 29845.683\:\Omega\$ and that \$R_2\approx 21761.766\$. Using nearest 0.5% (E192) values, I find \$R_1=29.9\:\text{k}\Omega\$ and \$R_2=21.8\:\text{k}\Omega\$.

for i in solve( [ Eq( 1/2/pi/sqrt(r1*r2*c1*c2), 1000 ),
                  Eq( (zeta-sqrt(K-gamma+zeta**2-1))/(omega_0*(1-K+gamma)), r1*c1 ) ],
                [r1,r2] )[0]:
    i.subs( { gamma:10/3.9,
              omega_0:2*pi*1000,
              K:3.5,
              zeta:sqrt(2)/2,
              c1:3.9e-9,
              c2:10e-9 } ).n()
29845.6831183718
21761.7658259683

Just to verify:

enter image description here

The above is using a dual supply and a trusty opamp that I use here.

It can be re-fitted for a \$1.65\:\text{V}\$ DC output bias like this:

enter image description here

There's a little loss and damping change due to the biasing impedance and the added capacitors. But I'm using a single \$3.3\:\text{V}\$ supply rail and you can see that the behavior is about the same as before. And running this with .TRAN shows good results, as well.

Further exploration

Some additional exploration may be informative.

Suppose I knew I wanted \$R_1=47\:\text{k}\Omega\$? What would be the \$Q\$ of the final circuit?

for i in solve( [ Eq( 1/2/pi/sqrt(r1*r2*c1*c2), 1000 ),
                  Eq( (zeta-sqrt(K-gamma+zeta**2-1))/(omega_0*(1-K+gamma)), r1*c1 ) ],
                [r1,r2] )[0]:
    i.subs( { gamma:10/3.9,
              omega_0:2*pi*1000,
              K:3.5,
              c1:3.9e-9,
              c2:10e-9 } ).n()
636619.772367579*zeta - 636619.772367579*(zeta**2 - 0.0641025641025644)**0.5
1020.22399417882/(zeta - 1.0*(zeta**2 - 0.0641025641025644)**0.5)

1/2/solve(Eq(636619.772367579*zeta - 636619.772367579*(zeta**2 - 0.0641025641025644)**0.5,47e3),zeta)[0]
1.06145487557702            # Q of new circuit

for i in solve( [ Eq( 1/2/pi/sqrt(r1*r2*c1*c2), 1000 ),
                  Eq( (zeta-sqrt(K-gamma+zeta**2-1))/(omega_0*(1-K+gamma)), r1*c1 ) ],
                [r1,r2] )[0]:
    i.subs( { gamma:10/3.9,
              omega_0:2*pi*1000,
              K:3.5,
              zeta:1/2/1.06145487557702,
              c1:3.9e-9,
              c2:10e-9 } ).n()
47000.0000000001
13819.0375944268

So I'd use \$R_1=47\:\text{k}\Omega\$ and \$R_2=13.8\:\text{k}\Omega\$:

enter image description here

Gain peaking should be about \$1.6\:\text{dB}\$ and that looks about right, as well.

The highest possible \$Q\$ that can be reached by the capacitors I've chosen is \$Q\approx 1.97\$. This can be determined by inspection from a partial derivative of either of the above resistor equations:

derivative(1020.22399417882/(zeta - 1.0*(zeta**2 - 0.0641025641025644)**0.5),zeta)
-636619.772367579*zeta/sqrt(zeta^2 - 0.0641025641025644) + 636619.772367579
#                           ---------------------------
# NOTE: within the sqrt() function is: zeta^2 - 0.0641025641025644
#
1/2/sqrt(0.0641025641025644)     # Compute highest possible Q
1.97484176581315

The safest nearby resistor values would be \$R_1=160\:\text{k}\Omega\$ and \$R_2=4.07\:\text{k}\Omega\$:

enter image description here

We'd expect a gain peaking of about \$6\:\text{dB}\$ and that's what the plot shows, too.

Some final thoughts

A low-pass Sallen-Key 2nd order filter of type #1 (first example they provide in their paper) starts by knowing your critical angular frequency, \$\omega_{_0}\$, the desired filter shape, \$\zeta\$ or \$Q\$, and the desired gain, \$K\$ or \$A\$, if other than one.

Note that the capacitor and/or resistor ratios scale with the desired gain, as the radical \$\sqrt{1+\gamma-K}\$ or \$\sqrt{1+\rho-K}\$ clearly points out. The difference must not get smaller than -1! So this is very close tracking. High gain requires high ratios!

So, in general, with Sallen-Key you want to keep the gain at low values. If you need high gain then find another topology or include another stage.

Filters are also difficult, generally. If you want temperature stability then you are already in the market for expensive capacitors C0G/NP0. And they have limited values to select from, too. Plus, they are often in 10% or 5%. And if you want 5% you will pay more. The filter's sensitivity to variations can be relatively high, especially with high gain situations, so most of the initial focus is on getting good value for performance and balancing cost vs variation of performance. So don't just pick a high gain because it is convenient. It will cause much trouble.

Resistors are much easier and a 0.5% resistor is the same price as a 1%. They get a little more expensive at 0.25% and 0.1%, of course. Certain values will be cheaper than others, as well. So that may play into the calcs. You also have copper's tempco to deal with. But these problems are usually far less of a problem than the capacitors.

So I generally focus more on the capacitors. This is why \$\gamma\$ is so important in the design. Just don't worry about \$\rho\$. It's not worth thinking about.

With \$\omega_{_0}\$ and \$\zeta\$ or \$Q\$ in hand, along with reasonably smaller values of \$K\$ or \$A\$ for the filter in mind, the next step is to select reasonable capacitors and tolerances and tempcos that will be priced in an appropriate way.

You will broadly know the R and C values given \$\omega_{_0}\$ as \$R\,C \ge \frac1{\omega_0}\$. So if \$f_{_0}=10\:\text{kHz}\$ then \$R\,C \ge 16\:\mu\text{s}\$. If you like \$R\approx 10\:\text{k}\Omega\$ then it follows that \$C\approx 2\:\text{nF}\$. Etc. But if \$C\$ seems too low, and you'd like to use larger values for some reason, then you will need to reduce the magnitude of \$R\$, broadly speaking.

Think in those ways. Balance things out, massage the ranges a bit, and find an optimum for your application.

But in the end, select two capacitor values that work for you and let the resistor values fall out from there.

Once you've found an exact value for \$\gamma\$, based upon actual capacitors you can buy, then you can compute \$\rho=\left(\omega_{_0}\,\tau_{_1}\right)^2\,\gamma\$. But that's not the point of this equation. The point is that you have the ability to choose \$\tau_{_1}\$ to control the proportionality constant (\$k=\left(\omega_{_0}\,\tau_{_1}\right)^2\$) relating the two ratios, \$\gamma\$ to \$\rho\$. That may inform better choices for \$\tau_{_1}\$ as it permits some balancing trade-offs regarding the capacitor and resistor ratios.

In any case, if you have a final \$\gamma\$ value from the two capacitor values you've selected then \$R_1\$ and \$R_2\$ just fall out and you are done.

The design is really pretty easy to perform. There's software out there. And it may include standard values for capacitors and resistors. But you can just do this on your own, too. It's not rocket science.

You debug the MAX chip

I'm not going to investigate using the MAX part you are using, since I'm not interested in debugging. Just discussing design issues. I'll leave any issues with the MAX part to you.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you so much for taking the time and effort in showing me how it's done. I suppose i was blindly following a college level textbook when i should have instead read from the original papers directly. The textbook went like this - "choose a reasonable capacitor value, then work out the values of the resistors with these formulae" \$\endgroup\$ Commented Nov 21 at 21:35
1
\$\begingroup\$
  1. Try adding negative supply rail to opamp. Replace the GND with negative 3.3V at the opamp negative power supply pin. The waveform shows output voltage (red trace) is clamping at 0V. This change will allow output voltage to swing negative without saturating the output stage of the opamp.

  2. At the start of the sim, let V1 be 0V for the first 100ms. Observe opamp output during that first 100ms - it should be constant & close to 0V. If it is not constant, then your circuit is not reaching equilibrium as you expect. There may be some dc-blocking capacitors that have not reached steady-state voltage at the start of the sim.

  3. Put a large value resistor in parallel with C2. A value of, say, 10MEG-ohm would be a good starting point. The aim of this resistor is to provide a path for the bias current of the opamp input pin, rather than it flowing into capacitors that then causes a voltage ramp (integrator). This effect may be causing any dc offset or ramp you might see when you implement changes 1 & 2 above.

\$\endgroup\$
1
\$\begingroup\$

I strongly recommend to re-start the design process for a fixed closed-loop gain of Acl=1 (100% negative feedback) or Acl=2 (two equal resistors in the feedback path). This is due to the very large sensitivity of the pole quality Qp to gain tolerances. (How would you realize resistor values of 145k or 58k ?).

In this context, it is very important to connect a DC biasing circuitry to the non-inverting input (and NOT to the inverting one). Note that such a biasing is necessary only in case of single supply operation (split supply is preferred, of course). Place the resistive voltage divider directly behind the coupling capacitor C1 ( this capacitor is necessary only in conjunction with this DC biasing). This is the classic and well-known DC biasing scheme for single supply operation.

Example: Acl=2; C2=C3=C; Qp=SQRT(R1/R2) and pole frequency wp=Qp/(R1 * C).

The parameter Qp determines the selected approximation (Butterworth with Qp=0.7071); wp=w(3dB) for Butterworth.

(Note that the gain Acl=2 leads to simple design equations (much simpler than for Acl=1)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.