AN1291. Low-Cost Shunt Power Meter using MCP3909 and PIC18F25K20 OVERVIEW HARDWARE DESCRIPTION

Similar documents
TC53. Voltage Detector. Not recommended for new designs Please use MCP111/2 TC53. General Description: Features: Typical Applications:

MTCH112. Dual Channel Proximity Touch Controller Product Brief FEATURES PACKAGE TYPE SOIC, DFN GENERAL DESCRIPTION 8-PIN SOIC, DFN DIAGRAM FOR MTCH112

MTCH810. Haptics Controller Product Brief. Description: Features: Pin Description: Package Type: DESCRIPTION MTCH810

AN1476. Combining the CLC and NCO to Implement a High Resolution PWM BACKGROUND INTRODUCTION EQUATION 2: EQUATION 1: EQUATION 3:

AN1312. Deviations Sorting Algorithm for CSM Applications INTRODUCTION DESCRIPTION. The Second Concept Most Pressed Button

AN1085. Using the Mindi Power Management Simulator Tool INTRODUCTION ACCESSING MINDI ON MICROCHIP S WEB SITE

AN763. Latch-Up Protection For MOSFET Drivers INTRODUCTION. CONSTRUCTION OF CMOS ICs PREVENTING SCR TRIGGERING. Grounds. Equivalent SCR Circuit.

PIC16F506. PIC16F506 Rev. C0 Silicon Errata and Data Sheet Clarification. Silicon Errata Issues

Low-Power Techniques for LCD Applications RTH = (2R*R)/(2R+R) RTH = 2R 2 /3R RTH = 2R/3 RSW = 4.7K RCOM = 0.4K

AN1322. PIC MCU KEELOQ /AES Receiver System with Acknowledge TRANSMITTER LEARNING INTRODUCTION SYSTEM OVERVIEW RECEIVER FUNCTIONALITY

TABLE 1: REGISTERS ASSOCIATED WITH SLOPE COMPENSATOR MODULE

PIC16F506. PIC16F506 Rev. B1 Silicon Errata and Data Sheet Clarification. Silicon Errata

Low Cost Single Trip Point Temperature Sensor. Part Number Voltage Operation Package Ambient Temperature

TC620/TC621. 5V, Dual Trip Point Temperature Sensors. Features: Package Type. Applications: Device Selection Table. General Description:

MCP2515. MCP2515 Rev. B Silicon Errata. 3. Module: CAN Module. 1. Module: Oscillator Module. 4. Module: CAN Module. 2. Module: RAM Module

PIC18F2420/2520/4420/4520

TCM828/TCM829. Switched Capacitor Voltage Converters. Features. Description. Applications. Package Type. Typical Application Circuit

2, 5 and 8-Channel Proximity/Touch Controller Product Brief

PIC16F87/88. PIC16F87/88 Rev. B1 Silicon Errata. 1. Module: Internal RC Oscillator

TB3121. Conducted and Radiated Emissions on 8-Bit Mid-Range Microcontrollers INTRODUCTION ELECTROMAGNETIC COMPATIBILITY CONDUCTED EMISSIONS

AN1213. Powering a UNI/O Bus Device Through SCIO INTRODUCTION CIRCUIT FOR EXTRACTING POWER FROM SCIO

New Peripherals Tips n Tricks

AN1332. Current Sensing Circuit Concepts and Fundamentals CURRENT SENSING RESISTOR INTRODUCTION. Description. Microchip Technology Inc.

MIC5528. High Performance 500 ma LDO in Thin and Extra Thin DFN Packages. General Description. Features. Applications.

TC4426AM/TC4427AM/TC4428AM

Voltage Detector. TC54VC only

TC mA CMOS LDO TC1108. General Description. Features. Applications. Typical Application. Device Selection Table. Package Type SOT-223

PIC16(L)F72X Family Silicon Errata and Data Sheet Clarification

