ADE7953 sample code question

Hi,

I was able to download below sample code for ADE7953 in ADI website.

Can anyone answer to my questions?

Q1. Meaning of 662/6330 in ActivePower EQ?

Q2. Meaning of 200/16836 in IrmsA EQ?

Q3. Meaning of 1/84 in IrmsB EQ?

Q4. Meaning of 1/200 in Vrms EQ.

Q5. For FrequencyA, I think it should be 223Khz/DATA_PERIOD.wordL.low. Am I correct?

Q6. Why Multiply 1000/32768 for PowerFactor?

= Downloaded sample code(Metering.c) =

 ActivePowerA = DATA_AWATT.F_DATA;
 if(ActivePowerA & 0xff800000) ActivePowerA = 0 - ActivePowerA;
 ActivePowerA = ActivePowerA * 662/6330;
 ActivePowerB = DATA_BWATT.F_DATA;
 if(ActivePowerB & 0xff800000) ActivePowerB = 0 - ActivePowerB;
 ActivePowerB = ActivePowerB * 662/6330;
 
 ReactivePowerA = DATA_AVAR.F_DATA;
 if(ReactivePowerA & 0xff800000) ReactivePowerA = 0 - ReactivePowerA;
 ReactivePowerB = DATA_BVAR.F_DATA;
 if(ReactivePowerB & 0xff800000) ReactivePowerB = 0 - ReactivePowerB;
 IrmsA = DATA_IRMSA.F_DATA*200/16836;
 IrmsB = DATA_IRMSB.F_DATA/84;
 Vrms = DATA_VRMS.F_DATA / 200;
 FrequencyA = 22375000 / DATA_PERIOD.wordL.low;
 PowerFactorA = DATA_PFA.wordL.low;
 if(PowerFactorA > 0x8000)PowerFactorA = PowerFactorA - 0x8000;
 PowerFactorA = (unsigned long)PowerFactorA*1000/32768 ;
 PowerFactorB = DATA_PFB.wordL.low;
 if(PowerFactorB > 0x8000)PowerFactorB = PowerFactorB - 0x8000; 
 PowerFactorB = (unsigned long)PowerFactorB*1000/32768 ;

  • 0
    •  Analog Employees 
    on Jan 11, 2017 7:41 PM over 4 years ago

    Hi,

    I apologize for the delay, let me answer your questions now if they haven't been already.

    These are all basically constant that the registers are multiplied by in order to get the real world value for the registers. Many of these area specific to the meter design that this code was taken from and your constants will be different.

    1. Specific to this meter design, you will have to find your own conversion factor to get to real world Watts. You have to perform a calibration to get these constants.
    2. Again same thing, except for Current RMS.
    3. Same as number 2.
    4. Same as number 2 except for Voltage RMS.
    5. That equation follows the equation from the data sheet using the clock frequency
    6. The value of 1000/32768 is used to translate the register value to PF*1000, which means a PF = 0.955 will show up as 955 when multiplied by that value.

    Regards,

    Dlath

  • Hello dlath,
    pls I urgently need your assistance on ADE7953 Evaluation Board + interface board. I have both and I'm working on the evaluation board. I have design a power 3.3VDC power supply to the board and it's working perfectly but it keeps giving values which I need to change to true values. I have read the AN-1118 pdf files and been able to calculate Wh/LSB constant, AERNERGA Expected and the WGAIN. But still not displaying the real values. Pls explain in details (step by step as I'm new to the board) how to be getting real values from the board. Pls help me as its urgent.

  • Thanks so much Dlath. I'm grateful. I will keep to your advice.

  • 0
    •  Analog Employees 
    on Jan 19, 2017 12:15 AM over 4 years ago

    Hi Godson,

    Please try to keep your posts to only 1 discussion, posting in multiple places will not get a faster reply and actually makes the discussion much harder to follow. This has been answered in the following discussion: [ADE7953] refer to input LSB calculation.

    Regards,

    Dlath