摘要
用来计量电能的电能表,其精度十分重要。于是,检测和校验该类仪表准确度的电量计量校验仪应运而生,成为计量单位和供电部门重要的测试仪器。电能计量校验仪自身要能准确的检测各种电力参数,还要能够对其他电能表进行校验。
在分析了目前国内外同类产品的设计方案之后,采用了专用电能计量芯片来实现系统的电参数测量部分,简化了系统的软硬件设计。专用芯片采样电流电压值并在其内部运算得出各参数值,微控制器从中读取数值并进行数据处理。基于CS5460A 开发的电能计量校验仪可以测得电流电压有效值及有功功率、功率因数; 基于ADE7758开发的功能更完善的电能计量校验仪还能实现无功功率、视在功率和频率的测量。通过扫描按键状态转入相应的操作流程来执行参数的显示、存储,对其他电能表的校验以及与上位机的通讯等功能。
在分析了如何采用传统的前后台系统方式完成软件设计之后,选择了小型实时操作系统μC/OS-Ⅱ。首先完成了μC/OS-Ⅱ向ARM 微控制器的移植,随后针对各具体模块进行了驱动程序的开发,然后将系统功能划分为多个任务,并确定了各任务的优先级完成了应用程序的开发。两种编程方式对比之后,更深刻的理解了嵌入式实时操作系统的任务调度机理,并总结出了在检测仪表中引入小型实时操作系统的优点。实时操作系统的引入,使得系统的实时性、稳定性得以提高,增添新的功能也很方便。
本文的最后给出了实验结果和误差分析,从实验结果可以看出,本设计方案基本达到了系统所要求的精度,具有一定的实用价值。
The precision of power meters is very important. So calibration instrument of power measurement which to test precisions of this kind of instruments emerges as the time require. It’s very important for the power test and power supply departments. The calibration instrument of power measurement should have the ability to measure electrical parameters and vefify other power meters.
After analyzing the design schemes of this kind of products demestic and abroad, special power chip is adopted to measure electrical parameters and the hardware and software design become compact. Special chip samples voltage and current and calculate electrical parameters. Mcu reads these parameters from it and does data processing. The calibration instrument based on CS5460A can measure the virtual value of voltage and current, active power and power factor. The enganced one based on ADE7758 can measure reactive power, visual power and frequency yet. Through scaning the key state, the program switch to the corresponding subprogram to display and save these parameters, calibrate other power meters and communicate with host computer.
We select small real-time operation system μC/OS-Ⅱafter analyzing how to design program in foreground and background system. Firstly, μC/OS-Ⅱis ported to ARM mcu and then driver for each module are designed. At last, prioritiy for each task are confirmed and application programme is designed. After the compare of the two different ways, the task scheduling method of real-time operation system is understood clearly. And advantages of using real-time operation system in design of instruments are summed up. The characteristic of real time and stability of the system is enhanced, and new functions are easily enlarged.
At last, error analyses and experiment results are provided. From the results, we can see the system achieve the expected request and have practicality.
引文
[1] 赵伟,庞海波,刘灿涛. 电能表技术的发展历程. 电测与仪表,1999,36(6):4~7
[2] 曾乃鸿. 电子式电能表的发展现状和展望. 华东电力,2001,(9):24~27
[3] 施奕平,吴国安. 基于DSP的电能质量监测仪. 电测与仪表,2002,39(1):17~19
[4] Betta G, Liquori C, Pietrosanto A. A multi-application FFT analyzer based on a DSP architecture. IEEE Transaction on Instrumentation and Measurement, 2001, 50(3): 825~832
[5] 郭松林,林海军,张礼勇. 电子式电能表专用芯片分类及原理. 电测与仪表,2002,39(10):5~7
[6] 王威,郑维. 一种多相多功能电能测量集成电路ADE7758. 现代电子技术,2004,(16):73~75
[7] Nagaraju M, Praveen Kumar T. Networked electronic energy meters with power quality analysis. In: Power Quality '98 . Hyderabad, India. 1998. New York, NY, USA: IEEE, 1998. 45~47
[8] 钟炎平,靳玲,高玉良. 数字式电能表研制中的问题探讨. 仪表技术,1997,(3):5~6,24
[9] 吕京建,肖海桥. 面向21 世纪的嵌入式系统. 半导体技术,2001, 26(1):2~3
[10] 刘喜文,杨云艳. 32 位嵌入式处理器的应用开发要点. 电测与仪表,2004,41(3):39~40,6
[11] 吴爱国,刘林山.嵌入式系统面临的挑战与ARM 嵌入式微处理器发展现状.组合机床与自动化加工技术,2004,(9):1~3
[12] Jamil T. RISC versus CISC. Potentials,IEEE,1995, 14(3):13~16
[13] 周怡蔚,王以刚,林春梅. Windows CE 在电子商务与安全领域里的应用和发展前景. 计算机工程,2002,28(6):257~259
[14] Clarke K.S.P, Kershaw D. The system design of a WindowsCE ARM based micro-controller. In: Proceedings International Conference on Computer Design. VLSI in Computers and Processors. Los Alamitos, CA, USA. 236~241
[15] Sankowski D, Strzecha K, Kolodziejski H, et al. Application of real-time operating system QNX for automatic determination of dynamic properties of resistance furnaces identification. In: Anon. Proceedings of the 20th IEEE instrumentation and measurement technology conference. Vail, CO, United States. 2003. Piscataway, USA: Institute of Electrical and Electronics Engineers Inc, 2003. 1617~1621
[16] Neugass H, Espin G, Nunoe H, et al. VxWorks: an interactive development environment and real-time kernel for Gmicro. In: Proceedings of The Eighth TRON Project Symposium. Tokyo, Japan. 1991. Los Alamitos, CA, USA: IEEE Comput. Soc. Press, 1991. 196~207
[17] Bollinger T. Linux in practice: an overview of applications. IEEE Software, 1999, 16(1):72~81
[18] 王铁勇,侯明善,吴盘龙. 嵌入式操作系统uC/OS-II 的特点及应用. 控制工程,2003,10(1):74~76
[19] 张小芳,李向华,陆起涌. uC/OS-II 在仪器仪表中的应用. 仪器仪表学报,2003年, 24(4)增刊:131~133
[20] Ngolah C.F, Yingxu Wang, Xinming Tan. Implementing task scheduling and event handling in RTOS. In: Canadian Conference on Electrical and Computer Engineering 2004. Niagara Falls, Ont., Canada. 2004. Piscataway, NJ, USA: IEEE, 2004. 1523~1526
[21] 万柳,锅玉东.嵌入式RTOS 中就绪任务查找算法和优先级反转的解决方案.计算机应用,2003,(6):49~51
[22] Jae-Ho Lee, Heung-Nam Kim. Implementing priority inheritance semaphore on uC/OS real-time kernel. In: Nakajima T, Kim M.H. Proceedings IEEE Workshop on Software Technologies for Future Embedded Systems. Hokkaido, Japan. 2003. Los Alamitos, CA, USA: IEEE Comput. Soc, 2003. 83~86
[23] Munday M, Hart, D.G.. Methods for electric power measurements. In: 2002 IEEE Power Engineering Society Summer Meeting. Chicago, IL, USA. 2002. Piscataway, NJ, USA: IEEE, 2002. 1682~1685
[24] 富致超,田春雨,耿心志等. 数字移相法测量无功功率的频率误差补偿. 电测与仪表,2004,41(10):9~11
[25] 王柏林,刘华. 用准同步离散Hilbert 变换测量无功功率. 电测与仪表,2003,(12):13~15
[26] Lev-Ari H, Stankovic A.M. Hilbert space techniques for modeling and compensation of reactive power in energy processing systems. IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, 2003, 50(4): 540~556
[27] Lev-Ari H, Stankovic A.M. Hilbert space techniques for reactive power compensation with limited current bandwidth. In: 2004 IEEE International Symposium on Circuits and Systems. Vancouver, BC, Canada. 2004. Piscataway, NJ, USA: IEEE, 2004. 238~243
[28] 缪国清,李丹丹,唐璞山. 过采样??∑模数转换器的噪声特性. 复旦学报(自然科学版),1995,34(2):1~10
[29] 富致超,江大川. 电子式多功能电度表自校准技术的探讨. 电测与仪表,2000,37(8):5~9
[30] 毛明荣,王绮红. 用CS5460A 构成的单相电能表现场校验仪. 微型电脑应用,2002,18(2):25~26
[31] 罗旭, 张彦斌,胡国鹏等. 电子式电能表专用芯片CS5460 及其在电测仪表中的应用. 电子技术应用,2001,(5):69~71
[32] 周杰, 杨心怀. 32 位RISC CPU ARM 芯片的应用和选型. 电子技术应用,2002,(8):6~9
[33] Cui Guangzuo, Li Zhaolin. MT ARM: multithreading implementation in Arm7 architecture. In: Ting-Ao T, Huihua Y, Wang A, et al. ASICON 2001. 2001 4th International Conference on ASIC Proceedings. Shanghai, China. 2001. Piscataway, NJ, USA: IEEE, 2001. 793~796
[34] 王威. 基于ADE7758 和MCU 的多相多功能电能测量电表. 微计算机信息,2004,20(8):84~86
[35] 周立功. ARM微控制器基础与实验. 第一版. 北京:北京航空航天大学出版社,2003. 258~266
[36] 周卫华,梁方. 基于I2C 总线的串行EEPROM 与单片机接口技术.电子计算机外部设备. 1996,20(6):50~53
[37] 王明顺,吴省. 可涓流充电的串行实时时钟芯片DS1302及应用设计. 电子技术应用,1996,(10):49~51
[38] Sanders J. Linux, open source, and software's future. IEEE Software, 1998, 15(5):88~91
[39] 王田苗主编. 嵌入式系统设计与实例开发――基于ARM 微处理器与μC/OS-II 实时操作系统. 第一版. 北京:清华大学出版社,2002. 37~45
[40] JEAN J.LABROSSE 著. 第一版. μC/OS-II――源码公开的实时嵌入式操作系统. 邵贝贝译. 北京:中国电力出版社,2001. 186~198
[41] 王劲松,李正熙,夏旺盛. 嵌入式操作系统μC/OS-II的内核实现. 现代电子技术,2003,(8):48~50
[42] 李明. μC/OS-II在ARM上的移植. 电子设计应用,2003,(4):47~50
[43] 张静,张凯. 实时操作系统μC/OS-II 在ARM7 上移植的研究与实现. 计算机工程与应用,2004,(4):100~102
[44] Katcher D.J, Arakawa H, Strosnider J.K. Engineering and analysis of fixed priority schedulers. IEEE Transactions on Software Engineering, 1993, 19(9): 920~934
[45] Katcher D.I, Sathaye S.S, Strosnider J.K. Fixed priority scheduling with limited priority levels. IEEE Transactions on Computers, 1995, 44(9):1140~1144
[46] Etienne Moulin. 电能表计量无功功率的方法. 电测与仪表,2004,41(4):46~48
[47] 杨晔. 实时操作系统μC/OS-II下TCP/IP协议栈的实现. 单片机与嵌入式系统应用,2003,(7):80~83