引用: 色色隐隐 发表于 2018-12-27 11:39
1,电流和电压数值基本上是很接近,数值上应该没有问题,但是在改变方向时,没有正负号之分,后来直接读AIRMS和AVRMS时发现改变方向并没有改变读取到的数值。这个是什么原因啊?
电流和电压有效值是没有方向性的,他们永远是正数值。
谢谢您,问题一后来我想了一下,确实是,交流电流电压是没有方向的,虽然他们的寄存器(XIRMS,XVRMS)里24位带符号位的数据。
有功功率和无功功率还有电能读数完全不正确我也想可能是有些寄存器设置问题,但是不知道有哪些地方需要设置的,我所有的寄存器设置都是采用默认值。具体如下:
void ADE7880Cfg()
{
ADE7880.Write2byte_ADE7880(Gain,0x0000);
ADE7880.Write2byte_ADE7880(CONFIG,0x0002);
ADE7880.Write2byte_ADE7880(HPFDIS,0x0000);
ADE7880.Write4byte_ADE7880(AIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(AVGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(BIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(BVGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(CIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(CVGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(NIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(AIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(AVRMSOS,0x00000000);
// ADE7880.Write4byte_ADE7880(BIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(BVRMSOS,0x00000000);
// ADE7880.Write4byte_ADE7880(CIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(CVRMSOS,0x00000000);
// ADE7880.Write4byte_ADE7880(NIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(AWGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(AWATTOS,0x00000000);
ADE7880.Write4byte_ADE7880(BWGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(BWATTOS,0x00000000);
ADE7880.Write4byte_ADE7880(CWGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(CWATTOS,0x00000000);
ADE7880.Write2byte_ADE7880(APHCAL,0x0000);
ADE7880.Write2byte_ADE7880(BPHCAL,0x0000);
ADE7880.Write2byte_ADE7880(CPHCAL,0x0000);
ADE7880.Write1byte_ADE7880(ACCMODE,0x80);
ADE7880.Write1byte_ADE7880(COMPMODE,0x80);
ADE7880.Write1byte_ADE7880(MMODE,0x1C);
ADE7880.Write1byte_ADE7880(WTHR,0x03);
ADE7880.Write1byte_ADE7880(VARTHR,0x03);
ADE7880.Write1byte_ADE7880(VATHR,0x03);
ADE7880.Write4byte_ADE7880(VLEVEL,0x00000000);
ADE7880.Write4byte_ADE7880(VNOM,0x000000);
ADE7880.Write1byte_ADE7880(LCYCMODE,0x78);
ADE7880.Write2byte_ADE7880(LINECYC,0xFFFF);
ADE7880.Write4byte_ADE7880(MASK0,0x00000000);
ADE7880.Write4byte_ADE7880(MASK1,0x00000000);
ADE7880.Write2byte_ADE7880(0xE7FE,0xAD);
ADE7880.Write2byte_ADE7880(0xE7E3,0x80);
ADE7880.Write2byte_ADE7880(Run,0x0001);
}
引用: 色色隐隐 发表于 2018-12-27 11:39
1,电流和电压数值基本上是很接近,数值上应该没有问题,但是在改变方向时,没有正负号之分,后来直接读AIRMS和AVRMS时发现改变方向并没有改变读取到的数值。这个是什么原因啊?
电流和电压有效值是没有方向性的,他们永远是正数值。
谢谢您,问题一后来我想了一下,确实是,交流电流电压是没有方向的,虽然他们的寄存器(XIRMS,XVRMS)里24位带符号位的数据。
有功功率和无功功率还有电能读数完全不正确我也想可能是有些寄存器设置问题,但是不知道有哪些地方需要设置的,我所有的寄存器设置都是采用默认值。具体如下:
void ADE7880Cfg()
{
ADE7880.Write2byte_ADE7880(Gain,0x0000);
ADE7880.Write2byte_ADE7880(CONFIG,0x0002);
ADE7880.Write2byte_ADE7880(HPFDIS,0x0000);
ADE7880.Write4byte_ADE7880(AIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(AVGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(BIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(BVGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(CIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(CVGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(NIGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(AIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(AVRMSOS,0x00000000);
// ADE7880.Write4byte_ADE7880(BIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(BVRMSOS,0x00000000);
// ADE7880.Write4byte_ADE7880(CIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(CVRMSOS,0x00000000);
// ADE7880.Write4byte_ADE7880(NIRMSOS,0x00000000);
ADE7880.Write4byte_ADE7880(AWGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(AWATTOS,0x00000000);
ADE7880.Write4byte_ADE7880(BWGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(BWATTOS,0x00000000);
ADE7880.Write4byte_ADE7880(CWGAIN,0x00000000);
ADE7880.Write4byte_ADE7880(CWATTOS,0x00000000);
ADE7880.Write2byte_ADE7880(APHCAL,0x0000);
ADE7880.Write2byte_ADE7880(BPHCAL,0x0000);
ADE7880.Write2byte_ADE7880(CPHCAL,0x0000);
ADE7880.Write1byte_ADE7880(ACCMODE,0x80);
ADE7880.Write1byte_ADE7880(COMPMODE,0x80);
ADE7880.Write1byte_ADE7880(MMODE,0x1C);
ADE7880.Write1byte_ADE7880(WTHR,0x03);
ADE7880.Write1byte_ADE7880(VARTHR,0x03);
ADE7880.Write1byte_ADE7880(VATHR,0x03);
ADE7880.Write4byte_ADE7880(VLEVEL,0x00000000);
ADE7880.Write4byte_ADE7880(VNOM,0x000000);
ADE7880.Write1byte_ADE7880(LCYCMODE,0x78);
ADE7880.Write2byte_ADE7880(LINECYC,0xFFFF);
ADE7880.Write4byte_ADE7880(MASK0,0x00000000);
ADE7880.Write4byte_ADE7880(MASK1,0x00000000);
ADE7880.Write2byte_ADE7880(0xE7FE,0xAD);
ADE7880.Write2byte_ADE7880(0xE7E3,0x80);
ADE7880.Write2byte_ADE7880(Run,0x0001);
}
举报