Automatically closing power windows or doors on cars 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.
For reasons of cost and simplicity, the system described in this article uses a common brushed motor with Hall effect sensors. The detection algorithm based on speed and torque derivatives has been verified to be robust and fault tolerant. The algorithm can be used on all Atmel AVR Flash microcontrollers with A/D converters and I/O ports that trigger interrupts on changes. This article describes the basic principles, and the application note on the Atmel website has a detailed description of the implementation.
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 and high-end cars will be systematically 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 developed 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; maximum 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 the best 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 costly and limit the style of window/door design), or non-directional measurement through physical monitoring (this is the best solution in terms of overall cost).
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; maximum applied force of 100 N; 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
The force applied to the glass must be calculated from the motor current. The position of the moving part is continuously available in terms of velocity. These parameters can be used to determine if 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: A preliminary learning sequence is performed to store the torque values in memory. This technique is memory intensive and requires a defined calibration sequence. [page]
– 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 final 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, choke point detection and storage 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, last known position, etc. If a default value is set 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 (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, derived speed and motor current reference. By counting consecutive direction changes, 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...)
Calculate the average of the last 8 sampling points. 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:Design of digital phase-shift signal generator based on AVR and FPGA
Next article:The establishment of communication protocol between AVR microcontroller and host computer
Recommended ReadingLatest update time:2024-11-16 22:38
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Metronom Real-Time Operating System RTOS for AVR microcontrollers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- [Xianji HPM6750 Review 10] Drawing a multi-function expansion board and verification
- About the distance of infrared obstacle avoidance circuit
- Repost - Tesla battery violent disassembly video
- Relationship between transformer and inductor
- How to port uCOS-II to LPC17XX
- X-NUCLEO-IKS01A3 sensor driver transplantation based on NUCLEO-L011K4
- Standard EIA RS-198
- IEC 61000-4-5 Phases of three-phase power supply systems
- [Chuanglong TLA40i-EVM development board] +04.USB-Camera test-abnormal (zmj)
- [Automatic clock-in walking timing system based on face recognition] MaixBit-K210 can easily run with face recognition function!