The increased number of fixed function, energy meter integrated circuits (ICs) on the market in recent years has made it more difficult for companies to remain competitive with energy meter designs. Many analogue front-end (AFE) energy metering ICs utilise delta-sigma analogue-to-digital converters (ADCs), with ROM-based, fixed function state machines for power output calculations. These ICs cannot be modified or used for functions other than measuring energy.
Digital calculation blocks, such as active power, apparent power, and RMS current and voltage, are all static, running at fixed frequencies with fixed output accuracies. While these devices are good at performing their fixed function, this approach is not flexible to the designer. An open source solution that performs these functions, previously only available from IC manufacturers as ROMbased energy metering ICs, is now available in the form of a delta-sigma, configurable Flash design.
This article will present a complete energy meter design example that uses approximately 7 kb of programme words to implement a complete three-phase energy meter IC. This design is interrupt-driven, and uses only 50% of the interrupt processing time available in a 60 Hz, 28 sample per line cycle system. Approximately 65 μs out of the available 130 μs window is used for all three-phase calculations, including calibration correction of offset, gain and phase, as well as an LSB adjustment. With power output register width requirements of up to 48 bits for accurate meter designs, performing this calculation on a low-cost, 8 bit microcontroller (MCU) is not trivial.
The flexibility of this Flash approach offers many benefits over ROM-based energy meter ICs. ROM-based energy meter designs require meter calibration to depend upon external memory and intelligence for loading the state machine — a costly, two-step approach. The third stage of signal flow must load the static energy metering IC with the calibration constants. Combining the calculations from a ROM-based AFE with a central Flashbased MCU eliminates one of these stages. The meter calibration algorithms and constants can all be contained in one stage, which helps to reduce IC count and lower system costs.
Meter accuracy demands proven analogue performance
Prior to making design decisions regarding calculation and meter calibration, designers must establish that the analogue design is sound. The meter’s overall accuracy is ultimately limited by the system’s analogue and ADC performance. With design trends pushing smaller shunt and signal sizes, energy metering ICs with lower noise, higher resolution ADCs are becoming much more desirable.
A dual channel, 16 bit ADC with low noise, negligible crosstalk and excellent linearity is a solid start for developing IECcompliant energy meters, including class 0.5 and 0.1 meters. The MCP3909 energy metering IC from Microchip Technology is a delta-sigma device designed specifically for energy metering applications that meet the above criteria, and it includes a flexible digital block and communication path.
The dual 16 bit ADCs onboard the IC have a signalto- noise and distortion (SINAD) ratio of 82 dB, enabling dynamic range measurements that far exceed IEC requirements. The IC’s onboard PGA, with gains up to 32 V/V, allows for signal sizes and measurement error accuracies such as those shown below. Additionally, the devices enable designers to control the ADC and multiplier outputs, as well as the filter input.
This device can be paired with an MCU, or it can be used as a stand alone metering solution. In some cases, a two-chip approach to energy meter design is not entirely necessary. In these cases, keeping power calculation on the energy meter IC is sufficient. A static DSP block that performs active power calculation with a mechanical counter output drive has seen great success in the industry.
This pulse output calculation block has become a standard, and is included on the MCP3909 IC. This single chip approach is present in millions of energy meters and requires only a single point calibration. The flexibility of being able to use this type of design in both stand alone and MCU-based meters greatly assists in device qualification and testing for meter manufacturers.
Additionally, qualifying a single energy meter IC for use across multiple meter designs benefits meter designers, manufacturers and, ultimately, electricity companies looking for a proven solution. The dual functionality of the MCP3909 device makes it very flexible in this light, and qualifies it for a wide array of meter designs.
Dual functionality energy metering
IC The design concept is accomplished via dual functionality pins that enable designers to access the delta-sigma ADC and multiplier outputs directly. This approach provides a lot of flexibility for interaction between the energy metering IC and Flash MCUs. With direct access to the voltage, current and power ADC outputs, the digital calculations can now be moved to a Flash MCU, which can act as both the calculation engine and the central processor.
Design example : Three -phase meter design
An example of a three-phase energy meter reference design using the MCP3909 and a PIC18F family of high-end, 8-bit microcontrollers (MCP3909RD-3PH1) is shown in Figure 2. This example combines the direct access, delta-sigma energy metering IC with a low-cost, Flash power meter calculation engine to save component cost and streamline meter calibration and design.
Configuration registers, power and energy registers, and RMS current and voltage registers are located onboard the Flash MCU. All registers are available via a serial interface, just as they would be in a standard ROM-based energy metering IC. This design is unique in that the registers available serially contain numbers in exact power units, after meter calibration. The decimal value of the registers represents the decimal value of the power quantity.
Register sizes up to 48 bits are available for power, and 64 bits are available for energy. For example, register names ending in ‘W’ correspond to measured Watts. Registers ending in ‘VA’ contain measured volt-amperes for a given phase — ‘I’ for measured RMS current and ‘V’ for measured RMS voltage. This concept of LSB correction allows designers to set the register resolutions through automated calibration software.
The registers represent LSB quantities for kilowatts, volts, amperes and kilowatt hours for energy. For example, a digital value of 1234 in a given output register will represent 1234 Watts, or 1.234 kilowatts. This greatly simplifies the design of meter firmware that interfaces to other meter systems, modules or output displays such as a LCD. The location of the decimal point, e.g. the resolution of the power quantities, is determined by the values entered into the meter design section of this design’s calibration software.
When the meter is calibrated using the calibration steps that are automated with the software, the proper LSB correction factor is calculated to ensure that the least significant bit represents the least significant digit for a given quantity. For example, if the PHA_I_RMS register, which represents the RMS current for Phase A, contains the decimal value 4523, and the resolution has been defined to be 0.01 based on the meter design software entry, this value represents exactly 45.23 Amperes.
These calculations and the software that automate this process are included with the energy meter reference design. The meter design frame in the software allows the user to input specific meter ratings. Increasing the ADC headroom for RMS or active power calculation for any given production run of meters can be customised at production. Other meter constants, such as no load threshold limits, are also changed easily at meter production through the software/Flash interface.
USB meter reading/calibration
For advanced meter designs, calculating the required correction factors for the meter occurs externally to the meter at production and during calibration through software and calibration equipment. Communication through USB from meter calibration software is becoming more desirable, as many current generation PCs have lost the once common RS 232 serial port.
RS 232 only supports communication to one device connected to the bus at a time. Typically, meter calibration will occur with 10 to 50 meters connected to the controlled calibration voltage and current. Communicating to these multiple meters via a single PC that controls the calibration is impossible using RS 232. USB monitoring and calibration software for energy meters offers several advantages over conventional serial and parallel software solutions.
These advantages include increased connectivity, higher bandwidth communication and the ability to provide power to multiple meters. Additionally, data from multiple meters can be quickly gathered using USB. The USB energy meter software shown in Figure 3 provides energy meter calibration and reading, through the example Flash PIC18F and MCP3909 energy metering IC example presented earlier.
The software’s interface supports both RS 232/485 and USB for both approaches. This open source USB software offers many features over existing solutions, including the ability to store and read meter calibration status. The Flash MCU contains calibration status registers that the software uses to flag certain power quantities as having been calibrated or not. Phase calibration status is flagged as yellow icons, as shown in Figure 3.
This approach to calibration is unique to Flash-based energy meter calculation engines and cannot be performed on ROM-based energy meter ICs. Additionally, the system keeps track of which phase has been selected as the standard phase for phase-to-phase gain matching during calibration. To help protect against meter tampering, an important consideration when taking this approach involves code security and encryption. In addition to tampering, there is also the possibility of protecting meter design intellectual property.
Once modified for specific customer needs, if the energy meter calculation engine contains intellectual property that a meter manufacturer wants to protect from its end customer, there are a number of options available for code security. One level of security uses memory algorithm locking, which prohibits reading sections of memory via a serial port. Locks to read and write within sections of a MCU’s memory keeps other portions of code, like the RS 485 or USB portions, from accessing the secured sections, such as those that hold the calibration and correction factors.
Additionally, standard encryption algorithms are available, such as the Advanced Encryption Standard (AES) and Tiny Encryption Algorithm 2 (XTEA). Secure collaborati ve utilit y meter design Protecting intellectual property in collaborative utility metering system designs is also a common challenge, as customising the power calculation engine can bring additional intellectual property into the design.
Meter design houses, software intellectual property vendors, sensor modules and OEMs may each have their own intellectual property in a utility meter, and the final meter may contain two to three embedded MCUs, each with different meter functions and intellectual property specific to different companies. These multiple devices with different intellectual property increase costs to both end customers and utility companies. Multiple sections of intellectual property can be incorporated into a single device, while protecting sections of code independently, and integrating the solution on a single 16-bit MCU or Digital Signal Controller (DSC).
This collaborative approach to intellectual property on a single device offers protection for all parties, and final products may then be offered at lower costs. Ne w optio ns for ener gy meter designs The broad selection of Flash-based MCUs and analogue products available today offers many new and exciting avenues for meter designs.
In recent years, the advent of Flash-based MCUs as small as 6 pins, with unit costs lower than $0.40 has provided new possibilities for low-cost, single-phase energy meter calibration. Higher-end 16 and 32 bit meters can also be easily developed with modular AFE calculation blocks, all working together for simplified calibration techniques and faster meter production. Accurate, flexible AFEs that utilise delta-sigma ADC technology, paired with Flash MCU intelligence, open new avenues for innovative single- and three-phase energy meter designs.
For more information on the MCP3909 three-phase energy meter reference design (MCP3909RD-3PH1), as well as more information and resources for developing high performance, reliable energy, water, utility or heat meters, visit Microchip’s online Utility Meter Design Center