In this application for input frequency of 60 Hz, OSR of 256 and sampling frequency of 3906, the
resolution for every bit in the preload register is approximately 0.02° with a maximum of 5.25° (maximum
of 255 steps). Because the sampling of the three channels are group triggered, a method often used is to
apply 128 steps of delay to all channels and then increase or decrease from this base value. This allows
positive and negative delay timing to compensate for phase lead or lag. This puts the practical limit in the
current design to ±2.62°. When using CTs that provide a larger phase shift than this maximum, an entire
sample delay along with fractional delay must be provided. This phase compensation can also be modified
on the fly to accommodate temperature drifts in CTs.
4.3.3 Frequency Measurement and Cycle Tracking
The instantaneous I and V signals for each phase are accumulated in 48-bit registers. A cycle tracking
counter and sample counter keep track of the number of samples accumulated. When approximately one
second of samples have been accumulated, the background process stores these 48-bit registers and
notifies the foreground process to produce the average results like RMS and power values. The sample
code uses cycle boundaries to trigger the foreground averaging process, because this gives very stable
results.
12