Post Go back to editing

Category: Software

I am a beginner in energy metering.

My question is how do I convert the AENERGYx Register value into KWh reading for display purpose . Example i got energy register value as 16755372d how is this convert into KWH for my LCD display

I am using shunt(.0005ohm) for current reading and CF pulse for the calibration.

• Is important to note that AENERGYA is a a signed 24 bit number that ranges from  0x7FFFFF to 0x800000 or -8388608d to 8388607d and that in its default state resets after each read. Therefore the actual value that you are reading would be -21844d indicating that the power is negative or that it was not read for so long that it rolled over as shown in Figure 46. In order to go from that value to kWh you would calculate a conversion value from the rate of accumulation at a given inputs. As stated in the datasheet at full scale inputs and assuming that Vrms and Irms have been calibrated properly so that fullscale IRMS = VRMS = 9032007d, the accumulation rate would be 206.9kHz so if you waited 1 sec between each read AENERGYA = 206900d = 0x32834. This value would then be correlated to your KWHr at full scale (FSKWHr = VFS * IFS * power factor * Time [ 1 hour] ). This number could then be used to calculate the KWHr when accumulating over one second at other inputs using:

Additional details and alternative accumulation modes are discussed in the data sheet beginning on pg 24.

-David M

• THANKS DAVID ,

that's my mistake i was reading a negative value energy  now i corrected it so i get the positive value. Thanks for the help

actually I didn't see that equation about X[KWhr] in application not or datasheet.

the data sheet tells that for accurate energy reading must read it on CYCEND interrupt is that correct and voltage irms reading at ZCDV .

My IRQ pin is always low there is no interrupt actually my IRQENA=0x148000 and I rested all interrupt by reading RSTIRQSTATA .It is not going back high.

My LINECYC=0x0064 is it correct for 100cycle Is that correct

• -That specific equation is not in the datasheet, just a simplified example of how to derive the values based on the information provided in the datasheet. You will need to adapt it to the values and accumulation times used in your setup.

-The CYCEND interrupt indicates when the accumulation for the desired number of cycles has been completed and the new value has been updated in the AENERGY register. It will then hold (or zero on read, depending on the RSTREAD value) this value until the next accumulation and CYCEND interrupt. Reading the AENERGY register simply has to occur before it is updated with the value of the next accumulation cycle.

-RMS values on the other hand, is not held between zero-crossing events. In order to follow the recommendation for accurate readings the rms registers should be read in sync with the zero crossing.

-For the IRQ pin, where you able to service the first reset done interrupt and see IRQ go back high or does this behavior occur after the setup is done?

-The value in LINECYC is the number of Half Cycles so 0x0064 = 100d would be 100 half cycles or  50 cycles

David M

• THANKS DAVID YOU HELPED ME A LOT THANKS