基于CAN总线的汽车电器网络设计 - 学习can总线宝典 - 图文 联系客服

发布时间 : 星期日 文章基于CAN总线的汽车电器网络设计 - 学习can总线宝典 - 图文更新完毕开始阅读

毕业设计

基于CAN总线的汽车电器网络设计

摘 要

随着社会的发展,汽车逐渐成为人们生活中不可缺少的交通工具。电子装置在汽车上的使用使汽车的驾驶更加舒适安全。为了满足人们对于汽车性能越来越高的要求,汽车上装备的电子装置、控制单元也在不断增加,传统的线束已远远不能满足复杂的控制系统要求。汽车CAN总线技术的引入给汽车电子控制技术带来了新的飞跃。CAN总线技术不仅满足了车身控制的功能要求,而且可以降低成本、简化车身冗余线束。

本文提出了一种基于CAN总线的汽车电器网络的设计方案。设计中采用了ATmega128作为主控制器,CAN模块电路主要采用了CAN总线控制器SJA1000、总线驱动器PCA82C250以及高速光耦6N137,通过ATmega128控制工作在PeliCAN 模式下的SJA1000实现各ECU单元之间的通信。

文中完成了系统软件开发,并在CAN2.0B通信协议以及车用CAN协议(SAEJ1939)的基础上制定了基于车身控制模块的应用层协议;同时,为保证系统能够稳定、可靠地工作,文中针对系统工作中可能出现的干扰因素进行了分析,并进行了软硬件的抗干扰设计。

通过联机调试,验证了整个系统通信的可靠性,该网络能够较好地达到车内总线对于信号传输的实时性与稳定性的要求。

关键词:CAN总线; 控制网络;电子控制单元; 数据采集;数据传输

ABSTRACT

With the development of society, automobiles play a very important role in people’s daily life, and the electronic devices equipped in the vehicle make the driving more comfortable and safe. With the electronic device in vehicle increasing continuously, the traditional wiring harnesses can not satisfy the complex functions of the control system. As the CAN bus introduced into vehicle control system, great progress has taken in the areas of vehicle electron. By adopting CAN bus, the function of vehicle body control system is satisfied perfectly, the cost is decreased, and the redundant wiring harnesses are cut down.

A vehicle electrical network design based on CAN bus is brought forward in this paper to achieve the data transmission of the electric control units (ECU). In this design, the main controller uses ATmega128. The hardware circuit of CAN bus communication module adopts CAN bus control chip SJA1000, bus driver PCA82C250 and high-speed optical coupler 6N137. ATmega128 completes the data transmission of ECU through controlling SJA1000 which works on the PeliCAN mode.

Following,the software designs are discussed, and the CAN communication protocol of application layer which matches the vehicle body control system is constructed based on CAN2.0 protocol and SAEJ1939 protocol. Furthermore, some anti-interference measurements are put forward to ensure the stability and reliability of the system.

The experiments confirm the overall system communication is reliable, and the signal transmission inside the CAN bus achieves the requirements of real-time and stability.

Key words: CAN-BUS; Control Network; Electric Control Unit; Data acquisition;

Data Transmission;

目 录

第一章 绪论 ............................................................................................................ 1

1.1课题背景 ........................................................................................................... 1

1.2当前国内外汽车CAN总线的研究情况 ........................................................ 1 1.3研究汽车CAN总线网络的目的和意义 ........................................................ 1 1.4课题主要内容 ................................................................................................... 2

第二章 CAN总线通信原理 .............................................................................. 3

2.1 引言 .................................................................................................................. 3 2.2 CAN 总线协议的性能特点 ............................................................................ 3 2.3 CAN 节点的分层结构 .................................................................................... 4 2.3 报文传送及其帧类型 ...................................................................................... 5

2.3.1 数据帧 .................................................................................................... 6 2.3.2 远程帧 .................................................................................................... 8 2.3.3 出错帧 .................................................................................................... 8 2.3.4 超载帧 .................................................................................................... 9 2.4 基于CAN2.0B 应用层协议的制定 ............................................................ 10 2.5本章小结 ......................................................................................................... 11

第三章 系统整体结构设计 .............................................................................. 12

3.1系统整体框图 ................................................................................................. 12 3.2 系统ECU框图 .............................................................................................. 12 3.3 CAN控制器SJA1000 ................................................................................... 13

3.3.1芯片SJA1000概述 .............................................................................. 13 3.3.2 SJA1000的内部结构以及在系统中的位置 ....................................... 14 3.3.3 CAN控制器SJA1000的几个控制模块 ............................................ 15 3.4CAN总线驱动器PCA82C250 ....................................................................... 16

3.4.1 CAN总线驱动器PCA82C250概述 ................................................... 16 3.4.2 PCA82C250结构框图及基本功能描述 ............................................. 16 3.5本章小结 ......................................................................................................... 18

第四章 CAN总线网络硬件设计................................................................... 19

4.1 整体方案确定 ................................................................................................ 19 4.2 CPU控制电路 ................................................................................................ 19 4.3 CAN模块电路 ............................................................................................... 21 4.4 DS18B20温度采集模块 ................................................................................ 22 4.5 显示模块 ........................................................................................................ 23 4.6电源模块 ......................................................................................................... 23 4.7系统JTAG调试 ............................................................................................. 24 4.8按键信号采集接口电路 ................................................................................. 25