AN1321. KEELOQ Microcontroller-Based Transmitter with Acknowledge DUAL TRANSMITTER OPERATION INTRODUCTION RECEIVER ACKNOWLEDGE SAMPLE BUTTONS/WAKE-UP

AN1328. KEELOQ with XTEA Microcontroller-Based Transmitter with Acknowledge INTRODUCTION DUAL TRANSMITTER OPERATION BACKGROUND RECEIVER ACKNOWLEDGE

High-Speed N-Channel Power MOSFET

TC mA Fixed Output CMOS LDO. Features. Package Type. Applications. Device Selection Table. General Description. Typical Application

TC1272A. 3-Pin Reset Monitor. General Description. Features. Applications. Package Type. Typical Application Circuit TC1272A TC1272A.

High-Speed N-Channel Power MOSFET. PDFN 5 x 6 S

TC682. Inverting Voltage Doubler. General Description: Features: Applications: Functional Block Diagram. Device Selection Table. Package Type TC682

PIC16F818/819. PIC16F818/819 Rev. B0 Silicon Errata Sheet

PIC18F24J10/25J10/44J10/45J10

TC59. Low Dropout, Negative Output Voltage Regulator TC59. Features. General Description. Applications. Functional Block Diagram

AN1292 Tuning Guide 1.1 SETTING SOFTWARE PARAMETERS. STEP 1 Fill in the tuning_params.xls Excel spreadsheet with the following parameters:

TC7662A. Charge Pump DC-to-DC Converter. Features. Package Type. General Description. Applications. Device Selection Table. 8-Pin PDIP 8-Pin CERDIP

TC32M. ECONOMONITOR 3-Pin System Supervisor with Power Supply Monitor and Watchdog. Features: General Description: Applications:

TC1047/TC1047A. Precision Temperature-to-Voltage Converter. General Description. Applications. Block Diagram. Features.

TC1240/TC1240A. Positive Doubling Charge Pumps with Shutdown in a SOT-23 Package. Features. General Description. Applications

High-Speed N-Channel Power MOSFET

High-Speed N-Channel Power MOSFET

MCP1401/02. Tiny 500 ma, High-Speed Power MOSFET Driver. General Description. Features. Applications. Package Types

TC620/TC621. 5V, Dual Trip Point Temperature Sensors. Features: Package Type. Applications: Device Selection Table. General Description:

TB090. MCP2030 Three-Channel Analog Front-End Device Overview INTRODUCTION MCP2030. Youbok Lee, Ph.D. Microchip Technology Inc.

TC1275/TC1276/TC1277. Obsolete Device. 3-Pin Reset Monitors for 3.3V Systems. Features. General Description. Applications. Device Selection Table

TC57. Line Regulator Controller TC57. General Description. Features. Applications. Functional Block Diagram. Device Selection Table.

Programmable Gain Amplifier (PGA)

TC7660. Charge Pump DC-to-DC Voltage Converter. Package Types. Features. General Description. Applications. Functional Block Diagram TC7660

PIC16(L)F1782/ Pin 8-Bit Advanced Analog Flash Microcontroller Product Brief. High-Performance RISC CPU: Analog Peripheral Features:

PIC12(L)F1822/PIC16(L)F1823

PIC32MX450F256L 100-pin to 100-pin TQFP USB Plug-In Module (PIM) Information Sheet

PIC16F818/819. PIC16F818/819 Rev. A4 Silicon Errata Sheet. 2. Module: PORTB FIGURE 1: 1. Module: Internal RC Oscillator

TC1121. Obsolete Device. 100mA Charge Pump Voltage Converter with Shutdown. Features: Package Type. Applications: General Description:

1.5A Dual High-Speed Power MOSFET Drivers. Temp. Range

PIC12F1822/16F182X. 8/14/20-Pin 8-Bit Flash Microcontroller Product Brief. High-Performance RISC CPU: Peripheral Features:

PIC16F/LF1826/1827 Family Silicon Errata and Data Sheet Clarification. (1) Revision ID for Silicon Revision (2)

