Smart meters can be fully customizable
New European regulations and the establishment of the SmartGrid have transformed the electricity distribution market. EU regulations demands AMR (automated meter reading) that allows any user to see his energy consumption every 15 minutes over the entire day, while the SmartGrid allows us to achieve this using PLM (power line modem) communication over various protocols, for example, Linky G1, G3, and PRIME.
The old mechanical disc meters (Ferraris) are no longer effective and digital e-meters are taking their place. This change not only brings easier integration and more communication possibilities but also more intelligence. What are the benefits of a digital e-meter made using a microcontroller?
- Functions can be changed and extended by simple firmware upgrades
- Microcontrollers can drive switches and/or other devices
- Tamper detection can be implemented to compare currents in phase and the neutral line
- Tamper date, a time log, and a real time clock with a calendar can be set up
- Tariffs can be managed via connection into the SmartGrid
- Prepaid e-meters can be introduced and managed more efficiently
The designer of a fully digital e-meter will have to choose from these possibilities:
a) a.) A dedicated chip for energy measurement - AFE (Analog Front End) that drives mechanical register and pulse LED
b) b.) A dedicated AFE connected to a microcontroller
c) c.) A microcontroller with integrated AFE
d) d.) A general purpose microcontroller with external ADC
e) e.) A general purpose microcontroller with embedded ADC
Since the EN 50470-1:2006 standard prescribes the maximum allowed errors at every point of the entire meter current and voltage range, reaching the limits is not a very easy task. That is why there are so many AFEs on the market that are tested and fully compliant to EN 50470-1:2006, which prescribes ISTART, IMIN, ITR, IREF, IMAX [ITR = IREF/2 (alternatively called INOM), IMIN=ITR/2, ISTART = 20 mA].
Class B power meters
Let’s evaluate an example of the construction of a power meter in Class B, with maximum current of 100 A. For such a high maximum current, the typical request for nominal current is 5 A. In this case, a precision of 1.5% is prescribed for a range from IMIN = 250 mA to ITR = 500 mA, and a precision of 1% for range from ITR = 500 mA to IMAX. Below IMIN no precision is prescribed, but an e-meter must detect zero current (no load) conditions.
In order to achieve this precision, the AFE contains 16/24 bit sigma delta ADCs, as well as advanced decimation, filtering and computational algorithms that reject all kinds of possible noise and errors. Since many AFEs are external, or if properly designed when embedded are isolated from the noise of the microcontroller, they can reach the necessary precision. The cost we pay when using AFEs in combination with a microcontroller is simply a two-chip solution price (although, as we’ll see, it can be up to a seven-chip solution price).
Figure 1: The latest AFE for e-meters from STM
Wouldn’t it be better to use one chip without the embedded dedicated AFE?
Designing an e-meter without these AFE chips is possible; however, there are tradeoffs that need to be considered. For example, an e-meter could be constructed using a simple 8 or 10 bit ADC that is typical among MCUs on the market today. This is not a single chip solution. You will need to add additional circuitry in front of the ADC inputs (signal conditioning) in order to handle the current range, filtering, and noise. These additional components will add cost to the overall solution.
In a highly competitive market, adding cost for additional functionality (algorithm control) is not acceptable. In order to take advantage of the MCU solution, a good quality ADC (external or embedded) is necessary to build a cost effective e-meter. Using a high quality and higher resolution external ADC has an advantage, allowing the designer to control how injected noise is handled with the conversion. This external ADC is still a two-chip solution.
The embedded ADC allows a single chip solution, knowing that the injected noise management is mostly handled by the chip manufacturer. The embedded ADC solution does add risk to the design, which needs to be managed. On the other hand, this is a very cost effective solution. Again, a trade off arises - noise management versus a single chip solution with the ability of the designer to modify the algorithm. Depending on the application, some customers do favor the single chip solution.
Some customers prefer a solution in which they can use their own computational algorithms rather than an AFE chip with an already proven hardwired algorithm. Why would that be?
They simply want to control the computation process. They do not want to rely on an algorithm and the expertise of an AFE supplier. They prefer to use their own expertise. Moreover, some AFEs have limitations. They do not perform all the computations the customer wants, or the definition of the computation could differ from customer to customer. The required values are not only RMS voltage, RMS current and active power, but also reactive power, total harmonic distortion, distortion power, power factor, phase shift, harmonic analysis, coverage of certain harmonics. For example, the reactive power could be computed more than one way:
- It could be computed from a vector triangle of the apparent and the real power
- It could be computed as real power from the signal, where all the harmonics of the current were shifted by 90 degree
- It could be computed from Fourier computation as an imaginary part of the power spectra
- It could be computed by the very simple but popular method of shifting the current waveform by 90 degrees of the fundamental harmonic
Some customers want to be able to control the computation in case they need to change the computation algorithm quickly.
Moreover, when using current transformers as current sensors, because of the galvanic isolation, the one-chip solution for three phase meters could be very efficient from the point of view of PCB design, assembly, reliability, and overall cost. In the US market, where the meters are often in a circular housing using complete metal shielding, any noise the lines coming from sensors to the chip will be decidedly rejected. Using the shunts for three phase measurements makes the use of a multi-chip solution a must because of the insulation implementation.
A powerful general-purpose microcontroller, such as that introduced by STMicroelectronics, has been used for our example: the STM32F373 Cortex-M4F core running on 72 MHz with three embedded 50 ksps 16-bit sigma-delta ADCs (SDADC) and one 1 Msps 12-bit fast successive approximation register ADC. The very successful value, performance and connectivity line series from STM32 family, which includes the value-, performance- and connectivity-line series, continues with the Analog line series. The embedded analog part makes this microcontroller suitable for a 3-phase e-meter implementation giving the computational flexibility mentioned in previous paragraphs.
Prior to the STM32F373 announcement, ST had already introduced a successful design of a one-phase e-meter using a general-purpose microcontroller, the STM32F100 with 12-bit ADC. A lot of the expertise learned through the STM32F100 design was used in the STM32F373. For example, the knowledge that oversampling reduces only the differential non-linearity (DNL) of an ADC is the main presumption to be able to build a precise metering system.
Although some ADC precision correction is possible by software, it could cause difficulties in the manufacturing, certification and calibration processes. Since for non-sigma-delta ADC the hardware (or software) linearity enhancement is needed, when higher precision is expected, sigma-delta ADC are naturally very linear. If we are able to manage the overall in-system noise, we could get an increased number of effective bits from the ADC.
Although single values coming from the ADC contain some noise, the situation is different if we speak about the RMS value computed from the aforementioned values. The noise drops with the number of the values used for all computation. To summarize, attention must be paid to the overall system linearity, in-system correlated noise, and the overall system performance.
Figure 2: Floating-point performance
The STM32F373 brings this performance, and furthermore, it brings features that make it possible to build not only a cost effective e-meter, but one with a harmonic analyzer. Since the STM32F373 delivers these features, an e-meter implementation can be relatively simple and effective:
- The standard, widely used Cortex-M4F 32-bit core with floating point, changing the bothering with fixed-point precision to the pleasure of working in floating point
- An available DSP library using the DSP functions of the Cortex-M4F core makes an implementation of the all the math, filtering, and FFT, for example, very simple and easy
- The STM32F373 on-chip flash can be used as an EEPROM for calibration constants, tamper data, measured values, tariff specification and load profiles
- Embedded RTC, internal oscillators, and communication peripherals make this chip easy to use standalone but also interconnect with other devices like IR ports, PLM, MEMs, among others
Although the most important output of the e-meter used for certification and calibration purposes is the LED output, an LCD display is an integral part of the e-meter. In the EU, ARM systems are still mostly in pilots, and customers demand meters with a display in order to control their hour-to-hour or day-to-day consumption.
The design of an e-meter display rightly receives a lot of attention since that is the primary consumer interface. Even though the directly driven LCD segment display was thought to be the least expensive and most popular solution, when we question customers over the world, half of them preferred the opposite: chip on glass approach. Why?
- The chip on glass always contains a voltage booster that allows using less-expensive LCDs in order to cover the entire operational temperature range and still offer a quality, easy to read, display.
- The chip on glass uses only SPI: it is easier to maintain EMC for just three wires.
- Because only three wires for an LCD are used, this leaves many pins free for other uses, saving the cost of GPIO expanders or extra solutions to extend functionality of the microcontroller.
- PCB layout is faster and easier.
- When using a software LCD driver in microcontroller rather than a hardware LCD driver, using chip on glass reduces the microcontroller load and makes the software shorter and simpler.
With the huge number of STM32F373 GPIO pins (for the 100-pin package, there are 84 GPIO pins), the SW LCD driver could directly drive a large segment LCD in case this option is needed. The e-meter reference design makes it possible to drive LCDs from 4 x 14 segments to 4 x 31 or to connect SPI B&W and color display.