Author Topic: LCR Impedance Viewer for Picoscope+Keysight+R&S Bode Plot Data (open source)  (Read 30200 times)

2N3055, Finity, _Wim_, HighVoltage and 5 Guests are viewing this topic.

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
As I understand your proposal,
Make cal. file 1 with only the scope probe attached.
Measure a complex load and correct it with cal. file 1.
Make a new cal. file 2, now with an added cap over the probe.
Measure the same complex load again but now with the added cap and correct the result with cal. file 2.
Corrected result for the complex load should be the same in both cases.
Yes, indeed.

1) Is there a reason why you attached an image of a probe, or do you suggest this to be used as a complex load
=> was just to give an idea on how an probe and input looks to give an idea about the values to make a modified "bad" input

2) what capacity do you suggest to place in par. to the probe for cal. file 2 ?
=> I would take something like 47pf or maybe up to a 100pf. This will already limit HF response quite severely. For the optional series resistance I would think something like 100k and and 100pf.
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim

O.k. I'll place a 75pF cap par to the probe to produce cal. file 2.

The optional 100K + 100pF that you mention, is that meant to be placed par. to the probe (instead of the above mentioned 75pF ?) to generate a cal. file 3 and if so, the two in series or in parallel.

And still open is the question: how should the DUT look like, or is that the 100K + 100pF ?

Hans
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Hi Wim

O.k. I'll place a 75pF cap par to the probe to produce cal. file 2.

The optional 100K + 100pF that you mention, is that meant to be placed par. to the probe (instead of the above mentioned 75pF ?) to generate a cal. file 3 and if so, the two in series or in parallel.

And still open is the question: how should the DUT look like, or is that the 100K + 100pF ?

Hans

The optional 100K + 100pf is to create a high pass characteristic. Together with the parallel cap, this should create a response with:
- some loss of gain due to the 100K series resistor (acts as a voltage divider with the 1M input impedance to the scope)
- for higher frequencies, the 100K is bypassed by the parallel cap, increasing the gain again
- for very high frequencies, we have again a loss in gain due to the parallel input cap.

This should create a non flat response to challenge the calibration logic. I would start however with only the parallel input cap.

For a load I would just a parallel LC network with a series resistor, just to have both some inductive & capacitive behavior. Values are not very critical, I would just ensure that you have some non-flat parts in the zone where the calibration correction is the largest (to challenge the correction).
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim,

I'm extremely sorry, but I have some other bad news.
So far I only concentrated on the capacitance calculations of FRA Imp Viewer.
But now being busy with calibration and so on, I found more that's not O.K.

Still with a 100R reference resistor, and as load 100R+10nF in series, I took FRA's inductance image, having on the right side the ESR.
At 100Hz, the 10nF still has a large impedance, so most of Resr comes from the probe, but the FRA image shows -50R at 100Hz.
To my opinion, Resr can never become negative and a value of 50R seems impossible altogether.
In the Excel Image below, Re is as expected, positive and 45K at 100Hz.

Then the Inductance shows 250H in FRA at 100Hz, where Excel using the same .csv file shows 22H at 100Hz.
As from 1kHz and upwards, FRA and Excel are the same within 10%.

At least ESR has some miscalculation, which could be the cause of the wrong inductance value, but maybe there's more.

Hans


 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Hi Wim,

I'm extremely sorry, but I have some other bad news.
So far I only concentrated on the capacitance calculations of FRA Imp Viewer.
But now being busy with calibration and so on, I found more that's not O.K.

Still with a 100R reference resistor, and as load 100R+10nF in series, I took FRA's inductance image, having on the right side the ESR.
At 100Hz, the 10nF still has a large impedance, so most of Resr comes from the probe, but the FRA image shows -50R at 100Hz.
To my opinion, Resr can never become negative and a value of 50R seems impossible altogether.
In the Excel Image below, Re is as expected, positive and 45K at 100Hz.

Then the Inductance shows 250H in FRA at 100Hz, where Excel using the same .csv file shows 22H at 100Hz.
As from 1kHz and upwards, FRA and Excel are the same within 10%.

At least ESR has some miscalculation, which could be the cause of the wrong inductance value, but maybe there's more.

Hans

