摘 要:在当今汽车电子控制网络中,CAN总线发挥着不可替代的作用,将复杂的通讯网络化为一体,高速、可靠的实现了车辆的控制与运行。汽车作为生活中的一种重要交通工具之一,为使学生能更好的了解CAN总线在汽车中的应用,设计出基于CAN总线的教学模拟汽车模型,汽车模型主要用于教学演示,达到辅助教学的目的。
本系统将玩具电动车改装成为所需的汽车模型,系统采用主从控制模式。用主控制器控制前轮步进电机,从控制器控制后轮步进电机,电动车要仿照现实中的真车一样进行主从通信,所以CAN总线将被用于电动车内部主从控制器之间进行通信。本论文由无忧论文网www.51lunwen.org整理提供以AT89S52作为系统的控制核心,主要由驱动电路,检测信号电路,电源电路,按键、显示电路,总线接口电路,报警电路等其他辅助电路构成,利用功能键进行控制,实现所要执行的功能。根据所要执行的功能选择相应的按键代码,控制电动车的启停、调速、前进、倒车、转向、灯光照明、仪表显示等功能。
如今,CAN总线已成为汽车电子控制装置之间通信的标准总线,在汽车分布式控制系统中得到了广泛的应用。基于CAN总线的汽车模型布线较简单,避免了繁琐的大量布线。汽车模型的工作过程也简单明了,易于学生学习。
Abstract:At present in automotive electronic control network, CAN bus plays an irreplaceable role, and just uses two simple cables to put cars interior’s vast, complex communications networks into one, high-speed, reliable to achieve the control and operation of the vehicle. The vehicle is an important means of transport in the life. www.51lunwen.orgIn order to make students understand the CAN bus in the application of vehicles better, the teaching simulation model of the vehicle which bases on the CAN bus is designed, the car model will mainly be applied to teaching demonstrations to assist teaching purposes.
This system will be converted into electric car toys for the car model, the system uses master-slave control model. www.51lunwen.orgFront-wheel-stepper motor will be controlled by the main controller, the stepper motor will be controlled by the slave controller, electric car’s communication will follow the true car in real life, so CAN bus will be used within the electric vehicles which between the main-slave controller of the communications. AT89S52 is used as the core of the control in the system; the system is consisted of the driven circuit, signal detection circuit, the power circuit, keys, show circuit, bus interface circuits, alarm circuits and other auxiliary circuit, www.51lunwen.orgusing function keys to achieve the implementation of the functions. According to the functions to select the appropriate button code, controlling electric car’s starting, stopping, speeding, forwarding, reversing, steering, lighting, instrument display, and other functions.
Nowadays, CAN bus have become the standard bus among electronic vehicle control devices of communication; www.51lunwen.orgit has been widely used in car distributed control system. To avoid a large number of wiring, Model bus based on CAN bus wires simply. The work process car model is simple and clear, students can learn easily.
Key words:CAN bus;Electric vehicles;AT89S52;Stepper motor
目 录
第1章 绪 论 1
1.1 CAN总线在汽车中的应用 1
1.2 基于CAN总线的教学模拟汽车模型的设计的目的与意义 2
1.3 基于CAN总线的教学模拟汽车模型的设计的主要研究内容 2
1.4 基于CAN总线的教学模拟汽车模型的设计关键技术 3
第2章 系统的总体方案 4
2.1 系统概述 4
2.2 系统的设计工作过程及原理 4
第3章 系统的硬件设计 6
3.1 CAN接口电路模块 6
3.1.1 CAN总线硬件介绍 6
3.1.2 独立CAN总线控制器SJA1000 7
3.1.3 CAN总线驱动器PCA82C250 10
3.1.4 CAN接口电路硬件设计 12
3.2 主系统硬件设计 13
3.2.1 电源模块的设计 14
3.2.2 微处理器模块的选择 14
3.2.3 电机驱动模块的设计 18
3.2.4 液晶显示模块 20
3.2.5 按键接口模块 20
3.3 从系统硬件设计 23
3.3.1 后轮步进电机模块的设计 23
3.3.2 报警电路模块 23
第4章 系统的软件设计 25
4.1 软件设计思想 25
4.2 通信协议的设计 25
4.2.1 电机通信协议的设计 25
4.2.2 CAN通信协议的设计 26
4.3 系统软件主流程图设计 26
4.4 系统软件子流程图设计 27
4.4.1 从控制器子程序流程图 27
4.4.2 按键子程序流程图 28
4.4.3 CAN中断程序流程图 29
4.4.4 步进电机子程序流程图 30
第5章 结 论 31
参考文献 32
致 谢 34
附 录Ⅰ 35
附 录Ⅱ 50
附 录Ⅲ 52
参考文献
[1] 沙占友,王彦朋,孟志永.单片机外围电路设计.北京:电子工业出版社,2003
[2] 徐爱均.www.51lunwen.org智能化测量控制仪表原理与设计.北京:北京航空航天大学出版社,2000
[3] 梅丽凤.单片机原理及接口技术.北京:清华大学出版社,2004
[4] 余永权.ATMEL 89系列单片机应用技术.北京:北京航空航天大学出版社,2002
[5] 赵负图.现代传感器集成电路.北京:人民邮电出版社,2001
[6] 何立民.MCS-51系列单片机应用系统设计.北京:北京航空航天大学出版社,2000
[7] 李正军.现场总线与工业以太网及其应用系统设计.北京:人民邮电出版社,2006 [16]
[8] 赵广林.轻松跟我学Protel 99SE电路设计与制版.北京:电子工业出版社, 2005
[9] 小艇.电子系统设计.杭州:浙江大学出版社,2001
[10] 何立民.单片机高级教程:应用与设计.北京:北京航空航天大学出版社,2000
[11] 杜刚.电路设计与制板——Protel应用教程.北京:清华大学出版社,2006
[12] 雷霖.微机自动检测与系统设计.北京:电子工业出版社,2003
[13] 余祖俊.微机检测与控制应用系统设计.北京:北方交通大学出版社,2001
[14] 薛钧义,www.51lunwen.org武自芳.微机控制系统及其应用.西安:西安交通大学出版社,2003
[15] 陈请泉,孙逢春.祝嘉光.现代电动汽车技术.北京:北京理工大学出版社,2002
[16] 杜坤梅,李铁才.电机控制技术[M].哈尔滨:哈尔滨工业大学出版社,2002
[17] 史红梅,余祖俊,刘盾,赵爱菊.ISD语音芯片的开发与应用.现代电子技术,1998(9)
[18] 李心巧,寇峻舟.单片机在转速测速器中的应用.电器开关,2000 (4)
[19