Parallel Parking System Design with Fuzzy Logic Control

The difficulty with parallel parking, especially when going backwards is when adjusting the steering wheel so that the car can park in the right direction. Based on these problems, this study aims to design an automatic parking system. To improve parking success, a trajectory tracking system with fuzzy logic control will be implemented on a 1/7.5 scale test car. The coordinates obtained from the bicycle kinematic model are compared with the design trajectory. The difference between the facing direction read by the gyroscope sensor and the trajectory design is processed using a fuzzy logic controller to direct the servo motor as the steering wheel. The test results obtained that the error value for the position and direction facing in the automatic parking test using fuzzy logic control is 1.25cm and 1.59°.


INTRODUCTION
The increasing number of vehicles causes the traffic situation to become denser. This is because the area of roads and parking lots for vehicles is not able to keep up with the growth in the number of vehicles. This condition makes it more difficult for fourwheeled vehicles to park in the area that has been provided [1]. One of the parking methods to overcome narrow streets is parking parallel or parallel to the road [2]. However, this parking technique is quite difficult for drivers because they need to know the conditions around the vehicle and the parking location. Apart from parallel parking, transverse parking also requires special attention in reversing the vehicle. The system is designed using fuzzy logic to adjust the speed and direction of the steering angle on the prototype car [3].
Research on parking guidance systems has existed in recent years including automatic parallel parking guidance systems using ultrasonic sensors and fuzzy control. The parking system test equipment uses 1/10 RC car. The parking mechanism still uses space detection and relies on ultrasonic sensor readings. The success rate of parallel parking is 75% on average [4].
The automatic car parking prototype is carried out by recognizing the distance of the object around it. The method used is the automatic parking sequence algorithm. The system was made based on the HC-SR04 ultrasonic sensor and processed with a Mega 2560 microcontroller. The test results show that the parking area is 1.33 times the length of the test car [5]. The trajectory design system and fuzzy control in the automatic parking system. The paths are designed using the polynominal curve function equation. An automatic parking system was successfully simulated through matlab and prescan simulation [6]. The same thing is also done but using fuzzy hybrid for parallel parking [7]. Another method is a combination of Sliding Mode Variable Structure and Fuzzy Logical Control to determine effective parking [8]. A parking detection system and parking trajectory design using only ultrasonic sensors. In his research, this system can determine the parking trajectory according to the type of parking, such as entering a garage. Paths for parallel parking use the polynominal curve equation and for garage parking uses a quarter circle curve plus a short straight line at the end of the quarter circle curve. The vehicle control system uses Self-Organized Fuzzy Control. With the SOFC algorithm the system can be flexible to parking conditions. In testing using a 1/6 RC car the tracking error is less than 0.2 cm [9].
The use of PD + I control is also applied to parallel parking systems. The parking guidance system uses trajectory and uses ultrasonic sensors. Fuzzy method is used to determine PD constants and only uses 25 rules [10].
The automatic parallel parking system design is applied to real cars. This study proposes a correction of the parking lane tracking so that the optimal path is obtained. In addition, a sliding mode variable control algorithm is used to determine the path tracking strategy. The experiment was started by making a simulation with CarSim and MATLAB / Simulink software. The test success of 50 trials is 90% [11]. Maltab simulation was also carried out in this study but with several differences in the situation forwards and backwards [12].
Automatic parking system based on digital image processing. The camera will detect the line at the parking location then the system will design the vehicle motion trajectory to the parking location. vehicle control using fuzzy logic with genetic algorithms. With the genetic algorithm the system can be flexible to parking conditions [13].
The vehicle's automatic parking guidance system was made in the form of a prototype with a focus on reducing parking time. The use of fuzzy logic control methods to estimate parking space by displaying it on an LCD [14].
From the studies previously described about automatic parking, the authors are interested in the parking method based on trajectory control. The small error rate coupled with error control using fuzzy logic makes it the right combination to be implemented on real vehicles. However, the parking system above does not provide feedback from the direction of the car. For this reason, the author wants to design an automatic parking system using trajectory control method with face-to-face feedback. The author assumes that with the addition of a gyroscope sensor, the system can know the direction facing the actual car and adjust the direction towards the destination using fuzzy logic control. It is hoped that this research can become a reference in designing an automatic parking system for real cars.

