Design of intelligent control system for car windows based on CAN controller P8xC591 and sensors

Publisher:Ziyu2022Latest update time:2020-03-24 Source: 时代汽车Keywords:CAN Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction


At present, automotive electronics represented by microcontrollers are widely used in vehicle electronic systems, and automotive control is shifting from electromechanical control systems to intelligent systems based on distributed networks. CAN bus is a serial communication network that supports distributed and real-time control. It is widely used in the field of automatic control with its high performance and high reliability. As one of the field buses with the greatest application potential, CAN bus technology provides support for China's automotive industry to upgrade, reduce costs, and expand market share.


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).


2. System functional structure


2.1 CAN bus communication implementation principle


CAN bus is a type 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 10 km, and the communication rate can reach up to 1 Mb/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 an 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 lifting and lowering of the local (left front) window and can also remotely control other windows. Each node is designed with an independent microcontroller with CAN function, and its CAN network structure is shown in Figure 1.

Design of intelligent control system for car windows based on CAN controller P8xC591 and sensors

2.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. 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 master 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. The intelligent control process of the window is explained by the button action of the master control node unit, and its structural logic is shown in Figure 2.

Design of intelligent control system for car windows based on CAN controller P8xC591 and sensors

3. 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 SJAl000 CAN 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 12 MHz 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 commands and status of each node unit are transmitted and shared with other node units through the CAN bus in the form of messages via the CAN controller. The hardware design block diagram of the system node unit is shown in Figure 3.

Design of intelligent control system for car windows based on CAN controller P8xC591 and sensors

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 10 A 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 optical 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.


4. System software design


The system software design mainly includes three modules: CAN controller initialization, node sending and receiving messages, and main control program.


4.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.


4.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 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.

[1] [2]
Keywords:CAN Reference address:Design of intelligent control system for car windows based on CAN controller P8xC591 and sensors

Previous article:The transparent A-pillar with a price of 12,000 yuan is here to solve the blind spot problem
Next article:NXP: More mobility, more responsibility

Recommended ReadingLatest update time:2024-11-23 15:14

Hanwei Technology steps up production to cope with the short supply of infrared thermopile sensors
In response to questions from investors, Hanwei Technology stated that due to the impact of the epidemic, the company is gradually increasing the overall resumption rate of production recently, but has not yet fully resumed production.   In terms of product applications, Hanwei Technology said that the company's infra
[sensor]
Hanwei Technology steps up production to cope with the short supply of infrared thermopile sensors
Application of OPTIMESS laser sensors in the railway industry
Preface Laser Measurement - Applications in the Railway Industry 1. Overview The OPTIMESS laser displacement sensor installed on the trackside can measure the position of the locomotive wheel on the inside of the railway at high speed. Several sensors on the same line close to the measuring po
[Test Measurement]
Application of OPTIMESS laser sensors in the railway industry
Distributed embedded system upgrade solution using CAN bus
  Preface   Embedded systems have many advantages such as high intelligence, small size, high reliability, and strong real-time performance. They have been increasingly used in various industries such as consumer electronics, industrial control, and automotive electronics. Often a large system is composed of many smal
[Microcontroller]
Distributed embedded system upgrade solution using CAN bus
Development and application of remote download technology based on CAN
0 Introduction The variable refrigerant volume (VRV) air conditioning system is a network air conditioning system, which consists of a refrigerant pipeline network and a communication information flow network. One outdoor unit is connected to multiple indoor units through piping and communication bus. The monitoring P
[Microcontroller]
Development and application of remote download technology based on CAN
STM32 CAN---A Brief Analysis of Interrupt Management
1 Introduction bxCAN occupies 4 dedicated interrupt vectors. Each interrupt source can be enabled and disabled individually by setting the CAN Interrupt Enable Register (CAN_IER).                                                                       figure 1 As can be seen from Figure 1, there are four interrupts on
[Microcontroller]
STM32 CAN---A Brief Analysis of Interrupt Management
GUVS-T10EC high temperature UV sensor is used in high temperature curing box for detection
    The high temperature curing box comprises a main box body, wherein a test chamber is arranged in the main box body, and the inner wall of the test chamber is coated with a protective layer, wherein the protective layer is composed of the following components by weight: 2.4 parts of 6-di-tert-butyl-p-cresol, 1.3 pa
[sensor]
GUVS-T10EC high temperature UV sensor is used in high temperature curing box for detection
Simplifying 60GHz automotive in-cabin radar sensor design using antenna-on-package technology
Millimeter-wave radar provides a primary sensing method for automotive and industrial applications, capable of detecting objects from a few centimeters to hundreds of meters away at long distances and with excellent angular and velocity accuracy, even in harsh environmental conditions. A typical rad
[sensor]
Simplifying 60GHz automotive in-cabin radar sensor design using antenna-on-package technology
SmartSens launches SC485SL, a 4MP image sensor in the super-starlight series
October 23, 2024, Shanghai, China - SmartSens (Shanghai) Electronic Technology Co., Ltd. launched the Star Light (SL) Series 4MP image sensor - SC485SL . As a 1/1.8-inch large-size back-illuminated image sensor, this new product is built on SmartSens SmartClarity®-3 process technology, equipped with Lightbox
[sensor]
SmartSens launches SC485SL, a 4MP image sensor in the super-starlight series
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号