ADE9430
Recommended for New Designs
The ADE9430 is a highly accurate, fully integrated, polyphase energy and power quality monitoring device. Superior analog performance and a digital signal...
Datasheet
ADE9430 on Analog.com
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:
int64_t delta = current - previous;
sometimes:
Is this expected behavior due to:
Currently the accumulated energy appears to grow significantly faster than expected.
Thank you very much for your support.