TC mA CMOS LDO with Shutdown ERROR Output and Bypass. Features. General Description. Applications. Typical Application. Device Selection Table

TC913A/TC913B. Dual Auto-Zeroed Operational Amplifiers. Features: Package Type. General Description: Applications: Device Selection Table

MCP9700/9700A MCP9701/9701A

PIC24FJ128GC010 FAMILY

Integrated Temperature Sensor & Brushless DC Fan Controller with FanSense Detect & Over-Temperature

PIC18F1XK22/LF1XK22 Family Silicon Errata and Data Sheet Clarification

MCP1406/07. 6A High-Speed Power MOSFET Drivers. General Description. Features. application.

AN1739. Improving Battery Run Time with Microchip s 4 µa Quiescent Current MCP16251/2 Boost Regulator PRIMARY BATTERY CONSIDERATIONS INTRODUCTION

TB3103. Buck Converter Using the PIC16F753 Analog Features PERFORMANCE SPECIFICATIONS INTRODUCTION ELECTRICAL SPECIFICATIONS

RE46C100. Piezoelectric Horn Driver Circuit HORNS HRNEN HORNB. Package Types. Features: General Description: Functional Block Diagram

PIC12LF1840T39A. PIC12LF1840T39A Product Brief. High-Performance RISC CPU: Low-Power Features: RF Transmitter: Flexible Oscillator Structure:

MCP9509/10. Resistor-Programmable Temperature Switches. Features. Description. Package Types. Applications. Typical Performance

TC1070/TC1071/TC ma, 100 ma and 150 ma Adjustable CMOS LDOs with Shutdown. Features: Description: Applications: Typical Application

9A High-Speed MOSFET Drivers. 8-Pin 6x5 DFN-S (2) INPUT EP 9

HV825. High-Voltage EL Lamp Driver IC. General Description. Features. Applications. Typical Application Circuit

GS004. Driving an ACIM with the dspic DSC MCPWM Module INTRODUCTION MCPWM MODULE FILTERED BY THE MOTOR'S WINDINGS

TB3126. PIC16(L)F183XX Data Signal Modulator (DSM) Technical Brief INTRODUCTION

DN2470. N-Channel, Depletion-Mode, Vertical DMOS FET. Features. Description. Applications

TC7660S. Super Charge Pump DC-to-DC Voltage Converter. Features: Package Types. General Description: Applications:

Configurable Logic Cell Tips n Tricks

High-Precision 16-Bit PWM Technical Brief MODE<1:0> PWM Control Unit. Offset Control OFM<1:0> E R U/D PWMxTMR. PHx_match. Comparator.

AN1202. Capacitive Sensing with PIC10F IMPLEMENTATION INTRODUCTION + - BASIC OSCILLATOR SCHEMATIC. Microchip Technology Inc.

MCP ma, High PSRR, Low Quiescent Current LDO. Features: Description: Applications: Package Types. Related Literature:

Section 45. High-Speed Analog Comparator

PIC12(L)F1501/PIC16(L)F150X

TC1410/TC1410N. 0.5A High-Speed MOSFET Drivers. Features. General Description. Package Type. Applications. 8-Pin MSOP/PDIP/SOIC TC1410N TC1410

PIC16F716 Silicon Errata and Data Sheet Clarification. (1) Revision ID for Silicon Revision (2)

AN2092. Using the Temperature Indicator Module INTRODUCTION. Constants. Application Limits. Equations. Variables. Microchip Technology Inc.

TC Bit Digital-to-Analog Converter with Two-Wire Interface TC1320. General Description. Features. Applications.

MCP ma, High PSRR, Low Quiescent Current LDO. Features: Description: Applications: Package Types. Related Literature:

DN2450. N-Channel, Depletion-Mode, Vertical DMOS FET. Features. Description. Applications

