Hi, I am trying to get the peak values on current channel A from ADE9153A eval boad.
So far, I'm able to get readings from different registers, but this one is giving me a hard time, perhaps because I don't fully understand the way it works.
My setup, apart from standard conditions (i.e. 230 Vac and resistive heater 8A aprox, stable)
I set PEAK_SEL to 01 (channel A selected) so register CONFIG3 is:
#define ADE9153A_CONFIG3 0x0004 /*Peak and overcurrent settings*/
Now, to verify the values of the register, I'm reading the IPEAK register once a second and getting values like this:
So, from those bits, bit 24 is always 1, indicating that channel A is selected, but I was expecting almost constant values in the remaining bits.
I guess my problem is related to the time when I'm reading IPEAK register, but the info on datasheet and Application notes gives me not to many clues.
Could you please provide some help?
I have a feeling your issue is with your input on current channel A. The value's you show for IPEAK fluctuate between 2 values, 16,318,464 and 457,728. Per the data sheet, IPEAK = I_WAV/2^5, this means on the larger side your getting 522,190,848 but the expected full-scale value of AI_WAV is 74,565,404. This means that your IPEAK value is about 7x larger than full-scale.
Please go through your signal path and verify you have everything setup correctly. The current through the shunt, the shunt size, the PGA gain value, the AIGAIN value, basically anything in the path for the IPEAK measurement. I would suggest keeping registers at their default and changing them one at a time to see where your issue is.
Hi dIath, many thanks for your answer.
Look, I don't think the problem is on the current pah, but of course I may be wrong. Let me tell something more about my setup:
I'm using the EV-ADE9153ASHIELDZ, with the settings as per in the provided Arduino code, except for this register modified value #define ADE9153A_CONFIG3 0x0004 /*Peak and overcurrent settings*/
So AI_PGAGAIN is 0x000A (16x)
I'm getting most values correct at some extend(system not fully calibrated), including AI_RMS.
I'm trying resistive loads which consumes 0.1A, 4.4A and 8.5A approx. The measured RMS voltage values on the shunt terminals are 2.3mVAC, 6mVAC and 11.4mVAC respectively.
The way I'm reading the IPEAK register is like this:
tempReg=int32_t (SPI_Read_32(REG_IPEAK)); //Read IPEAK register Data->IPeakReg = tempReg; tempValue=(float)tempReg; //Calculate IPeak Data->IPeakValue = tempValue;
and on the main api code
Serial.print(pqVals.IPeakValue); Serial.print(","); // to get decimal values
Serial.println(String(ade9153A.SPI_Read_32(REG_IPEAK), BIN)); // to get binary data
Please, look at the gathered data below
I hope you can identify something I'm doing wrong. Shoul I need to read this data faster or synchronized to something?
I see what's going on now and your results look good. First off, bit 24 can be dropped because it simply indicates the channel the peak event happened on. Then from there, the IPEAKVAL bitfield is a 24 bit signed bitfield because the register is storing the peak and since it's signed you know if the peak happened in the negative or positive direction.
With that information:
The register list says its "absolute value" but that is incorrect, it is a signed result. I will submit a correction for the data sheet.
Awesome!!Many thanks for your answer.I just have one final question, related to translate IPEAK register values to 'real-world' values.My interpretation is, according to the data sheet:IPeak(real value) = IPEAK(register value) / 32(2^5)So for an input of 4.38A rms, theoretical peak current value is 6.194IPeak(real value) = 233748 / 32 = 7,304.625Of course system is not calibrated and the IPEAK register values are stable and changing consistently with the current input value.Could you please tell me if I'm doing conversion the right way?By the way, for the 8.58A rms input, I'm getting readings of ±14272, which makes more sense.Best regardsZague