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

0 Members and 1 Guest are viewing this topic.

Offline HalFET

  • Frequent Contributor
  • **
  • Posts: 512
  • Country: 00
To further elaborate on it, since you're using gain apparently (assuming I read your code correctly) we'll have to convert the scope's measurement error to gain error:
Gain = 20 log(V1/V2)
dGain/dV1 = - 20 / V1
dGain/dV2 = 20 / V2

So then:
Gain Error = sqrt( (dGain/dV1 * V1_Error)^2 + (dGain/dV2 * V2_Error)^2 )
Gain Error = sqrt( (20 / V1 * V1_Error)^2 + (20 / V2 * V2_Error)^2 )
Gain Error = 20 * sqrt( (V1_Error / V1)^2 + (V2_Error / V2)^2 )

Next we need to put this into Z_DUT = Z_REF * V1 / (V2 - V1)

If we rework it a bit it should become Z_DUT = Z_REF / (V2 / V1 - 1) = Z_REF / (1 / (V1/V2) - 1)

Then V1/V2 = (|V1| < Phi)/(V2 < 0°) = (|V1| * cos(phi) + j * |V1| * sin(phi)) / |V2| so we need to know the error on |V1|/|V2|.

Since |V1|/|V2| = 10^(Gain/20) the error becomes sqrt((Gain Error * 2^((x-40)/20) * 5^((x-20)/20) * ln(10))^2)

I'll do the rest later.
« Last Edit: March 01, 2019, 11:31:16 am by HalFET »
 
The following users thanked this post: 2N3055

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
To further elaborate on it, since you're using gain apparently (assuming I read your code correctly) we'll have to convert the scope's measurement error to gain error:
Gain = 20 log(V1/V2)
dGain/dV1 = - 20 / V1
dGain/dV2 = 20 / V2

So then:
Gain Error = sqrt( (dGain/dV1 * V1_Error)^2 + (dGain/dV2 * V2_Error)^2 )
Gain Error = sqrt( (20 / V1 * V1_Error)^2 + (20 / V2 * V2_Error)^2 )
Gain Error = 20 * sqrt( (V1_Error / V1)^2 + (V2_Error / V2)^2 )

Next we need to put this into Z_DUT = Z_REF * V1 / (V2 - V1)

If we rework it a bit it should become Z_DUT = Z_REF / (V2 / V1 - 1) = Z_REF / (1 / (V1/V2) - 1)

Then V1/V2 = (|V1| < Phi)/(V2 < 0°) = (|V1| * cos(phi) + j * |V1| * sin(phi)) / |V2| so we need to know the error on |V1|/|V2|.

Since |V1|/|V2| = 10^(Gain/20) the error becomes sqrt((Gain Error * 2^((x-40)/20) * 5^((x-20)/20) * ln(10))

I'll do the rest later.

Wow, thanks for this. I will have a detailed look at it this weekend, to late for math now...  :)
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
New version in first post:

Bugfix:
- was not possible any longer to open multiple FRA4Pico plots (was always opening new plot).

Other changes:
- cursor info always same nr of lines (so chart does not move when right mouse button is used)
- pompt on exit when unsaved files are present
 
The following users thanked this post: 2N3055, HalFET

Offline HalFET

  • Frequent Contributor
  • **
  • Posts: 512
  • Country: 00
To further elaborate on it, since you're using gain apparently (assuming I read your code correctly) we'll have to convert the scope's measurement error to gain error:
Gain = 20 log(V1/V2)
dGain/dV1 = - 20 / V1
dGain/dV2 = 20 / V2

So then:
Gain Error = sqrt( (dGain/dV1 * V1_Error)^2 + (dGain/dV2 * V2_Error)^2 )
Gain Error = sqrt( (20 / V1 * V1_Error)^2 + (20 / V2 * V2_Error)^2 )
Gain Error = 20 * sqrt( (V1_Error / V1)^2 + (V2_Error / V2)^2 )

Next we need to put this into Z_DUT = Z_REF * V1 / (V2 - V1)

If we rework it a bit it should become Z_DUT = Z_REF / (V2 / V1 - 1) = Z_REF / (1 / (V1/V2) - 1)

Then V1/V2 = (|V1| < Phi)/(V2 < 0°) = (|V1| * cos(phi) + j * |V1| * sin(phi)) / |V2| so we need to know the error on |V1|/|V2|.

Since |V1|/|V2| = 10^(Gain/20) the error becomes sqrt((Gain Error * 2^((x-40)/20) * 5^((x-20)/20) * ln(10))^2)

