Professional Documents
Culture Documents
Utility Metering with PIC Microcontrollers and the MCP3905 Energy Metering IC
Slide
Class Agenda
Part I
MCP3905 Craig L. King, Analog & Mixed Signal Product Division
Part II
PIC MCU Energy Measurement, Gas/Water/Heat Meters Design, & AMR and Prepaid Meter Design Vidyadhar Vivekananda, India Design Center, Advanced Microcontroller Products Division
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
Class Agenda-Part I
MCP3905 Energy metering
MCP3905 Functional Blocks Hands-on Exercises MCP3905 Operation and Calibration Hands On use of MCP3905 and PIC MCU in energy metering Current Sensing Discussion Demonstration Shunt Inductance zero compensation and Phase Shift Compensation
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
Agenda-Part II
Other Energy Meter solutions from Microchip
Stand Alone PIC MCU solution
Discussion on Metering Connectivity Demonstrate Water Meter reference design with PIC MCU
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
Class Agenda-Part I
MCP3905 Energy metering
MCP3905 Functional Blocks Hands-on Exercises MCP3905 Operation and Calibration Hands On use of MCP3905 and PIC MCU in energy metering Current Sensing Discussion Demonstration Shunt Inductance zero compensation and Phase Shift Compensation
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
Goals of Part I: 1) MCP3905 Operation, Eval, Board 2) Energy Metering Applications Information 3) Delta Sigma ADC
Class
Slide
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
LPF
Slide
MCP3905 ADCs
Bipolar
CH0+ CH0-
PGA
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
LPF
Slide
Class
Slide
Convert to Base 2
18.9 bits
MCP3905 = 16-bit ADCs + Averaging Typical for Energy Metering ICs
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
10
MCP3905 ADC 2ND Order Modulator w/ 3RD Order SINC Filter 16-bit word, 15.7-bits Effective Number of Bits (ENOB) Over-samples at MCLK/4
(1 MHz for MCLK = 4 MHz)
Class
Slide
11
MCP3905 ADCs
Bipolar
CH0+ CH0-
PGA
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
LPF
Slide
12
ADC Representation
MCLK (4MHz)
Modulator
Class
Slide
13
0 dB -20 dB -40 dB
-60dB
-80 dB
Frequency (kHz)
Class
Slide
14
-20dB
2 0 4 0 6 0 8 0 1 0
-120dB
1 2 0 1 4 0 00000 1 246802 10
fSAMPLE (1 MHz)
2fSAMPLE
3fSAMPLE
Class
Slide
15
Noise
4kHz
fdata
1MHz
MCP3905 S
Class
Slide
16
PGA
SINC3
HPF
16-BIT ADC 2.4 Ultra Low Drift VREF Bipolar CH2+ CH2-
X
SINC3
HPF
16-BIT ADC
LPF
Slide
17
Digital Processing HPF, Multiplier, and LPF i(t)=I*cos(t) , v(t)=V*cos(t) P(t) = V*I( 1 + COS (2t) )
Instantaneous Power or p (t)
V*I 2
0 (AGND)
CH0 or i (t)
2005 Microchip Technology Incorporated. All Rights Reserved. Class
CH1 or v (t)
Slide 18
-5 dB
-10 dB
-15 dB
Frequency (Hz)
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
19
-5 dB
-10 dB
-15 dB
Frequency (Hz)
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
20
V*I 2
0 (AGND)
CH0 or i (t)
2005 Microchip Technology Incorporated. All Rights Reserved. Class
CH1 or v (t)
Slide 21
PGA
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
Active Power
LPF
Instantaneous Power
Class
Slide
22
er ow lP ota
KEG OF BEER
Slide
23
AC Power Quadrants
Reverse Forward
90
2 180
1 0
270
Class
Slide
24
Forward
MCP3905 Real Power Accuracy applies from 60 lag to 37 lead NEG pin logic indication for any reverse power (~ 85 degree)
2 180
1
60 37
270
Class
Slide
25
Power Measurement
Reverse
90
MCP3905 - Part I
Specified measurement of Forward Active Power Alarm for Reverse Power
To
ta lP
180
RMS measurement VA
Class
Slide
26
MCP3905
Bipolar
CH0+ CH0-
PGA
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
LPF
Slide
27
Class
Slide
28
Class
Slide
29
Class
Slide
30
MCP3905 Channel 0
Bipolar
CH0+ CH0-
PGA
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
LPF
Slide
31
Slide
32
MCP3905 Channel 1
The remaining unknown
Bipolar CH0+ CH0-
PGA
SINC3
HPF
Bipolar
CH1+ CH1-
SINC3
HPF
LPF
Slide
33
VIN = 220V
CH1+ Z3
Z8
GND
Class
Slide
34
Class Agenda-Part I
Energy metering
MCP3905 Blocks Hands-on Exercises MCP3905 Operation and Calibration Hands On use of MCP3905 and PIC MCU in energy metering Current Sensing Discussion Demonstration Shunt Inductance zero compensation and Phase Shift Compensation
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
35
Hands On Material
MCP3905 Evaluation Board PICDEM LCD Evaluation Board ICD2 for in-circuit PIC MCU programming MCP3905 Data Sheet MCP3905 Application Note
Class
Slide
36
To avoid shock please keep cover on when system is powered up! Class Hint: Keep one hand in your pocket to avoid electricity running through your chest and/or heart
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
37
Slide
38
Class
Slide
39
Load MPLAB Calibration Project Do not connect PICDEM LCD board yet Load and program .hex file Discuss the firmware
Class
Slide
40
Class
Slide
41
Class
Slide
42
Slide
43
Power Factor
PF = 1 Purely Resistive Load PF = 0.5 lag Inductive Load (60) PF = 0.88 lead Capacitive Load (30)
Measurement Error Graphs for PF = + 0.5 AND PF = -0.5
I lags V by 60 I leads V by 30
Class
Slide
44
Class Agenda-Part I
Energy metering
Power Theory Overview MCP3905 Blocks Hands-on Exercises MCP3905 Operation and Calibration Hands On use of MCP3905 and PIC MCU in energy metering Current Sensing Discussion Demonstration Shunt Inductance zero compensation and Phase Shift Compensation
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
45
Load MPLAB IDE kWh Display on LCD Load and program .hex file Discuss the firmware
Class
Slide
46
Class Agenda-Part I
Energy metering
Power Theory Overview MCP3905 Blocks Hands-on Exercises MCP3905 Operation and Calibration Hands On use of MCP3905 and PIC MCU in energy metering Current Sensing Discussion Demonstration Shunt Inductance zero compensation and Phase Shift Compensation
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
47
Slide
48
The Shunt
The Shunt is A SIMPLE RESISTOR typically from 100u to 500m Parasitic Inductance 1-5 nH Voltage drop across shunt is dependant on both the current AND the frequency Ultimately Limited by Self Heating Good Accuracy at Low Cost, simple to use Very popular
Class
Slide
49
Specifications From Data Sheet Manufacturer: Isabellenhutte Heusler Part Number: BKW-M-R0003-5.0
Resistance Tolerance Temperature Coefficient Temperature Range Load Capacity Internal Heat Resistance Inductance Stability
2005 Microchip Technology Incorporated. All Rights Reserved.
The Shunt
0.3 mOhm 5% 20ppm/K (20C to 60C) -55C to 140C 3 Watt < 10 K/W 3 nH Deviation < 0.5% after 2000 h
Class
Slide
50
Class
Slide
51
Class Agenda-Part I
Energy metering
Power Theory Overview MCP3905 Blocks Hands-on Exercises MCP3905 Operation and Calibration Hands On use of MCP3905 and PIC MCU in energy metering Current Sensing Discussion Demonstration Shunt Inductance zero compensation and Phase Shift Compensation
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
52
0.1 0.05
Frequency (Hz)
Class
Slide
53
Problem #2 Combination of certain R and L values (parasitic inductance) cancels the antialiasing filter! Anything around 1 MHz is a problem due to aliasing concerns Goal: Show how to compensate for this parasitic shunt Inductance using complex frequency analysis in Excel
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
54
Noise
4 kHz
fdata
2005 Microchip Technology Incorporated. All Rights Reserved.
fS/2
1 MHz
fS
Class
Slide
55
Frequency Response of RC
Next lets add the shunt zero
0 -5
Frequency (Hz)
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Phase (degree)
Slide
Mag(dB)
57
Frequency Response of RC + LR
Disaster arises around 1 MHz Need compensation with SECOND RC!
0 -5
Mag(dB)
Frequency (Hz)
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
Phase (degree)
58
0 -5
Class
Slide
59
Class
Slide
60
Part I Review
Mechanical Meter
Goals of Part I: 1) MCP3905 Operation, Eval Board Usage 2) Energy Metering Applications Information 3) Delta Sigma Terminology & Understanding
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
61
Part I Review
Power Theory Fundamentals Energy Metering Basics MCP3905
Stand Alone Meter Operation Calibration & Frequency Output Over-sampling Anti-aliasing Filter Design
CT vs. Shunt
Shunt zero inductance Phase Adjustment
Slide 62
Class
Demo Boards
MCP3905 Energy Meter Reference Design MCP3905 Evaluation Board
Design Tools
FilterLab software Excel File RC Phase Compensation . xls
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
63
Class
Slide
64
Slide
65
Block Diagram
Measurement
Communication / Control
PIC16F873A
LCD Controller
Attenuator Voltage Line Current Neutral Current Ground Gain Selection Calibration Input Selection RS232 Port Selectable Gain Amplifier ADC LED Indicators
RTC
Calibration Mode
Class
Slide
66
Measurement Algorithm
When accumulated V x I 3600 x Fs x Kd2 = -------------------------- x 200 Kv x Ki
Class
Slide
67
Phase Calibration
Delay between Voltage and Current
Current Sample Point Voltage Sample Points
V t
Class
Slide
68
Other Features
Root Mean Square Calculation KVA = Vrms x Irms Max. Demand--RTC
Class
Slide
69
Calibration
Class
Slide
70
Flow Meters
Class
Slide
71
Flow Sensors
50
8 28
Class
Slide
72
Positive Displacement
One rotation for a known volume of fluid Volumetric Measurement
Flow rate to be calculated
Class
Slide
73
PD-Pick up
Inductive Capacitive Magnetic
Reed Switch Hall Effect
Class
Slide
74
Turbine Type
Flow Rate Measurement
Volume to be calculated
Class
Slide
75
Turbine
More than 4 inches for pipe size for water More than 10 inches for gas
Class
Slide
76
Heat Meter
Precision Flow measurement Temperature Sensors: In & Out Temperature Calculator
Q = CV (Tin Tout) Q: Heat energy consumed in KWH C: Specific heat of the fluid V: Volume of fluid flown Tin and Tout are supply and return temp.
Class
Slide
77
Fluid Volume
PIC18F6490
Class
Slide
78
Heat Meter
Precision flow meter For temperature measurement, the temperature is variable from 0~200 degree C To measure the temperature, it needs high resolution A/D converter Temperature error less than 0.3 degree C Matching error of two temperature sensor must be less than 0.1 degree C Pt1000 platinum resistor is usually used to measure temperature in matching pairs
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
79
Class
Slide
80
Water Meter
Class
Slide
81
Water Meter
Class
Slide
82
Water Meter
3.6V Lithium Battery supply
Low Power, Sleep
Pulse count
PD type, Dual REED switch pick up
LCD interface Key press for different display Low Voltage detection Anti Damage functions Card Functions Supply Cut Off
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
83
Water Meter
Class
Slide
84
Water Meter
Demonstration of pulse count Demonstration of SLEEP / Wake up Demonstration of low voltage/anti damage functions Demonstration of card reading functions
Class
Slide
85
Class
Slide
86
Slide
87
AN/Ref. Design
AN939 MCP3905 reference design Water Meter Reference design X10 application note ZigBee Application note
Class
Slide
88
Summary
Environment of operation
IEC Standard or local regulation
Measurement Algorithm: MIPS Easy and quick Calibration during production LCD interface & NV Storage
2005 Microchip Technology Incorporated. All Rights Reserved. Class
Slide
89
Summary
Data Collection and Storage
Load profile in energy meter: EEPROM
Class
Slide
90