TB3073. Implementing a 10-Bit Digital Potentiometer using a Quad 8-Bit Digital Potentiometer Technical Brief INTRODUCTION.

PIC16(L)F1526/1527 Family Silicon Errata and Data Sheet Clarification DEV<8:0>

AN1259. KEELOQ Microcontroller-based Code Hopping Encoder INTRODUCTION DUAL ENCODER OPERATION TRANSMITTER OVERVIEW FUNCTIONAL INPUTS AND OUTPUTS

RE46C317/18. Piezoelectric Horn Driver with Boost Converter. Features: Description: Applications: Package Types. Typical Application

MTD6501C/D/G. 3-Phase Brushless DC Sinusoidal Sensorless Fan Motor Driver. Features. Description. Package Types

TC1232. Microprocessor Monitor. General Description: Features: Block Diagram. Package Types. Device Features

TC125/TC126. PFM Step-Up DC/DC Regulators. Features: General Description: Applications: Device Selection Table. Typical Application.

MCP16301 High Voltage Buck-Boost Demo Board User s Guide

PIC18(L)F2X/45K50. PIC18(L)F2X/45K50 USB Flash MCU Product Brief

Transcription:

Low-Cost Shunt Power Meter using MCP3909 and PIC18F25K20 Author: OVERVIEW Iaroslav-Andrei Hapenciuc Microchip Technology Inc. This application note shows a single-phase energy meter solution using the MCP3909 Dual Channel ADC and the PIC18F25K20 8-bit microcontroller. This application note uses Microchip's reference design "Low-Cost Power Monitor using MCP3909 and PIC18F25K20", Part Number: MCP3909RD-PM1. For cost reasons, the current sensor is a 200 µω shunt. To improve the low current measurements, the value can be increased to a larger resistance and the meter would require calibration at this lower current. The shunt used in this application note is a model that is connected to the circuit through screws on the meter case. The meter PCB has a footprint for an SMD Shunt and the two large through hole pads (visible on the lower left side in Figure 1) are available for high current wire soldering. The meter was tested for a range of current from 0.1A to 20A using the Fluke 6100A Electrical Power Standard. Measurement results are visible on the LCD or on the Pulse Output. This document is intended to provide guidance for designers who are interested in using Microchip s MCP3909 Metering ADC with synchronous sampling and PGA on current channel, and the low-cost high performance PIC18F25K20 microcontroller. The LCD is used to indicate the RMS current and RMS voltage (U RMS and I RMS ) on the first row, and the Power Factor and Active Power on the second row. For systems that require more than local display or monitoring, a second circuit is available for remote monitoring through USB. On the same PCB, there is also a USB circuit, isolated by the meter circuit with optocouplers. This circuit uses the 8-bit PIC18F14K50 microcontroller with USB. The USB circuit is powered from the PC. The firmware given has the USB set up as a virtual COM port with a 19200 baud rate. The user can easily change the meter firmware to send various information from the meter to PC for different tasks, such as accuracy evaluation, calibration, etc. HARDWARE DESCRIPTION The MCP3909 is an energy-metering IC designed to support the IEC 62053 International Metering Standard Specifications. It supplies a frequency output proportional to the average active real power, with simultaneous serial access to ADC channels and multiplier output data. This output waveform data is available at up to 14 khz with 16-bit ADC output and 20-bit multiplier output words. The 16-bit delta sigma ADCs allow for a wide range of I B and I MAX currents and/or small shunt (< 200 µω) meter designs. The integrated on chip voltage reference has an ultra-low temperature drift of 15 ppm per degree C. FIGURE 1: Low-Cost Single Phase Shunt Meter using MCP3909 and PIC18F25K20. Microchip s MCP390X metering ADC family has been developed to simplify the design of energy meters. 2009 Microchip Technology Inc. DS01291B-page 1

