自动控制升降旗系统
摘 要
本系统是由单片机(AT89S52)、步进电机、ISD2560语音芯片、时钟芯片PCF8563、显示电路、遥控电路、按键等基本的部分组成的控制国旗升降系统。采用由单片机控制的步进电机带动国旗升降,实现对国旗升降的自动控制。采用接近开关FR12-4DN,防止旗帜在最高点或最低点误动作,从而实现了双重保险的作用。使用抱闸装置保证步进电机在不通电的时候静止不动。本系统具有以下特点:
1、可手动、可遥控。即可以通过按键来控制旗帜的匀速升降,也可以通过遥控器来实现远距离控制;
2、可以按照用户的要求上升或下降到指定位置,并可在任意位置停止;
3、国旗在上升过程中能准确与国歌乐曲同步;
4、能实现半旗的升降功能;
5、具有断电保护功能;
在实现以上功能的过程中,升降旗时间在30~120秒内可调,通过改变步进电机的转动速度来改变旗帜上升或下降的速度,并通过LED显示上升或下降时间和旗帜所在高度。旗帜达到顶端后,由鼓风机提供风源使旗帜始终处于飘扬的状态。
测试表明,该系统无论在功能上、性能上都完全达到了题目的要求,(包括发挥部分的设计要求),并设计了其他创新功能,且误差较小,操作方便,经济实用,美观大方。
关键字:单片机 步进电机 遥控 接近开关 抱闸装置
ABSTRACT
The national movements control system is made up of MCU (AT89S52), stepper motor, ISD2560 voice chip, clock chip PCF8563 and display circuits, remote control circuit, keyboards and other basic components. With the stepper which is controlled by MCU, to driver the flag rising and lowering, thus to achieve the flag automatic controlling. With automatic approach device FR12-4DN to prevent the flag malfunction at the highest or lowest point, thus realizing the dual role. Brake device used in stepper motor to ensure the static electricity. The system has the following features:
First .Can be manually operated, can be remote-controlled. That is, through the buttons to control movements can be achieved, and through remote control device can also achieved.
Second. in accordance with the requirements of the user to the designated location and may increase or decrease in any position to stop;
Third. Arrive the appoint position according to customer's require, and stop at the any position.
Forth. Achieve the half-mast to functional movements;
Fifth. Power outages protective function;
In the process of achieving the above functions, 30-120 seconds for the flag rising is adjustable, by changing the rotational speed of the step motor, the flag raising speed can be changed, and the time & tallness will be showed on the LED. After the flag reached the top, the wind provided by the blower will make the flag in fluttering state.
The test results show that the system in functional and performance requirements have been fully attained (including the design requirements of play), and other innovations are designed. And which is less error and easy to use, economical and practical, attractive and unaffected.
Keywords: MCU Step motor Remote control
一、方案的论证:
1、单片机的选择
采用AT89S52单片机实现,该单片机内部资源丰富,集成了内部看门狗、双数据指针、在系统编程(串行下载目标程序)等功能,软硬件调试方便,对于电子设计竞赛时间紧、任务多的开发来说是极为有利的。
2、电机的选择
方案一:采用直流电机控制升降旗运动,直流电机力量大,能获得较大的启动转矩,转动速度快,但由于存在机械触点,直流电机容易产生噪声,而且单独使用时不能完成位置控制,需要配以传感器才能控制定位。
方案二:采用步进电机控制升降旗运动,步进电机不需要使用传感器就能精确定位,而且通过给定的脉冲周期,能够以任意速度转动,定距运动较精确。虽然步进电机不能高速转动,但根据题目要求的时间和移动距离,步进电机完全能够符合要求,是该种要求下广泛使用的一种电机。
基于上述理论分析,我们拟选择方案二。
3、 系统工作电源的选择
直流稳压电源的制作方案较多,而且可供选择的余地较大,我们本着简单、实用、安全、可靠的原则,着重从以下几个方案中进行了选择:
方案一:采用开关电源,优点是输出功率大、体积小、效率高;缺点是输出纹波系数较大、对电网易产生干扰。
方案二、采用传统的线性稳压电源,优点是输出电压可以随意调节、输出电压纹波系数较小;缺点是效率低、体积大、电路较为复杂,成本较高。
综合制作难易程度以及成本和本系统使用实际情况,我们选用了第一套方案。
4、显示的选择
方案一:用LED数码管显示旗帜所在的高度和升降旗时间,本系统中只需要6只LED数码管进行动态显示即可以显示高度和时间。优点是接口简单,易于控制,对电压电流的要求低,价格便宜,寿命长;缺点是只能显示0~9的数字和一些简单的字符。
方案二:用LCD液晶显示,优点是能显示更多的字符和汉字,有着良好的人机界面,体积小,功耗极低;缺点是成本高,亮度不高,夜晚不易清晰观察数据。
基于上述考虑,所以我们选择方案一。
二、系统设计
1、系统框图
根据题目要求和上述论证,本系统的系统框图如图一所示: