Part Number: TMS320F28379S
Hi,
I'm just testing the POWER_MEAS_SINE_ANALYZER library and noticed, that when jitter is detected, only the sample is counter is set back to 0. This brings the problem that when the next zero crossing is detected, the count of samples is usually correct but all the sum variables not. Shouldn't these also be set 0 at the same time as sample counter?
Original:
if (v->nSamplesMin < v->nSamples) { ... } else { // // otherwise it may be jitter ignore this reading // but count the number of jitters you are getting // but do not count to infinity as then when the grid comes back // it will take too much time to wind down the jitter count // if (v->jitterCount < 30) { v->jitterCount++; } v->nSamples = 0; }
Should be?
if (v->nSamplesMin < v->nSamples) { ... } else { // // otherwise it may be jitter ignore this reading // but count the number of jitters you are getting // but do not count to infinity as then when the grid comes back // it will take too much time to wind down the jitter count // if (v->jitterCount < 30) { v->jitterCount++; } v->nSamples = 0; v->vSum = 0; v->vSqrSum = 0; v->iSqrSum = 0; v->pSum = 0; }
JHi