I'll do the rest later.

Fixed a little error, forgot the ^2 on the ratio of |V1|/|V2|  error, but I'd just replace it with abs() in software. Also didn't remember that cos(x) + j*sin(x) = e^(j*x).

The error on V1/V2 then becomes:

d(V1/V2)/d(|V1|/|V2|) = exp(j*phi)
d(V1/V2)/d(phi) = (|V1|/|V2|)*exp(j*(phi+0.5*pi))
Error V1/V2 = sqrt((d(V1/V2)/d(|V1|/|V2|) * Error(|V1|/|V2|))^2 + (d(V1/V2)/d(phi) * Error(Phi))


 

Offline HalFET

  • Frequent Contributor
  • **
  • Posts: 512
  • Country: 00
Redid it entirely in Matlab to avoid errors (think a few might have sneaked in already, like I forgot a ln(10) in the gain error probably):
Code: [Select]
syms REF_Magnitude positive; syms Error_REF_Magnitude positive;
syms REF_Phi real;           syms Error_REF_Phi positive;
syms V1_Magnitude positive;  syms Error_V1_Magnitude positive;
syms V1_Phi real;            syms Error_V1_Phi positive;
syms V2_Magnitude positive;  syms Error_V2_Magnitude positive;

%Calculate Gain error based on scope measurements
%This should be a function of the scope which is calculated once.
TrueGain = 20 * log10(V1_Magnitude / V2_Magnitude);

dGain_dV1 = diff(TrueGain, V1_Magnitude);
dGain_dV2 = diff(TrueGain, V2_Magnitude);
TrueGain_Error = sqrt( (dGain_dV1 * Error_V1_Magnitude)^2 + (dGain_dV2 * Error_V2_Magnitude)^2 );


%Lets assume the Gain and Gain_Error are input variables
syms Gain Gain_Error real;

%Calculate V1/V2 error based on Gain error
V1_V2_Magn_ratio = 10 ^ (Gain / 20);
Error_V1_V2_Magn_ratio = abs(diff(V1_V2_Magn_ratio, Gain) * Gain_Error);

V1_V2 = V1_V2_Magn_ratio * exp(1i * V1_Phi);

dV1_V2_dGain   = diff(V1_V2, Gain);
dV1_V2_dV1_Phi = diff(V1_V2, V1_Phi);
V1_V2_Error = sqrt(( dV1_V2_dGain * Gain_Error)^2 + (dV1_V2_dV1_Phi * Error_V1_Phi)^2);

%Device Under Test
Z_REF = REF_Magnitude * exp(1i * REF_Phi);
Z_DUT = Z_REF * 1 / (1 / V1_V2 - 1);
Z_DUT_Magnitude = abs(Z_DUT);
Z_DUT_Phase     = angle(Z_DUT);

Z_DUT_Magnitude_deltas  = [diff(Z_DUT_Magnitude, REF_Magnitude) diff(Z_DUT_Magnitude, REF_Phi) diff(Z_DUT_Magnitude, Gain) diff(Z_DUT_Magnitude, V1_Phi)];
Z_DUT_Magnitude_errors  = [Error_REF_Magnitude Error_REF_Phi Gain_Error Error_V1_Phi];
Z_DUT_Phase_deltas      = [diff(Z_DUT_Phase, REF_Magnitude) diff(Z_DUT_Phase, REF_Phi) diff(Z_DUT_Phase, Gain) diff(Z_DUT_Phase, V1_Phi)];
Z_DUT_Phase_errors      = [Error_REF_Magnitude Error_REF_Phi Gain_Error Error_V1_Phi];

Z_DUT_Magnitude_Error   = sqrt(sum((Z_DUT_Magnitude_deltas .* Z_DUT_Magnitude_errors).^2));
Z_DUT_Phase_Error       = sqrt(sum((Z_DUT_Phase_deltas .* Z_DUT_Phase_errors).^2));


Code: [Select]
Z_DUT_Magnitude = REF_Magnitude/abs(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1)
Z_DUT_Phase = angle(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1))