If you put a 10nF capacitor in series with 100 ohm, you create a high pass filter with a 159kHz -3db point. Each octave lower will be another -6db.  You loose another 7-8 db by the voltage divider created by the two 100 ohm resistors and the 50 ohm resistor in the signal generator. Counting all of these losses up you end up in the noise floor of your scope (in other words, for the scope your DUT is an open circuit at these low frequencies).

As your scope channels are not perfectly identical and have some bias offset, the current "measured" through the reference resistor can be negative (as this current is measured by the difference between channel 1 and channel 2), and all sort of strange things can also happen in the noise. Your csv file show a positive gain at lower frequencies (+0.018 db, which means the signal measured on the DUT is LARGER then the signal put into the reference resistor => this can only be via bias offset differences in an open circuit situation, as this is impossible for a passive device)
You will probably see a similar result by measuring an open circuit.

I have no idea what you have done in your excel to handle negative currents (positive gains), in the case of my app I limited the gain to zero (see "GainCorrectedDB" function). A more clear solution would be to plot no data at all when the gain is positive, but having a smooth continuous curve like in your excel is even more confusing (I presume you somewhere use an "absolute value" function to circumvent this issue).


« Last Edit: May 15, 2021, 07:16:14 pm by _Wim_ »
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
If you look at the gain of the CSV you posted, you can see that somewhere just before 10-15kHz the scope runs out of resolution. To measure your DUT in these lower frequencies, the reference resistor should be much larger to give the system again the change to see variations in gain. 
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Wim,

I appreciate very much that you are still communicating after so many points I brought forward with results that deviate from what was to be expected.
Your program has a wonderful graphical interface, that's the reason I like to use it.
In Excel I have all the formulas to calculate the same, but with very simple graphical options.
But at the end no matter where the calculations are taking place, results should be 100% identical, which they are not.
When leaving the capacity calculation as a separate issue, I would have expected no difference in Resr, Inductance and impedance.

No offense, but if I may say so, the used way of calculating is rather complicated with additional current and a second phase that I haven't checked because calculation can be done much simpler with less chance of making mistakes, see calculation below.

The fact that my Excel shows different graphs based on one and the same .CSV file says that one of both must be wrong.
So here is the Math that I have checked over and over.


 
 
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Hi Hans,

No offence taken. For me your calculation looks more complex, but that is probably because we both spent more time on our own method or due to different backgrounds.  ;)

I found this webpage from Tektronix which also uses the I-V method and matches very closely with what I have done:

https://uk.tek.com/document/application-note/capacitance-and-inductance-measurements-using-oscilloscope-and-function-ge

I especially like the piece posted below  ;D

As to the difference in results, in your last measurement the DUT acts as an amplifier (positive gain). It is no surprise for me that in that case different calculation strategies lead to different results, as there exist is no passive device combination that can work as an amplifier (when talking about RLC-components). So whatever formula's used to calculate the equivalent set of RLC-components, the only correct result should be "not possible", and any numbers that are spit out should be ignored.  Compared these numbers for "correctness" does not make sense.

