{$cfg_webname}
主页 > 电子信息 > 电子 >

便携式交直两用电源在线测试系统的软件设计(附程序清单)

来源:wenku163.com  资料编号:WK1636489 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK1636489
资料介绍

便携式交直两用电源在线测试系统的软件设计(附程序清单)(含任务书,开题报告,毕业论文15900字)
摘要:在应急突发事件供电和野战条件下等场合,为了保证电子设备的正常工作,往往离不开便携式交直流电源。在以往的电源测试系统中,电参数的大小往往是通过指针式的仪表进行显示,这样造成了读数不方便且不准确且不能实时详细的反映出各种电参数的信息。因此就需要研制一种具有数据自动采集和处理,所有参数能够通过LED数码管进行显示且具备系统故障检测和保护的电源在线测试系统。
本文详细阐述了采用以STC12C5410AD单片机为核心构成的电源在线测试系统的软件设计,并对硬件设计做了简单的介绍。本测试系统对用于单兵作业的交、直两用的500W电源,输出直流电压为25V,交流电压为230V的便携式交直两用电源进行测试,能够通过单片机自带的4路十位A/D实时测量电源输出的交直流电压和电流的大小;同时通过外部中断和定时器实现交流频率的等精度测量。所测量的结果通过串行方式送至串行静态显示电路来完成显示,并通过拨动开关确定显示的参数和显示方式。该测试系统还具有系统保护功能和故障报警功能,当电源存在过流、过压或过载时,系统会控制继电器对电源系统进行保护并通过蜂鸣器报警。在主程序中,所有程序的调度都是通过多任务延时程序实现。
                 
关键词:电源  单片机   A/D采样  等精度测频

The software design of portable AC-DC dual
Abstract: In Emergency power supply and the emergency field conditions occasions, in order to ensure the normal operation of electronic equipment, portable AC-DC power supplies often can not be separated .In the past power test system, the size of Electrical parameters of the instrument is often carried out through the pointer display, this resulted in an accurate reading is not convenient and can not reflect the real-time detailed information on a variety of electrical parameters. Therefore we need to develop a kind of Power test system, which can achieve automatic data acquisition and processing ,all parameters can be displayed through the LED nixietube and with fault detection and protection.
This article describes the software design of power online test system  use to STC12C5410AD microcontroller as the core components of the power-line test system, this system is measure to portable AC-DC dual-power which is operated by a single soldier, that is used for AC-DC dual-power supply with 500W and the value of the DC voltage is 25V , AC voltage is 230V power supply. The test system can real-time measurement of AC and DC power supply output voltage and current through the 4-channel 10-bit A / D of the SCM. At the same time,SMC can achieve frequency measurement with equl-precision through the exchange of the external interrupter and timer. The measurement results sent by the serial mode to serial static display circuit to complete the display,and through the switches to determine the display parameters and the display style. The test system also has the system fault alarm and protection function, when the power supply is over-current, over -voltage or overload, System will control the power system relay to protect the power system and alarm through the buzzer. In the main program, all procedures dispatch are implement by multi-task scheduling delay program.

Keywords: solar water heater, microcontroller, A / D converter

1.3 本课题的研究内容
该系统是以单片机为核心,实现对用于单兵作业的交、直两用500瓦,输出直流电压为25V,交流电压为230V便携式电源的实时在线的监测功能,其主要用于实现以下功能:
(1) 直流和交流相关参数的测量,包括交、直流电压、电流的大小以及交流电压的
频率;
(2) 大电流下直流电压、电流的采样;
(3) 数码管显示和键盘控制;
(4) 系统故障报警和保护

2.2 系统硬件概述
本课题研究的是便携式交直流两用电源在线测试系统,系统的硬件组成主要包括由STC12C5410AD构成的单片机最小系统电路、RS232串口通讯电路、串行静态显示电路、键盘扫描电路、信号采集电路、保护电路和报警电路等构成。
系统经由A/D转换器采集测试端的交直流信号参数,采集到的经过数据处理之后通过LED数码管显示电路来实时显示采集到的数据;通过故障检测电路对电源的不正常工作进行时实监测,若电源工作异常,则单片机输出特定信号到报警电路进行报警。系统硬件结构框图如图2.2所示。
 
2.3 系统软件概述
该系统软件部分主要由主程序、显示子程序、A/D采样子程序、键盘处理子程序、故障检测和报警子程序、定时器中断处理程序和外部中断程序等部分组成,通过单片机的外部中断对交流频率进行测量和内部10位A/D转换器对交直流信号的电压和电流参数进行采集后经单片机处理后,再通过串行显示方式将需要显示的参数送到LED数码管显示;通过故障检测程序对电源的不正常工作进行时实监测,若电源工作异常,则通过单片机输出特定信号到报警电路进行报警同时通过保护电路对系统进行保护。

便携式交直两用电源在线测试系统的软件设计(附程序清单)
便携式交直两用电源在线测试系统的软件设计(附程序清单)
便携式交直两用电源在线测试系统的软件设计(附程序清单)
便携式交直两用电源在线测试系统的软件设计(附程序清单)
便携式交直两用电源在线测试系统的软件设计(附程序清单)


目  录
1  引  言………………………………………………………1
1.1 国内外发展状……………………………………………………………1
1.2 课题背景及意义…………………………………………………………2
1.3 本课题的研究内容………………………………………………………2
2  电源系统总体设计…………………………………………3
2.1 电源系统总体结构 ……………………………………………………3
2.2 系统硬件概述 …………………………………………………………4
2.3 系统软件概述 …………………………………………………………4
3  测量原理和方法……………………………………………6
3.1 电压采样原理 …………………………………………………………6
3.1.1 直流采样原理 ………………………………………………………6
3.1.2 交流采样原理 ………………………………………………………6
3.2 频率的测量 ……………………………………………………………9
3.2.1 直接测频法 …………………………………………………………9
3.2.2 等精度测频法 ………………………………………………………10
4  系统硬件设计 ……………………………………………12
4.1 单片机及外围电路设计 ………………………………………………12
4.2 直流电压测量电路 ……………………………………………………14
4.3 直流电流测量电路 ……………………………………………………15
4.4 交流电压测量电路 ……………………………………………………15
4.5 交流电流测量电路 ……………………………………………………16
4.6 交流频率的测量电路 …………………………………………………17
4.7 串行静态显示电路 ……………………………………………………17
4.8 系统供电电源的设计 …………………………………………………18
4.9键盘电路设计  …………………………………………………………18
5  系统软件设计 ……………………………………………20
5.1 系统主程序程序设计  ………………………………………………21
5.2 键盘扫描和显示子程序………………………………………………21
5.3 频率测量子程序  ……………………………………………………24
5.4 PCA定时器中断处理程序 ……………………………………………25
5.5 利用定时器中断的多任务延时子程  ………………………………27
5.6 直流采样子程序  ……………………………………………………28
5.7 交流信号采样子程序  ………………………………………………29
6  系统调试 …………………………………………………31
             6.1硬件调试  …………………………………………………………31
            6.2软件调试  …………………………………………………………32
            6.3系统整体调试  ……………………………………………………33
结束…………………………………………………………35
参考文献…………………………………………………….36
致  谢……………………………………………………….37
附录A 部分程序清单………………………………………38
附录 B作品实物图…………………………………………49

推荐资料