Design of ACC Adaptive Cruise System Based on Ultrasonic Ranging and Internet of Vehicles

Nowadays, with the development of society, the vehicle ownership continues to increase. Vehicle has become the third important space for people besides home and office. As an important means of transportation for daily travel, people pay more and more attention to the convenience and safety of vehicle control. However, most vehicles sold on the market today are not equipped with emergency braking or emergency avoidance systems, even if equipped with the system, its accuracy is not high enough. When an emergency situation occurs in front of the vehicle, the vehicle cannot evade or brake on its own, only the driver can take measures, which often causes unnecessary collision. An ACC adaptive cruise system using ultrasonic ranging and Internet of Vehicles can share driving information between vehicles via Bluetooth to ensure identification of the speed and accuracy of the front vehicle, and able to avoid the front vehicle without driver’s intervention, enhancing emergency response capabilities. At the same time, unlike the existing ACC adaptive cruise system, most of which can only be activated when the speed is higher than 25km/h or 30km/h. This system can work at full speed of the vehicle, automatically follow the front vehicle, and automatically brake or accelerate reverse, increasing the convenience of daily driving.


Introduction
Active safety system refers to the safety system of electronic equipment including ABS, ESP, etc. The most typical of which is the active braking system. Data shows that 75% of rear-end accidents occur at a speed of about 30km/h, and researching an active braking system can prevent these accidents. This system can monitor the situation within a certain distance in front of the vehicle. When the front vehicle brakes, stops, or there are other obstacles, this system will first automatically apply force to the brake system to help the driver shorten the braking distance before making an action. Or it can adjust the steering wheel to change the vehicle's driving path to avoid obstacles. Of course, if the obstacle is close enough, the system will automatically brake without the driver's operation.
The Internet of Vehicles is a huge interactive network composed of information such as vehicle locations, speeds, and routes. Through GPS, RFID, sensors, camera image processing and other devices, vehicles can complete the collection of their own environment and status information. Through Internet technology, all vehicles can transmit their information to the central processing unit. Through computer technology, these The information of a large number of vehicles can be analyzed and processed, so as to calculate the best route for different vehicles, report the road conditions and arrange the period of traffic lights. Through the application of the Internet of Vehicles, vehicles in emergency can upload their information, and other vehicles can take corresponding measures to avoid collision, thereby reducing the probability of accidents.
ACC is "Adaptive Cruise Control". The adaptive cruise control system is an intelligent automatic control system, which is developed on the basis of the existing cruise control technology. While the vehicle is running, the distance sensor (radar) installed in the front of the vehicle continuously scans the road in front of the vehicle, and the wheel speed sensor collects the vehicle speed signal. When it's too close to the front vehicle, the ACC control unit can properly brake the wheels and reduce the output power of the engine so that the vehicle can always maintain a safe distance from the front vehicle. This is achieved by coordinating actions with the brake anti-lock system and the engine control system. When the distance from the front vehicle is far to a safe distance, the ACC control unit controls the vehicle to drive at the set speed.
This design mainly researches the functions that the ACC adaptive cruise system, such as automatically following the front vehicle, adjusting the speed and distance. Through the hardware and programming, the vehicle can determine the movement status of the front vehicle and take corresponding measures to adjust its own vehicle moves. Based on the programming of this system, the designed system was downloaded into two model vehicles to test the stability of the system.
In addition, currently existing problems in the ACC system are the need for the driver to take over the vehicle at low-speed situations etc. Corresponding improvements are made in the design, and two vehicles were used as experiment to test the practicability.

Overall system design
The system is mainly composed of MCU control chip, ultrasonic ranging module, motor drive module, infrared communication module, Bluetooth communication module and others.
The infrared communication module installed in front of the front vehicle collects information and transmits it to the MCU control system.
The system analyzes the input signals and outputs the processed signals to the motor drive module to control the movement of the front vehicle. The Bluetooth communication module installed in the behind of the front vehicle receives the signal from the MCU control system and transmits it to the MCU control system via the Bluetooth module of the back vehicle. After the signal is processed, the signal is output to the motor drive module to control the back vehicle move.

Overall software design
As shown in figure 1, when the infrared remote control sends signal, the infrared receiver of the front vehicle receives the signal and transmits it to the Arduino board in the form of a hexadecimal 8-digit code of "numbers+letters". After that, the Arduino board of the front vehicle receives the signal and analyzes it according to the program, transmits the signal to four motors, controls the wheel rotation of the front vehicle, and outputs another signal to Bluetooth at the same time. The front vehicle Bluetooth receives this signal and transmits it to the Bluetooth of the back vehicle. The Bluetooth transmits the received signal to the back vehicle driving computer (Arduino board). At this point, the Arduino board of the behind processes this signal and transmits the processed signal to the 4 motors. The motors use the received signal to control the current output, thereby controlling the wheel rotation, and completing the commands of forward, backward, left, right, and stop etc.
In addition, the ultrasonic sensors in the back vehicle can measure the distance to the front. Through programming, the sensor can send a specific signal to the Arduino board when the distance is less than a certain value. The Arduino board can transmit the signal to the motor and control the current output, so that the vehicle can stop or turn around to avoid accident.

System software design
In this design, the encoder is used to measure the speed of the front vehicle, and it is transmitted to the Arduino board of the back vehicle through Bluetooth, so that the Arduino board can send signals, and adjust the speed of the back vehicle to be the same as that of the front vehicle on the premise of safe distance. If the distance is too close, the emergency avoidance software will be run first, and the same speed will be adjusted after the distance is normal. This process is shown in the following figure:  In this design, Arduino is used as the control terminal of the vehicle emergency avoidance. Arduino programming language is developed based on C language, but Arduino has stronger practicality. In this design, the setup ( ) function is mainly used to set the pin, serial baud rate, etc.; The loop ( ) function is an endless loop, and the program code inside it is continuously executed after the program is initialized. In the program, the serial peripheral on the Arduino board is used and the baud rate is set to 38400. Serial.read ( ) is used to read the data received by the serial port, and Serial.println ( ) prints the data in the serial port. This design enables the vehicle to learn the distance from the front vehicle and share status information with the front vehicle by the Arduino programming. When the front vehicle is moving forward, the back vehicle can follow; when the current vehicle turns left and right, the back vehicle also turns left and right; when the front vehicle stops, the back vehicle can brake; the front vehicle reverses and the distance is too close (less than 10cm), the back vehicle will reverse at a faster speed than the front, and the reverse speed will be the same after the distance is safe; when the distance between the two vehicle is less than 10 cm, the back vehicle will remain still even if the front vehicle moves forward until the distance is safe.

Mechanical structure design
For a good product, it is essential to have a beautiful appearance and a strong mechanical structure. The vehicle shell in this design should be firm, and there should be space to accommodate many electronic components and circuits.
The streamlined design of the vehicle shell is more close to the actual shape of the vehicle. Therefore, the roof needs to be spliced from multiple wooden boards to make the shape of the vehicle more streamlined. The roofs of both vehicles should adopt a convertible design to facilitate later finetuning of the internal circuits. In addition, there must be an opening in the front vehicle shell to place the infrared device and battery charging interface, and an opening to place the ultrasonic sensor in the back vehicle shell. As shown in the figure, use CAD software to design the circuit container of the appearance for this design, and each part is cut by laser. The material to be cut is wood with a thickness of 2.8mm, and the connection of each part is connected by strong glue, which ensures the accuracy of the design and the appearance and firmness of the shape. The side of the vehicle shell is cut as an entire part from the wooden board, and the roof is cut into strips with a width of 20 mm and pasted with strong glue, leaving a space in the middle with a removable cover plate on it. There is a 5mm×10 mm square hole on the cover plate of the front vehicle to place the infrared device. A round hole with a radius of 7mm is left on the front side of the front vehicle, which is used to place the battery charging interface. In addition, there are two round holes with a distance of 10mm directly in the front of the back vehicle for placing the ultrasonic ranging sensor modules. There is another space for Arduino board and Bluetooth hardware in the two vehicles.

System test and result analysis
In this experiment, the back vehicle implements the ACC adaptive cruise function, which can follow the front vehicle and brake when there are obstacles. Based on this function, it can be verified by the following experiments that the ACC system can make the back vehicle keep the same speed as that of the front vehicle accurately, and react quickly in the event of emergency.

Test steps
1) Place the front vehicle at the right front side of the back vehicle, turn on the two vehicles, and use the infrared remote control to control the front vehicle to move forward. When it is the meeting of two vehicles, the back vehicle will stop and the distance between the two vehicles will be measured. Simulate the process of automatic braking of vehicles when entering the main road on the high-speed route ramp.
2) Place the front vehicle on the right front side of the back vehicle, the two vehicles are at an angle of 90°, and repeat the steps in test 1). Simulate the complex road condition of two vehicles meeting each other when driving in the city.
3) Place the front vehicle on the left front side of the back vehicle, the two vehicles are at an angle of 90°, control the front vehicle to go straight, and the back vehicle turn right at the same time. When the vehicles meet, the back vehicle will stop and measure the distance between the two vehicles. Simulate a vehicle that turns right to avoid the coming vehicles going straight. 4) Make the distance between the two vehicles 8cm (less than 10cm); control the front vehicle to reverse, and measure the time and moving distance of the two vehicles to reach a safe distance (10cm) IOP Publishing doi:10.1088/1742-6596/1650/2/022029 6 by increasing the speed of the back vehicle. Simulate the front vehicle slipping or the front vehicle reverses to avoid dangerous situations when waiting the red light.
Each step was repeated three times, and averages the results.

5) Simulation experiments
Simulation circumstance i) The front vehicle at a uniform speed Make the back vehicle move faster than the front vehicle. When the distance between the two vehicles is less than the safe distance (10cm), the back vehicle will start to keep the same speed as the front. Measure the speed and distance between the two vehicles.
Simulation circumstance ii) The front vehicle changes speed and brakes Change the speed of the front vehicle, and measure the moving distance that the back vehicle moves before braking when the front vehicle is braking.
Simulation circumstance iii) The front vehicle changes speed (the speed is always lower than the maximum speed limit of the back vehicle) Make the back vehicle move faster than the front vehicle. When the distance between the two vehicles is less than the safe distance (10cm), the back vehicle starts to keep the same speed as the front vehicle. The front vehicle accelerates at 35s and decelerates at 75s. Measure the speed and distance between two vehicles.
Simulation circumstance iv) The front vehicle changes speed (the speed sometimes higher than the maximum speed limit of the back vehicle) Make the back vehicle move faster than the front vehicle. When the distance between the two vehicles is less than the safe distance (10cm), the rear vehicle starts to keep the same speed as the front vehicle. At 35s, the front vehicle accelerates and the speed is higher than the setting of the back vehicle. The back vehicle starts to move at the maximum speed limit. At 45s, the front vehicle decelerates to the speed below the maximum speed limit of the back vehicle, and the back vehicle returns to follow the front vehicle. The speed is the same as the front vehicle, and the speed and distance of the two vehicles are measured. The average time to reach the safe distance is 1.9s. The average moving distance is 5cm.  Figure 5. Simulation Results.

Test results and analysis
When the front vehicle moves, the back vehicle programmed to simulate the ACC adaptive cruise can follow the front vehicle well and its movement status is consistent with the front vehicle. This shows that this system can realize the basic functions of ACC adaptive cruise, including following the front vehicle, move forward, backward, turn left, turn right, brake and stop.
In tests 1, 2 and 3, the back vehicle can be automatically stopped. The average distance between the two vehicles after parking is 9.8 cm, which is slightly less than the safe distance (10cm). This shows that this active braking system can cope with the situations such as on-ramp vehicles entering the main road, vehicles coming straight from the right side and vehicles moving straight when turning right in the city. When the distance is less than or equal to the safe distance, vehicle stops to avoid collision.
The average time taken for the vehicle to get a safe distance in test 4 is 1.9s, and the average moving distance of the back vehicle is 5cm. This shows that the back vehicle can make a safe distance from the front vehicle in a short time, and can basically avoid collision with the back vehicle. This ACC adaptive cruise system can cope with the danger of the slipping of the front vehicle or an emergency reversing.
In simulation circumstance i, the back vehicle accelerates at 0-5s and the vehicle speed is higher than the front vehicle at 5-18s, and the distance between the two vehicles gradually decreases. After 18s, the back vehicle accelerates to the same speed as the front vehicle, the distance between the two vehicles is stable, and the vehicle speed basically coincides. In simulation circumstance ii, the front vehicle speed (electric frequency) is positively related to the braking distance of the back vehicle. In simulation circumstance iii, the movement trajectory of the two vehicles is similar to simulation circumstance i. The front vehicle accelerates at 35s, and the back vehicle adjusts its speed to be consistent with the front vehicle after about 1s, and the front vehicle decelerates at 75s. After about 2s, the back vehicle decelerates to the same speed as the front vehicle. The distance between the two vehicles is basically maintained at the set value (10cm), and the time difference between the speed changes of the two vehicles is small. In simulation circumstance iv, the motion trajectory of the two vehicles before 33s is basically the same as that of simulation circumstance i. From 33s, the front vehicle accelerates to beyond the set speed limit of the back vehicle (electric frequency value 90). The back vehicle starts to move at the limit speed. At 45s, the front vehicle decelerates to a value below 90, and the back vehicle decelerates to the same speed. At 55s, the distance between the two vehicles is maintained at about 9.8cm, which is close to the set value. These experimental results show that the back vehicle can accurately identify the speed of the front vehicle and keep the speed consistent with the front. The back vehicle can accurately identify and stop when the front vehicle is stopped, and the response of the back vehicle is fast when the front vehicle's status changes.

Summary and prospect
This design improves the shortcomings of current active braking and ACC adaptive cruise system, enabling the vehicle to stop automatically, cruising at full speed, following the state of the front vehicle, and increasing the response procedure of the back vehicle to the reverse of the front vehicle, improving situations this system can handle. In addition, the system introduces the concept of Internet of Vehicles, and realizes information sharing between vehicles through Bluetooth, which improves the speed and accuracy of vehicle status recognition.
The main work completed in this paper includes the following aspects: (1) The electronic hardware used in this system is introduced in detail.
(2) The software of the system is introduced in detail, including the Arduino software programming.
(3) According to the requirements of beautiful appearance and firmness, 2.8mm wood boards cut by laser are used to meet the stability of the structure and the beauty of the appearance. (4) In actual tests, it shows that the vehicle can accurately follow the front vehicle, automatically stops or accelerates to reverse when the distance is less than or equal to the safe distance, realizing the functions of active braking and ACC adaptive cruise system. Prospect: (1) The distance ranging system can be improved. In the future, there will be a higher accuracy ultrasonic ranging system and a more accurate scheme than ultrasonic ranging.
(2) In the future, the vehicle will be able to accurately measure the speed of the front vehicle, and adjust the speed to be consistent with the front vehicle to form a real adaptive cruise system.
(3) In the future, the Internet of Vehicles will have a more convenient interconnection scheme than Bluetooth, which can get rid of the restriction of the number of connected devices and the transmission congestion for too many devices.