Z_DUT_Magnitude_Error = (Error_REF_Magnitude^2/abs(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^2 - (1/10^(Gain/10)*Error_V1_Phi^2*REF_Magnitude^2*sign(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1)^2*exp(-V1_Phi*2i))/abs(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^4 + (1/10^(Gain/10)*Gain_Error^2*REF_Magnitude^2*sign(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1)^2*exp(-V1_Phi*2i)*log(10)^2)/(400*abs(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^4))^(1/2)
Z_DUT_Phase_Error = ((Gain_Error^2*real(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1))^4*(imag((1/10^(Gain/20)*exp(REF_Phi*1i)*exp(-V1_Phi*1i)*log(10))/(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^2)/(20*real(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1))) - (real((1/10^(Gain/20)*exp(REF_Phi*1i)*exp(-V1_Phi*1i)*log(10))/(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^2)*imag(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1)))/(20*real(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2))^2)/(imag(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2 + real(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2)^2 + (Error_V1_Phi^2*real(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1))^4*(real((1/10^(Gain/20)*exp(REF_Phi*1i)*exp(-V1_Phi*1i))/(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^2)/real(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1)) + (imag((1/10^(Gain/20)*exp(REF_Phi*1i)*exp(-V1_Phi*1i))/(exp(-V1_Phi*1i)/10^(Gain/20) - 1)^2)*imag(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1)))/real(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2)^2)/(imag(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2 + real(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2)^2 + (Error_REF_Phi^2*real(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1))^4*(imag(exp(REF_Phi*1i)/(1/10^(Gain/20)*exp(-V1_Phi*1i) - 1))^2/real(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2 + 1)^2)/(imag(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2 + real(exp(REF_Phi*1i)/(exp(-V1_Phi*1i)/10^(Gain/20) - 1))^2)^2)^(1/2)

This isn't very practical though, the question is where to start simplifying. Or better yet, what's an acceptable error estimate. The flu hit me a bit too hard for me to think straight about this one for now, heheh.
 
The following users thanked this post: _Wim_

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Yikes  :o. That's alot of math to check this weekend. Maybe I will need a couple more...  :)
 

Offline HalFET

  • Frequent Contributor
  • **
  • Posts: 512
  • Country: 00
Yikes  :o. That's alot of math to check this weekend. Maybe I will need a couple more...  :)
It just over-inflates very quickly if you don't use in-between answers and simplify some terms, it ain't as bad as it looks. The principle behind error/uncertainty calculations is really simple though: Error of Value = sqrt( sum of (dValue/dx1 * Error of x_i)^2 for all variables x_i)

So it'd be a lot more practical to calculate dValue/dx_i for each variable, and then just add it all up together like that like I did in the Matlab code. Just a bit too hazy to cut it up into pieces at the moment, should be easy enough to do if you fire that code up in Matlab or Octave though.

But the main interesting bit is that the gain error in practice stays quite flat until you go into the lower ranges, there the potential offset error of the scope can kill it for you.
Code: [Select]
Series = 0.001:0.005:10;
[X, Y] = meshgrid(Series, Series);
Z = 20 .* log10(X./Y);

figure(1);
surf(X, Y, Z, 'edgecolor', 'none');
xlabel('V2 [V]');
ylabel('V1 [V]');
zlabel('Gain [dB]');
title('Voltage Gain - Decibel');

%Scope error =  Gain error + Offset error + ADC error
%            =  +/- 5% value +/- 5 mV +/- 0.25% range

Range1X = X <= 0.1;                         Range1Y = Y <= 0.1;
Range2X = xor(X <= 1, Range1X);             Range2Y = xor(Y <= 1, Range1Y);
Range3X = xor(X <= 10, Range1X | Range2X);  Range3Y = xor(Y <= 10, Range1Y | Range2Y);


XError = 0.05 .* X + 0.005 + 0.0025 .* (Range1X .* 0.1 + Range2X .* 1 + Range3X .* 10);
YError = 0.05 .* Y + 0.005 + 0.0025 .* (Range1Y .* 0.1 + Range2Y .* 1 + Range3Y .* 10);
ZError = (20 ./ log(10)) .* sqrt((YError./Y).^2 + (XError./X).^2 );

figure(2);
surf(X, Y, ZError, 'edgecolor','none');
xlabel('V2 [V]');
ylabel('V1 [V]');
zlabel('Gain Error [dB]');
title('Voltage Gain Error - Decibel Error');

Operating on the assumption that the 39°C fever hasn't completely fried my brain, you're looking at something along the lines of <0.75 dB as of uncertainty throughout the practical range. Practical offset errors will probably be less than 2 mV, and the gain error on any modern scope frontend ought to be less than 5% really. See attached plots for 0 through 10V with the values of the code above.
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
First let me explain the current calculation that is in the software:

        V1 o------+
              |
             | |
             | | Z_REF
             | |
              |
   V2 o------+
              |
             | |
             | | Z_DUT
             | |
              |
            ___
   GND     -

   Z_DUT = V2 / I

   I = Rref / (V2 - V1)
   
   => Z_DUT = Rref* V2 / (V1-V2)

   Angle between V1 and V2 = θ, V1 at 0°equal to siggen.

   Current in polar coordinates: [r=sqrt(X²+Y²) //  α= tan-1 (y/x) ]
   <=> I = Rref / sqrt((V1 - V2 * cosθ)² +(V2 * sinθ)²)
   <=> I = Ref / sqrt(V1²-2 * V1 * V2 * cosθ + V2²)


  Magnitude & angle of Z_DUT: [dividing vectors in polar coordinates = divide magnitudes and substract phases]
        Z_DUT = Rref* V2 / sqrt(V1²-2*V1* V2*cosθ + V2²)
        α =  θ – tan-1 ((-V2* sinθ)/(V1-V2* cosθ))

  To translate the above to “gain”, we know <=> gain = V2/V1

   -----------------------------------------------------------
   | Zmag = Rref* gain / sqrt(1-2*gain* cosθ + gain²) |
   ----------------------------------------------------------- (equation 1)
   -----------------------------------------------------
   | α =  θ – tan-1 ((-gain* sinθ)/(1-gain* cosθ)) |
   ------------------------------------------------- ---(equation 2)

   Capacitance:
   -------------
   Z_DUT expressed in rectangular format has only a real part equal to Resr and a negative imaginary part equal to 1/(2*π* f*C)
   
   Z_DUT = Resr – j / (2*π* f*C)
   
   Z_DUT = Zmag* cosα + j* Zmag*sinα
   =>

  --------------------------
  | Resr = Zmag* cosα  |
  -------------------------- (equation 3)
 
  Zmag* sinα = -1 / (2 * π * f * C) <=>

  ----------------------------------------
  | C = -1 / (2 * π * f * Zmag * sinα |
  ----------------------------------------(equation 4)

  Inductance:
  ------------

  Z_DUT expressed in rectangular format has only a real part equal to Resr and a positive imaginary part equal to 2*π* f*L

  Z_DUT = Resr + j * 2 * π * f * L

  Z_DUT = Zmag* cosα + j* Zmag*sinα
  =>

   --------------------------
   | Resr = Zmag* cosα  |
   -------------------------- (equal to equation 3)
   --------------------------------
   | L = Zmag* sinα / (2*π* f) |
   --------------------------------- (equation 5)
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Calibration:

If we perform the calibration with a purely resistive calibration resistor Rcal, we know Z_TOT  will consist of Rcal + Z_ERR

In rectangular coordinates we can express this as

Z_TOT = Zmag_err*cosα_err + Rcal + j* Zmag_err*sinα_err
Z_TOT =  Zmag*cosα                      + j*Zmag*sinα

=>
Zmag*cosα = Zmag_err*cosα_err + Rcal (1)
Zmag*sinα = Zmag_err*sinα_err (2)

(2) Can be changed to:

-----------------------------------------
| Zmag_err = Zmag*sinα / sinα_err |
----------------------------------------- (equation 6)

Substituting equation 6 into (1)

Zmag*cosα = = Zmag*sinα *cosα_err/sinα_err   + Rcal <=>

------------------------------------------------------------
| α_err = tan-1 (Zmag* sinα / (Zmag*cosα – Rcal))  |
------------------------------------------------------------ (equation 7)

This way we know the error vector that can be used to adjust the measurement in the future.
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Calculation of DUT with correction:

We know Z_TOT  will consist of Z_DUT + Z_ERR

In rectangular coordinates we can express this as
Z_TOT = Zmag_err*cosα_err + Zmag_DUT*cosα_DUT + j* (Zmag_err*sinα_err + Zmag_DUT *sinα_DUT)
Z_TOT =  Zmag*cosα                                                + j*Zmag*sinα
=>

Zmag*cosα =  Zmag_err*cosα_err + Zmag_DUT*cosα_DUT
Zmag*sinα = Zmag_err*sinα_err + Zmag_DUT *sinα_DUT
=>
------------------------------------------------------------------------
| Zmag_DUT = (Zmag*sinα - Zmag_err*sinα_err) / sinα_DUT   |
------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
| α_DUT = tan-1 ((Zmag*sinα - Zmag_err*sinα_err)/ (Zmag*cosα - Zmag_err*cosα_err)) |
------------------------------------------------------------------------------------------------------

The capacitance and inductance formulae above can now be changed with Zmag_DUT and α_DUT.


I am not a Matlab guy, so did not check this, just tried to make my written calculations in digital format.

Basic principle would be as follows:

- run a calibration with an Rcal reference resistor once. This file will be saved with values for Zmag_err and α_err for each frequency (interpollation will be used for in between frequencies)

- measure a DUT.
    * first calucalate Zmag + α
    * lookup Zmag_err + α_err from the calibration file for each frequency
    * based on the above, calculate Zmag_dut and α_DUT
    * caculate capacitance and inductance using these last 2

Am I missing something? Although I am currently not sick, my head also goes to 39°C when doing this stuff, so could be full with mistakes. So to all the math guru's, please check  :)

All of this is off course only true if Z_ERR can be thought of as an impedance in series with Z_DUT...


edit: some spelling mistakes, copy paste error and clarifications
« Last Edit: March 03, 2019, 08:45:09 pm by _Wim_ »
 

Offline Hans Polak

  • Contributor
  • Posts: 39
  • Country: nl
Wim,
I downloaded your nice calculation tool and it seems to work fine on the .csv file produced by FRA4Picoscope.
Problem however is that although FRA4Picoscope produces nice Bode plots, they show 1/A instead of input A, no idea why. Your tool obviously assumes an A and not an 1/A.

That's why I tried "Measure" in your program.
A nice screen appears with all relevant parameters to be entered, but when I press "start Measurement", I get a message "Unhandled Exception" and when  clicking continue nothing further happens.
I have installed SDK from Picoscope, but that makes no difference.
Do I still need some additional software on my machine ?
I have a 5243B PicoScope and my computer has Windows 10.

I enclosed as a .txt file the .CSV file for a bode plot of a 2200 Ohm Rsense between B and A and a 1mH +56 Ohm coil between A and Gnd plus what FRA4Picoscope made of it.

Hans


 


 

Offline _Wim_Topic starter

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

If I see the plot from FRA4Picoscope, I think you got input and output channel mixed up , because your gain can never be bigger than 0db with a passive device and a series resistance (input channel = input to DUT; output= output from DUT, it gets me confused also quite regularly). My app does not case which channels were used, I only look at gain and phase in the CSV file.
As for my app crashing, normally there should be a log file in the execution directory. Can you post that one here? Did you close FRA4Picoscope while testing with my app (both cannot be run at the same time because both want access to the scope)?If FRA4Picoscope runs fine, you normally do not need to install anything else.

 

Offline Hans Polak

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

Thanks for your rapid reply.
You are right, changing the A and the B inputs returns the correct information.
I have now the DUT from input B to gnd and not from input A as in your instruction.
Thanks again,

Hans


 

Offline Evodad

  • Contributor
  • Posts: 21
  • Country: se
Hi Wim,

I have used FRA4 quite a lot on and of since it was released. So yours is a really nice contribution to the tools for Picoscope,
expanding on the usability !

As for Hans in the Previous post I can't get the included measurement application to work. See attached file.
With FRA4 everything works just fine.

As for calibration and improvements. May I suggest to add checkboxes with a number for each loaded file.
(Or some other good way to do it)
  • Unchecking will remove them from display
  • Simple functions could take Trace 1 and subract from Trace 2 (where Trace 1 could be e.g a zero ohm refererence)
  • You could save a combination of data as new data
  • You could delete Trace X of not needed anymore etc

Keep up the good work !

)) Kind regards, Per

 

Offline _Wim_Topic starter

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

I have used FRA4 quite a lot on and of since it was released. So yours is a really nice contribution to the tools for Picoscope,
expanding on the usability !

As for Hans in the Previous post I can't get the included measurement application to work. See attached file.
With FRA4 everything works just fine.

As for calibration and improvements. May I suggest to add checkboxes with a number for each loaded file.
(Or some other good way to do it)
  • Unchecking will remove them from display
  • Simple functions could take Trace 1 and subract from Trace 2 (where Trace 1 could be e.g a zero ohm refererence)
  • You could save a combination of data as new data
  • You could delete Trace X of not needed anymore etc

Keep up the good work !

)) Kind regards, Per

Hi,

Could you post the "log4net.log" file from the execution directory. I hope this will give me some additional info.

Deleting a trace is possible already, just left click on legend item you want to remove.

As to the other improvements, some things were already planned, but I have been quite occupied with actual work lately, and lost a bit of momentum on this. This started out as a "quick and dirty" personal tool, and I should make some quite big structure changes to add things like you requested more easily.

 

Offline Evodad

  • Contributor
  • Posts: 21
  • Country: se
Just answered but that reply does seem to have gone into Cyberspace....
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
into Cyberspace....

My debugger does not run wel there...  ::)
 

Offline Evodad

  • Contributor
  • Posts: 21
  • Country: se
Added Log first changed to .txt then zipped and changed to .txt, will it post :)

YES, this worked better !!!
« Last Edit: April 21, 2019, 11:03:49 am by Evodad »
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Added Log first changed to .txt then zipped and changed to .txt, will it post :)

YES, this worked better !!!

Something is not correct, because the file does not contain any readable text. Normally you should be able to open this file in notepad and see something like this:

Code: [Select]
2019-03-07 22:02:35,865 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetDoubleValue: SettingName:StartFrequencyHz DefaultValue:100
2019-03-07 22:02:35,904 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:StartFrequencyHz
2019-03-07 22:02:35,908 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:35,913 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetIntValue: SettingName:ExtraSettlingTimeMs DefaultValue:30
2019-03-07 22:02:35,919 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:ExtraSettlingTimeMs
2019-03-07 22:02:35,926 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:35,934 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetDoubleValue: SettingName:StimulusOffset DefaultValue:0
2019-03-07 22:02:35,941 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:StimulusOffset
2019-03-07 22:02:35,950 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:35,956 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetDoubleValue: SettingName:InitialStimulus DefaultValue:0,1
2019-03-07 22:02:35,963 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:InitialStimulus
2019-03-07 22:02:35,966 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:35,973 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetDoubleValue: SettingName:OutputDCOffset DefaultValue:0
2019-03-07 22:02:35,978 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:OutputDCOffset
2019-03-07 22:02:35,986 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:35,995 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetStringValue: SettingName:OutputChannel DefaultValue:B
2019-03-07 22:02:36,001 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:OutputChannel
2019-03-07 22:02:36,006 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:36,010 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetStringValue: SettingName:OutputAttenuation DefaultValue:X1
2019-03-07 22:02:36,016 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:OutputAttenuation
2019-03-07 22:02:36,023 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
2019-03-07 22:02:36,030 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsManager - GetStringValue: SettingName:OutputCoupling DefaultValue:DC
2019-03-07 22:02:36,039 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetValue fileType:Settings section:Picoscope settingName:OutputCoupling
2019-03-07 22:02:36,046 [1] DEBUG WHConsult.Utils.Settings.IniFiles.IniSettingsController - GetInifile fileType:Settings
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Can you try to copy the app to your local C-drive with a short pathname and execute it from there?
 

Offline Evodad

  • Contributor
  • Posts: 21
  • Country: se
Sorry if a confused you.

The file was orginaly: log4net.log, this did not work to post so I changed it to log4net.log.txt
This did not work either so I took log4net.log.txt and Zipped the file to log4net.log.txt.ZIP
and changed the .ZIP with .txt to log4net.log.txt.txt.

So to go back, change from .txt to .ZIP and then you should have your file after Unzipping.

)) Kind regards, Per
« Last Edit: April 21, 2019, 12:08:44 pm by Evodad »
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Ok, now I could open the log, but it seems like the log is not from the time the app crashed (the app was opened again afterwards, so more info was added to the log).