FIGURE 2: Power Meter Analog Circuit with Shunt. FIGURE 3: DV DD HPF AV DD NC CH0+ CHO- CH1- CH1+ 24-Lead SSOP 1 2 3 4 5 6 7 8 24 23 22 21 20 19 18 17 MCP3909 Pinout. F OUT0 F OUT1 HF OUT D GND NEG / SDO NC CLKOUT CLKIN MCLR 9 16 G0 REFIN / OUT A GND 10 11 15 14 G1 F0 / CS F2 / SCK 12 13 F1 / SDI The CH0 is used for current measurement because the PGA will allow the use of small value shunts. To select a shunt, the desired current range must be established first, the maximum value in particular, so that the voltage drop is less or equal to the maximum CH0 Voltage, as presented in Table 1. TABLE 1: GAIN SELECTIONS G1 G0 CH0 Gain Maximum CH0 Voltage 0 0 1 ±470 mv 0 1 2 ±235 mv 1 0 8 ±60 mv 1 1 16 ±30 mv In the design presented here, the gain used is 16, so the maximum peak voltage on the shunt must not exceed 30 mv, or, for convenience, the maximum RMS value should be under 20 mv. For a 80A meter design, the recommended shunt value is 200 µω, as used in this design. Since the MCP3909 is a part with a dynamic range of 1000:1, then the minimum measured current with good accuracy is 0.1A. To be able to obtain this value in an application, the sources of noise around the ADC must be eliminated, otherwise the low current measurements will be less accurate than the 0.1% that can be achieved by the MCP3909. The PCB layout and grounding scheme used on this demo board was sufficient enough to allow for these low current measurements, as will be described in later sections of this application note. DS01291B-page 2 2009 Microchip Technology Inc.

METER FIRMWARE In this design, the MCU receives the current and voltage samples from the MCP3909's 16-bit ADCs. Inside the microcontroller, these samples are processed in order to get the U RMS, I RMS, Power Factor, Active Power and Energy Accumulation. The communication between the MCP3909 and PIC18F25K20 is SPI, and after the last byte is received the PIC starts the calculation phase for all the power quantities. Each data transfer causes an SPI interrupt to begin this calculation on each sample. Because the calculations are done after each current and voltage sample is aquired, and because it is quite a long process using the PIC18F MCU, the sampling speed of the meter is limited below that which the MCP3909 can sample. The achieved sampling speed on current design is 880 sps. The sampling speed can be increased by removing some of the computation tasks. For example, if only the Energy Accumulation and Active power is computed, the sampling speed can be increased at 1.6 ksps. The signal processing can be summarized in Figure 4. Voltage Sample HPF Active Power Scaling Factor LPF LPF Active Power Current Sample HPF RMS Current Scaling Factor Power Factor LPF LPF SQRT LPF LPF SQRT Apparent Power RMS Voltage Scaling Factor URMS IRMS FIGURE 4: Power Meter Signal Processing. As presented in Figure 4, the MCU must compute the result of 8 first order IIR filters, and this takes almost 1 ms. In the existing firmware, to compute the output of IIR filters, numbers in Double format are being used to avoid rounding and saturation. A way to decrease the computation required to get the results is to use 16-bit or 32-bit number formats and write most of the code in assembly. The code written here was done in C and this increases the processing speed of the calculation. All IIR filters are first-order filters. For the low-pass filters, it is possible to use a second-order IIR filter, but the coefficients will be numbers that will not be represented very accurately in 16 or 32-bit number format; the coefficients will be numbers very close to 1 or to 0. The time needed to compute the two first-order IIR filters is equal to the time required to compute a single second-order IIR filter. The IIR filters structure is Direct Form I, this structure being presented in Figure 5. FIGURE 5: Form I Structure. First Order IIR Filter Direct In the case where the ADC noise is much lower than the measured signal, the only adjustment necessary for a correct indication are three scaling factors. However, if the ADC noise is close to the signal level, this could induce an offset like error, so, next to the scaling factor an offset compensation might be required. This happens usually in low-value shunt designs, while measuring low currents. 2009 Microchip Technology Inc. DS01291B-page 3

CALIBRATION For this design, the calibration is done by modifying the scaling factors in code. As long as the noise of the ADC is much lower than the signal acquired, the offset removal will not be necessary. In this case, a one-point calibration is enough. For situations where the shunt value is low (under 200 µω) at low current the noise will have an effect on the calculation, since its RMS value will add to the measurement. For this situation, an offset compensation will be necessary by doing a two-point calibration. In Figure 6 are presented two situations for the current measurement, using two shunt values: 100 µω and 1000 µω. This figure shows that for the low value 100 µω shunt, the noise affects the lower current ranges. For the higher value 1000 µω shunt, the current goes much lower before the noise has an impact on the accuracy.. Measured Value 100 10 1 0.1 Current Channel Non-Lin- FIGURE 6: earity. 1000 µω 100 µω I measurement linearity 0.01 0.001 0.01 0.1 1 10 100 Real Value To increase the linear region for the desired range, two solutions are possible: the first one is to use a higher shunt value, while the second solution is to use a non-linear calibration equation for the low current region. Another problem is the calibration for different power factors (PF). It is possible that for PF = 1, the errors are very small, but for other PF values the errors will increase significantly. This is mostly caused by the difference between the two analog channels (voltage and current). The current channel will have gain introduced by the PGA, and the voltage channel will not. In addition, the RC circuits at the inputs for the two channels can be different because of the part's tolerance. To ensure low errors at different values for PF, one component from the RC circuits must be modified. To modify just one value with maximum effect the best part is the capacitance in parallel with the low side resistor of the voltage divider from CH1. The value of that capacitance (C15 in this design) will be changed gradually until the measurement error will be minimum on a wide range of PF. Figure 7 shows the evolution of errors for different power factors and different values for C15. Error (%) FIGURE 7: Measurement Error vs. Power Factor for Different Capacitors (C15). POWER FACTOR COMPENSATION One of the main tasks in designing an energy meter is to minimize the effect of power factor variations over the measurement accuracy. In order to have accurate measurements over a wide range of power factors, the input of the MCP3909 ADC has identical current channel and voltage channels. Any difference between channels can cause phase shift between the current and voltage samples and this will cause a decrease in accuracy. The external passive components can induce phase shift because of the parts value tolerances. A way to minimize the effect of the phase shift on accuracy is to make a multi-point calibration, in order to have information about the effect of different power factors to meter accuracy. Figure 8 shows that the accuracy varies monotonously with the angle between the voltage and current. On a narrower range (-45, 45 degrees) this variation can be considered linear with a good accuracy. Therefore, it is possible to determine the equation of the best fit line between the calibration points -45, 0, 45 degrees (the yellow points in Figure 8). Error (%) 1 0.8 0.6 0.4 0.2 0-0.2-0.4-0.6-0.8-1 1.500 1.000 0.500 0.000-0.500-1.000-1.500 FIGURE 8: Error vs Power Factor CAP 100nF CAP 80nF CAP 90nf CAP 95nF NO CAP -80-60 -40-20 0 20 40 60 80 Power Factor (Degrees) Errors vs PF PF OLD Values Calib Points -80-60 -40-20 0 20 40 60 80 Phase Angle (degrees) Error vs. Phase Angle. DS01291B-page 4 2009 Microchip Technology Inc.

The pink line is the variation when calibration was done in one point, without considering the effect of PF over the accuracy of measurements. The green and blue lines are the errors after the meter was calibrated in three points and the extra information was used to compensate the PF. It is visible how in the -60, 60 degree range, the situation improved visibly from ±0.5% to less than ±0.2%. The three points calibration is used to determine the best fit line equation that will be used to modify the active power scaling factor relative to the power factor. The calibration method is quite simple. First, the meter is calibrated at one point: 1A, 0 degrees. The value of the Active Power Calibration Constant is noted. After that, the errors at -45 and 45 degrees are recorded. Using these values, it is possible to compute the ideal value of the Active Power Calibration Constant to have minimum errors in these three points. The three values of the Active Power Calibration Constant are plotted in a graph (Figure 9). On the X scale, not the actual PF is displayed, but a selection of normalized values in order to have the three points in a line. narrower or wider. Figure 10 shows three situations, for 880 sps (as in this meter), 1200 sps and 3200 sps. In Figure 11, the (48 Hz, 52 Hz) range is magnified and the Y axis is scaled to have a crossing at 50 Hz between all three cases. FIGURE 10: Functions. Sinc Filters Transfer Calibration Constant 50400 50350 50300 50250 50200 Calibration Equation y = 432.98x + 50232 50150 50100 Series1 Linear (Series1) 50050-0.4-0.2 0 0.2 0.4 Normalised PF FIGURE 9: Determination of the Active Power Calibration Constant Equation. The equation from the graphs is used to compute the Active Power Calibration Constant at different PF. The X axis could have been scaled in degrees, but this would have meant to compute the PF value in degrees in the MCU also. The normalized values were used for simplicity and minimum MCU computation power requirement. LINE FREQUENCY COMPENSATION A 50 Hz line frequency was used, and typically this is the frequency most of the time. However, this is not a constant, and it can vary around this value by a few Hertz. This line frequency shift can cause measurement errors because of the Sinc filter characteristics at low sampling speeds. The Sinc filter transfer function is similar to a low-pass filter until a frequency equal with the sampling speed where the signal is completely attenuated. Depending on the sampling speed of the ADC, this low-pass filter can be FIGURE 11: Frequency. Errors Caused by Line Here it is visible how the low speed ADC is causing a sensitive attenuation of the signal when the line frequency is higher than 50 Hz relative to the situations when line frequency is lower than 50 Hz. The measurement differences can be higher than 0.2%. In order to have accurate measurements, no matter the line frequency, it is necessary to compensate for these low-pass filter situations. The compensation is normally done using complex long FIR structures called Sinc Compensation Filters. Such a structure is impossible to be implemented in this application when the MCU is already used close to its maximum computation power. The solution is to adjust the cut-off frequency of the HPF to a value for which the transfer function of the HPF will compensate the Sinc transfer function around the 50 Hz value. The simulation and the measurements indicate that a cut-off frequency of 9 Hz for the HPF will be the best choice in this case (see Figure 12). 2009 Microchip Technology Inc. DS01291B-page 5

