Design of car light control system based on CAN bus

Publisher:满足的36号Latest update time:2012-08-21 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: This paper presents a design scheme of a headlight control system based on CAN bus, introduces the hardware design and software design of the headlight control system, and gives detailed descriptions of the overall structure, hardware configuration, and software functions of the system. Experiments show that the system has a simple structure, reliable performance, and broad application prospects.

0 Introduction

CAN (Controller Area Network) is a vehicle-specific serial data communication bus developed by Bosch of Germany for the automotive industry in the early 1980s. It meets the SAE (Society of Automotive Engineer) requirements for Class C high-speed vehicle networks (≤1Mb/s) and is suitable for information transmission and control of powertrain and chassis electronic systems, and therefore also for information transmission and control of general vehicle electronic systems.

Compared with traditional technology, CAN bus has the following characteristics: ① Using non-destructive arbitration technology, the node that obtains arbitration priority will continue to transmit messages, and the message will not be destroyed or erroneous by another node; ② CAN bus adopts short frame structure, and the effective data of each frame is 8 bytes, the data transmission time is short, the probability of interference is low, and the retransmission time is short; ③ CAN uses CRC (CyclicRedundancy Check) verification for each frame of data, which ensures the high reliability of data transmission and is suitable for use in high interference environments; ④ CAN uses balanced differential signals to transmit data. When the communication rate is 5kb/s, the direct communication distance can reach up to 10km, and when the communication distance is 40m, the communication rate can reach up to 1Mb/s, which can form a field cancellation effect; ⑤ It can avoid the repeated laying of automobile wiring harnesses, effectively reduce the number of wiring harnesses on the car, improve reliability, and reduce costs. Therefore, using CAN bus for car lighting system design can improve car performance.

1. Car light function and system design

Figure 1 shows the lighting and signal system of the vehicle, which consists of lighting and signal light groups, including headlights (high beam, low beam), turn signals, fog lights, brake lights, top lights, position lights, reversing lights and license plate lights, etc. Different types of lights have different functions and different installation locations. According to the location of the lights, they can be divided into four lighting and signal light groups: left front, left rear, right front, and right rear, as well as an interior lighting group. Therefore, a control module, a left front module, a left rear module, a right front module, a right rear module and an interior lighting module can be set in the CAN communication network, a total of 6 nodes. The structure diagram of the vehicle lighting system is shown in Figure 2. Among them, the control module sends control instructions to the other 5 modules by monitoring the change of the switch state. After receiving the control instructions belonging to this module, these 5 modules control the action of the lights at the corresponding positions respectively. Since CAN is an event-triggered protocol based on priority, the priority of each node in the system should be set in turn according to the different driving safety levels. It should be emphasized that the switch control module is the system control instruction sending module, which has the highest safety requirements and the highest priority. The left rear and right rear modules involve braking and other lights related to driving safety, and their priority is second only to the switch control module.

Figure 1 Headlighting and signaling system

Figure 2 CAN bus headlight system structure

2 Hardware Design

This design uses 8051 microcontroller and Intel 82527 CAN bus controller as the core to form an intelligent node. Among them, Intel 82527 CAN controller supports CAN2.0 standard, including standard and extended data and remote frames, programmable global shielding; including standard and extended information identifiers, with 15 message buffers, each with a data length of 8 bytes; 14 TX/RX buffers, 1 RX buffer with programmable shielding; variable CPU interface, with multiple 8-bit bus (Intel or Motorola mode), multiple 16-bit bus, 8-bit non-multiplexed bus (synchronous/asynchronous) and serial interface; programmable bit rate and programmable clock output; variable interrupt structure; output driver and input comparator structure can be set; 2 8-bit bidirectional I/O ports; 44-pin PLCC package.

This solution uses Philips' PCA 82C250 as the CAN bus transceiver and physical layer bus interface. It can provide three different working modes: differential transmission and reception of the bus, high-speed slope control and standby. It can isolate transient interference and improve the receiving and transmitting capabilities. In the hardware design, 82527 completes the information exchange with the CAN bus, and 8051 completes the driving of the car light relay; the bypass input comparator uses the interrupt mode for information exchange with 8051, and the address is 7F00 ~ 7FFFH. The system hardware structure is shown in Figure 3.

Figure 3 System hardware structure diagram

3 Software Design

CAN2.0B protocol only defines the protocols of CAN physical layer and data link layer. When designing the system, the corresponding CAN application layer protocol must be formulated according to the needs of users. According to the nodes of the bus system and the functions to be realized, the data to be shared between each other is determined, and then the information to be received and sent by each node is understood, and the information to be transmitted in the CAN network is uniformly formulated. Finally, identifiers are assigned to the formulated CAN network transmission messages. The CAN protocol stipulates that the smaller the identifier ID, the higher the priority. Therefore, when determining the ID, the urgency of the information frame requirement must be analyzed first.

The location distribution of automobile lights and driving safety requirements are used as the basis for the division of each module, and the IDs are assigned in the order of control module, left rear module, right rear module, left front module, right front module, and interior lighting module.

Information encoding is to combine similar or related information into a data block so that their data can be sent from the control node to the bus at the same frequency. Other CAN nodes can obtain this group of information at the same time and process it accordingly. This headlight control system sends information through the main controller. Each sub-node first receives the information it needs through the acceptance/shielding filter, shields the unnecessary information, and then performs corresponding operations according to the received content. Among them, 4 sub-nodes are set to single filtering. The meaning of each bit in the 1B data sent by the main controller is shown in Table 1.

Table 1 1B Meaning of each bit in the data

This paper adopts modular programming concept to design software. According to the function, it is divided into different program modules. Each module is relatively independent to complete specific functions, mainly including CAN node initialization, message receiving, message sending and data processing modules. At the same time, modules can call each other and share data to achieve the purpose of reusing code and simplifying code. The main program flow chart is shown in Figure 4.

Figure 4 Main program flow chart

4 Experiments and conclusions

According to the hardware and software design scheme introduced above, the headlight control system was completed in the laboratory and assembled into a headlight bench. The control test was carried out by repeatedly debugging the hardware and software of the system. The bench test results proved that the design scheme of the headlight control system is feasible, reducing the use of wiring harnesses, and has reliable performance and good engineering application prospects. It can also be predicted that with the widespread application of CAN bus in automotive electrical control, the usability and reliability of automobiles will also be greatly improved.

Reference address:Design of car light control system based on CAN bus

Previous article:The Third Eye explains the secrets behind the central rearview mirror
Next article:Geely Auto's automatic door and window opening technology ensures safety when falling into water

Latest Automotive Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号