Post Go back to editing

AD5933 Understanding gain factor and calibration

I have a fully functioning setup using the Diligent impedance analyzer module PmodIA.  I don't understand how I am supposed to calibrate the device to measure an unknown impedance.  My program below will calculate the correct impedance of any resistor over any frequency range if I first calibrate that resistor and use the gain factor at each frequency step to calculate the impedance.  If however I calibrate with one resistor and try and use the calculated gain to measure another I don't get what I expect.  I don't think this is a programming problem per se but more a better understanding of the steps is required.  I repeated the steps below after changing the output voltage to 200mV p-p and the results were similar.  Thanks.

Calibrated, measured, and impedance calculated with 200K resistor from1-11KHz:

1.0KHz A=0.00000000029628510475 R=-16841 I=1065 |Z|=200011.81
2.0KHz A=0.00000001781990432739 R=279 I=-37 |Z|=199390.57
3.0KHz A=0.00000003652457952499 R=136 I=-28 |Z|=197179.28
4.0KHz A=0.00000009405544281005 R=51 I=-15 |Z|=200000.00
5.0KHz A=0.00000020244407653808 R=25 I=-10 |Z|=183453.46
6.0KHz A=0.00000018306301116943 R=25 I=-11 |Z|=200000.00
7.0KHz A=0.00000015103051662445 R=27 I=-16 |Z|=210968.28
8.0KHz A=0.00000035355334281921 R=12 I=-10 |Z|=181071.48
9.0KHz A=0.00000047036037445068 R=7 I=-6 |Z|=230600.23
10.0KHz A=0.00000039043440818786 R=9 I=-8 |Z|=212700.21
11.0KHz A=0.00000028261671066284 R=13 I=-12 |Z|=200000.00

Calibrated, measured, and impedance calculated with 120K resistor from1-11KHz:

1.0KHz A=0.00000000049383964538 R=-16842 I=1065 |Z|=119992.46
2.0KHz A=0.00000002969984054565 R=278 I=-37 |Z|=120057.21
3.0KHz A=0.00000006035161972045 R=136 I=-28 |Z|=119332.17
4.0KHz A=0.00000015873737335205 R=51 I=-15 |Z|=118504.47
5.0KHz A=0.00000034483580589294 R=20 I=-10 |Z|=129688.86
6.0KHz A=0.00000030050773620605 R=25 I=-12 |Z|=120000.00
7.0KHz A=0.00000026552205085754 R=29 I=-16 |Z|=113709.32
8.0KHz A=0.00000058202528953552 R=14 I=-6 |Z|=112801.33
9.0KHz A=0.00000078393406867980 R=7 I=-8 |Z|=120000.00
10.0KHz A=0.00000065072393417358 R=11 I=-8 |Z|=112984.09
11.0KHz A=0.00000047102785110473 R=13 I=-12 |Z|=120000.00

Measured only (120K "unknown") and impedance calculated using gain from first (200K) calibration:

1.0KHz A=0.00000000029628515243 R=-16841 I=1065 |Z|=200011.79
2.0KHz A=0.00000001781990432739 R=278 I=-38 |Z|=200000.00
3.0KHz A=0.00000003652457952499 R=135 I=-28 |Z|=198579.85
4.0KHz A=0.00000009405544281005 R=50 I=-17 |Z|=201322.25
5.0KHz A=0.00000020244405269622 R=21 I=-10 |Z|=212371.53
6.0KHz A=0.00000018306301116943 R=25 I=-13 |Z|=193860.43
7.0KHz A=0.00000015103051662445 R=29 I=-15 |Z|=202794.75
8.0KHz A=0.00000035355331897735 R=15 I=-7 |Z|=170871.54
9.0KHz A=0.00000047036037445068 R=8 I=-8 |Z|=187916.23
10.0KHz A=0.00000039043440818786 R=10 I=-8 |Z|=200000.00
11.0KHz A=0.00000028261672973632 R=13 I=-12 |Z|=199999.98

