A Novel Safe Merging Algorithm for Connected Vehicles Using NetLogo

In this paper, we present two new algorithms for MetroCar System (MCS) vehicles at a merging zone. First algorithm states the regulations of vehicles in the same road such as control the following vehicle’s to prevent collision with the frontier vehicle. Second algorithm is for merging section of roads in order to prevent any collision at merging point. The proposed algorithms are verified and validated by using simulation results of the NetLogo simulation software. The simulation results show that the proposed algorithms guarantees that no collision occur at the merging zone.DOI: http://dx.doi.org/10.5755/j01.eie.24.3.20956

presented a longitudinal freeway merging control algorithm for maximizing the average travel speed of fully automated connected vehicles [16].Lu et al. [17] developed a longitudinal control algorithm to securely merging vehicles based on wireless communication.Kamal et al. [18] used model predictive control (MPC) to solve a multi objective optimization problem for safety.Makarem et al. [19] used MPC to solve the decentralized problem where each vehicle defines its own constraints by using some valuable information from other vehicles.Milanes et al. [20] used fuzzy logic to design a control system that allows a fully automated vehicle to allow the vehicle of incoming in the conflict in zone or cross if collision risk is not present.Lu et al. [21] proposed an automated merging control method based on automated highway system (AHS) based on reference speed path for the merging zone vehicle.
A nonlinear optimization model is developed by Xie et al. [22] in order to improve traffic safety and increase traffic flow at freeway ramps.This model uses the second-bysecond accelerations of all vehicles as the decision parameter and tries to maximize the total speed of all vehicles.It also ensures that when a vehicle arrives at the merging point, the distance between the vehicle and adjacent vehicles are greater than a minimum value to guarantee safety.Wang et al. [5] proposed an on-ramp merging control algorithm for Internet-connected vehicles.On the basis of vehicular operation characteristics during the merging process analysis, a cooperative driving algorithm based on Internet of vehicles was designed to achieve ramp merging without collision.
In recent years, many papers are published to solve merging control problem at multi-way intersections [23]- [31].
In this paper we will focus on both lateral and longitudinal control in decentral approaches by new algorithms.Unlike former studies that we have developed new algorithms will be implemented on MCS which is a recently proposed system to overcome traffic problems in cities. MCS combines the advantages of personal vehicles and the metro transportation system [32].
In this study, a novel merging algorithm is developed for MCS vehicles in order to increase the safety and to decrease the traffic congestion at merging zone.Moreover, it is guaranteed that no collision at merging zone.In this work, we can control traffic flows with different vehicle speed whereas some researchers have assumed that speed of vehicles at merging zone are fixed [2].Additionally, merge algorithm is developed for three different zones separately whereas only one algorithm and/or assuming one zone has proposed in most papers [5], [20], [33], [34].The rest of this paper is organized as follows: The MetroCar System is explained in Section II.MCS infrastructure and MCS vehicles' attributes are given.In Section III, the vehicle tracking problem is discussed.We offer a new algorithm to solve this problem.The merging control algorithm is proposed to organize vehicles with various speeds in order to avoid a collision in Section IV.All proposed algorithms are tested using NetLogo simulation software.Some of the simulation results are given in Section V. Finally, concluding remarks are reported in Section VI.

II. METROCAR SYSTEM
MetroCar System (MCS) is a new transportation system that combines the metro, personal cars and automated cars.Although personal cars provide flexibility, hygiene and security, they are caused traffic congestion and time wasting.On the other hand, although there are some problems about flexibility for using metro, there is no traffic congestion.We suggest a flexible, hygienic and secure transport system, which is named MCS combining these systems' advantages.
MCS is consisted of two levels, personal drive level and automated drive level.In the first level, user has to drive his/her car from home/work to the MCS station at gradeseparated road.Throughout this level the vehicle is user controlled.Automated drive level is started when driver request to admission to MCS.If main system allows, it will take the vehicle's control from driver and automatic driving is performed.Finally, the driver takes the vehicle control again after the vehicle leaves the MCS station.
MCS vehicles are small sized, one seater, operated by only electricity.They communicate each other with DSRC when control is taken by the main system.We set fixed all fundamental attributes for a MetroCar vehicle.In this way, we can control the traffic flow easily.Mechanical, physical and hardware attributes for all of vehicles are assumed to have some standards.Furthermore, speed control is controlled by fixed deceleration and acceleration.MCS vehicles are less costly than automated and personal vehicles because they use special grade-separated roads.MSC offers a good solution for traffic problems; however, new infrastructure and grade-separated narrow roads have to be built for MCS.These roads must be isolated from pedestrians, animals and other external factors.MCS roads, which can be made with fixed intervals of lane change, fixed entry and exit points.Furthermore, there is no signaling system in these roads.An illustration is given in Fig. 1.

III. VEHICLE TRACKING
In this section, a new vehicle tracking algorithm is developed before we propose our novel merging algorithm.It is assumed that all connected vehicles have the same technical specifications, e.g.size, maximum speed, etc.All vehicles can communicate with each other if necessary; moreover, each vehicle propagates its position and speed information to others every τ time.Speed value of a vehicle can be changed by the system with two acceleration constants, positively or negatively in order to increase or decrease speed respectively.Deceleration will be used for negative acceleration from now on.Since a discrete time simulation platform is used in this work, let us define that each vehicle has speed and acceleration/deceleration rate as follows: where ν is speed, x is the position, α is acceleration/deceleration rate, and τ is time step.Using (1) and ( 2), each vehicle's speed and position can easily be derived for every time.Assuming the vehicle only increase or decrease the speed, for a n th time step, e.g.time is equal to n.τ, speed and position of a vehicle can be given as follows: Since the speed of a vehicle can be determined by (3) for each time step using only initial speed value, (4) can be rewritten in terms of initial and final speed values of a vehicle after some manipulation as following If we know initial and current speed values and initial position, we can determine the current position of a vehicle using (5).Let us define Δx as position difference for both difference of initial and final position of a vehicle or difference of current positions of two vehicles.For a single lane road, all vehicles have to update their speed for a safe tracking according to some rules.The key point for safe tracking, Δx between successive vehicles has to be greater than Δxmin for all times.Δxmin is defined as minimum following headway for successive vehicles so that if the leading vehicle makes its speed lower or it stops, the following one has to change its speed accordingly in order to prevent any collision.
Figure 2 shows a vehicle tracking to another one by Δx1 and Δx2 respectively.Δx1 is the difference between the initial positions of vehicles whereas Δx2 is the difference between final positions of vehicles.If the leading one makes lower its speed therefore the following one also has to decrease its speed.The worst case of this scenario is the leading one's stop.In this case, Δx2 has to be greater or equal to Δxmin = δ + xsize where xsize is fixed vehicle size and δ is minimal safe tracking distance.Assume that both vehicles stop for final case.Since vehicles speed of each one will be zero for the final condition, (5) can be rewritten for each vehicle as follows: For a safe traffic flow, the next equation must be provided as explained above Therefore, the following conditions of ( 9) have to be ensured for all time for a safe tracking.In summary, we can control the safe vehicles tracking with the following algorithm according to (9).We can update each one of vehicle's speed with tracking algorithm.

IV. MERGING CONTROL
A novel vehicle merging tracking algorithm is proposed in this section.We consider a main and a secondary parallel road are merging; therefore, all vehicles at the secondary road have to merge to the main road vehicles safely in order to avoid any collisions.Secondary road is assumed long enough so that a vehicle can increase its speed at most maximum allowed value if necessary before merging point.For that reason, average speed values of both vehicles are very similar around the merging point.Vehicles at the secondary road keep on seeking for a gap to enter into the main road.The main problem is whether main road vehicle or secondary road vehicle has to accelerate or decelerate its speed in order to ensure a suitable gap between two vehicles.A sample road configuration is given as Fig. 3.As seen from the figure, there are three zones for merging roads; namely, self-zone, control zone and critical zone.At the self-zone, vehicles at both roads have to obey only tracking algorithm.It means, there is only communication among the vehicles at the same road.
On the other hand, possibly merging vehicles at main and secondary roads start to communicate with each other at the control zone in order to decide the priority.At this zone, secondary road vehicles are master whereas the main road vehicles are the slave since secondary road vehicles are assumed to have more priority than main road vehicles.A vehicle at the secondary road seeks a vehicle at the main road to be a companion before the critical zone.Assume that a vehicle at the secondary road has a position of xs, i.e.Δxs is left to the merging point.Assuming to keep its speed, it can be at the merging point at ts time.This vehicle controls the main road vehicles if there is any vehicle at the position of xs ± Δx which can be at the merging point at ts ± Δt.Here, Δt is the minimum time gap between two vehicles' passing time at merging point safely without any collision.If there is so vehicle, let assume that it has a position of xM, i.e.ΔxM is left to the merging point.Assuming to keep its speed, it can be at the merging point at tM time.If both conditions are assured, they are set to be the companion at this time step.Companion vehicles are lined up by increasing or decreasing their speed before the critical zone so that secondary vehicle can merge to the main road before or after the companion vehicle safely.Companion vehicles have to obey the following merging algorithm (Fig. 4).Note that, all other vehicles at this zone have to obey the tracking algorithm.
Finally, at the critical zone, both roads are assumed as a virtual single road.Since companion vehicles are lined up before the critical zone, it is guaranteed that there is no collision at the merging point.They can be assumed as flowing on the same road.All vehicles have to follow only the tracking algorithm in this zone assuming virtually to be on the same road.

V. SIMULATION RESULTS
Proposed algorithm is tested using NetLogo which is an agent-based programming language and integrated modeling environment.A platform of Fig. 3 is designed.The length of the main and secondary road is set to 140 m and 120 m, respectively.The control and critical zone length are set to 60 m and 15 m respectively.Acceleration rate is considered as 2,5 m/s 2 whereas deceleration rate is 10 m/s 2 .Minimal tracking distance δ is 2 m and size of each vehicle is regarded as 2 m.
Headway of vehicles entering the secondary road is considered to be fit to the normal distribution as given ( 11) where 2 , , 0 x        , μ is the mean and σ is the standard deviation.
The developed tracking algorithm and the merging algorithm is run at NetLogo simulation program.The algorithm is tested with different μ and σ to verify the safety of the proposed algorithm.In this paper, μ is set to 3000 and σ is to 1000 and simulation tests are performed.For example, leading vehicle forced to be stopped, hopefully the following vehicle is also able to stop safely.It is observed that the following vehicle may adjust (increase or decrease) its' speed safe tracking distance with leading vehicle.Speed and position graphics for this simulation are depicted in Fig. 5.As you seen from the figure, the rear vehicle increased its speed until to point where it can stop safely then it decreased its speed.Finally, it stopped to keep safe margin between its position and the front car.All of the simulation results shows that our novel algorithm is definitely safe and there has never been happened any collision.The merging algorithm has also been tested for different situations.As shown in Fig. 6, vehicles which have been flowing on secondary and main roads are started to communicate with each other.The vehicle on the secondary road can be easily merged to the main road at the final position.Additionally, this figure shows that distance between vehicles on the main road is increased by the time to create a safe gap for the merging car.Furthermore, speed and position changes of these vehicles are given in Fig. 7.As seen from the figure, the position difference between the vehicles is increased by the time and the distance between the vehicles is as much as the distance Δxmin at the final point.In addition, all of vehicles are started the simulation with the maximum speed.The front vehicle is continued at the maximum speed and the middle and rear vehicles are decreased their speed by the time.However, it is observed that the rear vehicle reduces the speed more than the middle one.It is also seen that the speed change of the vehicles is variable, up and down basis.This can adversely affect engine performance and driving comfort.Future work will suggest solutions to this situation.As mentioned above, our proposed algorithm works with different speed vehicles at merging zone, i.e. vehicles do not have to be the same speed.In order to verify this property, some simulations are performed.Position versus time for a vehicle is plotted and given in Fig. 8.As seen from the figure, position of vehicles on the main road is plotted as blue whereas secondary road's one is plotted as red.Vehicles obey the proposed algorithm to pass the merging point safely.Please note that, leading vehicle at the self or control zone can be following vehicle at the critical zone since they adjust their speed to obey algorithm rules.Since companion vehicles are lined up before the critical zone, only one vehicle at a specific time is crossing the merging.

VI. CONCLUSIONS
In this paper, we developed a tracking and merging algorithms for MCS vehicles in order to ensure safe and efficient flow at merging zone.We design a main and a secondary road to test our algorithm with NetLogo simulation platform.The efficiency of the proposed system was validated through simulation.By using the proposed algorithms, traffic flow can be easily controlled with different vehicles speed.Headway of vehicles entering the secondary road is forced to be as the normal distribution.The platform is tested with mean as 3000 and standard deviation as 1000.All simulation results agree that the proposed algorithm ensure for safe merging for MCS vehicles.Moreover, it is guaranteed that no collision at anywhere including merging zone.These results are encouraged us for further studies about MCS algorithms.

Fig. 2 .
Tracking vehicles by another one at an initial time and final time (b).

Fig. 3 .
Fig. 3.A secondary road is merging to a main road.

Fig. 5 .
Tracking algorithm verification by: a) speed and; b) position.