One interesting point of the Tektronix article, if you look at equation 1, this would place the maximum achievable accuracy at 0.5% for a Picoscope 5000 series. Not bad. A top of the line Keysight impedance analyzer (https://www.keysight.com/be/en/product/E4990A/impedance-analyzer-20-hz-10-20-30-50-120-mhz.html) does "only" 10-times better.  :)
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
No offense, but if I may say so, the used way of calculating is rather complicated with additional current and a second phase that I haven't checked because calculation can be done much simpler with less chance of making mistakes, see calculation below.

Looking at your calculation, I think you did oversimply a bit. You consider the measured phase as the phase of the capacitor/inductor, but the measured phase is the phase of the current through the reference resistor only. For purely capacitive or inductive loads the phase of the current will be identical, but the difference gets larger for combined loads.
« Last Edit: May 16, 2021, 08:32:13 am by _Wim_ »
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim,

I don't get what you mean with the phase.
The only reason there is a phase shift in the first place is because the DUT (and the probe) are causing this.
But I will dive into the Tektronix calculation and see what it brings.
No matter what roads are taken to calculate the characteristics of a DUT, the outcome should be 100% the same.
It's not the calculation that determines the properties, but the only DUT.
When trying to achieve the same result, one of both must be wrong, but I'm sure we will find out.

As a control system in the background, we can also use LTSpice, because with 3 simple commands it calculates:
L = IM(Rref*(V2/(V1-V2))/w)
Resr=Re(Rref*(V2/(V1-V2)))
Imp=Mag(Rref*(V2/(V1-V2)))

Hans

P.S. I saw in the above shown calculation that I forgot to include R* in the imaginary part E. But in my Excel this is correct.
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Hi Hans,

This is the general principle I followed (and also in the Tektronix article)

The only info we have is the voltage & phase at point A1 and A2 in the Tektronix figure. For A1 we set the phase to 0°, for A2 we use the phase FRA reports. From these 2 voltage vectors, the current vector can be calculated because Rref in known. We also know this current has to go through the DUT.

By using ohms law and knowing both the current vector and voltage vector in A2, we can calculate the impedance of the DUT.  From there I think our calculation methods agree to extract ESR, Capacitance and inductance from the impedance.

Hope this clarification helps.
 

 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim,

Step one.
I did the math my way with all the figures from the Tektronix article, and got the exact same figures as they did.

Hans
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Second test now with 10mH.
Again, exactly the same figures as Tektronix.

Hans
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Wim,

For completeness, here's the Excel file that I used for the above calculations.

Hans
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Wim,
This is the test circuit I propose for testing the calibration with 1)probe alone and 2) probe +75pf
Can you agree with this ?

Hans

 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
In the image at the left Rref is a symbolic 2200, but in the simulation plot at the right I used the correct value of 100R as can be seen in the topline above the plot.
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim,

Here are the first results, resp the LTSpice plot, the Excel plot uncalibrated and the third one calibrated for the used probe,
and finally the recorded .CSV  File disguised as txt file.

Hans

 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Hi Wim,

Step one.
I did the math my way with all the figures from the Tektronix article, and got the exact same figures as they did.

Hans

That is no surprise as the load is almost purely capacitive or inductive. What do you get when running the same CSV data with from above (with the positive gain) using the Tektronix formula's? I would guess you also get a negative ESR like I did and not the plot you posted.

You will not get my complete plot as I limit the gain to max zero dB, but at least you should verify if your claim from above is correct that there is a fault in my ESR calculation.
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Wim,
This is the test circuit I propose for testing the calibration with 1)probe alone and 2) probe +75pf
Can you agree with this ?

Hans

That looks ok to me
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
Hi Wim,

Here are the first results, resp the LTSpice plot, the Excel plot uncalibrated and the third one calibrated for the used probe,
and finally the recorded .CSV  File disguised as txt file.

Hans

I am not sure how I need to interpret these result. Is the just probe the result without the 75pF, the the calibrated the result with the 75pF cap & then calibrated? Can you post a plot where you see in one graph:

- DUT measured with no 75pf cap at scope input
- DUT measured with 75pf cap at scope input
- DUT measured with 75pf cap at scope input & with calibration correction implemented

1 & 3 should be identical in an ideal calibration situation, 2 should be different enough to see the calibration "working"
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Wim,

1) You already have the results for measuring the DUT with probe, uncompensated and compensated,
Here are the results when adding a 68pF cap over the probe, first image uncompensated, second image compensated and third image both compensated versions on top of each other in the same image.
I suppose the two dips at 5Mhz in the compensated version are because of the inductance in the wires connecting the 68pF, but below 3Mhz, both compensated versions are exactly equal so I did not try to correct this.

2) I didn't understand your comment that you were not surprised,
I did both Tektronix tests for resp. 10uF and 1mF and got exactly the same results with my formulas.
You even got the Excel file that calculated these results.

The simulation with LTSpice also gave the exact same plot as my real life DUT measurement.
What else do you need as a prove that my formulas are correct ?

Hans
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim,

I have the impression that you still find it hard to believe that there's something wrong with your calculations.
That's why I have implemented the full Tektronix formulas from the link that you gave.
I ran two sessions, one with the DUT with 100R/1mH+38R/1nF, first image below.
The other one was with the 100R+10nF in series, where we had the discussion whether Resr could be -50R, see second image below,
I gave both models these two files:  model1 with my math , the other model2 with the Tektronix math.
I overlaid the outcome of both ways of calculation to clearly see the differences between the two.