I have added some more code to log better were I think the crash occurs. Can you please run the attached version, and copy the log to here directly after the app crash occurred?

Did you try to run the app from the C-drive directly?
 

Offline Evodad

  • Contributor
  • Posts: 21
  • Country: se
This should do it I hope, booth from 1008 and 1009. Just Zipped this time :)

Running it from the C-drive didn't make a difference.

)) Per
« Last Edit: April 22, 2019, 07:33:48 am by Evodad »
 

Offline Hans Polak

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

Thanks for the wonderful job you did, especially with the cursor and using FRA4PS as input works fine for me.
I have a point to mention.
In the image showing the impedance, the program also shows a phase. However this is the phase that belongs to the Gain.
In the Image below I show the difference phase that belongs to the impedance.

Hans
 

Offline _Wim_Topic starter

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
This should do it I hope, booth from 1008 and 1009. Just Zipped this time :)

Running it from the C-drive didn't make a difference.

)) Per

Seems to be related to a 32-bit vs 64-bit conflict when calling the DLL from FRA4Picoscope. I suspect your running on x64, can you try if you can run the attached version, or experiment with running the exe in compatability mode.

According to this (https://bitbucket.org/hexamer/fra4picoscope/wiki/Home), currently only 32-bit is supported (I am running still 32-bit, so this could be the reason).

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf