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.
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
- Popular Resources
- Popular amplifiers
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- dsp28335 data space
- [Xianji HPM6750 Review 8] Detailed description of the small twists and turns encountered by SPI peripherals
- MSP430 MCU Development Record (16)
- I posted a thread about icebabycool. He didn't answer the question but laughed at me instead of showing my low IQ. Please punish this kind of rogue behavior severely.
- Help with POE design issues
- [Voice and vision module based on ESP32S3] Material unpacking—ESP32S3 BOX
- PCBA intelligent detection fixture, one-click generation of test reports
- How to choose the right inductor in a switching power supply
- EEWORLD University Hall----Introduction to Isolated Modulator
- A brief introduction to the use of the console for learning common components of RT-Thread