What are the tradeoffs between control vs software algorithms (in charge pump PLL)


I have a grid signal (45-65 Hz) that I've sampled with an ADC and put it through an IIR LPF so that noise does not effect the zero crossing detection.

All I want is the frequency of the signal. Now what are the advantages/disadvantages of using a software implemented charge-pump PLL vs just averaging the time between the last few zero crossings?

I know much better PLLs can be used to find the frequency, but given I only have the zero crossings what method will offer the best result.

Best Answer

I would like to calculate f as often as possible accurate to 0.5Hz accuracy and my zero crossing is accurate to within 100us.

If you were measuring a 65Hz waveform over 1 cycle and you had a zero cross error of 100us the total period measured would be: -

\$\dfrac{1}{65} + 100E-6\$ = 0.015484615 seconds or, a frequency of 64.58 Hz.

This seems accurate enough given your requirements. You should also consider how many pulses you would count over that period and I'd aim for counting 10us pulses or better. This is one-tenth of the error incurred by the zero cross detector and filter.

I don't think you need to go to the complexity of any PLL for this.