Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pitfalls in filter design

Status
Not open for further replies.

a70duster

Electrical
Mar 14, 2005
52
So this is my first stab at designing and building a bandpass filter. TI has a filter building tool that determines component values. I am creating a 4-pole Chebyshev band-pass filter with a uni-polar power supply (5 volts) and a LM324 as the op amp.

How spot on do I have to be with component tolerances? It is easy and cost effective enough to get 1% resistors. The capacitors are a little harder. Will a 5% tolerance be fine for the filter?


Bandpassfilter.jpg
 
Replies continue below

Recommended for you

Polysytrene caps are readily available at 1% tolerance. As an observation, all the resistor values are quite low. [wink]





----------------------------------
image.php

If we learn from our mistakes I'm getting a great education!
 
You don't say what your requirement is; how can anyone determine what tolerance you need?

TTFN

FAQ731-376
 
Phase response? Group delay? Bandwith? Center Frequency? Q-factor?

Is this signal for time-domain signals or frequency-domain signals (yes, it does matter). Chebyshev filters have amazing frequency response, but you may not recognize the signal that comes out the other end due to the phase response (although this is typically more for low pass filters).

"easier said than done" - other tools from other manufacturers (Linear Tech, Analog Devices) may make that easier (although it really isn't that hard). Are you familiar with four-corners testing?

John D
 
Thanks for the feedbak - let me give some more info on this.

The bandpass of the filter is 5.0 kHz to 6.4 kHz. I am looking at a knock signal of an engine. I am using the filter to only look at the knock signal and filter out all the other noise not in the bandpass region. I am looking at the amplitude of the knock so phase and time delay won't be a factor. Since I have never designed this complicated a filter before, I was asking for some pointers in regards to component choice and tolerance.

Here is a spectrograph of the engine knock
knocknofilter.jpg


Here is a spectrograph of the engine knock with a digital fitler
knockfilter.jpg
 
Well that doesn't look good. Your unfiltered response is peaking around 14 KHz, and your filtered response is peaking around 6 KHz; it looks like you just killed most of your signal unless the 14 KHz was a systematic noise source that you were trying to knock out. What is the difference in the gain setting between the two plots?

Can you explain the 'beating' across the time domain? the amplitude appear to be pulsing about 5 times per division, or at about 25 Hz.

Do you hear a 5-6.4 KHz whine and that is why you say it has this bandwidth? If that pulses then the lower end of your spectrum is much lower, and you won't accurately measure the pulses unless your filter bandwidth includes 1/period of the pulse duration (25 Hz?).

and if that's the case,

"I am looking at the amplitude of the knock so phase and time delay won't be a factor." - yes they will. Unless your knock signal is a pure sinewave you need linear phase across your filter or all the harmonics needed to create your signal will show up at the wrong time and thus won't add up properly and your signal will come out of the filter severely distorted (i.e. a very different amplitude). A high order Butterworth filter is your best bet for passing a pulse.

Does your scope have an FFT function (most do these days, and the latest firmware upgrade for the TEK TDS family now includes it as a standard feature)? That might give you a better view of your required bandwidth.

John D
 
I was hoping to get away with asking a basic filter question - but that isn't going to happen. ;) Here is more info.

I based the design of the filter on this equation.

Knock Frequency (in kHz) = 1800 / (pi * d) where d = piston diameter

The test engine is a 4 cylinder and has 100 mm pistons so 5.73 kHz is the calculated frequency. If you look at the unfiltered plot, there is always some "knock energy" present around that frequency. As for the other bands of frequencies, I don't care about them getting filtered out.

In the bandpass region of the filter the engine is relatively quite, so that was another reason to design a filter in that region.

There was an additional 30 dB added to the digital filter to get more “filtering” onto the signal.

The beating across the time domain of the plot is certain combustion events within the engine. The knock sensor is physically located closer to one of the pistons (H4 engine design). This test was at ~3000 RPMs or 50 RPS. There are 2 ignition events for each revolution or 100 sparks per second. The knock detector is picking up every forth combustion event.

I chose a Chebyshev filter because of it’s steep rolloff. I am only interested in those peaks in the 5.0 to 6.4 kHz range.

Here is a plot for the above Chebyshev filter
Filterresponse-1.png


Here is a plot for the Butterworth filter
FilterResponseButterworth.png



So the phase change is the same for both filters. There is about 200 µs of delay in the Butterworth and ~300 µs of delay in the Chebyshev. With the knock events spaced apart at 10 ms apart (6000 RPM), I don't believe that 100 µs would mess up the knock signal in the bandpass that much between the two filters.

Here is a spectral plot of the engine with no knock, the engine is ramped up from 3000 to about 5500 RPMs.
noknocknofilter.jpg
 
a70duster, first you get pluspoints for choosing MFB filters. I dream of the day when those lousy Sallen-Ket filters will disappear from all websites and textbooks.

I have a text back from my university days which describes how to choose the optimum component values to achive the lowest possible sensitivity to tolerances. With the MFB type of filters, you can always achive sensitivities below 1, meaning that if a resistor is 1% out of tolerance, the effect on Wo, Ho and Q is lower than 1%.
I can mail you a scan, if you like.

Regards,

Benta.

 
Crazy! Not piston diameter but bore size. The size of the cylinder has a part in the frequency of the knock. If you don't believe me then search the internet.
 
SAE 871911 - "Individual Cylinder Knock Control by Detecting Cylinder Pressure"
by Kunifumi Sawamoto, Yoshiaki Kawamura, Toru Kita and Kenjiro Matsush*ta of Nissan Motor Co. Ltd.

Relationship of knock frequency with acoustic velocity in the combustion gasses, bore diameter and resonance mode. Characterizes the frequency multiples of the modes. Shows where in crank angle knock typically occurs.

Interesting. Makes sense once I thought about it as bore size would affect resonant frequency just like a pipe organ (you'd think after looking at details for Helmholtz resonators in exhausts I would have made the connection).

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
benta - Thanks for the input. The filter design and component choice is from the Texas Instrument program called FilterPro. After poking at it some more - I am finding more features within the program. It shows deviations from Q and fn when component tolerance is 1% of listed values.

Playing with the FilterPro and knowing the spectrograph, would using a narrow bandpass filter at 5.9k be a better choice? Here is a two pole narrow bandpass filter with a Q of 5. Simpler circuit, repeat of components, steep attenuation outside the frequency of interest.

NarrowbandFilter.png


*Replace the earth symbol with 2.5 V
 
Ah, that's more interesting!

I misspoke - both Chebyshev and Butterworth filters have odd phase responses; only Bessel filters have flat group delay. From "RF Circuit Design" by Bowick:

"Chebyshev and Butterworth filters have extremely non-linear phase response over the filter's passband. This phase nonlinearity results in distortion of wideband signals (i.e. pulses) due to the widely varying time delays associated with the different spectral components (i.e. harmonics) of the signal. Bessel filters... with their maximially flat (constant) group delay are able to pass wideband signals with a minimum of distortion."

So if you are really only interested in the fundamental frequency then this may be a moot point.


As you already have your spectrograph, can you process the data with a digital filter? A lot of the tools have a nice setup where it is only a few button clicks to select your filter type and order. That lets you try a lot of different filter settings quickly, as long as your A/D can handle the unfiltered bandwidth.

John D


 
The need for an analog filter is a quick response to knock by backing the timing off before the next ignition event. Some more information.

Low RPM no knock
LowRPMSpectrum.jpg


Max RPM no knock
MaxRPMSpectrum.jpg


Light knock
LightKnockSpectrum.jpg


Heavy knock
HeavyKnockSpectrum.jpg


So if I am looking for engine knock at low RPMs, it should be pretty easy to find it at 5900 Hz. At max RPMs it may tricky to pick out a light knock. It appears that a narrow bandpass filter should fit the ticket. Anything wrong with using a narrow filter?
 
Looking at your plots, it appears that your "decision-window" is only around 10 dB, which is not a lot, especially as this is relative and probably not absolute.
I also wonder why your 5.9 kHz has no higher harmonics.
Have you looked at how commercail knock sensors are made?

Benta.
 
I also was wondering why there is no other "harmonics" of 5.9 kHz. The way I understand it that the knock sensor is a piezoelectric element. Now I am wondering if 5.9 kHz is its natural frequency. Back to the lab!
 
As far as I'm aware (did a little reading after my last question), knock sensor are generally chosen for the range of frequencies desired for the specific application.. the intent is to select a sensor's resonant frequency near the one you expect to see. I second benta's caution to make sure you're actually seeing knock at that specific frequency or if you're seeing a harmonic ghost... best to be safe in such a case.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Can you build this circuit and try it out? When i look at your op amps, it looks like the first two will oscillate. I would have to calculate it out but that’s what my gut tells me. What does everyone else think? I think you will have to be very careful in which op amp you chose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor