Transcript Power Meter
Power Meter ECE 4512 Senior Design I Department of Electrical & Computer Engineering Mississippi State University Team Advisor: Professor Raymond S. Winton Team Leader: Wei-Keat Quek Contribution: A/D Converter, LCD Display, & Documentation Team Members: Matthew Hemphill Contribution: Voltage-sensing circuit & Documentation Scott Fredrick Contribution: Current-sensing circuit & Documentation James Nixon Contribution: Microcontroller & Documentation Motivation To provide average American householders with a portable & accurate digital power meter • Importance – Can educate consumers, save them money, & aid in purchase decisions – Can aid in troubleshooting problem circuits & in making decisions to conserve energy • Relevance – Allows for concrete, practical design experience based on curriculum – Allows for group collaboration and division of tasks based on each member’s specialty Problem Statement • To accurately sense the voltage and current used over a range of typical household devices. • To achieve reliable power measurements by taking phase differences between the voltage and current, i.e. the power factor, into account. Design Requirements • • • • Voltage-sensing circuit (0 to 120 Vrms) Current-sensing circuit (0 to 30 A) Power Factor Calculation (DS87Cx20 Microcontroller) Power (9 V Battery) Design Requirements • Display (4-digit LCD) • • • • Power Measurement Range (0 to 3600 W) Energy Measurement Range (0 to 86.4 kWhrs) Tolerance (+/- 3%) Size & Packaging (Plastic enclosure – 4” x 8” x 1.5” (W x L x D)) Digital Power Measurement Voltage-Sensing Circuit vo = (1 + 2*R4/R3)(v2 – v1) where = R2/R1 Simulation Simulation Results Voltage Input (Vp-p) 180 170 160 150 140 130 120 110 100 90 Vo (Vp-p) 5.0110 4.7227 4.4322 4.1637 3.9022 3.6260 3.3447 3.0547 2.7774 2.5067 Vo Scaled by 36 Percent error (%) 180.396 0.2200 170.017 0.0101 159.559 0.2755 149.893 0.0712 140.479 0.3423 130.536 0.4123 120.409 0.3410 109.409 0.0280 99.9864 0.0136 90.2412 0.2680 Monte Carlo Simulation Current-Sensing Circuit Simulation Simulation Results Voltage Input (Vp-p) Vo (mVp-p) 180 68.743 170 64.775 160 61.459 150 57.585 140 52.740 130 48.959 120 46.029 110 42.131 100 37.895 90 34.303 I (mA) 68.743 64.775 61.459 57.585 52.740 48.959 46.029 42.131 37.895 34.303 I (Rsense) (mA) Percent error (%) 68.714 0.0422 64.803 0.0432 61.433 0.0423 57.587 0.0035 52.717 0.0436 48.935 0.0491 46.001 0.0608 42.092 0.0927 37.872 0.0607 34.280 0.0671 Monte Carlo Simulation A/D Conversion Power Factor Calculation Sampling & Displacement • Sampling rate >= 1/(8*fo) where fo = 60 Hz • Displacement = -/ where = 2f Example • = * displacement = 2(60 Hz)*1.5 ms = 0.565 rad/s Power • P = Vrms*Irms*cos() = (127.6 V)/(68.714 mA)(0.8446) = 7.4 W Maclaurin Series • cos() = 1 - ^2/2! + ^4/4! - ^6/6! + … + (-1)^k ^2k/2k! + … C Code •After the first three harmonics, cos () = cos(0.565) = 0.8446. C Program Flow Select functio n Start Pinstantaneous Calculate real power Pavg Input time Time out or disconnect ? Receive digital voltage value (Reference) Receive digital current value Yes Display output End No Has first zerocrossing been reached? Yes Calculate displacement between current and voltage No UMPS Simulation Vcc LCD 4 P1.6 P1.7 P3.0-P3.7 EA 31 40 DS87Cx20 Vcc P2.1 P2.2 7-14 5/1 10 K 22 30 pF 19 SW2 4 MHz 20 3 10-17 0.1 F GND 2 7 8 23 XTAL1 6 Vcc XTAL2 18 30 pF SW1 UMPS Simulation c:\temp\lcd.asm org 0 ajmp Main org 020h Main: mov CKCON,#%00001000 mov TMOD,#%00000001 mov TCON,#%00010000 mov IE,#%10000010 ; LCD Display mov P1,#03Fh CPU Registers ; Program Main ; ; ; ; ; Use Internal /4 Clock for Timer0 Timer0 - Uses Internal Clock - Run in Mode 1 Start Timer0 running Enable the Timer 0 Interrupt P1 0000003F P3 00000007 ; Make sure all LCD lines are Low acall Dlay5 acall Dlay5 acall Dlay5 ; Wait 15 ms for the Display to Power Up mov P3,#$7 clr P1.6 setb P1.7 clr P1.7 ; Output a 7 on the Display Line ; Clear the RS Line ; Toggle the LCD "E" Clock acall Dlay5 ; Wait 5 ms for the instruction to execute : SP 07 Resources 7 SW1 SW2 Conclusions/Future Work Conclusions • Ensure our tolerance levels are met • Meet challenge of accuracy Future Improvements • Expand functions for both AC & DC measurements • Expand measuring range • Improve tolerance levels • Allow PC connectivity • Improve internal power consumption References [1] “ADC 0801/ADC 0802 ADC 0803 ADC 0804 ADC 0805 8 bit µP Compatible A/D Converters”, National Semiconductor Corporation, U.S.A., 2000. [2] “EDC190 4-Digit 7-Segment Liquid Crystal Display”, Microelectronic Company, U.S.A., June 1987. [3] Fisher, G. J., “An Enhanced Power Meter for SPICE2 Circuit Simulation,” IEEE Transactions On Computer-Aided Design, Harris Semiconductor, Melbourne, FL, May, 1998. [4] Garverick, S. L., McGrath, D. T., Baetsch, R. D., and Fujino, K., “A Programmable Mixed-Signal ASIC for Power Metering,” IEEE International Solid-State Circuits Conference, GE Corporate Research and Development, Schenectady, NY, January, 1991. [5] Graf, Rudolf F., Encyclopedia of Electronic Circuits, Vol. 3, TAB Books Inc., 1991. [6] Hanselman, Duane, and Littlefield, Bruce, Mastering MATLAB: A Comprehensive Tutorial and Reference, The MATLAB Curriculum Series, Upper Saddle River, NJ: Prentice Hall, 1996. [7] Hayes, Thomas C., and Horowitz, Paul, Student Manual for the Art of Electronics, Cambridge University Press, 1989. [8] Helps, Richard, “Op-amps Note,” http://www.et.byu.edu/~rhelps/EET444/html/op-amps_note.htm (11/9/00). [9] "High-Speed Microcontroller User Guide", Dallas Semiconductor, http://www.dalsemi.com/ References (cont.) [10] Horowitz, Paul, and Hill, Winfield, The Art of Electronics, 2nd ed. Cambridge University Press, 1989. [11] Lamego, M. M., Sousa, G. C. D., and Vierira, J. L. F., “A Single Phase Microcontroller Based Energy Meter,” IEEE Instrum. And Meas. Tech. Conf.Proc., Electrical Engineering Dept., Universidade Federal do Espirito Santo, May, 1998. [12] Landee, Robert W., and Davis, Donavan C., Electronics Designer’s Handbook, 2nd ed. New York: McGraw-Hill, 1977. [13] Lapuh, R., Visocnik, I., and Arnsek, A., “Single DVM Sampling Power Meter For Low Frequencies,” IEEE Instrum. And Meas. Tech. Conf. Proc., Slovenian Institute of Quality and Metrology, Ljubljana, Slovenia, May 2000. [14] Lenk, John D., Circuit Encyclopedia & Troubleshooting Guide, Vols. 1 & 2, New York: McGraw-Hill, 1974. [15] Liu, L. X., Chen, T. P., and Chua, S. W., “Influence of Frequency Difference between Current and Voltage on AC Power Measurement Result,” National Measurement Centre of Singapore Productivity and Standards Board, Singapore, 2000. [16] May, R., “A PIC Based AC Power Meter,” www.edtn.com/embapps/emba027.htm, July, 1998. [17] Neamen, Donald A., Electronic Circuit Analysis and Design, Boston, MA: WCB McGraw-Hill, 1996. References (cont.) [19] Svensson, S., “Preferred Methods for Power-Related Measurements,” 8th International Conference on Harmonics and Quality of Power ICHQP ’98, Swedish National Testing and Research Institute, Boras, Sweden, October 1998. [20] Tuinenga, Paul W., Spice: A Guide to Circuit Simulation & Analysis Using PSpice, 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1995. [21] Voland, Gerald, Engineering by Design, Reading, MA: Addison-Wesley, 1999. [22] Woodward, W. S., “Optical isolator computes watts,” Electronic Design, 102-103, October 14, 1994. [23] Ziemer, R., Tranter, W., and Fannin, D., Signals and Systems: Continuous and Discrete, 4th ed. Upper Saddle River, NJ: Prentice Hall, 1998.