Vehicle stable driving and acceleration and deceleration control based on PID control strategy of Atmega8

Publisher:科技狂人Latest update time:2018-03-25 Source: eefocusKeywords:Atmega8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    This article introduces the structure and working principle of the car automatic cruise control system, and selects the PID control strategy based on Atmega 8 microcontroller to achieve the stable driving and acceleration and deceleration control process of the vehicle. This system can effectively reduce the workload of the driver during long-distance driving, improve comfort, reduce fuel consumption, and benefit the environment.

    According to a survey, 10% of traffic accidents are caused by fatigue driving and improper operation. The car automatic cruise control system introduced in this article can effectively reduce the driver's fatigue, avoid traffic accidents, and is beneficial to environmental protection. When driving on the highway for a long time, after turning on the automatic operation switch of the system, the cruise control system will automatically increase or decrease the throttle opening according to the driving resistance, avoiding the driver's frequent stepping on the accelerator pedal to keep the car's driving speed constant, greatly reducing the driver's fatigue intensity. Because the cruise control system can automatically maintain the speed of the car, it avoids unnecessary manual changes in the accelerator pedal, thereby reducing the fuel consumption and exhaust emissions of the car.


    1 Composition of automobile cruise control system

    The automotive electronic automatic cruise control system is mainly composed of a cruise control switch, a vehicle speed sensor, an electronic control unit (ECU), a vehicle brake switch, an actuator, etc. The components of the electronic automatic cruise control system and their installation in the car are shown in Figure 1.

a.JPG

    The structural principles and functions of each part will be introduced in detail below.

    (1) Cruise control switch. When the main switch is turned on, if the vehicle speed is within the cruise control range (generally 40 to 200 km/h), the "set/coast" switch is turned off. At this time, the vehicle speed will be stored in the RAM, and the car will maintain this speed and drive steadily. When the driver wants to increase the cruising speed, the "recovery/acceleration" switch is turned on, and the cruise control ECU will increase the throttle opening through the actuator to accelerate the car. At this time, the RAM memory storing the actual vehicle speed parameters of the car is in a dynamic refresh state, and the vehicle speed at the moment the switch is turned off is stored in the memory, and the car will then drive at this speed at a constant speed; when the driver wants to reduce the stable speed, the "set/coast" switch is turned on, and the cruise control ECU will close the throttle opening through the actuator, and the car will decelerate and coast. At this time, the RAM memory storing the actual vehicle speed parameters of the car is in a dynamic refresh state, and the vehicle speed at the moment the switch is turned off is stored in the memory, and the car will then drive at this speed at a constant speed.

    (2) Cruise control ECU: It is used to receive signals from various sensors, calculate and process them, and then send instructions to the actuator to control the actuator's actions.

    (3) Neutral start switch. Used to control whether the vehicle immediately exits the cruise control state.

    (4) Brake switch. Installed on the brake pedal, it is used to transmit a brake signal (i.e., a signal that the driver has stepped on the brake pedal) to the cruise control ECU to quickly exit the cruise control state.

    (5) Vehicle speed sensor: The vehicle speed sensor collects the actual real-time vehicle speed signal as the input of the electronic control unit.


2 Working Principle of Cruise Control System
    Figure 2 is a typical double closed loop automotive electronic cruise control system principle block diagram. As shown in Figure 2, the input of the controller is the difference between the set fixed speed signal and the feedback signal of the actual speed. The ECU compares the two signals to obtain an error signal, which becomes a throttle control signal after amplification and processing, and is sent to the throttle actuator to drive the throttle actuator to work and adjust the engine throttle opening to correct the actual speed, so that the actual speed is quickly adjusted to the driver's setting. The relationship between the speed and the throttle opening when the car is driving on a flat road is usually stored in the ROM of the cruise control system ECU. The cruise control system automatically maintains the car at a constant speed according to the target speed.


