Nowadays, all mid-range and high-end cars are equipped with electric windows, and buttons control the lifting and lowering of the window glass. If the window is not intelligent, the driver presses the button without noticing the passenger's hand or object sticking out of the window, and the passenger is easily pinched by the window. For safety reasons, many cars use electric anti-pinch windows. Based on a thorough study of the application of CAN bus in automotive electronic systems and the anti-pinch solution for electric windows, a design scheme for a car window intelligent control system based on CAN bus is proposed to realize the anti-pinch control function of the window in normal working mode and the rapid lifting and lowering window control function in emergency situations (abnormal working mode).
System functional structure
1. CAN bus communication implementation principle
CAN bus is a kind of multiplexed bus. It was first developed by Bosch in Germany as a bus specification mainly used for automotive electrical system control. It uses non-destructive bus arbitration technology and works in multi-master mode. The direct communication distance can reach up to 10km, and the communication rate can reach up to 1Mb/s. The frame message uses CRC check and other error detection measures, and has the function of automatically shutting down nodes with serious errors. CAN nodes realize data transmission through message identifier filtering. Different priorities 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 is flexible to choose. The message adopts a short frame structure, with short transmission time and low probability of interference, ensuring that the data error rate is extremely low. The bus in the automotive network system transmits data in units of messages, and the node accesses the bus using bit arbitration. The message start sending node identifier is divided into a function identifier and an address identifier. CAN bus system nodes are divided into non-intelligent nodes without microcontrollers and intelligent nodes with microcontrollers. The system adopts intelligent node design, and the car windows are divided into four node units: left front, right front, left rear and right rear according to the CAN bus structure and the physical position of the electrical components in the car. The left front node is the main control unit, which is responsible for the raising and lowering of the local (left front) window and can also remotely control other windows.
2. Intelligent control of car windows
Each door of the electric window system has a window glass lifting mechanism, which is similar to the traditional hand-crank mechanism, but is driven by a DC permanent magnet motor. The motor size is very small and can be installed inside the door, and it has a reduction mechanism to increase the output torque and reduce the output speed. The direction of motor rotation (i.e. the up and down movement of the window) is achieved by changing the polarity of the input voltage, and the window lifting speed depends on the size of the input voltage.
The system uses a resistor with a small resistance value (about 1Ω) as a current sensor. The sensing resistor 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 across the resistor. The motor keeps working before the voltage on the sensing resistor reaches the set threshold. Once the voltage drop of the sensor reaches the threshold. The motor stops rotating and detects the window position. If the window position does not reach the final position. It means that the window encounters an obstacle and the window will automatically return to the initial position. If the window reaches the end of the travel, the motor circuit is disconnected. In order to complete this operation control, the window position needs to be controlled in real time. For this purpose, piezoelectric sensors are installed at the top and bottom of the window guide rail to determine whether the window has reached the preset limit position based on the voltage generated by the pressure.
In addition to realizing the automatic anti-pinch function under normal circumstances, the system design also requires that the driver can control the forced closing or opening of the window in the event of an emergency (such as robbery by gangsters or passengers escaping in danger). The system has three buttons for window control (K1, K2 and K3) for each node unit. Among them, K1 is used to control the rise and fall of the window and is a 2-value signal switch; K2 pause/resume button is used to pause the rise or fall of the window, and pressing K2 again will continue the movement; K3 mode selection button, which defaults to the normal working mode (with anti-pinch function), and executes the abnormal working mode (without anti-pinch function) after pressing K3, has the highest priority and is used to quickly set the window to rise or fall. The main control node unit is the left front node unit. In addition to being responsible for the lifting and lowering of the local window, it also controls the synchronous action of the windows of all node units. On the basis of the first three control buttons, a local/global control mode button K4 is added. The default is the local control mode, and the control mode is switched after the button is pressed.
System hardware design
In addition to the global control of the left front node unit of the system, the other node units are only responsible for controlling the local windows. The hardware design only has one more button K4, and the main focus is on software design. The control circuit designed in this system not only supports CAN bus communication between node units, but also detects analog quantities such as piezoelectric sensors and load current, judges various logics, and realizes control functions through drivers.
The system uses the P8xC591 with an on-chip CAN controller as the node unit main controller. The P8xC591 uses the powerful 80C51 instruction set; it integrates the PeliCAN function of the SJAl000CAN controller; the fully static core provides extended power saving methods: the oscillator stops and resumes without losing data; the improved 1:1 internal clock divider achieves a 500ns instruction cycle at a 12MHz external clock frequency.
The controller P8xC2591 reads the key information, drives the window motor to run according to the pre-programmed software instructions, and monitors the output voltage and load current of the sensor as a logical judgment when the window is clamped by an obstacle during the rising (falling) process, and then drives the motor. In order to prevent the motor from being blocked by impact when the window glass rises to the top or falls to the bottom, thereby reducing the service life of the electric window mechanism, the system is designed with a soft stop function, and this function is available for manual or automatic rising and falling. When the glass rises (falls) almost to the top (bottom), the power supply of the motor is cut off at the rising soft stop point to stop it from working, and the glass rises (falls) to the top (bottom) through the inertia of the motor.
The relevant commands and status of each node unit are transmitted and shared with other node units through the CAN bus in message format via the CAN controller.
The motor drive circuit uses the motor driver MC33486 dedicated to automotive electronics . The device has two dual high-end switches and two pre-driven low-end switches. Its low-end switch can be connected to two MOSFET tubes and can continuously output 10A of current. At the same time, it can collect the motor current and use it to feed back to the A/D conversion sampling module of the microcontroller to obtain the motor current value, complete the motor control, and realize the window blocking and anti-pinch functions. The system reduces the coupling of noise through the filter capacitor, and the photoelectric isolator 6N137 is added between the transceiver PCA82C250 and the CAN bus. The DC-DC converter is used to isolate the power supply, and the terminal resistors are connected at both ends of the bus to eliminate the reflected signal.
System software design
The system software design mainly includes three modules: CAN controller initialization, node sending and receiving messages, and main control program.
1. CAN controller initialization
The CAN controller must be initialized after power-on or hardware reset, including operation mode, acceptance filter, bus bit timing, interrupt and configuration of TXDC output pin.
2. Node sends/receives messages
The message transmission is automatically completed by the CAN controller following the CAN protocol specification. First, the CPU must combine the data to be sent into a frame message in a specific format, enter the CAN control transmission buffer, and set the transmission request flag in the command register. The transmission process can be controlled by an interrupt request or a query status flag. The transmission procedure is divided into two types: remote frame and data frame. The remote frame has no data field.
The message receiving program is responsible for receiving node messages and handling other situations such as bus shutdown, error alarm, and receiving overflow. The message sending and receiving mainly include interrupt receiving mode and query receiving mode. The software design adopts the query interrupt control mode for message receiving and the interrupt control mode for message sending.
3. Main control program
Among all the window node units, the left front node unit has the most complex functions and has the highest control priority. Here, the left front node unit is taken as an example to introduce its main control program design in detail. First, initialize the system, including the CAN module initialization, interrupt, I/O port, timing module, watchdog module, A/D converter module and setting of global variables of the P8xC591 controller. The maximum current when the motor is blocked and the voltage threshold of the sensor when the window reaches the top (bottom) must also be written into the EPROM. P8xC591 compares the measured current with the calibration value in the EPROM to realize the anti-pinch function, and compares the voltage threshold with the measured sensor circuit voltage value to determine whether the window has reached the limit position. After the initialization is completed, read the combination 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 each node unit.
Main technical parameters and functions of the system
In addition to the automatic window up/down and manual pause/resume functions, the electric window control system also has the following functions:
(1) After the anti-pinch function is initialized, the anti-pinch function is available during manual and automatic rising, and the number of anti-pinch times is unlimited; the range from 40 mm below the lower limit of the window and 40 mm above the upper limit of the window is the anti-pinch range: at room temperature (22 ± 5) ° C, 80 mΩ line resistance, 15 V working voltage, and measured with a 10 N/mm measuring instrument, the anti-pinch force of the glass rising is less than 100 N.
(2) Power saving mode: 120ms after the input signal disappears and the motor temperature is close to room temperature (25°C), the system automatically enters power saving mode. The static current is less than 300μA. The motor control unit is awakened as soon as it receives an input command.
(3) Soft stop function The rising soft stop point is about 2 mm above the upper limit position, and the descending soft stop point is about 12 mm above the lower limit position.
(4) Motor protection function takes protective measures for the motor to increase the service life of the motor and the electric window system. Within 250ms of the motor stalling, the control unit cuts off the power supply to the motor and the motor stops working. After the control unit is powered on, if there is no initialization, the initial temperature of the motor is set to 80°C; if it is initialized, the initial temperature of the motor is set to 160°C. Under normal circumstances, if the motor temperature reaches 170°C, the input command is invalid, and the function will be restored once the motor temperature drops; if the motor temperature reaches 190°C, the motor will stop working immediately, and the function will be restored once the motor temperature drops.
(5) Self-diagnosis protection function To ensure the reliability of the system and improve the system's mean time between failures, self-diagnosis protection measures are adopted: if the power supply voltage exceeds 16V±0.5V, the automatic rise function is turned off.
(6) System anti-interference design technology Software anti-interference is widely used due to its advantages such as flexible design, saving hardware resources and low cost. The software design of this system embeds a watchdog to further improve the reliability of the system.
A car window intelligent control system based on CAN bus is designed. The node unit is based on P8xC591 single-chip microcomputer, and the window motor and electronic control components are connected to the system. CAN bus is used to transmit, share and query data to achieve distributed control. Compared with the manual operation and point-to-point interconnection of traditional automotive electrical appliances, the use of CAN bus technology significantly reduces wiring, the body system structure is simple, the system reliability is high, and it is easier to maintain. At the same time, the system realizes the anti-pinch function of the electric window by monitoring the current of the window motor, and designs a forced window "action" function to target personal safety hazards, so that the intelligence, humanization and safety of the whole vehicle are further improved. At present, the system design has been installed and tested on a domestic car, and the effect is good. The proposed scheme has strong portability and scalability, and is also suitable for the intelligent upgrade of automotive electrical systems and the development of other CAN bus intelligent products with more powerful functions.
Previous article:Design of battery management system for pure electric vehicles using LIN bus
Next article:Research and design of electronic control unit for automobile electric power steering system
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Displaying the SARS-CoV-2 virus with flashing LEDs
- How to improve simulation? Learn to generate LTspice models yourself
- Essential for EMC Electronic Engineers
- Can you help me take a look at this FPGA development board?
- FLUKE is hiring!
- Help, about converting hexadecimal to numeric value (LIS25BA)
- FPGA realizes digital tube counting
- MSP430FW42X Non-Magnetic Sensor Water Meter Solution
- Error handling in C programming for embedded systems
- RF calculation formula backup one