# Design and Implementation of a Smart Traffic Signal Control System for Smart City Applications
## 4 EVSP Process
### Traffic Signal Control Algorithm  
After the host RSU check, the RSU starts the EV signal preemption control process, where the control algorithm of this process is presented in Figure 9. RSU reads the current signal plan from the traffic signal controller, determining whether to extend the green period or cut off the red period to facilitate the EV passing through the intersection. The green mode (\(G_{mole}\)) indicates that the EV direction is currently in the green period and that it should remain green until the EV passes the intersection. If the EV direction is currently in red mode (\(R_{mole}\)), the signal controller should turn to green as soon as possible but still has to follow the minimum green constraints to ensure the safety of pedestrians. A traffic signal guarding mode (\(Y_{mole}\)) is designed after the \(R_{mole}\) control is completed. The RSU judges the remaining green time (\(G_{rt}\)) of the signal in the non-EV direction. If \(G_{rt}\) is smaller than minimum green protection time (\(G_{min}\)), \(R_{mole}\) will continue until \(G_{rt}\) is greater than \(G_{min}\). It then enters the traffic signal guarding mode (\(Y_{mole}\)), where the RSU will convert the non-EV traffic light from yellow to red. The RSU controls the signal into green mode (\(G_{mole}\)) after \(Y_{mole}\), and stays in \(G_{mole}\) until the EV leaves. Figure 8: HostRSU algorithm. Figure 9: Traffic signal control algorithm. A new traffic signal mechanism is specially designed for smoothing the EVSP system operation. It is constituted by two traffic signal blinking modes: \(R_{mode}\) and \(G_{mode}\), as shown in Figures 10 and 11, where \(R_{mode}\) is responsible for the handling the process of signal control when the signal of EV direction is red, and \(G_{mode}\) is responsible for the condition that signal is green. Different from the traditional single green/yellow/red light, a hybrid signal scheme is designed to notify all the nearby vehicles and pedestrians that an EV event is now happening and provides information on which direction the EV is coming from. For example, the signal will display red with blinking yellow at the same time in the EV direction to inform all vehicles where the EV is coming, and the signal will change to green as soon as possible, and switches to green with blinking yellow to facilitate EV going through the intersection. A changeable message sign (CMS) attached on the signal displays a message to inform from which way the EV is coming, and which way the vehicles should move to facilitate EV through and ensure safety. Figure 11: Traffic signal blinking mode (\(G_{mode}\)). Figure 10: Traffic signal blinking mode (\(R_{mode}\)). * Traffic Signal Mode: \(R_{mode}\)  
In \(R_{mode}\), where the current signal in the EV direction is red, RSU will begin the process of switching the signal to green as soon as possible to facilitate EV moving through the intersection, while the process still has to follow a minimum green constraint to ensure safety. The process of the \(R_{mode}\) scenario is illustrated in Figure 10. Assume that the EV is on emergency duty and approach the intersection from the south direction. If the signal is in a red period, the RSU will activate the \(R_{mode}\) procedure after it determines it is the host RSU. The red period will be cut off and smoothly switched to green due to the EV owning the priority. The traffic signal control algorithm controls the signal and displays red and blinking yellow (instead of the red) in EV moving directions, and green and blinking yellow (instead of green) in cross directions. This signal scheme as well as the message shown in CMS are specially designed to inform all the vehicles and passengers from which direction the EV is coming and how to move for giving way.