Car Prototype Design
This study uses a kengaroo car model with a scale of 1 / 7.5. The chassis and body of the car are made of acrylic with dimensions of 285 mm x 215 mm x 135 mm. The test car uses a DC motor 25GA370 130 RPM 12 with a built-in 12 ppr encoder as the driving motor and TowerPro SG-90 servo motor as the steering motor. The gyroscope sensor GY-25 is used to read changes in the direction of the face. All of these components are controlled by a STM32F103 microcontroller programmed using the Arduino IDE. The test car can be seen in Figure 1. The driving of the test car uses a differential gear rc with a gear ratio of 1: 4.4. Then the encoder resolution per wheel rotation is 3346 pulses / rotation.

Modeling of Test Car Kinetics
The test car has a front wheel design as a guide that can turn by changing the angle between the front wheels and the rear wheels. The rear wheels are fixed so that the angle between the rear wheels and the chassis is parallel and does not change. The configuration is similar to a bicycle mechanism. For that, modeling to determine the position of the car can use the bicycle kinematic model. The bicycle kinematic model parameters can be seen in Figure 2.  To find ̇ and ̇ use equations 1,2, and 3.
Due to the fact that the car is going backwards the Vr is negative. The facing direction is obtained from the reading of the gyroscope sensor.

Parkir Parking Trajectory Design
Designing a parking trajectory based on the empty parking spaces detected by the prototype is an important step in designing an automatic parking lot. The parking trajectory is used as a reference for an automatic parking system so that the car can park in the right direction.
For garage parking, the steering is turned to the maximum angle then the vehicle backs up will create a circular motion trajectory when parking. [9] Then the vehicle continues to reverse with normal steering until the minimum distance the door can be opened. The entire transverse reverse parking stroke forms a quarter circle trajectory and a short straight line at the end of the quarter circle The quarter circle trajectory can use the general circle formula, namely: Where x and y are coordinate point variables. The variable r is the radius of the circle. Application of the general formula for a circle in an automatic parking system requires a variable starting point and an end point for the circle. The starting point of the trajectory is determined at the point x = 0 and y = 0. To determine the next point to the end point is to find y with respect to x based on equation (4) using equation (5).
Since the corner points of the block are at x = 0 and y = a, then the y point is added by an offset (a) according to the turning radius using equation (6).
Radius is an important variable in designing a parking trajectory. Therefore, before designing the trajectory, it is necessary to first test the minimum radius of the test car. By using equation (1) where θ comes from the reading of the GY-25 heading sensor. The method of testing the turning radius is to run the car in reverse and the steering angle is 45 °. The turning radius is the largest coordinate value for the x-axis. The prototype test car received a maximum x value of 44.2 cm. Based on the data above, the turning radius that will be used in the parking trajectory design is 44.2 cm.
After the car follows the quarter-circle trajectory, the car moves backward following the straight-line trajectory. The car reverses in the direction of the y-axis to the parking end point.
The coordinates in Figure 3 are used for reverse parking with parking spaces to the left and right of the car. For parking spaces to the left of the car the y value is positive.
After knowing the point x d`an y, to find the direction facing the point x, y can use the inverse tangent trigonometric function of points x and y to the center of rotation of the car. The minimum turning radius value on this car is obtained by testing the turning radius at a maximum steering angle of 45 °. Here is equation (7) to determine the facing direction.

Tracking Trajectory Tracking System Design
In order for the test car to go to the parking destination point according to the trajectory design, the motor and car steering wheel are controlled based on the data sent from the system input. the data from the sensor is processed by microcontroller to get the coordinates of the car. The car coordinates are obtained from the car coordinates compared with the parking trajectory design. The difference between the current facing direction and the direction facing the trajectory is processed using Sugeno's fuzzy logic control to get the value of the steering angle that must be executed. The speed of the car on a 1: 1 scale when parking based on the author's observations is 0 -10 km / hour or 0 -2.78 m / s. So that the behavior of the test car is appropriate and the accuracy of the system is in the condition that the test car is set to go at a constant speed of 3.51 km / h or 0.97 m / s. The speed is adjusted to the scale of the test car to be 0.13 m / s. PI control is applied to the drive motor to keep the car speed constant. The system block diagram is shown in Figure 4 and the system work process can be seen in the flow diagram of Figure 5.  Figure 4, fuzzy logic control uses 1 input and 1 output. The input is the difference between the facing direction read by the gyro sensor and the facing direction setpoint at that point. Facing error is processed to determine fuzzy logic (fuzzyfication). In this study, the facing error uses 3 membership, namely Negative (N), Neutral (Z) and Positive (P). The facing direction membership error can be seen in Figure 6. The value of the three membership errors in the face direction are accumulated to find out the fuzzy logic. After knowing the fuzzy logic of the directional error value, the next step is designing a rule evaluation. The following is a rule evaluation applied in this study: Rule [1] IF the delta error is negative (N) then the servo angle turns left (bkiri). Rule [2] IF delta error zero (Z) then the servo angle (middle) Rule [3] IF the delta error is positive (P) then the servo angle turns right (Bkanan) The final step is designing the Inference engine and defuzzyfication. Due to the fuzzy logic control Sugeno method the output is in the form of numeric values. Inference engine and defuzzyfication are combined. The result of this system is the steering angle. The steering system uses a servo motor with a 180° range of motion. Steering angle membership can be seen in Figure 7.

Testing The Parking System without Fuzzy Logic Control
In phase 1 the car will park with a constant steering angle (45 °) and a reverse speed of 0.13m / s. when the turning process is complete the steering will return to angle 0 constantly. The car goes to the parking space on the orders of the operator.
During the parking process, the prototype sends coordinate data to the computer via the HC-05 Bluetooth module. The data is analyzed and represented in graphs and tables. The motion of the car while parking is shown in figure 9.
From the graph in Figure 9 it can be concluded that the car can follow the trajectory but the error value of the position and direction of the face is quite high. From the parking test data in table 3, the average position error is x = 9.98 cm and y = 0.83 cm. Face direction error is 9.64 °.
The x-axis error tendss to be bigger due to feedback to stop at the end point using the y-axis parameter.

Testing The Parking System using Fuzzy Logic Control
In phase 2 testing the car will park towards the end point following the designed trajectory. The difference in the direction that is read by the GY25 sensor with the facing direction should be processed with fuzzy logic control to get the steering angle. the testing process is the same as testing in stage 1.
The coordinate data sent by the prototype is analyzed and displayed on graphs and tables. The car track graph is shown in Figure 12. Documentation of the stage 2 testing process is shown in Figure 11. The results of stage 2 testing are shown in table 4. From the parking trajectory graph in Figure 10, it can be concluded that the parking system can follow the trajectory that has been designed. The use of fuzzy logic control to control the direction of the car is able to reduce the error value facing the direction and position at the end point significantly. From table 4 the average error value for the position is x = 1.25 cm, y = 0.59 cm and the direction error is 1.59 °.
The weakness of using fuzzy logic control when compared to the results of the trajectory without fuzzy logic control with the results of the trajectory using fuzzy logic control is a larger turning radius. This is due to the steering angle correction by fuzzy logic control when parking. The difference is so small that the car can still go to the end point with an error below 2 cm and below 5 °. The error value on the x-axis is still large because the setpoint stops at the end point only on the y-axis. To reduce the x-axis error, the resultant equation of the x and y axes can be used with the consequence that the y error value is slightly larger.

CONCLUSIONS
Designing a prototype of an automatic parking system that can follow the trajectory on a 1/7 scale car, there are several steps that must be passed. Among them are designing a test car prototype, designing a bicycle kinematic model program, designing a parking trajectory reference and designing a trajectory tracking system using Fuzzy Logic Control. The use of gyro sensors and fuzzy logic control in automatic parking systems greatly affects parking accuracy. The test results show that the average error value of parking position using Fuzzy Logic Control is x = 1.25 cm, y = 0.59 cm and facing direction = 1.59 °. Whereas for those without fuzzy, it is x = 9.98 cm, y = 0.83 cm and facing direction = 9.640.