An intelligent vehicle is a robot that can automatically drive in an environment according to a pre-set mode, or it can autonomously perform specific operations according to the on-site situation. Its design content involves multiple disciplines such as automatic control, computer technology, sensing and detection technology. Intelligent vehicles have broad application prospects in the field of automatic control. Among them, how to ensure that the vehicle drives in a straight line instead of zigzag, how to ensure parallel driving during the turning process, and overtaking are three basic problems that need to be solved. This paper proposes solutions to the three problems respectively, and the actual experimental results are good.
1 Principle of simulation of real-world applications
This paper simulates real-world applications and uses the runway shown in Figure 1 (made of two pieces of blockboard, 8 cm above the ground, the boundary line on the board is composed of black tape about 2 cm wide: the dotted line is composed of black tape 2 cm wide, 10 cm long, and 10 cm apart) to achieve the following functions: the front of car A is close to the starting mark line, the rear of car B is close to the boundary, and cars A and B start at the same time, pass the starting mark line one after another, go in the same direction in the lane, overtake in the overtaking area, and realize the function of alternating overtaking and leading the two cars.
2 System structure
The system composition structure is shown in Figure 2. The car is mainly composed of a control center (MSP430F149 single-chip microcomputer), a collision avoidance detection module, a turning line detection module (also used as a curve correction module), a straight correction detection module, a motor drive module, a simple button, an nRF905 communication interface, and a power supply.
2.1 Collision avoidance detection module
To ensure that the two vehicles do not collide, the distance between the two vehicles needs to be kept within a suitable range, that is, collision avoidance. The system uses the HY-SRF05 ultrasonic distance sensor, which is installed on the front of the car. It can measure the longitudinal distance between the two vehicles in real time, so as to control the acceleration and deceleration of the two vehicles to keep the distance moderate. HY-SRF05 has excellent performance, sensing angle: no more than 15 degrees; detection distance: 2~450 cm; accuracy can reach 0.2 cm. Let l be the measurement distance, t be the round-trip time difference, and the propagation speed of ultrasonic wave be c, then t=2l/c, and the transmission rate of sound wave in air is
(m/s). In the formula, T is the ambient temperature; Co is the speed at absolute temperature, which is a constant. It can be deduced from the above two formulas
.
2.2 Turning line detection module
The infrared reflective transceiver pair is used to detect the black marking line. It is placed at the front of the car and is used to detect the turning marking line and overtaking marking line in Figure 1. The infrared light emitted by the infrared transmitting tube is irradiated on the flat plate. If the infrared receiving tube cannot receive the reflected light, it means that the light is completely absorbed, and the black marking line is detected, thereby outputting a high voltage. If the reflected light can be received, it means that a non-black marking line is detected, and a low voltage is output.
2.3 Straight road deviation correction detection module
The driving lane is 40 cm, and the boundary is surrounded by 2 cm black tape. If no protective measures are taken, the car is easy to slide off. Normally, if no protective measures are taken, the car is easy to leave the runway. Two E18-D80NK infrared sensors on the side of the car are used to correct the deviation in the straight road. The two infrared obstacle avoidance sensors are tilted outward at a certain angle and installed on both sides of the car, as shown in Figure 4. The sensing distance of the infrared obstacle avoidance sensor is adjusted so that the obstacle avoidance distance is between the sensor and the runway and the sensor and the ground. When the sensor detects the runway, it outputs a low level, indicating that the car is on the runway. When it detects the ground, it outputs a high level, indicating that the car is about to leave the runway. At this time, timely correction is performed to ensure that the car is running normally.
2.4 Communication interface
When overtaking, in order to determine the position of the two cars, adjust the speed of the two cars in time, and reduce the overtaking time, nRF905 is needed to communicate wirelessly between the two cars. nRF905 is a single-chip RF transceiver launched by Nordic VLSI of Norway, which uses the SPI interface to communicate with the microcontroller.
2.5 Motor drive module
L298N is used to drive the DC motor, and its internal bridge circuit is used to drive the motor. The advantage of this method is that PWM waves are used to control the motor speed, and the remaining ports can control the forward and reverse rotation of the motor.
3 Software Design
The driving modes of the car are divided into autonomous mode and following mode. Autonomous mode means that the front car drives at a pre-set speed and automatically corrects the deviation. Following mode means that the rear car follows the front car closely, keeps a certain distance, and automatically corrects the deviation. Autonomous mode and following mode can be switched automatically.
3.1 Straight-track deviation correction algorithm
During the driving process of the car, the straight-track deviation correction adopts two correction methods. If only one correction is used, as shown in the left of Figure 5, although the forward direction of the car can be corrected, the car is at the edge of the runway as a whole and deviates from the center of the runway. When the deviation occurs next time, it is easy to fall off the runway before it is corrected in time. According to the law of negation of negation, two corrections are used. While correcting the driving direction, the position of the car is adjusted to the center of the runway. The algorithm is as follows:
TimerA is turned on while correcting the straight-track deviation; TimerA is turned off when the car leaves the edge of the runway, and the timing value is saved: nTurnHold.
Continue turning for 2*nTurnHold (keep turning for 2*nTurnHold to adjust the car to the middle of the runway); turn in the opposite direction for nTurnHold (turn in the opposite direction to correct the direction of the car); restore the original driving mode. The specific flow chart is shown in Figure 6. First, determine whether the approach is the left or right line, make left and right turn marks, then calculate with the straight road two correction algorithms, and finally correct the opposite direction according to the left and right turn marks.
3.2 Curve Correction Algorithm
The method of using different speeds on both sides of the car and delay to achieve turning, so the delay time is the key. However, usually when passing the turning mark line, the car body is not perpendicular to the line and the angle is not fixed, as shown in Figure 7. This will make it impossible to determine a fixed delay value. For this reason, the curve correction method is used to ensure that the posture of the car can be controlled after turning. The flow chart of this method is shown in Figure 8. Each vehicle is equipped with two turning line detection modules symmetrically distributed on both sides of the front of the vehicle. When one of them detects a turning line, it first determines whether it is left or right. If the left side detects the line first, the symbol is "+", otherwise it is "-". Then the MSP430 timer TimerA is immediately turned on to calculate the time difference between the two sensors detecting the turning line. According to whether the symbol is "+" or "-", the time difference obtained above is added/subtracted to the fixed delay time in a certain proportion. There is no accurate calculation method for this proportion. The actual value is mainly determined by objective conditions such as the friction of the runway and the speed of the car, and then the final time parameter (i.e., the turning time nVeerTime) is obtained. The turning function calls this parameter. This "negative feedback correction" method can make the car basically parallel to the runway after turning and go to the middle of the runway.
[page]
Turning time: nVeerTime; left and right sensors detect the time difference of turning: nDiffValue; fixed delay value of turning: nStaticTime; proportional coefficient: fRatio.
nVeerTime=nStaticTime+nDiffValue*fRatio
.
Multiple turns are required when overtaking, so multiple black lines are set in the overtaking sign area, which can be adjusted multiple times to ensure that the posture of the car after entering the overtaking area is the most ideal.
3.3 Overtaking correction algorithm
After arriving at the overtaking area in Figure 1, the posture of the car is adjusted by multiple lines in the overtaking sign area using a similar curve correction method. Then, according to the results of ultrasonic ranging, it is determined whether the car is the front car or the rear car. If it is the rear car, turn into the overtaking lane, accelerate to overtake, and then return to the driving lane, send a wireless signal to inform the other car that the overtaking is completed, and finally resume autonomous mode driving. If it is the front car, slow down and wait for the overtaking end signal of the rear car, and finally resume following mode driving. When overtaking, the rear car enters the overtaking zone and the front car drives on the original track. As long as the speed difference between the two cars is large enough, the rear car can smoothly overtake the front car.
The specific flow chart is shown in Figure 9. The key is the time problem of the two cars' cooperation. The two cars can be synchronized through the wireless module. The car will automatically correct the deviation during the straight road, turning, and overtaking process, and realize the automatic switching between autonomous mode and following mode.
3.4 Collision avoidance algorithm
In straight driving, in order to prevent the rear car from hitting the front car, a collision avoidance detection module is needed to maintain the distance between the vehicles. This paper uses the HY-SRF05 ultrasonic ranging sensor to measure the distance between the two vehicles, and presets a safety value of 25 cm. When the distance between the two vehicles is greater than the safety value, the rear car can accelerate; when the distance between the two vehicles is less than the safety value, it slows down. In this way, the rear car can follow the front car and realize following driving, but when turning and overtaking, all autonomous driving is performed and no longer follows the front car. After turning, overtaking and other special operations are completed, autonomous driving/following driving is restored. The flow chart of the collision avoidance algorithm is shown in Figure 10.
4 Conclusion
Aiming at the hot issue of path tracking in a guide line environment, this paper adopts multi-sensors and realizes the path tracking and automatic deviation correction functions of the intelligent car through single-chip control. On this basis, the overtaking function of the vehicle is also realized. In the actual test, it takes about 14.85±1.52 s to run one circle. The car runs stably and does not fall in the 25 circles of the test. It shows that the effect is good and easy to implement.
Previous article:Development of Intelligent Reactive Power Compensation Controller Based on ADuC812
Next article:Discussion on the stability of single chip microcomputer system in the field of measurement and control
Recommended ReadingLatest update time:2024-11-16 21:30
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
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
- Advice for beginners of DLP4500 light modulation.
- RC parallel circuit bandwidth problem - 3db bandwidth position problem, please help
- When I posted a message just now, as soon as I selected the invitees and clicked the Save button, an error message appeared: Discuz!
- EEWORLD University - In-depth technical training on battery management
- The firmware flashing tool is perfectly adapted to esp32-c3
- Ask about the selection of bidirectional thyristor
- 2-way ADC0808 measurement digital tube display assembly program
- [TI star product limited time purchase] shopping experience
- Detailed explanation of .dat file type in CCS
- Real-time processing method of wavelet image based on FPGA