The most important block for accurate measurement is the ADC converter and voltage reference. Precise time base is also critical, because energy is integral to the power in time and measurements must be made in real time due to tariff switching.
Interface parts include an LCD interface to drive display and a button for manual data reading. For automated data reading, the PM uses an infrared interface (EN62056-21), optoisolated RS232 and energy pulse output. Some interrupt input for tamper sensing is also needed.
ADC converter. An ADC with 14.5 ENOB accuracy is suggested for a single phase electricity meter application. Does the 14.5 ENOB work for accuracy requirements of 1:320 at one percent? Class B allows 1.5 percent error in interval so that by the following formula:
ENOB = ln (1/DR * err)/ln (2) = ln (1/320*0.015)/ln(2) = 14. 38 bit
The MC9S08LH64 MCU provides an AD converter with 14.5 ENOB, which is sufficient for defined current dynamic range. The accuracy of energy calculation is further improved by averaging in the calculation algorithm.
Differential input should be used for current measurement in order to reach the best possible noise-free signal with doubled dynamic range. On the voltage measuring path, there are no strict requirements, as voltage of the mains vary from a maximum + or – 20 percent to a nominal 230(120)V.
If the MCU has only one ADC converter with MUX, the MCU has to switch ADC between voltage and current inputs. The MC9S08LH64 MCU provides hardware triggering with “ping-pong” mode, which takes the samples in the proper time and switches the two inputs via the hardware.
An interrupt is then issued once both conversions are finished. Ping-pong mode is ideal for PM applications as it minimizes CPU time needed for sampling. Phase shifts between voltage and current signal may be compensated by time delay between voltage and current samples. The A/D converter supports hardware averaging up to 32 samples.
Voltage reference. A 16-bit SAR AD converter may use internal voltage reference. Freescale’s 9S08LH64 voltage reference is based on compensated bandgap diode and has 1.2V @ 40ppm/°C. Reference is trimmable by 8-bit register in 0.5mV steps.
For example, the micro adjusting of the reference voltage might be considered for use as the overall measurement error compensation against temperature. (Tip: Internal bandgap diode may be used for temperature measurement.)
Time reference. A 32.768Hz crystal reference might be used to pair both the precise CPU bus clock together with Real Time Clock signal source. Crystal frequency is multiplied in FLL module to get bus clock 19.922 MHz to utilize CPU calculation power.
The “Time Of Day” (TOD) module is embedded in the 9S08LH64 and may be sourced directly out of the crystal. The TOD module runs even if the MCU is in the stop mode and may wake up the MCU in pre-defined time. This functionality provides the advantage of creating real time and calendar time in software.