b.JPG

    When the car is in cruise control mode, when the speed of the car decreases, the ECU increases the throttle opening, so that the engine power increases, the torque increases, and the speed reaches the set speed. On the contrary, the throttle opening is reduced. When the system is in cruise control, if the speed is v on a flat road, press the setting switch to enter the automatic driving state of cruise control. Once you encounter a climb, the driving resistance increases. If no adjustment control is performed, the speed will decrease. At this time, the cruise controller will increase the throttle opening according to certain control rules, stabilize the speed at v, and regain power balance. When encountering a downhill, the driving resistance decreases, and the cruise control system adjusts the throttle opening to be smaller, so that the speed is kept at v to achieve balance. Therefore, even if the driving resistance changes, the speed will only change within a small range, achieving the purpose of stable driving. When the speed exceeds a specific upper and lower limit, the cruise system does not work. The range of this upper and lower limit is not fixed and varies slightly depending on the model.

    When the system's sensor fails or the control signal circuit is cut off, the sensor output is zero. At this time, the vehicle speed exceeds specific upper and lower limits and the cruise control system stops working.

    3. Selection of Control Algorithm for Automobile Cruise System

    As the earliest developed control strategy, PID control has been continuously developed and improved for a long time, and has the advantages of simple structure, good robustness, high reliability, and easy parameter setting. Therefore, PID algorithm has the most extensive application in industrial control. This design selects PID control strategy to realize the speed control function of the cruise system.

c.JPG

    The functions of each correction link of the PID controller are introduced below.

    (1) Proportional link: Based on the deviation signal e(t) of the control system, a control action is generated in a certain proportion to reduce the error.

    (2) Integral link. It is mainly used to eliminate static error and improve the system's degree of freedom from error. The strength of the integral effect depends on the integral time constant. The larger the integral time constant, the weaker the integral effect, and vice versa.

    (3) Differentiation link: It can reflect the changing trend (rate of change) of the deviation signal and introduce an effective early correction signal into the system before the deviation signal value becomes too large, thereby speeding up the system's action speed and reducing the adjustment time.

    In digital computer control systems, digital PID controllers are used, and digital PID control algorithms are divided into position PID control algorithms and incremental PID control algorithms. Compared with the two control algorithms, when the computer only outputs increments, the incremental PID control algorithm causes small output changes due to computer malfunctions, and the switching impact of the control state is also small. There is no accumulation operation in the formula, and the increment is only related to the most recent few samples. The control effect is significantly better than the position PID control algorithm. Therefore, the incremental digital PID control algorithm is selected.

    4 Hardware Design Overview

    The inputs of the car automatic cruise control system introduced in this article are: actual vehicle speed, throttle opening, engine speed, brake switch (when the brake switch is effective, the system setting value is the set vehicle speed). The Atmega 8 microcontroller is selected as the control core, and the actuator is a DC motor. The control process is as follows: the set speed and actual vehicle speed input, the deviation is compared, and the PID algorithm is used to adjust, and the signal after the other inputs are processed is combined, and the speed of the DC motor is driven by the PWM channel of the Atmega 8 microcontroller to change the throttle opening to achieve vehicle speed control.

    For safety reasons, the brake switch is directly connected to the throttle actuator in the hardware design, so that when the brake pedal is pressed, the cruise control system is disconnected from the throttle cable while stopping the microcontroller constant speed control program.

    The system hardware circuit is mainly composed of microprocessor , power supply circuit, clutch and DC motor drive circuit, protection circuit, A/D conversion circuit and input signal processing circuit. Atm ega 8 microprocessor is the core of the system. Sensors are used in many places in the car cruise control system for signal acquisition. The required sensors mainly include vehicle speed sensor, throttle position sensor, brake pedal sensor, clutch pedal sensor, etc.

    The speed signal collected by the speed sensor is one of the most important input information of the vehicle cruise control system. The speed sensor converts the collected speed analog signal into a digital quantity and transmits it to the cruise control ECU. As a feedback signal, it compares with the set value and generates an output signal to drive the actuator to achieve the control requirements. The requirements for the speed sensor are real-time, accuracy, and reliability.

    The function of the throttle position sensor is to collect the throttle position signal. In this system, a potentiometer-type angular displacement sensor is used for throttle position measurement. There is an A/D conversion circuit between the sensor and the microprocessor, which converts the voltage signal output by the sensor into a digital quantity and then processes it by the microprocessor.

    The brake pedal sensor is installed under the brake pedal and is used to obtain the brake pedal action signal to decide whether to exit the cruise system.

    The clutch pedal sensor is installed under the clutch pedal and is used to obtain the clutch pedal action signal.


    5 System software process

    The cruise control process is shown in Figure 4. In the automotive electronic cruise control system, the actual vehicle speed signal is fed back to the electronic controller and compared with the set vehicle speed. Therefore, the system works in a closed-loop control mode, and the control method adopted is an incremental PID control strategy. By programming the single-chip microcomputer to adjust the speed of the DC motor and the opening of the throttle, the vehicle speed is kept stable within the allowable error range.