Conclusion: For Imp, Resr and Induction, result is exactly the same as was to be expected.
Only the Capacity differs because of the reason I mentioned before, that when having j in the numerator and in the denominator, you can not simply put an equation upside down, as was also 100% confirmed in the LTSpice simulation.
But nevertheless, the plot produced using this simplification, seems quite useable so I can live with it.
Where Tektronix differs from my math, I have put a T in red on the plotted line.

One example of what is still not O.K. in your Imp Viewer is visible for the 100+10nF series giving Resr=-50R and the L=250H both at 100Hz, because as you see they have to be resp 43K an 22H, So it's not the math that is wrong, but something in your calculation goes aside.
Hope you can find it.

Hans
 

Online _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1521
  • Country: be
I have the impression that you still find it hard to believe that there's something wrong with your calculations.
That's why I have implemented the full Tektronix formulas from the link that you gave.
I ran two sessions, one with the DUT with 100R/1mH+38R/1nF, first image below.
The other one was with the 100R+10nF in series, where we had the discussion whether Resr could be -50R, see second image below,
I gave both models these two files:  model1 with my math , the other model2 with the Tektronix math.
I overlaid the outcome of both ways of calculation to clearly see the differences between the two.
Conclusion: For Imp, Resr and Induction, result is exactly the same as was to be expected.
Only the Capacity differs because of the reason I mentioned before, that when having j in the numerator and in the denominator, you can not simply put an equation upside down, as was also 100% confirmed in the LTSpice simulation.
But nevertheless, the plot produced using this simplification, seems quite useable so I can live with it.
Where Tektronix differs from my math, I have put a T in red on the plotted line.
 
Your impression is indeed correct. Below the Tektronix math vs mine (screenshots from post 32) To express the Tektronix formula’s in "gain", you only have to divide by Va1. When you do that you get EXACTLY the same formula. No mathematical simplification, the same.  If you see it otherwise, please point me to the difference.

The reason for the difference between your graph and the Tektronix one, is by not calculating for current first, as explained above. See the second term in equation 3 of Tektronix, this is the reason for your difference. If the measured phase goes to 90° (pure inductive or capacitive loads), the second term disappears and the data is the same. Also as explained above.

One example of what is still not O.K. in your Imp Viewer is visible for the 100+10nF series giving Resr=-50R and the L=250H both at 100Hz, because as you see they have to be resp 43K an 22H, So it's not the math that is wrong, but something in your calculation goes aside.
 

As also  explained above, I limit the gain to zero (so positive gains are removed), but you seem to insist to pick a part of the plot were the DUT was acting as an active device. This was a deliberate choice or mine, because otherwise plots can have a very large difference between min and max, causing the user to have to zoom in every time he wants to see the "interesting part" (because the part were the DUT acts an amplifier does not mean anything). 

That's why I have implemented the full Tektronix formulas from the link that you gave.
I ran two sessions, one with the DUT with 100R/1mH+38R/1nF, first image below.
The other one was with the 100R+10nF in series, where we had the discussion whether Resr could be -50R, see second image below,
I gave both models these two files:  model1 with my math , the other model2 with the Tektronix math.
I overlaid the outcome of both ways of calculation to clearly see the differences between the two.
 
Can you post your excel file? I would expect that ESR becomes negative where the DUT becomes an amplifier. The direction inversion in your plot seems strange to me as the measure profile is both smooth for phase and gain.
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Hi Wim,

I must say, you are rather hard to convince, but anyhow, here is the Excel file. That should finally convince you as it follows exactly each step accordingly.
Used file is the 100R+10nF in series that you already have with Rref=100R
And as said, it's obviously not the math that is wrong, but there must be something going wrong in your calculation giving L=246H and Resr=50R at 100Hz instead of 21.6H and 43.8K, and there is more.

Hans


 
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
You mentioned to limit the gain to one.
That will indeed increase the value of L considerably (and influence the capacity) , but also the value of Resr will increase to ca 47K at 100Hz and higher.
So after all the things I have done so far, it seems fair to say that now it's your turn to tell what exactly it is that you do on top of calculating the formulas , that may help to explain part of the differences.

Hans
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf