Author Topic: Bode Plot Question - phase response of passive LP filter seems odd...  (Read 2695 times)

0 Members and 1 Guest are viewing this topic.

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
I was testing out the Bode Plot functionality on my Siglent 1104x-e scope using a passive RC LP and then a passive RC HP filter.
The amplitude response seemed spot on (at least to the tolerances of the components).
However, the phase response seemed odd.

1. In the LP filter version (first attachment), the phase response hits -45deg about 3kHZ beyond the corner frequency of ~10kHz
2. Most strangely, for the LP filter, the phase response hits a negative minimum of about -65deg at about 55kHz and then increases back to 0deg! (rather than decreasing to -90deg)
3. The HP filter (second attachment) looks mostly right, although here it hits the -45deg mark about 3kHz before the corner frequency.

#2 is the hardest for me to understand/explain.

Any ideas???
Thanks!
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #1 on: September 30, 2022, 08:16:01 pm »
I'd say your probes are the problem.
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #2 on: September 30, 2022, 09:15:00 pm »
I should also note that the corner frequency of the LP configuration is about 10.3K while the corner frequency for the HP configuration (with the same resistor and capacitor) is about 3KHz higher.
Also, interestingly in both the HP and LP situations the 45deg phase point occurs at -4dB rather than the expected -3dB corner frequency.
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #3 on: September 30, 2022, 09:17:12 pm »
I'd say your probes are the problem.

Can you explain how that would happen?
Are you thinking stray resistances & capacitances would make this effectively into something more complex than a single stage passive RC filter?
I wouldn't have expected that to happen at relatively low corner frequencies like 10kHz given that this a 100MHz scope with decent probes.
I cold understand some slight phase shifting but the phase inversion in the LP filter case just doesn't make sense to me...
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16545
  • Country: us
  • DavidH
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #4 on: September 30, 2022, 09:52:38 pm »
I would set the oscilloscope up to make the phase and amplitude measurements automatically and do a manual sweep to find the exact -3dB and 45 degree points.  This will confirm if there is something off about the automatic bode plotting function.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #5 on: September 30, 2022, 09:55:08 pm »
Until you show us WHAT your're measuring, all bets are off. Schematic? Values? Scope settings?
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #6 on: October 01, 2022, 02:30:18 pm »
At first glance, I'd say that the "strange" phase response of the low pass actually matches quite well with the magnitude response. Note that it does not continue to slope downward but tilts back up. I can't explain why the filter is leveling off, but the phase response is on par.
 
The following users thanked this post: srb1954

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #7 on: October 01, 2022, 04:59:54 pm »
At first glance, I'd say that the "strange" phase response of the low pass actually matches quite well with the magnitude response. Note that it does not continue to slope downward but tilts back up. I can't explain why the filter is leveling off, but the phase response is on par.
No it doesn't. an RC LP phase response should asymptotically approach 90 degrees lag. There's a leading element in there somewhere.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #8 on: October 01, 2022, 05:44:56 pm »
At first glance, I'd say that the "strange" phase response of the low pass actually matches quite well with the magnitude response. Note that it does not continue to slope downward but tilts back up. I can't explain why the filter is leveling off, but the phase response is on par.
No it doesn't. an RC LP phase response should asymptotically approach 90 degrees lag. There's a leading element in there somewhere.
I'm not arguing with that fact. It should do that. Clearly in that graph, that isn't what is happening. The unexpected magnitude response has an equally unexpected but matching phase response.
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #9 on: October 02, 2022, 12:13:12 am »
Until you show us WHAT your're measuring, all bets are off. Schematic? Values? Scope settings?

Simple RC circuit. R=~158 ohms, C=0.1uF
Siglent Scope in Bode plot mode.
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3192
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #10 on: October 02, 2022, 12:55:06 am »
What type of cap? Have you measured it at various frequencies within the Bode range?

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #11 on: October 02, 2022, 12:57:57 pm »
What type of cap? Have you measured it at various frequencies within the Bode range?

Best,
cor
Electrolytic cap.
I got the same strange phase change when I increased R by factor of 10 moving the corner frequency to 1kHz.

I am using a Siglent SDS1104-e scope with it's standard probes and a Fygen 6900 signal generator.
At a 1kHz corner frequency, I would think that even the cheapest test equipment and probes would perform reasonably.
 

Offline mag_therm

  • Frequent Contributor
  • **
  • Posts: 633
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #12 on: October 02, 2022, 02:14:13 pm »
Do a hand calculation of mag and phi at about  200 kHz. That will show the problem with DUT,
Looks like you have about 9 Ohm ( Real,)  in the numerator of the voltage divider's transfer function.
That would be series R in capacitor leg under your probe.

If using electro as you mention, it would need to be a good one, and polarized with DC, properly isolating DC from the probes.
Better to use a polyester cap for this test.
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 6877
  • Country: ca
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #13 on: October 02, 2022, 05:18:25 pm »
I've never seen a 0.1uF electrolytic capacitor in my life....
Facebook-free life and Rigol-free shack.
 

Offline mag_therm

  • Frequent Contributor
  • **
  • Posts: 633
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #14 on: October 02, 2022, 06:07:59 pm »
I've never seen a 0.1uF electrolytic capacitor in my life....

Here are (5) from 3 sources.
Tan delta fairly high too, but not enough to cause the problem
https://www.newark.com/c/passive-components/capacitors/aluminium-electrolytic-capacitors/smd-aluminium-electrolytic-capacitors?capacitance=0.1uf
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #15 on: October 02, 2022, 08:13:07 pm »
I would set the oscilloscope up to make the phase and amplitude measurements automatically and do a manual sweep to find the exact -3dB and 45 degree points.  This will confirm if there is something off about the automatic bode plotting function.

I did as suggested with values of R and C as measured by my DVM to give a PREDICTED corner frequency of 1kHz.
The MEASURED corner frequency where the (average) amplitude was down by 3dB was 1.06kHz -- which is certainly within tolerance range of my DVM measurements of the component values.
At the measured corner frequency the (average) phase difference was -40.18deg
The measured phase difference hit -45deg at 1.28kHz at which point the amplitude was down by 3.8dB

And as I sweep higher, the phase decreases to a minimum of about -80deg at around 15-20kHz and then starts increasing again (as per my original post).

Attached is an updated bode plot of the same setup with the ~1kHz corner frequency -- which is very consistent with the measured values from my manual sweep.

The only thing I can think of is that the filtered signal is a bit noisy as the frequency increases and the amplitude decreases and perhaps this leads to erroneous phase measurements
The second attachment shows the two sin waves at 100kHz when the output signal amplitude is down 38dB (130mv vs. 10V input) and the phase is now increased to -62deg (whereas it should be close to -90).

While there is noise in the output signal which could effect the phase calculation, the stdev of the phase difference is only 6.77deg so I wouldn't think that would account for the difference between -62deg and -90deg.

And given that the corner frequency is just 1kHz (and my scope and probes have at least 100mHz BW), it's hard to believe that this is a limitation of the measuring hardware...

So this still remains a mystery for me!

 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #16 on: October 02, 2022, 09:12:27 pm »
I've never seen a 0.1uF electrolytic capacitor in my life....
Here...
This one measures 5.76 ohm ESR at 100kHz, compared to 0.42 ohm for some random green film cap, also 0.1 uF.
 

Offline jasonRF

  • Regular Contributor
  • *
  • Posts: 198
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #17 on: October 03, 2022, 12:06:32 am »
I recommend you plot the theoretical Bode plot, using a model of the capacitor that includes the series resistance.  The measurements may be exactly what you should expect them to be.  If you don't already know how to do that, then this could be a good learning opportunity.  If you don't want to learn the math, you could at least plot these in a spice package such as LTSpice. 

Anyway, I just did a quick and dirty experiement with a low-pass filter from a 33-Ohm resistor and 4.7 uF capacitor.   It also shows deviations from what you might expect for the Bode plot if the resistor and capacitor were ideal, but we will see that a model that includes the ESR of the capacitor will predict the measurements pretty well.   

Case 1: 4.7 uF electrolytic capacitor (Xicon, 35V, purchased at Radio Shack a decade ago I would guess) with measured (using a cheap transistor-checker) capacitance of 4.32 uF and ESR 2.6 Ohms.  The first image is the measured Bode plot (from a Picoscope) where I am applying no DC bias across the capacitor.



Applying a 1V DC bias (using 0.1V peak-to-peak AC) did change things a little, but not dramatically, as shown in the second image.




Now, the theory (including the ESR) says I should measure the following phase shown in the third image.

This is close enough to the measurement that I would say the measurement is expected. 


EDIT: if you want to understand qualitatively what is going on, consider what happens when the frequency is high enough that the ESR of the capacitor is much larger than its reactance.  At these high frequencies, a resistor of value ESR is a reasonable model for the electrolytic capacitor.  So the simple voltage divider equation should give you the gain at high frequencies (and is why the measurements look like they will asymptote to a fixed gain, instead of continuing to fall off at 20 dB / decade).  Likewise, the phase should be close to zero.  Of course, as the frequency gets higher, other effects (inductance of component leads, capacitance of the resistor, etc) may also play a role. 

Case 2: a 4.7 uF film capacitor (a Panasonic metalized polyester 100V job that is quite large!).  The fourth image shows the measured Bode plot

Closer to the ideal theory, since the ESR is apparently lower.  The cheap tester says this film cap has an ESR of 0.3 Ohms (spec on the cap is < 0.34 Ohms at 1 kHz), but a theoretical plot with 0.05 Ohms is closer to the measurements.  I think I believe the scope more than the tester, though.  The last plot is the theoretical phase assuming 0.05 Ohm ESR. 

[ Specified attachment is not available ]

Jason

PS: sorry fo the mess with the images.  I tried to make them inline (first with thumbnails) but am not the best user of this forum!  Also, I didn't bother to show the theoretical amplitude Bode plots; they also are consistent with the measurements. 
« Last Edit: October 03, 2022, 02:03:33 am by jasonRF »
 
The following users thanked this post: RoGeorge

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #18 on: October 03, 2022, 05:34:04 am »
I recommend you plot the theoretical Bode plot, using a model of the capacitor that includes the series resistance.  The measurements may be exactly what you should expect them to be.  If you don't already know how to do that, then this could be a good learning opportunity.  If you don't want to learn the math, you could at least plot these in a spice package such as LTSpice. 

Anyway, I just did a quick and dirty experiement with a low-pass filter from a 33-Ohm resistor and 4.7 uF capacitor.   It also shows deviations from what you might expect for the Bode plot if the resistor and capacitor were ideal, but we will see that a model that includes the ESR of the capacitor will predict the measurements pretty well.   

Thanks! And I think you nailed it!
Your explanation and experimental confirmation are very helpful with your graphs almost perfectly duplicating what I was finding. I would imagine the ESR of my electrolytic cap is rather high as it came from a cheap no-name Chinese assortment.

Just thinking off the top-of-my-head this would probably also explain why the distortion is so much more prominent in the LP rather than HP configuration since in the HP configuration the ESR would just show up as added output impedance from the signal generator.

BTW, I am very familiar with the math of Bode plots in particular and frequency-domain transforms in particular (I have even edited books, given lectures and written papers on signal processing) -- but it's been decades and it's been a good almost 40 years since I played with Bode plots in the lab -- done the old fashioned way with analog scopes and WWII vintage signal generators...

I will play around with LTSpice (it's been a while) as well as try the same experiment with a ceramic cap which should have much lower ESR.
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #19 on: October 03, 2022, 05:38:20 am »
And indeed using a ceramic 0.1uF capacitor gives a much cleaner and near ideal single-stage passive LP filter Bode plot.
- At the -3dB frequency, the phase angle is -43.5deg (which is pretty close to -45)
- The amplitude falloff is pretty close to linear (when plotted on a log frequency scale)
- The phase decreases monotonically in a sigmoid like curve, asymptotically to -90deg

Attached is the revised Bode diagram.

Again thanks to @JasonRF for providing the detailed explanation and experimental evidence!

 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #20 on: October 03, 2022, 01:24:34 pm »
And here for completeness is the HP filter version with the ceramic 0.1uF cap.
 

Offline jasonRF

  • Regular Contributor
  • *
  • Posts: 198
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #21 on: October 03, 2022, 04:06:45 pm »
Glad you sorted it out.  By the way, mag_therm was indicating the same issue in their post above.  I neglected to point that out in my post.   

I still recommend plotting the theoretical response, and playing with how the ESR effects the transfer function.  You could also add small resistors in series with your ceramic cap to measure the effect. 

Cheers,  jason
 

Offline puterboyTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #22 on: October 03, 2022, 11:46:52 pm »
Thanks to both you and mag_therm!!!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #23 on: October 04, 2022, 12:04:00 am »
For those following along at home, here is the MATALB code for the Bode' Plot of a simple low pass filter using a 10k resistor and 0.1 ufd capacitor.  MATLAB is smart enough to center the -3dB point in the center of the graph.
Code: [Select]
close all
clearvars
s = tf('s')
R = 1.0*10^4;   % 10k resistor
C = 0.1*10^-6;  % 0.1 ufd capacitor
H = 1/(1+s*(R*C));
opts = bodeoptions('cstprefs');
opts.PhaseVisible = 'on';
bodeplot(H, opts );
grid on; zoom on;

Octave  hasn't implemented the Bode' Plot functionality.  Bummer!  Octave is free and MATLAB is not.


Octave uses different function names, see below.
« Last Edit: October 05, 2022, 12:27:31 am by rstofer »
 
The following users thanked this post: jasonRF

Offline jasonRF

  • Regular Contributor
  • *
  • Posts: 198
  • Country: us
Re: Bode Plot Question - phase response of passive LP filter seems odd...
« Reply #24 on: October 04, 2022, 12:22:44 pm »
Thanks for posting that code!  I use Matlab every day at work and didn't realize it had built-in Bode plots - although I don't do electronics for a living so perhaps that is why. 

Anyway, I think posting a snippet of code is a great idea, so here is a little code to generate the Bode plot of the low-pass filter including the ESR of the capacitor.  It should work in both Octave and Matlab.  Not as clean as using built-in Matlab functions, but I only have Octave at home.   The actual calculation is just a couple of lines, but making a reasonable-looking plot takes a few more. 

Code: [Select]
% plot transfer function of simple RC low-pass filter

% inputs
fmin = 10; %minimum frequency to plot
fmax = 100e3; %maximum frequency to plot
R = 33;  % resistor
C = 4.32e-6;  % capacitance
Resr = 2.6;    % effective series resistance of capacitor

% calculation
f = logspace(log10(fmin), log10(fmax), 101);  % frequencies
Zc = Resr + 1./(2j*pi*f*C);      % complex impedance of capacitor
h = Zc ./ (R + Zc);              % voltage divider for transfer function


% plot
figure

  % plot gain in top panel
subplot(211);
semilogx(f, 20*log10(abs(h)), 'linewidth', 2);
set(gca, 'fontsize', 12, 'fontweight', 'bold');
ylabel('Gain (dB)');
xlabel('Frequency (Hz)');
title({'Low-Pass Filter Bode Plot', ...
[num2str(R),' Ohm R; ', num2str(C*1e6),' uF C with ', ...
num2str(Resr),' Ohm ESR']});
grid

  % plot phase in bottom panel
subplot(212);
semilogx(f, angle(h)*180/pi, 'linewidth', 2);
set(gca, 'fontsize', 12, 'fontweight', 'bold');
ylabel('Phase (deg)');
xlabel('Frequency (Hz)');
grid


Cheers!

jason


 
The following users thanked this post: rstofer


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf