Post Go back to editing

Clarification request regarding ADE9430 energy accumulation, scaling and rollover handling

Category: Datasheet/Specs
Product Number: ADE9430

I am currently integrating the ADE9430 and I would like to request clarification regarding the correct usage of the energy accumulation registers and their scaling.

My current configuration is:

Configuration code:

int32_t ConfigureAFE_EGYTIME(void){

    int32_t status = SYS_STATUS_SUCCESS;

    

    uint16_t egytime_value = 7999;

    status = AFEWrite16BitReg(REG_EGY_TIME, &egytime_value);

    if (status != 0) {

        status = SYS_STATUS_AFE_EP_CFG_SET_EGY_PWR_EN_FAILED;

    }

    return status;

}

Energy accumulation handling:

// -- External energy accumulator

#define ENERGY_CHANNELS     9

// Phase A: WATT, VAR, VA

// Phase B: WATT, VAR, VA

// Phase C: WATT, VAR, VA

#define MAX_45BIT           (1LL << 44)

#define RANGE_45BIT         (1LL << 45)

#define ROLLOVER_THRESHOLD  (MAX_45BIT / 2)

static int64_t  prev_raw[ENERGY_CHANNELS] = {0};

static bool     first_read = true;

The raw energy values are reconstructed as signed 45-bit values:

int64_t assembled = ((int64_t)(int32_t)hr_hi << 13)

                  | (int64_t)(hr_lo & 0x1FFF);

Energy conversion currently uses:

#define ADI_PQLIB_PHASE_POWER_FACTOR 20694066 // AWATT FULL SCALE

and:

double ConvertEnergyType(

    ADI_AFE_ENERGY_TYPE energy,

    float voltageScale,

    float currentScale)

{

    double energyValue;

    energyValue =

        ((double)energy) /

        ((double)ADI_PQLIB_PHASE_POWER_FACTOR);

    return energyValue;

}

Since RD_RST_EN is disabled, I currently perform accumulation externally in the MCU using deltas between consecutive readings:

static int64_t safe_delta(int64_t current, int64_t previous)

{

    int64_t delta = current - previous;

    if      (delta >  ROLLOVER_THRESHOLD) delta -= RANGE_45BIT;

    else if (delta < -ROLLOVER_THRESHOLD) delta += RANGE_45BIT;

    return delta;

}

Main concerns:

  1. Is this configuration correct for obtaining accumulated energy values every second using EGYRDY interrupts?
  2. Is the energy conversion method correct?
    Currently I only divide by:
    • ADI_PQLIB_PHASE_POWER_FACTOR = 20694066
  3. However, I am unsure whether:
    • voltage scaling
    • current scaling
    • EGY_TIME
    • ADC full-scale
    • internal DSP accumulation timing
  4. must also be included in the conversion to obtain Wh or kWh.
  5. Is the external accumulation approach correct when RD_RST_EN = 0?
    Since the registers do not appear to reset after each read, I assumed that the correct approach is to calculate a delta between consecutive reads.
  6. Is the rollover handling method correct for the 45-bit signed accumulators?
  7. When calculating:

int64_t delta = current - previous;

sometimes:

  • previous > current
  • delta becomes negative
  • total accumulated energy decreases

Is this expected behavior due to:

  • signed energy accumulation,
  • bidirectional power flow,
  • register rollover,
    or is the accumulation procedure incorrect?
  1. For validation purposes:
    If the measured load is approximately 4 kW constant active power, should the accumulated active energy increase approximately:
    • 4 kWh after 1 hour,
    • 8 kWh after 2 hours,
    • and approximately 1.11 Wh every second?

Currently the accumulated energy appears to grow significantly faster than expected.

Thank you very much for your support.