Measurements are one side of the smart meter; communications, field upgrades, and security the other
BY ROSS MITCHELL
Freescale Semiconductor
Austin, TX
www.freescale.com
Replacing an electric meter with a smart version is a step that must pay off for both the utility company and customer. The cost of a new meter must be kept to a minimum while the feature set must allow it to remain useful for at least 15 years, possibly more. Such flexibility usually conflicts with the cost-cutting drive, so how is this achievable?
Packing as many features into the microcontroller as possible reduces external components and thus system cost. For a meter, this means integrating features often separate on the PCB: a real-time clock; an accurate, high-dynamic-range A/D converter; dual flash memory for software upgrades; a segment LCD; and antitamper interfaces. Adding all these features puts a strain on the CPU, driving need for a powerful, yet power-efficient 32-bit architecture to handle the computation and code size challenges. However, many MCUs are available that are up to the task. We will look at an example design using the 50-MHz MCF51EM256MCU with a ColdFire core. The baby of a family of cores with up to 400-MHz speed, the MCU offers power efficiency and performance to cope with the demands of the smart-meter application.
The following routines are needed in a three-phase, four-wire meter:
• Line-to-neutral voltages/frequency
• Phase currents and average current
• Active power and net active power
• Reactive and apparent power
• Power factor
• Voltage/current unbalance
• Energy calculations
Power measurement is the heart of the meter. The conversion of current to a digital value using a shunt resistor, a current transformer, or a Rogowski coil can be done via two dual 16-bit A/D converters. The converters have an ENOB of 14.5 with built-in result-averaging hardware.
Making the measurements
Making simultaneous measurements from voltage- and current-sensing devices requires accurate control of any phase delays in the measurement chain. Shunt resistors can suffer from minor phase delays at low currents, but current transformers have a far greater phase shift, sometimes more than 4.
A delayed trigger for measurement can allow the A/D used for voltage measurement to make a current measurement, reducing the need for extra A/D converter modules. In our MCU, a special timer module, the programmable delay block, takes care of this by providing a delayed trigger for a current measurement by the A/D following a successful voltage measurement without CPU intervention. With timer granularity as low as 40 ns and prescaler settings allowing adjustment to the sample periods, it is possible to compensate for a wide range of phase delays. An example of 4 of phase compensation results in a delay of 185 µs with a timer resolution of 1 µs. Normally measurements are taken 64 times per mains cycle (every 260 µs for 60 Hz) so the same A/D channels can be used for the current measurement following a voltage measurement. The PDB thus removes a significant burden from the CPU and improves use of the A/D module.
A fully operational three-phase electricity meter reference design has been developed using the MCF51EM256, and it manages full metrology and IEC61107 within 128 Kbytes of code. The reference design has been shown to meet MID (Measuring Instruments Directive) class C rating for a 10 to 60-A meter with 0.5% accuracy and supports the following standards: optical port as per standard IEC 62056-22, meter standard compliance IEC 62053-11, IEC 62053-22, IEC 62053-23 and IEC62056-21. MID provides a range of standards for meters, focusing on measurement accuracy.
The other side
Making measurements is one side of the smart meter. Communications, field upgrades, and security are another side. A range of communications peripherals supporting UART, SPI, and I2 C are provided to support automated meter reading (AMR) for the utility provider and also make meter data available to the consumer for energy management. For in-building communications, the ZigBee protocol is popular as it provides a Smart Energy Profile for sharing energy use with other applications such as remote energy monitors.
The MCF51EM256 MCU can continue to perform metering and communications functions as normal while uploading new software.
The initial investment in the smart meter demands field updates for the potentially 15 to 20-year lifetime of the meter. The ability to run from one flash array while reprogramming the other array allows the MCF51EM256 to continue to perform metering and communications functions as normal while uploading new software.
Data rates for meter communications can be very low, often in the range of hundreds of bits per second, so it is not possible to stop metering functions during this time. Protection is provided through a memory manager and allows transfer to the newly programmed code when validated and then provides the user with an option to erase or retain the previous executable. Security features in the debug environment restrict any code access through hardware and password protection schemes and force flash erasure before the debug environment can be activated. Other forms of security lie with runtime and physical security.
Antitamper is a means of detecting that a pin on the device package has been disconnected from the PCB. Placement of pairs of antitamper pads among the active pins of the device provides immediate recognition of a physical attack. Dedicated pins with hardware detection force a bit in memory to trigger an interrupt and allow communications software to alert the utility company of the intrusion and allow access to the time-stamped event details when reconnected. The code on the MCU can determine if this warrants erasure of the flash or other extreme action to prevent theft of firmware. A key feature of the tamper-detection circuit is that it cannot be cleared until both the VDD and battery supplies are disconnected. Reconnecting the supplies forces optional security functions to be called, preventing a return to operation for the smart meter.
The RTC’s battery backup is essential so tariffs are always applied at the correct time of day even on re-connection. The RTC must remain operational for up to 10 years on a single button cell. In stop mode the robust RTC module consumes less than 2 µA and maintains accuracy better than 2 ppm (1 minute/year) with once-per-hour clock adjustment.
The clock is adjustable in increments of a single clock pulse at any time. Typically the on-board temperature sensor will be used to determine temperature drift, which is the most critical parameter for crystal accuracy, and allow adjustment of up to 128 clocks at a time. Thus a meter may be left without mains power for months at a time without risk of being reconnected and using electricity at the wrong tariff rates. ■
Learn more about Freescale Semiconductor