Post Go back to editing

EVAL-ADICUP3029 & EVAL-AD5941BATZ, AD5940_BATImpedance Problems

Category: Software
Product Number: EVAL-ADICUP3029 & EVAL-AD5941BATZ [45891791]

Hi,

After having successfully tested the EVAL-AD5941BATZ kit with the SensorPal software, I wanted to use the BATImpedance library from the GitHub platform to compile with IAR. I manage to compile but when I read the data they are apparently wrong :

The data :

Freq: 1.000000 (real, image) = ,37.162163 , -152.027023 ,mOhm
Freq: 1.247089 (real, image) = ,-206.896545 , 567.241394 ,mOhm
Freq: 1.555230 (real, image) = ,261.538452 , 157.692307 ,mOhm
Freq: 1.939510 (real, image) = ,-63.793106 , -284.482758 ,mOhm
Freq: 2.418741 (real, image) = ,15.000001 , 45.000000 ,mOhm
Freq: 3.016385 (real, image) = ,-46.153847 , 5.769231 ,mOhm
Freq: 3.761699 (real, image) = ,115.000000 , -45.000000 ,mOhm
Freq: 4.691173 (real, image) = ,-94.000000 , 12.000000 ,mOhm
Freq: 5.850308 (real, image) = ,-115.000000 , -205.000000 ,mOhm
Freq: 7.295854 (real, image) = ,-14.705883 , -41.176472 ,mOhm
Freq: 9.098577 (real, image) = ,-266.666687 , 133.333344 ,mOhm
Freq: 11.346732 (real, image) = ,-29.039303 , -7.205240 ,mOhm
Freq: 14.150382 (real, image) = ,-7.692308 , 88.461533 ,mOhm
Freq: 17.646782 (real, image) = ,0.000000 , -50.000000 ,mOhm
Freq: 22.007103 (real, image) = ,50.000000 , -50.000000 ,mOhm
Freq: 27.444809 (real, image) = ,-134.615387 , 273.076904 ,mOhm
Freq: 34.226112 (real, image) = ,50.000000 , -50.000000 ,mOhm
Freq: 42.682995 (real, image) = ,66.666672 , 0.000000 ,mOhm
Freq: 53.229485 (real, image) = ,46.341465 , -17.073172 ,mOhm
Freq: 66.381889 (real, image) = ,33.823528 , 39.705883 ,mOhm
Freq: 82.784103 (real, image) = ,66.666672 , -8.333334 ,mOhm
Freq: 103.239120 (real, image) = ,75.000000 , -275.000000 ,mOhm
Freq: 128.748337 (real, image) = ,-9.756097 , -12.195122 ,mOhm
Freq: 160.560593 (real, image) = ,0.000000 , 100.000000 ,mOhm
Freq: 200.233307 (real, image) = ,102.439026 , 28.048780 ,mOhm
Freq: 249.708694 (real, image) = ,66.853935 , -26.966291 ,mOhm
Freq: 311.408905 (real, image) = ,-200.000000 , 150.000000 ,mOhm
Freq: 388.354523 (real, image) = ,0.000000 , 30.000002 ,mOhm
Freq: 484.312531 (real, image) = ,-10.955056 , -47.471912 ,mOhm
Freq: 603.980713 (real, image) = ,41.176472 , 14.705883 ,mOhm
Freq: 753.217529 (real, image) = ,-68.918922 , 63.513512 ,mOhm
Freq: 939.329041 (real, image) = ,-73.076920 , 15.384616 ,mOhm
Freq: 1171.426636 (real, image) = ,-1.621622 , -30.270269 ,mOhm
Freq: 1460.872925 (real, image) = ,-72.602737 , 60.273975 ,mOhm
Freq: 1821.838135 (real, image) = ,92.920349 , -6.194690 ,mOhm
Freq: 2271.993896 (real, image) = ,-31.034481 , 222.413803 ,mOhm
Freq: 2833.377930 (real, image) = ,-12.500000 , -25.000000 ,mOhm
Freq: 3533.473633 (real, image) = ,3.503185 , -1.910828 ,mOhm
Freq: 4406.554688 (real, image) = ,-27.358490 , 20.754717 ,mOhm
Freq: 5495.364746 (real, image) = ,-110.000000 , -180.000000 ,mOhm
Freq: 6853.207520 (real, image) = ,55.882351 , 26.470589 ,mOhm
Freq: 8546.557617 (real, image) = ,-60.000004 , 30.000002 ,mOhm
Freq: 10658.315430 (real, image) = ,-63.414635 , 20.731707 ,mOhm
Freq: 13291.865234 (real, image) = ,6.234414 , 24.688280 ,mOhm
Freq: 16576.134766 (real, image) = ,150.000000 , 50.000000 ,mOhm
Freq: 20671.910156 (real, image) = ,25.000000 , 25.000000 ,mOhm
Freq: 25779.707031 (real, image) = ,58.620689 , 3.448276 ,mOhm
Freq: 32149.580078 (real, image) = ,-38.461540 , 7.692308 ,mOhm
Freq: 40093.378906 (real, image) = ,13.461539 , 17.307693 ,mOhm
Freq: 50000.000000 (real, image) = ,39.285713 , 32.142857 ,mOhm


Here are the settings :

AppBATCfg_Type *pBATCfg;

AppBATGetCfg(&pBATCfg);
pBATCfg->SeqStartAddr = 0;
pBATCfg->MaxSeqLen = 512;
pBATCfg->RcalVal = 50.0; /* Value of RCAL on EVAL-AD5941BATZ board is 50mOhm */
pBATCfg->ACVoltPP = 300.0f; /* Pk-pk amplitude is 300mV */
pBATCfg->DCVolt = 1200.0f; /* Offset voltage of 1.2V*/
pBATCfg->DftNum = DFTNUM_8192;

pBATCfg->FifoThresh = 2; /* 2 results in FIFO, real and imaginary part. */

pBATCfg->SinFreq = 200; /* Sin wave frequency. THis value has no effect if sweep is enabled */

pBATCfg->SweepCfg.SweepEn = bTRUE; /* Set to bTRUE to enable sweep function */
pBATCfg->SweepCfg.SweepStart = 1.0f; /* Start sweep at 1Hz */
pBATCfg->SweepCfg.SweepStop = 50000.0f; /* Finish sweep at 1000Hz */
pBATCfg->SweepCfg.SweepPoints = 50; /* 100 frequencies in the sweep */
pBATCfg->SweepCfg.SweepLog = bTRUE; /* Set to bTRUE to use LOG scale. Set bFALSE to use linear scale */

When I check the excitation signal after a reset, it goes out after 9 seconds. For what? If the measurements are made without the excitation, normally they will be wrong. Do you know what can cause this error?

Thanks in advance.

  • Hi,

    The same code in Github is used for Sensorpal. May I know if you have checked the github firmware on EVAL-AD5940BATZ kit?

    If AppBATCfg.NumOfData is not -1,but set to "n",  measurement is done only for "n" complete frequency sweeps (i.e., from  sweepstart till sweepstop n times) after which it stops.

  • Hi

    The definition of the default configuration structure and this one:

    AppBATCfg_Type AppBATCfg =
    {

    . state = STATE_IDLE,
    .bParaChanged = bFALSE,

    . SeqStartAddr = 0,
    . MaxSeqLen = 0,

    . SeqStartAddrCal = 0,
    . MaxSeqLenCal = 0,

    . SysClkFreq = 16000000.0,
    . WuptClkFreq = 32000.0,
    . AdcClkFreq = 16000000.0,
    . BatODR = 20,0, /* 20,0 Hz*/
    . numOfData = -1, <-- not modified.

    . PwrMod = AFEPWR_LP,
    . ACVoltPP = 800,0,
    . DCVolt = 1100.0f,
    . SinFreq = 50000.0, /* 50kHz */
    . RcalVal = 50.0, /* 50mOhm */

    . ADCSinc3Osr = ADCSINC3OSR_4,
    . ADCSinc2Osr = ADCSINC2OSR_22,

    . DftNum = DFTNUM_16384,
    . DftSrc = DFTSRC_SINC3,
    . HanWinEn = bTRUE,

    . FifoThresh = 4,
    . BATInited = bFALSE,
    . StopRequired = bFALSE,
    . MeasSeqCycleCount = 0,

    . SweepCfg.SweepEn = bTRUE,
    . SweepCfg.SweepStart = 1000,
    . SweepCfg.SweepStop = 100000.0,
    . SweepCfg.SweepPoints = 101,
    . SweepCfg.SweepLog = bFALSE,
    . SweepCfg.SweepIndex = 0,

    };

    I don't see where, apart from the configuration I provided earlier, can change the numOfData value.

    Why does the excitation signal not continue despite the continuous calibration and measurement process?

    I will continue to investigate and if you have a solution, it will be with pleasure.

    Thanks.

  • same problem here!

    This is Exactly what I am getting from my board! 

    dear Volotek would you please help me if you could solve the problem?

    I have been dealing with this problem for a long time.

  • Hi,

    The excitation signal goes out after 9 seconds because when sweep is enabled, excitation is given for 101 sweep points after which measurement and excitation stops and results are displayed.

    Also Note:

    For excitation frequencies below 80kHz,

    . PwrMod = AFEPWR_LP,

    For exciation frequencies above 80kHz, 

    . PwrMod = AFEPWR_HP,

    You may refer to (+) SensorPal Battery impedance measurement - Q&A - Reference Designs - EngineerZone (analog.com)

  • Thanks for your precisions. We continue to do tests.