The actual error measurements in the 48 Hz to 52 Hz range at the current equal with 1A are presented in Figure 13. ENERGY METER ACCURACY The overall accuracy of the meter was measured using the Fluke 6100A Power standard. The measurement was done on a range of 0.1-20A, PF = 1, 0.5, -0.5, at 50 Hz, 49 Hz and 51 Hz. The results are presented in Table 2 and plotted in Figure 14. TABLE 2: METER ACCURACY PF=1 PF=0.5 PF=-0.5 PF=1 PF=1 I 50Hz 50Hz 50Hz 51Hz 49Hz FIGURE 12: using HPF. error (%) FIGURE 13: Sinc Filter Compensation Error vs Frequency line 0.1 0.08 Error vs frequency 0.06 0.04 0.02 0-0.02 47 48 49 50 51 52 53-0.04-0.06-0.08-0.1 Frequency Line (Hz) Errors vs. Line Frequency. This is a simplified solution and it will not compensate for frequencies where harmonics might be, yet it improves the overall performance of the meter accuracy significantly. One drawback of this method must be mentioned. As is noticed, the signal will be attenuated a little more that the case when the HPF is having a lower cut-off frequency. This extra attenuation will increase a little the measurement errors at low currents, where the situation is already difficult because of the lower SNR. But in this situation, this accuracy decrease is less than 0.1% and it is considered acceptable. Error (%) 0.2-0.158-0.947-0.519-0.449-0.648 0.5-0.116-0.042 0.027-0.24-0.114 1-0.098-0.084-0.178-0.177-0.162 2-0.122-0.176-0.118-0.124-0.068 5-0.028-0.078-0.066-0.011-0.03 10 0.028-0.064-0.013 0.028 0.028 20 0.028 0.028 0.028 0.028 0.028 40 0.028 0.028 0.028 0.028 0.028 80 0.028 0.028 0.028 0.028 0.028 0.2 0-0.2-0.4-0.6-0.8-1 -1.2 FIGURE 14: REFERENCES Accuracy 50Hz PF=1 50Hz PF=0.5 50Hz PF=-0.5 51Hz PF=1 49Hz PF=1 0.1 1 Current (A) 10 100 Energy Meter Accuracy. [1] MCP3909 Data Sheet, Energy Metering IC with SPI Interface and Active Power Output, Microchip Technology Inc., DS22025, 2008. [2] AN1151, PIC18F2520 MCP3909 3-Phase Energy Meter Reference Design, Microchip Technology Inc. Microchip Technology Inc., DS01151, 2008 DS01291B-page 6 2009 Microchip Technology Inc.

Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet. Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable. Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, dspic, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, rfpic and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MXDEV, MXLAB, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, CodeGuard, dspicdem, dspicdem.net, dspicworks, dsspeak, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, mtouch, Octopus, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, PIC 32 logo, REAL ICE, rflab, Select Mode, Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. 2009, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company s quality system processes and procedures are for its PIC MCUs and dspic DSCs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. 2009 Microchip Technology Inc. DS01291B-page 7

WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.com Atlanta Duluth, GA Tel: 678-957-9614 Fax: 678-957-1455 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Cleveland Independence, OH Tel: 216-447-0464 Fax: 216-447-0643 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260 Kokomo Kokomo, IN Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 Santa Clara Santa Clara, CA Tel: 408-961-6444 Fax: 408-961-6445 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 ASIA/PACIFIC Asia Pacific Office Suites 3707-14, 37th Floor Tower 6, The Gateway Harbour City, Kowloon Hong Kong Tel: 852-2401-1200 Fax: 852-2401-3431 Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 China - Beijing Tel: 86-10-8528-2100 Fax: 86-10-8528-2104 China - Chengdu Tel: 86-28-8665-5511 Fax: 86-28-8665-7889 China - Hong Kong SAR Tel: 852-2401-1200 Fax: 852-2401-3431 China - Nanjing Tel: 86-25-8473-2460 Fax: 86-25-8473-2470 China - Qingdao Tel: 86-532-8502-7355 Fax: 86-532-8502-7205 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 China - Wuhan Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 China - Xiamen Tel: 86-592-2388138 Fax: 86-592-2388130 China - Xian Tel: 86-29-8833-7252 Fax: 86-29-8833-7256 China - Zhuhai Tel: 86-756-3210040 Fax: 86-756-3210049 ASIA/PACIFIC India - Bangalore Tel: 91-80-3090-4444 Fax: 91-80-3090-4080 India - New Delhi Tel: 91-11-4160-8631 Fax: 91-11-4160-8632 India - Pune Tel: 91-20-2566-1512 Fax: 91-20-2566-1513 Japan - Yokohama Tel: 81-45-471-6166 Fax: 81-45-471-6122 Korea - Daegu Tel: 82-53-744-4301 Fax: 82-53-744-4302 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 Malaysia - Kuala Lumpur Tel: 60-3-6201-9857 Fax: 60-3-6201-9859 Malaysia - Penang Tel: 60-4-227-8870 Fax: 60-4-227-4068 Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Hsin Chu Tel: 886-3-6578-300 Fax: 886-3-6578-370 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 EUROPE Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 Spain - Madrid Tel: 34-91-708-08-90 Fax: 34-91-708-08-91 UK - Wokingham Tel: 44-118-921-5869 Fax: 44-118-921-5820 03/26/09 DS01291B-page 8 2009 Microchip Technology Inc.