Hai Eva,
Thank you for your support.
1) I tried adjusting the HPF and LPF1 settings and i can able to get better response.
In HPF the least settiling time is 0.036sec and in LPF1 0.036sec is the least time.So the total settling time neaded for
correct reading is 0.72 sec.Am i correct? or the settling time of LPF2(least time) 0.217sec also come into the total time.
Please clarify me and help me to reduce this to 0.02 sec ie 20ms(one cycle time of 50hz)
2)In meterlib.h (democode)file i can able to see this.
/*! Metering library data structure definition - 2PH METER */
typedef struct
{
double umax; /*!< maximal voltage measurement range */
double imax; /*!< maximal current measurement range */
Frac32 thrd; /*!< sensitivity threshold */
int sens; /*!< sensor: 1-proportional, 2-derivative */
tBIASFILTER_COEF bias; /*!< dc bias supressor filter coefficients */
tBIASFILTER_COEF intg; /*!< integrator filter coefficients */
tBIASFILTER_DATA uDcb1[2]; /*!< ph1-voltage dc bias supressor data */
tBIASFILTER_DATA intd1; /*!< ph1-current integrator filter data */
tBIASFILTER_DATA iDcb1[2]; /*!< ph1-current dc bias supressor data */
tBIASFILTER_DATA uDcb2[2]; /*!< ph2-voltage dc bias supressor data */
tBIASFILTER_DATA intd2; /*!< ph2-current integrator filter data */
tBIASFILTER_DATA iDcb2[2]; /*!< ph2-current dc bias supressor data */
tPHSHFILTER_COEF hilb; /*!< Hilbert & delay filter coefficients */
tPHSHFILTER_DATA phSh1; /*!< ph1-Hilbert & delay filter data */
tPHSHFILTER_DATA phSh2; /*!< ph2-Hilbert & delay filter data */
tAVERFILTER_COEF aver; /*!< averager filter coefficients */
tAVERFILTER_DATA uRms1; /*!< ph1-voltage RMS averager data */
tAVERFILTER_DATA uRms2; /*!< ph2-voltage RMS averager data */
tAVERFILTER_DATA iRms1; /*!< ph1-current RMS averager data */
tAVERFILTER_DATA iRms2; /*!< ph2-current RMS averager data */
tAVERFILTER_DATA PAve1; /*!< ph1-active power averager data */
tAVERFILTER_DATA PAve2; /*!< ph2-active power averager data */
tAVERFILTER_DATA QAve1; /*!< ph1-reactive power averager data */
tAVERFILTER_DATA QAve2; /*!< ph2-reactive power averager data */
tENERGY_DATA Wh; /*!< active energy */
tENERGY_DATA VARh; /*!< reactive energy */
} tMETERLIB2PH_DATA;
This is the config tool generated meterlib2ph_cgf.h file.
If i build this file the error saying "braced around scaler initializer" always reported.
Then i compared the meterlib1ph_cfg.h in the emeter demo code folder and found some lines
additional with respect o the above structure Which i noted you in bold strikes letters.Please
clarify me what is the use of those additional parameters and also explain the METERLIB_KWH_DR
/**************************************************************************************
* Filter-based metering algorithm configuration structure
**************************************************************************************/
#define METERLIB2PH_CFG \
{ \
U_MAX, \
I_MAX, \
FRAC32(((+0.5000)/(U_MAX*I_MAX/2.0))), \
FRAC32((+0.0200)/I_MAX), \
1, \
{{0l,0l,0l},{0l,0l,0l}},{{0l,0l,0l},{0l,0l,0l}}, \
{{FRAC32(+0.99921521804155),FRAC32(-0.99921521804155),FRAC32(-0.99843043608309)}}, \
{{FRAC32(+0.13165249758740),FRAC32(+0.13165249758740),FRAC32(-1.0)}}, \
{{0l,0ll},{0l,0ll}}, \
{0l,0ll}, \
{{0l,0ll},{0l,0ll}}, \
{{0l,0ll},{0l,0ll}}, \
{0l,0ll}, \
{{0l,0ll},{0l,0ll}}, \
{ 49, \
{ \
FRAC32(0.0),FRAC32(-0.02767909511717),FRAC32(0.0),FRAC32(-0.03031520404553), \
FRAC32(0.0),FRAC32(-0.03350628280924),FRAC32(0.0),FRAC32(-0.03744820311487), \
FRAC32(0.0),FRAC32(-0.04244130157922),FRAC32(0.0),FRAC32(-0.04897073735245), \
FRAC32(0.0),FRAC32(-0.05787451260303),FRAC32(0.0),FRAC32(-0.07073552031589), \
FRAC32(0.0),FRAC32(-0.09094567403011),FRAC32(0.0),FRAC32(-0.12732394894731), \
FRAC32(0.0),FRAC32(-0.21220658747347),FRAC32(0.0),FRAC32(-0.63661977126234), \
FRAC32(0.0),FRAC32(+0.63661977126234),FRAC32(0.0),FRAC32(+0.21220658747347), \
FRAC32(0.0),FRAC32(+0.12732394894731),FRAC32(0.0),FRAC32(+0.09094567403011), \
FRAC32(0.0),FRAC32(+0.07073552031589),FRAC32(0.0),FRAC32(+0.05787451260303), \
FRAC32(0.0),FRAC32(+0.04897073735245),FRAC32(0.0),FRAC32(+0.04244130157922), \
FRAC32(0.0),FRAC32(+0.03744820311487),FRAC32(0.0),FRAC32(+0.03350628280924), \
FRAC32(0.0),FRAC32(+0.03031520404553),FRAC32(0.0),FRAC32(+0.02767909511717), \
FRAC32(0.0) \
}, \
25, \
{ \
FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0), \
FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0), \
FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0), \
FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0),FRAC16(0.0), \
FRAC16(-1.0) \
} \
}, \
{ \
{ \
0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l, \
0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l \
}, \
0ll, \
{ \
0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l \
}, \
0l \
}, \
{ \
{ \
0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l, \
0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l \
}, \
0ll, \
{ \
0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l,0l \
}, \
0l \
}, \
{ \
{FRAC32(+0.00130728645170),FRAC32(+0.00130728645170),FRAC32(-0.99738542709660)}, \
{FRAC32(+0.00130728645170),FRAC32(+0.00130728645170),FRAC32(-0.99738542709660)}, \
}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{0ll,0ll,0l,0ll}, \
{ \
FRAC48((+0.0000/(U_MAX*I_MAX))),FRAC32(+1.0000), METERLIB_KWH_DR( 10000), \
{0ll,0ll,0ll},0ll,0l,FRAC16(-1.0), \
{FRAC32(+0.00779293629195),FRAC32(+0.00779293629195),FRAC32(-0.98441412741610)}, \
{0ll,0ll,0ll},{0ll,0ll,0ll} \
}, \
{ \
FRAC48((+0.0000/(U_MAX*I_MAX))),FRAC32(+1.0000),METERLIB_KVARH_DR( 10000), \
{0ll,0ll,0ll},0ll,0l,FRAC16(-1.0), \
{FRAC32(+0.00779293629195),FRAC32(+0.00779293629195),FRAC32(-0.98441412741610)}, \
{0ll,0ll,0ll},{0ll,0ll,0ll} \
} \
}
#endif /* __METERLIB2PH1_CFG_H */
Thanks/regards,
K.Venkat