Automatically closing power windows or doors on vehicles present a potential risk of jamming, crushing and possible injury. They must be able to reverse movement to prevent the force applied by the motor from exceeding normal limits. This feature means that speed, current and glass position must be constantly monitored.
Electric devices in modern cars
Electronic components and systems now account for more than 20% of the cost of high-end passenger cars. Increasing the number of electronic devices allows for better control of sensors and actuators, thereby enhancing the comfort and safety of the car. It is expected that most mid-range or mid-size cars will be equipped with power window or door systems. The vast majority of these devices are fully automatic, which means that they must be accompanied by safety systems to prevent injury or mechanical failure. Regulations have established rules that power systems must follow. This is especially true for the raising of windows and sliding of doors. This application note describes how to implement an anti-pinch algorithm that was originally designed for power window systems but can be easily ported to other mobile devices.
standard
Car power windows are subject to international standards, such as MVSS118 in the United States or 74/60/EEC in Europe. In terms of how to reduce the risk to children, these documents put forward the following requirements: detection area: 4mm to 200mm; clamping force is 100N; can be reversed when clamped; determine the deflection angle test: 5N/mm to 20N/mm.
About Hardware
There are different detection strategies for determining whether there is an obstacle entering the critical clamping area:
(1) No mechanical contact. The reaction occurs before the clamping force is applied to the object. Because no external force is applied to the object, this is a safe protection method. It also does not rely on vibration, aerodynamic changes or deformation. However, this method requires integrated sensors (infrared, ultrasonic, etc.) and related circuit modules and lines, which leads to additional costs.
(2) With mechanical contact. The measured pressure is transmitted to the system to indicate that an object is trapped. In this regard, designers have two basic technologies available: directional measurement (mechanical sensors or contacts integrated into the door seal, these solutions have always been expensive and limit the style of window/door design), or non-directional measurement through physical monitoring (this is a cost-effective solution overall).
Anti-pinch algorithm details
The object detection algorithm was designed from the outset to meet the requirements of the standards (FMVSS118 & 74/60/EEC): detection area of 4 to 200 mm; 100 N of applied force; reversal of direction when an object is clamped; standard confirmation test.
The reasons for having to be adaptive include: – The mechanical parts of the lifting system will change over time (aging, local deformation, wear, etc.); – The electronic characteristics will change greatly; – The environment affects the friction (temperature, humidity, icing, etc.); The system should not react to disturbances and incorrect detection of objects. It must be robust to air friction, road vibrations, power failures, etc.
Physical parameters of the solution using the motor
It must be possible to calculate the force applied to the glass from the motor current and to provide continuous information on the position of the moving part in terms of speed. These parameters can be used to determine whether an object has been encountered and: whether the object is in the detection zone; whether the applied force exceeds the limit.
This article describes an anti-pinch algorithm that works by measuring motor current and a Hall-effect speed indicator. With very little modification, the algorithm can be used in systems such as sliding doors or convertible tops.
Pinch Detection Algorithm
Typically, the object detection algorithm operates by indirectly measuring the window lift system, including current (torque) and position (speed). The application notes associated with the algorithm use two techniques, which are based on:
– Calibrated torque stored in conflict-free memory: Perform an initial learning sequence and store the torque values in memory. This technique is memory intensive and requires a defined calibration sequence.
– Speed-derived calculation: A technique that makes sense because it requires less memory but more calculation, having the advantages of both approaches.
Implementation on AVR
The algorithm described in detail in the previous paragraphs has been implemented and tested on an AVR ATmega88 development board. Figure 2 describes the hardware used to implement the algorithm. It uses a standard ATmega88 and analog chain to measure the motor current. The hardware has two Hall effect sensors. The direction of the motor is controlled by a bipolar delay and a field effect transistor to activate the motor switch.
In-system Flash programming
In-system programming allows any AVR microcontroller located in the end system to be programmed and reprogrammed. Through a simple three-wire SPI interface, the in-system programmer communicates serially with the AVR microcontroller to reprogram all non-volatile memory on the chip. In-system programming does not require the chip to be physically removed from the system. This saves time and money both in the development phase in the laboratory and in the field for software or parameter upgrades. When uploading code into Flash memory at the end product stage, using the same standard AVR Flash microcontroller in multiple applications and customized versions can simplify total management.
Software Description
All codes are implemented in C language using IAR EWAVR 4.1. The implementation of basic functions (position management, initialization, current management, window operation, anti-pinch monitoring) requires 2KB Flash. Adding extended functions such as calibration, detection and storage of blocking points can expand the code size to 4KB. The software code is available on Atmel's website and its structure is as follows:
The initialization pin changes the interrupt to be used through a Hall effect sensor (sensitive to the rising and falling edges of the signal). It also initializes the clock and ACD used to measure speed and motor current.
This function loads the window lift parameters from EEPROM or with initial values to initialize the window lift. These parameters include window size, sensor value, entrapment threshold, entrapment zone, known position, etc. If a default value is given on the position parameter, it can request a down command to initialize the window lift at the bottom limit.
This function stores the window lifting parameters into EEPROM.
This function contains the window lift state machine. It controls the operation of the window through the given event parameters. It monitors the window position, the upper and lower limits, and the state of the anti-pinch system. It returns the state of the window lift (the same value as the get_window_state function).
This interrupt subroutine is executed on the Hall Effect sensor pin. It calculates the rolling direction, position, derives the speed and motor current reference by counting consecutive direction changes, and it is also able to detect the default value of the Hall Effect sensor (the sensor is not connected to an interrupt pin).
This function forces the window to stop after a defined step. This function returns the state of the window raising state machine (this return value is used in the window_ctrl function).
Establish window lift status: used in mandatory operations (such as stop request...)
The average of the eight sampling points is calculated and used to filter the motor current.
This function monitors the start button, generates an operation command event and passes it to the window_ctrl function.
Previous article:Atmel Studio 7.0 Quick Start Guide (Based on ASF)
Next article:Example of ATmega16 driving spi interface 128x64 screen written by MikroC
- 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
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Can the EPCS16SI8N chip be read and written directly? Altera configuration chip
- Installation Case | MODBUS to PROFINET Gateway Connects Smart Low Voltage Motors
- [NXP Rapid IoT Review] + Getting Started with NXP Rapid IoT
- What challenges will the 5G era bring to the LED display industry?
- Targeted GaN R&D
- 【Silicon Labs BG22-EK4108A Bluetooth Development Review】+Create a Bluetooth program from scratch
- 【mmWave Studio】Several experiences in problem solving
- Pin constraints are lost in Gaoyun Yunyuan software
- I need a schematic diagram and test program for controlling a four-wire brushless motor with a 51 microcontroller and A4988
- 【GD32F310G-START】Hardware SPI driver ST7735