基于单片机的汽车车窗控制系统.doc

约49页DOC格式手机打开展开

基于单片机的汽车车窗控制系统,摘  要本文设计的汽车电动车窗自适应控制系统采用司机主控面板和乘客子控面板双控制的方式来控制车窗的关闭和开启。为了充分保障司机对整车的控制权,主控面板的控制级别要高于分控制面板的控制。系统设有防夹功能,当车窗上升过程中遇到障碍物无法前进时会自动停止上升并下降一定幅度,并等待下次指令发出。此外为了满足突发情况发生时乘客强...
编号:45-213881大小:4.94M
分类: 论文>通信/电子论文

内容介绍

此文档由会员 雀巢的诱惑 发布

摘  要
本文设计的汽车电动车窗自适应控制系统采用司机主控面板和乘客子控面板双控制的方式来控制车窗的关闭和开启。为了充分保障司机对整车的控制权,主控面板的控制级别要高于分控制面板的控制。系统设有防夹功能,当车窗上升过程中遇到障碍物无法前进时会自动停止上升并下降一定幅度,并等待下次指令发出。此外为了满足突发情况发生时乘客强行关窗的需要,在司机主控面板处设有强行关窗指令按键,此时将忽略防夹功能进行强行关窗。系统对车内空气实时监测,对烟雾、酒精、丙烷等有害、可燃或其他危及车内人员身体健康或人身安全的气体进行检测,当此类气体达到一定浓度后会自行开窗通风。为了防止汽车高速行驶时发生意外,在高速行驶时会自动关窗并上锁,此时只有司机处的主控开关能够控制车窗开启。
该电动车窗自适应控制系统线路比较简单,为了节省成本同时为了便于维护和升级本系统采用独立控制模式。采用AT89C52单片机作为主控器进行指令采集、运算分析、车窗动作控制和障碍物判断等;采用键盘扫描的方式采集指令节省线路的同时节省控制器的接口资源;采用LM298驱动芯片结合光栅对车窗升降电机进行驱动和闭环控制,并实现障碍物判断;采用MQ-2气体传感器对车内空气检测并在浓度过高时触发主控器进行控制操作。
本设计具有线路简单、易实现、功能全和可维护性高等特点,并通过实物演示可知本文设计的系统可以完整的实现预设功能。

Abstract
The design of the adaptive control car windows system in this paper using two control panel —the driver’s master control panel and passenger sub-control panel to control the closing and opening of windows. In order to fully guarantee the driver’s control power of the car, the control level of the main control panel is higher than the level of sub-control panel. The system is equipped with anti-trap function, the car window will stop rise and decline a certain range if encounter to obstacles when the car window is during the ascent and whit the next command. And in addition , the need of force closing of the window in some emergence situation, the system also with an button of force close command in the driver’s main control panel, in this situation system will ignore the obstacle to force rise. System real-time monitoring of the air inside the vehicle, detection the gas of alcohol, methane and other harmful, flammable or other endanger the body health or safety of personnel inside the vehicle. The windows will open to ventilate when these harmful gas reaches a certain concentration. In order to prevent accidents when the car is in the process of high speed, windows will be closed and locked in the process. At this time , only the driver’s main control panel can control the windows .
This system’s circuit is simple. In order to save costs and facilitate the maintenance and upgraded, this system with independent control mode. The AT89C52 microcontroller as a master instruction acquisition, operational analysis, windows motion control and obstacle judge; Keyboard scanning to acquisition instruction in order to reduce lines at the same time saving interface resources; LM298 driver chip combined with the grating on the window lift motor drive and closed-loop control; Using the MQ-2 gas sensor for detection of air inside the vehicle and in the concentration is too high to trigger the master control operations.
The design is Simple circuit, Easy to implement and Maintainability. The design of the system In this paper can complete default features through in-kind demonstration shows.

 

目  录
摘  要 1
Abstract 2
引  言 1
1 设计方案 2
1.1 方案及功能概述 2
1.2 方案论证 3
1.2.1 升降和特殊功能按钮连接方案 3
1.2.2 车窗完全关闭和完全打开判断方案 4
1.2.3 防夹功能实现方案 4
1.2.4 车窗电机驱动方案 4
1.2.5 室内空气检测方案 5
1.2.6 主电源断电检测方案 5
1.3 器件的选型 5
1.3.1 单片机选型 5
1.3.2 电机驱动芯片选型 5
1.3.3 气体检测传感器选型 6
2 系统主要器件介绍 7
2.1 主控器STC89C52单片机介绍 7
2.1.1 STC89C52单片机主要引脚介绍 8
2.1.2 STC89C52单片机主要特性 11
2.2 L298N驱动芯片介绍 12
2.3 LM393电压比较器介绍 16
3 硬件设计 18
3.1 电动车系统总体硬件组成 18
3.2 系统各模块的设计 18
3.2.1 单片机系统电路设计 18
3.2.2 键盘扫描电路设计 19
3.2.3 电机驱动模块的设计 20
3.2.4 脉冲防夹检测模块的设计 21
3.2.5 空气检测模块的设计 22
3.3 系统硬件实物图 22
4 系统软件设计和算法实现 25
4.1 单片机开发软件Keil介绍 25
4.2 程序设计思想和流程图 26
4.2.1 整体程序控制流程 26
4.2.2 自适应障碍物判断程序 28
4.2.3 电机控制程序 29
4.2.4 一键关窗上锁功能程序 30
4.3 重要控制模块的实现程序 31
4.3.1 指令识别与判断 31
4.3.2 电机驱动程序 32
4.3.3 特色功能实现程序 33
5 系统调试 36
5.1 指令识别模块调试 36
5.2 空气检测模块调试 36
5.3 PWM控制电机速度调试 36
5.4 系统联调 37
5.5 调试过程中遇到的问题 37
结  论 38
参 考 文 献 39
附录A 系统其他主体程序补充 41
致  谢 45