Parents
  • Using PmodIA at low frequencies is tricky because the AD5933 "DFT" does not operate well below 10KHz producing substantial systematic errors in Re and Im results. Usually people reduce MCLK if low frequency operation is necessary.

  • Changing the frequency range did not solve the problem but I am not discounting your point either.

    The problem may be not enough signal at the input amplifier stage.  So I set the output voltage range to 1 (~3 V @ 5V Vcc) AND I switched Rfb to the 100k resistor and. That is I grounded the sel pin on the module.  Changing the output voltage level by itself did not help.  But going back to Rfb = 20 and changing the gain to x5 also resulted in better readings.

    Page 18 of the datasheet explains the system gain but I don't quite grok it all yet.  However, it seems that setting the gain, output voltage and selecting the correct feedback resistor Rfb for your particular application is critical.  The real value of the unknown resistor is 117K.  

    Current results:

    Cal resistor = 200K 1%

    80.0KHz A=0.00000000224191427230 R=1894 I=-1179 |Z|=199933.26
    81.0KHz A=0.00000000224630093574 R=1972 I=-1171 |Z|=194105.64
    82.0KHz A=0.00000000226644587516 R=1925 I=-1096 |Z|=199183.62
    83.0KHz A=0.00000000220377564430 R=1960 I=-1079 |Z|=202812.21
    84.0KHz A=0.00000000219569349288 R=1986 I=-1083 |Z|=201333.92
    85.0KHz A=0.00000000226266956329 R=2016 I=-1037 |Z|=194945.48
    86.0KHz A=0.00000000223688745498 R=1985 I=-1053 |Z|=198953.56
    87.0KHz A=0.00000000221387577056 R=1999 I=-1002 |Z|=202004.75
    88.0KHz A=0.00000000223917675018 R=2033 I=-967 |Z|=198374.42
    89.0KHz A=0.00000000221117663383 R=2050 I=-962 |Z|=199712.35
    90.0KHz A=0.00000000222384643554 R=2042 I=-933 |Z|=200294.53

    Unknown resistor = 120K 5%

    80.0KHz A=0.00000000224191427230 R=3351 I=-1239 |Z|=124848.16
    81.0KHz A=0.00000000224630093574 R=3386 I=-1220 |Z|=123691.61
    82.0KHz A=0.00000000226644587516 R=3323 I=-1177 |Z|=125158.40
    83.0KHz A=0.00000000220377564430 R=3378 I=-1059 |Z|=128178.78
    84.0KHz A=0.00000000219569349288 R=3383 I=-1031 |Z|=128777.63
    85.0KHz A=0.00000000226266956329 R=3422 I=-964 |Z|=124312.84
    86.0KHz A=0.00000000223688769340 R=3389 I=-928 |Z|=127228.34
    87.0KHz A=0.00000000221387577056 R=3401 I=-884 |Z|=128541.67
    88.0KHz A=0.00000000223917675018 R=3407 I=-821 |Z|=127433.19
    89.0KHz A=0.00000000221117663383 R=3437 I=-769 |Z|=128407.36
    90.0KHz A=0.00000000222384643554 R=3423 I=-736 |Z|=128432.3

Reply
  • Changing the frequency range did not solve the problem but I am not discounting your point either.

    The problem may be not enough signal at the input amplifier stage.  So I set the output voltage range to 1 (~3 V @ 5V Vcc) AND I switched Rfb to the 100k resistor and. That is I grounded the sel pin on the module.  Changing the output voltage level by itself did not help.  But going back to Rfb = 20 and changing the gain to x5 also resulted in better readings.

    Page 18 of the datasheet explains the system gain but I don't quite grok it all yet.  However, it seems that setting the gain, output voltage and selecting the correct feedback resistor Rfb for your particular application is critical.  The real value of the unknown resistor is 117K.  

    Current results:

    Cal resistor = 200K 1%

    80.0KHz A=0.00000000224191427230 R=1894 I=-1179 |Z|=199933.26
    81.0KHz A=0.00000000224630093574 R=1972 I=-1171 |Z|=194105.64
    82.0KHz A=0.00000000226644587516 R=1925 I=-1096 |Z|=199183.62
    83.0KHz A=0.00000000220377564430 R=1960 I=-1079 |Z|=202812.21
    84.0KHz A=0.00000000219569349288 R=1986 I=-1083 |Z|=201333.92
    85.0KHz A=0.00000000226266956329 R=2016 I=-1037 |Z|=194945.48
    86.0KHz A=0.00000000223688745498 R=1985 I=-1053 |Z|=198953.56
    87.0KHz A=0.00000000221387577056 R=1999 I=-1002 |Z|=202004.75
    88.0KHz A=0.00000000223917675018 R=2033 I=-967 |Z|=198374.42
    89.0KHz A=0.00000000221117663383 R=2050 I=-962 |Z|=199712.35
    90.0KHz A=0.00000000222384643554 R=2042 I=-933 |Z|=200294.53

    Unknown resistor = 120K 5%

    80.0KHz A=0.00000000224191427230 R=3351 I=-1239 |Z|=124848.16
    81.0KHz A=0.00000000224630093574 R=3386 I=-1220 |Z|=123691.61
    82.0KHz A=0.00000000226644587516 R=3323 I=-1177 |Z|=125158.40
    83.0KHz A=0.00000000220377564430 R=3378 I=-1059 |Z|=128178.78
    84.0KHz A=0.00000000219569349288 R=3383 I=-1031 |Z|=128777.63
    85.0KHz A=0.00000000226266956329 R=3422 I=-964 |Z|=124312.84
    86.0KHz A=0.00000000223688769340 R=3389 I=-928 |Z|=127228.34
    87.0KHz A=0.00000000221387577056 R=3401 I=-884 |Z|=128541.67
    88.0KHz A=0.00000000223917675018 R=3407 I=-821 |Z|=127433.19
    89.0KHz A=0.00000000221117663383 R=3437 I=-769 |Z|=128407.36
    90.0KHz A=0.00000000222384643554 R=3423 I=-736 |Z|=128432.3

Children
  • Yes, all that you mentioned is critical. If you have access to oscilloscope it is worth hooking it up to pin RFB of the AD5933 and watching the waveform - it should be a well-formed sine wave without any distortions or clipping as this is what ends up at the input of the ADC at gain=1. At gain=5 second stage may start clipping, not possible to see on the scope, but worth keeping in mind.

    Running it on Rfb=20 explains too low values in columns R and I, which I assume now are Real and Imaginary data from the AD5933 registers. The rule of thumb is that at gain=1 and Vout = 3V your calibration resistor should preferably be be equal to Rfb and all the unknown resistors should be higher than Rfb. Using 20 Ohm resistor in PmodIA circuit is not the best idea: the switch and the OPAMP output resistances add somewhat unpredictable few Ohms to it, so much accuracy should not be expected. 

    If you want to see the effects of the "DFT" at low frequencies, just do not connect anything to PmodIA J3 and J4 and sweep your 1 - 11 KHz range. Theoretically Re and Im output values should be zero (nothing is connected, maybe a few counts here and there) at all frequencies, watch the deviation grow as frequency goes down. 

  • Hi Snorlax,

    How will I change the RFB. Since PMODIA will not give provision to connect the desired RFB resistors. 

    Could you please tell me the step by step method to calibrate my board?

    -Thanks

  • For calibration I would recommend to begin with Vexc and gain settings at 2V p-p and 1 respectively, select R8 as your RFB and use 100k calibration resistor. This would allow you to measure unknown impedance roughly equal to or  higher than 100k.

    Calibration and measurement steps are: 
    1. Connecting known calibration resistor Rcal between J3 and J4, measuring complex output (re and im) Out = Gain / Rcal.
    2. Calculating complex system Gain by multiplying the complex output value Out by the resistor value Rcal: Gain = Out * Rcal
    3. Attaching unknown impedance Zx and measuring complex output Outx = Gain / Zx
    4. Dividing complex Gain from step #2 by Outx from step #3, which yields the unknown complex impedance Zx: Zx = Gain / Outx.

    The only way to change the RFB is to carefully desolder the resistors R7 and/or R8 from the PCB trying not to damage the solder pads and to solder the desired RFB resistor(s) instead, please see the schematic here.

  • Thanks Snorlax! It’s working well now.

    what if I have to measure impedance lease than 10k ohm?

  • You would need to replace either R7 or R8 resistor with something like, say, 1k and select it with your SEL signal. Then following the steps we just discussed with a 1k Rcal would allow you to measure unknown impedance above 1k.

    Once you are comfortable with the basic measurements, you can use different excitation voltages. For example, without changing R8 you can set excitation voltage at 0.2V p-p, calibrate your PmodIA with Rcal = 10k and measure impedance 10k and higher with R8 being the same 100k.

    If you have access to an oscilloscope, the thing to watch is the voltage waveform at the RFB pin of the AD5933 - it should always be a well-formed sine wave without any distortion or clipping at the power supply rails throughout your calibration and measurement procedures.or you will get wrong results.