Design of car window intelligent control system ba

2022-09-23
  • Detail

Design of car window intelligent control system based on CAN bus

1 introduction

can bus is a serial communication network that effectively supports distributed control and real-time control. With its high performance and high reliability, it has been widely used in the field of automatic control. At present, automobile bus network technology has been widely used in medium and high-end cars abroad, and some progress has been made in using CAN Bus Technology in domestic cars, but the overall level is relatively backward due to the limitations of technology and cost. As the most potential vehicle field bus at present, can bus technology can provide support for the upgrading of China's automotive industry, further reducing costs and expanding market share

now all medium and high-end cars are equipped with power windows. Press the button to control the rise and fall of the window glass. If the window is not intelligent, the driver is easy to be pinched by the rising glass if he does not notice the passenger's hand or object extending out of the window. For the sake of safety, many passenger cars now use electric anti pinch windows. In foreign countries, electric anti pinch windows have been used in automobiles as a mandatory standard. At the same time, drivers and passengers must forcibly open or close the windows in the face of accidents such as robbery, theft prevention and escape from danger

this paper is supported by the industrial research project "development of CAN bus control system for automotive power windows" of the Department of science and technology of Guizhou Province (Qian Ke he Gy Zi [2008] 3032), which fully studies the application of CAN bus in automotive electronic system and the anti pinch scheme of power windows, and puts forward a research scheme of car window intelligent control system based on CAN bus, It can realize the anti pinch control function of the window in the normal working mode and the fast lifting window control function in the emergency (abnormal working mode), make the control and management of the window more intelligent and humanized in the vehicle environment, and improve the safety, flexibility and reliability of automotive electronics

2 system functional structure

2.1 can bus communication implementation principle

can bus is a kind of multiplex bus, which was first developed by German Bosch Company and is mainly used for the bus specification of automotive electrical system control. It adopts non-destructive bus arbitration technology and works in various ways. The direct communication distance can reach 10km at most, and the communication rate can reach 1Mbps at most. The frame message adopts CRC check and other error detection measures, and has the function of automatically closing the node with serious errors. The CAN node realizes data transmission through the identifier filtering of the message, and has different priorities to meet different real-time requirements. The number of nodes depends on the bus drive circuit. The communication medium can be twisted pair, coaxial cable or optical fiber, which can be selected flexibly. The message adopts short frame structure, with short transmission time and low probability of interference, ensuring a very low error rate of data

the bus in the automobile network system transmits data in the unit of message, and the node accesses the bus in the way of bit arbitration. The identifier of the initial sending node of the message is divided into function identifier (such as remote window opening command) and address identifier (such as control unit node address)

can bus system has two types of nodes: non intelligent nodes without microcontrollers and intelligent nodes with microcontrollers. The system adopts intelligent node design. The car window is divided into four node units: front left, front right, rear left and rear right according to the CAN bus structure and the physical position of electrical components in the car. The front left node is the main control unit. In addition to being responsible for the lifting and lowering of local (front left) windows, it can also remotely control the actions of other windows. Each node is designed with an independent microcontroller with can function, and its can network structure is shown in Figure 1 below

Figure 1 can bus network structure

2.2 intelligent control of windows

each door of the power window system has a window glass lifting mechanism, which is very similar to the traditional hand cranking mechanism, but driven by DC permanent magnet motor. The size of the motor is very small, which can be installed in the door, and it is equipped with a set of reduction mechanism to increase the output torque and reduce the output speed. The rotation direction of the motor (i.e. the up and down movement of the window) is achieved by changing the polarity of the input voltage, and the lifting speed of the window depends on the size of the input voltage

the system uses a small resistance value (about 1 ω) As a current sensor, the sensing resistance is connected in series with the motor, and its voltage drop is proportional to the working current of the motor. The current flowing through the motor is detected by detecting the voltage at both ends of the resistance. Before the voltage on the sensing resistance reaches the set threshold, the motor works all the time. Once the voltage drop of the sensor reaches the threshold, the motor stops rotating, and then the window position is detected. If the window position does not reach the final position, it means that the window encounters an obstacle and the window automatically returns to the initial position. If the window position reaches the end of travel, the motor circuit is disconnected. In order to complete this kind of operation control, it is necessary to control the position of the window in real time. Therefore, a piezoelectric sensor is installed at the top and bottom of the window guide rail respectively to judge whether the window reaches the preset limit position according to the voltage generated by the pressure

in addition to realizing the automatic anti pinch function under normal conditions, the window intelligent system designed in this paper also requires that the driver can control the forced closing or opening of the window in case of emergencies (such as robbers or passengers escaping in distress). The system designs three keys (K1, K2 and K3) for window control for each node unit. K1 is a binary signal switch used to control the rise and fall of the window; K2 is the pause/resume button, which is used to pause the window in the process of rising or falling. Press it again to continue the original motion state; K3 is the mode selection key, which defaults to the normal working mode (with anti pinch function). After pressing it, it executes the abnormal working mode, which has the highest priority, and is used for quickly setting the window to rise or fall. The main control node unit, namely the front left node unit, is responsible for the lifting and lowering of local windows, and can also control the synchronous action of windows of all node units. On the basis of the previous three control keys, a local/global control mode key K4 is added, which defaults to the local control mode, and the control mode is switched after pressing the key

in this paper, the intelligent control process of the window is explained by the key action of the main control node unit, and its structural logic can be expressed as shown in Figure 2

Figure 2 window intelligent control structure diagram

3 hardware development of the system

except for the global control of the left front node unit of the system, the other node units are only responsible for the control of the local window, and there is only one key K4 in the hardware. The difference in function mainly lies in the difference in software design. In this design, the control circuit should not only support the CAN bus communication between node units, but also detect the analog quantities such as piezoelectric sensors and load currents, make various logical judgments, and complete the control function through the drive chip

the system uses p8xc591 as the main controller of the node unit. P8xc591 is a single-chip 8-bit [5] high-performance microcontroller with on-chip can controller. It is derived from MCS-51 microcontroller family. It adopts a powerful 80C51 instruction set and successfully integrates the pelican function of Philips semiconductor SJA1000 can controller. The fully static kernel provides an extended power saving method. The oscillator can stop and recover without losing data. The improved 1:1 internal time divider realizes 500ns instruction cycle at 12Mhz external clock frequency

the controller p8xc591 reads the key information, drives the window motor to operate according to the pre programmed software instructions, and monitors the output voltage and load current of the sensor at the same time, which is used as the logical judgment when the window is clamped with obstacles in the process of rising (falling), and the drive motor makes a reflection. The relevant commands and states of each node unit are transmitted and shared with other node units through the CAN bus in message format through the CAN controller. The hardware design block diagram of the system node unit is shown in Figure 3

Figure 3 hardware design block diagram of system node unit

the motor drive circuit adopts the motor drive chip MC33486 produced by Motorola Company for body electronics. The chip is equipped with two dual high-end switches and two pre driven low-end switches. This standard was first released in 1989. The two low-end switches can be connected with two MOSFET tubes, and have the ability of continuous 10A current output work. At the same time, it can collect the current of the motor, and use it to feed back to the a/d sampling module of the single chip microcomputer to obtain the current value of the motor, which can complete the control of the motor and realize the functions of blocking rotation and anti pinch of the window

4 system software design

the software design mainly includes the initialization program of the CAN controller, the sending and receiving message program of the node and the main control program

4.1 initialization of CAN controller

can controller must be initialized after power on or hardware reset. Initialization for can communication should include configuration of operation mode, acceptance filter, bus bit timing, interrupt and txdc output pin. The can initialization program is shown in Figure 4

Figure 4 can initialization flow chart

4.2 node sending and receiving message program

message sending is automatically completed by the CAN controller according to the CAN protocol specification. First, the CPU must combine the data to be sent into a frame message according to the specific format, enter the can control transmission buffer, and set the transmission request flag in the command register. The transmission processing can be controlled by interrupt request or query status flag. The sending program is divided into sending remote frames and data frames. There is no data field in remote frames

The receiving program of

message is responsible for the receiving of node message and the handling of bus shutdown, error alarm, receiving overflow and other situations. There are two main ways to send and receive messages: interrupt receiving and query receiving. The software design adopts the query interrupt control mode of message receiving and the interrupt control mode of message sending, which means much more than the practical interrupt control mode. See Figure 5 for the process flow of message receiving and sending

Figure 5 flow chart of message receiving and sending program

4.3 master control program

among the window node units, the left front node unit has the most complex functions and has the highest control priority. This paper introduces the main control program design process of the left front node unit in detail. Other nodes can be applied only with a little modification. Due to space limitations, it will not be discussed separately. First, initialize the system, including the initialization of can module, interrupt, i/o port, timing module, watch dog module, a/d module and global variables of p8xc591 controller. At the same time, write the maximum current when the motor is locked and the voltage threshold of the sensor when the window reaches the top (bottom) into EPROM. P8xc591 compares the actual measured current value with the calibration value in EPROM to realize the anti pinch function, and compares the voltage threshold value with the measured sensor circuit voltage value to judge that the window reaches the limit position. After initialization, read the combined key information, implement specific operations according to the key action, and send can messages at the same time to complete the can communication and intelligent control between node units. The main control program of the front left node unit and the subprogram flow chart of the window rising process under normal working conditions are shown in Figure 6 and Figure 7

Figure 6 main control program flow chart of left front window unit

Figure 7 subprogram flow chart of window rising process under normal working conditions

5 main technical parameters and functions of the system

in addition to the functions of automatic window rise, fall, manual pause and recovery, the power window control system also has the following functions:

5.1 anti trap function

after initialization, both manual and automatic rise have anti trap function, And the number of anti pinch is unlimited

Copyright © 2011 JIN SHI