This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sample count reading (Average power measurement)

Part Number: INA233

During average power reading (READ_EIN) the sample count returns different values for the same measurement delay time.

On chapter 7.6.2.14, the datasheet recommends a pre and post register reading to calculate average power.

The calculated power seems to be correct but the sample count is always around 1000 to 1500 for any delay time between pre and post if previously a READ_VIN command was issued.

Does the READ_VIN command somehow affect the sample count value of the energy measurement?

Will the sample count difference between pre and post be affected by the average ADC settings?

Will an auto reset accumulator also reset the sample count value?

  • Hello Th. Mathis,

    We are looking over this now and will send back a response today. Thank you.

    Best,

    Peter

  • Hey Th. Mathis,

    What are the time intervals between your READ_EIN commands? What is the ADC conversion time and averaging settings?

    If you are issuing the READ_EIN command at time intervals that are not exact, then you will have variation in the number of samples the accumulator has processed for each READ_EIN command.

    The READ_VIN command should not have an effect the sample count of the READ_EIN command.

    If you change ADC averaging settings in between READ_EIN readings, then this will also effect the number of samples even if you are issuing READ_EIN commands at exact time intervals.

    Best,

    Peter

  • Hi Peter

    I varied the time intervals between the READ_EIN commands between 100 ms and 1 second.

    The time intervals are no very exact but the sample count is very different if previously a READ_VIN command was issued.

    Currently I'm using no average and 1 ms conversion time. The ADC settings are done at the beginning of the application only

    If no READ_VIN command is used the sample count is about 120'000 for time intervals of 1 second.

    But with the READ_VIN command the sample count also depends on the time between the READ_VIN command and the pre READ_EIN command (Delay 1) .


    Steps I'm performing:

    READ_VIN

    Delay 1

    READ_EIN (pre)

    Delay 2

    READ_EIN (post) -> sample count = diff (post-pre)

  • Hello,

    So 120,000 samples seems like a lot for a 1 second time interval with ADC at 1 ms conversion time. I would think the samples should be around 1000.

    Could you provide the sample count when a READ_VIN command is issued? Can you elaborate on the correlation between Delay 1 and the sample count? Is this a positive or inverted relationship?

    Sincerely,

    Peter

  • Hello,

    I found one error in my code, i was not extracting correctly the 24 bit stream. Now that works fine, but I still have the problem, that the energy measurement is influenced by a standard register read.

    With 1100 ms sample time and no averaging the sample count is about 1/2 of the time in ms, So for 1000 ms delay I get 480 samples

    ADC config command is as follows: 0xd0, 0x27, 0x01

    I did some more test with changing delay 1 but constant delay 2.

    This shows that the sample count = to 0.48 * delay 1, independently of delay 2

    Then I put the read READ_VIN command between the two sample readings as follows

    READ_EIN (pre)

    READ_VIN

    Delay 2

    READ_EIN (post) -> sample count = diff (post-pre)

    In this configuration I always measure about 18 samples independently of delay 2

    I also exchanged the READ_VIN with READ_MFR_ID, but the same result

  • Up to now I didn't change the MFR_DEVICE_CONFIG register and left it at default value.

    But when I enable the READ_EIN Autoclear functionality then I will read higher values for the pre than for the post measurement and the post measurement values are always around 17 independently of the Delay 2

    10 times loop {READ_EIN (pre) -> READ_VIN -> Delay 2 -> READ_EIN (post) -> sample count = diff (post-pre)} with Delay 2 from 100 to 1000 in steps of 100

    Pre measurement is about 0.48 * Delay 2 for delays higher than 200 ms

    Post measurement is quite constant between 16 and 18

  • Hello Th. Mathis,

    Thank you for the description. In this loop you describe, do you perform any other operations after issuing the READ_EIN (post) command? Is there any time use by processor to determine and store the post-pre = N = sample count? In reality, this should not be necessary it you have the EIN_Auto Clear bit set in D5h.

    What is the slave address used for this device?

    Why do you try to write a 0 bit to bit 14 of MFR_ADC_CONFIG (reg 0x27)? This bit is always 0.

    What values are you reading back from READ_EIN? Are you considering the rollover byte?

    What is the EIN_STATUS bit of D5h?

    What are you calibrating D4h (MFR_CALIBRATION) to?

    Thank you for you patience.

    Sincerely,

    Peter

    It makes sense that the sample count would be half of the delay1 (or time from one READ_EIN to the next). 

  • Hi Peter

    I think, the behavior, I described is intended but unfortunately not described in the datasheet.

    Each time a command (eg. READ_VIN) is sent to the controller, the sample count and accumulator are copied to the output register.

    Reading this output register with READ_EIN will read the sample count and accumulator at the time the READ_VIN command was sent. In that way, the input voltage (READ_VIN) and the power (READ_EIN) are synchronized (sampled at the same time). Internally the sample count and accumulator will continue to increment.

    Therefore the next reading of READ_EIN (without previously sent an READ_VIN command) will read the actual sample count and accumulator.

    For me the case can be closed, with above knowledge, power and energy can accurately be easily be measured. But I would appreciate if you could add a more detailed description for this in the datasheet or application note.

    Thanks

    Thomas