d.JPG

 

    In order to clearly explain the software design of the automobile automatic cruise system, the composition of the microcontroller software programming part is explained from a modular perspective. The modules involved in microcontroller programming mainly include initialization module, keyboard scanning module, start-up judgment module, communication module, interrupt module, timing module, watchdog module, etc.

    The system detects whether a button is pressed. When the cruise switch is turned on, the judgment program is started to determine whether the speed signal obtained by the speed acquisition program is within the cruise range. When the setting key is valid at this time, the actual speed must be maintained at the current speed. The timing program block implements timing, and an interrupt occurs when the timing point is reached. The actual speed is collected and compared with the set value. If the difference is within the allowable error range, no action will be taken. If not, the program segment of the motor speed control will be entered to achieve speed setting. When it is detected that the acceleration or deceleration button is pressed, the speed setting value is first modified, and then the motor speed control program segment is entered to achieve acceleration or deceleration; when it is detected that the brake switch is turned on, the cruise control system is exited.

    6 Conclusion

    This paper combines the PID control algorithm with the Atmega 8 microcontroller and applies it to the study of the automobile automatic cruise control system, which effectively realizes the stable driving of the vehicle within the allowable error range, can reduce the labor intensity of the driver during long driving journeys, and thus reduce the occurrence of traffic accidents. It also makes the PID control algorithm more widely used in automotive electronics.


Keywords:Atmega8 Reference address:Vehicle stable driving and acceleration and deceleration control based on PID control strategy of Atmega8

Previous article:Development of DS80C400 based on IAR compiler
Next article:Design of portable device power supply system based on ATmega16L

Recommended ReadingLatest update time:2024-11-15 07:25

ATmega8 brownout detection
ATmega8 has an on-chip BOD (Brown-out Detection) circuit that detects changes in VCC during operation by comparing it with a fixed trigger level. This trigger level is set by the fuse bit BODLEVEL, 2.7V (BODLEVEL not programmed), 4.0V (BODLEVEL programmed). The BOD trigger level has a hysteresis function to eliminate
[Microcontroller]
ATmega8 brownout detection
Design of intelligent management system for electric vehicle battery based on ATmega8
Introduction: This paper takes ATmega8 microcontroller as the core and designs a distributed, modular electric vehicle battery management system that communicates via LIN bus and has intelligent charging function, which realizes the effective monitoring and management of multiple battery groups. introduction The adv
[Microcontroller]
Design of intelligent management system for electric vehicle battery based on ATmega8
采用ATmega8控制器的倾角测量系统设计
  目前,业内对倾角的测量多是基于MEMS的加速度传感器,SCA100T是由芬兰VTI公司推出,采用三维MEMS技术开发的一款高精度双轴倾角传感器,可同时测量相对于水平面的倾斜和俯仰角度,具有温度补偿功能。本文以塔式起重机为应用背景,采用SCA100T倾角传感器实时采集倾斜信息,检测塔式起重机支撑架的平衡性能,避免由于其过度倾斜而引发事故。以SCA100T为基础设计了一款小巧、灵敏度高的倾角测量系统,分析了SCA100T倾角传感器测角的原理,给出了系统各个模块的软硬件设计方法,同时提供了两种具有可扩展性的应用方法。     1 整体设计   图1所示为本系统的整体结构框图。该系统采用ATmega8单片机控制SCA100T倾角传感器
[Microcontroller]
采用ATmega8控制器的倾角测量系统设计
ATmega8 low frequency crystal oscillator
To use a 32.768 kHz watch crystal as the device clock source, the low frequency crystal oscillator must be selected by setting the CKSEL fuse to “1001”. The crystal connections are shown in Figure 11. By programming the CKOPT fuse, the user can enable the internal capacitors of XTAL1 and XTAL2, thereby removing the ex
[Microcontroller]
ATmega8 low frequency crystal oscillator
ATmega88 power failure detection
ATmega88 has an on-chip BOD (Brown-out Detection) circuit that detects changes in VCC during operation by comparing it with a fixed trigger level. This trigger level is set by the fuse bit BODLEVEL. The BOD trigger level has a hysteresis loop to eliminate the effect of power spikes. This hysteresis function can be int
[Microcontroller]
ATmega88 power failure detection
AVR ATMEGA8 Serial Port USART
The avr serial port configuration is very simple, just configure a few registers to send and receive; But there are a few things to understand: 1. Once the serial port is successfully configured, the IO function is automatically occupied, which is different from LPC or STM8/32 (registered configuration is required); 2
[Microcontroller]
Latest Microcontroller 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号