Improving the Performance of Single-Intersection Urban Traffic Networks Based on a Model Predictive Controller

The use of a Model Predictive Controller (MPC) in an urban traffic network allows for controlling the infrastructure of a traffic network and errors in its operations. In this research, a novel, stable predictive controller for urban traffic is proposed and state-space dynamics are used to estimate the number of vehicles at an isolated intersection and the length of its queue. This is a novel control strategy based on the type of traffic light and on the duration of the green-light phase and aims to achieve an optimal balance at intersections. This balance should be adaptable to the unchanging behavior of time and to the randomness of traffic situations. The proposed method reduces traffic volumes and the number of crashes involving cars by controlling traffic on an urban road using model predictive control. A single intersection in Tehran, the capital city of Iran, was considered in our study to control traffic signal timing, and model predictive control was used to reduce traffic. A model of traffic systems was extracted at the intersection, and the state-space parameters of the intersection were designed using the model predictive controller to control traffic signals based on the length of the vehicle queue and on the number of inbound and outbound vehicles, which were used as inputs. This process demonstrates that this method is able to reduce traffic volumes at each leg of an intersection and to optimize flow in a road network compared to the fixed-time method.


Introduction
Due to population growth, economics, social and cultural changes, and immigration [1,2], communities are rapidly developing and changing. With this urbanization, the number of vehicles has increased, especially in large cities, and problems involving these vehicles have arisen. Although it is very costly to build new roads every year, traffic is still an ongoing problem and causes congestion, especially at rush hour. Traffic peaks wordwide have become some of the biggest problems in urban areas, increasing traffic flow and imposing high costs for society at various levels. The importance of traffic control has increased due to its close relationship with issues such as air pollution, fuel consumption, and security issues, and traffic control systems are being used worldwide to improve the impact of traffic flow [3][4][5]. According to Chedjou et al. [6], this problem has become serious in developing countries in Asia because the vehicle ownership ratio and freight traffic volume have increased.
In the work by Papageorgiou and Araghi et al. [7,8], traffic lights at intersections were considered one of the most effective means of controlling urban traffic. Traffic-reduction and better-optimized control methods can reduce travel times along a route and vehicle queues. Zhao et al. [9] suggested that traffic can be controlled using fixed-time and smart methods. According to the work by Zhao et al. [10], the time constant of an intersection control method was either local or coordinated and the implementation of their method was set as offline for some hours of the day for optimization. Different dynamical models in traffic control have also been discussed. Silva et al. [11] established a multi-objective signal-timing optimization model to optimize average vehicle delay, slow traffic delay, vehicle stopping times, and traffic capacity. The experimental results showed that the model optimized traffic by reducing vehicle delays, slow traffic delays, stopping times at an intersection, and increasing traffic capacity.
Ye et al. [12] presented a novel traffic device (Lan-Pro) that avoids vehicles stopping at junctions in low-traffic conditions. The results show that the proposal may ensure non-stop crossing of intersections when traffic volume is expected to be high, and their primary goal is to handle low-traffic conditions. Stochastic model predictive control for signal coordination and control of transactions in urban pedestrian networks was presented in the work by Shihuang et al. [13]. One important feature in stochastic model predictive control (MPC) is that uncertain traffic demands and stochastic disturbances are considered. This is a random value model with odds limits used in a random targeted performance. The purpose is to model uncertainties and to prevent queuing at traffic networks to minimize queue length and green-light duration fluctuations between the two control stages. Finally, a hybrid smart algorithm (neural networks in the genetic algorithm) was proposed to solve random model predictive control (MPC). Thus far, traffic control processes have been based on classic control methods, which use statistical methods. However, due to the complex traffic control structure, an adequate response cannot be obtained using these methods. For this reason, with the development of smart methods, including artificial intelligence, fuzzy logic, neural networks, multiprocessor systems, etc., they can help solve and improve urban management problems.
Zhao et al. [9] used a neural network with a training set. Brian et al. [14] used an intersectional neural network and intersection to create a smart agent varying the greenlight duration of each cycle based on the information presented to improve its accuracy. Fiore et al. [15] presented a genetic algorithm to optimize traffic signals for saturated conditions. Various optimization strategies were used to provide minimal delay and were evaluated to maximize power at various intersections. Lin et al. [16] presented a model for traffic queue using the average vehicle wait time. Push control is an optimal control method based on the theory of transverse horizons. Including smart control methods, a pre-control method was developed. In Li et al. [17], model predictive control was used to control and coordinate urban transport networks; optimization of the pre-control nonlinear model requires long computational times due to the nonlinearity of the problem of optimizing combined logical programming.
Following these developments, new dynamic multipurpose optimization systems for the predictive control of existing network signals have been designed and presented. Two network models have been proposed. A network signal prediction control algorithm has been developed for online multi-objective optimization. A Genetic Algorithm (GA) was used to solve the optimization problem in the work by Zhou et al. [18]. The authors of [19] focused on controlling the uncertainties associated with traffic flow rate, which can be successfully used to control urban traffic system signals.
Various traffic diversion studies have shown that controllers have been designed for a traffic light based on the length of the vehicle queue and on the number of input and output vehicles. In this paper, using a pre-control method, traffic-light control is achieved by considering the controller's inputs, the traffic queue length (number of vehicles), the number of input and output vehicles, and the output problem parameters. This controller has the potential to minimize the difference between the outputted values and future occurrences. Model predictive control improves traffic flow better than a fixed-time method. One of the advantages of this smart method is the reduction in queue length, which ultimately reduces traffic congestion. One of the most significant advantages of using this controller is the reduction in the effect of uncertainties in the system because traffic is complex. The remainder of this paper is as follows: Section 2 presents a brief explanation of related work. Section 3 details the dynamic model. Section 4 describes the data set applied in the proposed system. Section 5 details the controller design. Section 6 presents the simulation results, and finally, we conclude this paper in the Conclusion section.
The main contributions of this paper are as follow: • Obtaining a traffic model and state-space parameters to prove the stability of the system by applying the MPC model; • Designing the predictive controller to reduce the number of cars waiting at a red light; • Simulating the process and comparing it with other state-of-the-art methods; • Providing a comprehensive model for vehicle behavior in the urban traffic system for a two-phase intersection; and • Evaluating the average number of cars at an intersection when using the controller and when not using the controller. Table 1 presents a comparison of the existing work using predictive controllers. The model, the queue length, the sample time, and the limitations of the processes were considered.

Related Work
This section presents relevant work about urban traffic using model predictive control and other work on urban traffic control. Additionally, any background information beneficial to realizing our study aims are introduced.

Urban Traffic Control with Model Predictive Control
A model for traffic at an intersection was presented in the work by [25] based on a car-moving-speed schedule. This research's main goal was to minimize the number of cars waiting at an intersection. A model predictive control (MPC) prediction algorithm was applied for this process. Control swarm physics in traffic was considered the optimal input for road networks to assess movement in road networks [26]. A two-layer controller was applied to explore and design the route projected to improve the safety of the driver. The first layer created a dynamic model, and the second layer was designed based on model predictive control. The fuzzy adaptive PID was used to track the controller, which encountered vehicles. Wu et al. [27] offered a distributed threshold-based incident-operated control strategy to update traffic signals. One paper summarized the latest expansions, research orientations, and control traffic networks using MPC approximates to reduce traffic congestion [28]. Zuo et al. [29] offered model predictive-based route planning and route tracking for smart cars and applied the MPC scheme to reflect the cooperative control of local planning and path exploration for smart vehicles. In the work by Wang et al. [30], traffic control transmission based on model predictive control (MPC) was proposed for urban traffic and a new model predictive controller for optimal flows at urban intersections was designed. KeLu et al. [31] proposed a reduction in the general calculation complexity by adding a real transportation system to a new traffic light. This was the system of Optimal Urban Traffic Model Predictive Control (OUTMPC) for the National Electrical Manufacturing Association Standards (NEMAS) that offers large-scale urban traffic optimal slot control [32]. Yao et al. [33] used MPC to resolve disputes in an smart intersection traffic model. The main goal was to minimize vehicle wait times at the intersection. In El Hatri et al. [34], the main focus was traffic flows and a mathematical model for traffic lights at intersections was created using model predictive control. The system is nonlinear and describes interactions between input and output roads in networks using a neural network. Chaudhuri et al. [35] suggested an economic control strategy for vehicles in urban road situations with fast MPC-based control using a developed fuel economy and reduced time computations at red lights.

Urban Traffic Control Based on Fuzzy Controller and Multi-Agent Controller
This article is about inter-communication between urban street networks using a macroscopic fundamental diagram that affects traffic flow [36][37][38]. This process solves urban traffic incident detection using deep fuzzy learning. Fuzzy logic is used to control the learning parameters. Additionally, a higher tracing value is one of its advantages [39,40]. Xu et al. [41] used flow prediction machine learning in intelligent support vector regression for short-term traffic flow prediction. Time-change, phase optimization in traffic lights, and a fuzzy control method were presented to reduce the delay in vehicles and to improve traffic valency at an intersection in [42,43]. Xu et al. [44] presented a multi-agent to manage signal control using fuzzy logic to control conflicting traffic networks. That model's main goal was the simulation of urban traffic in the present and future [45] by considering the macro-micro and mesoscopic levels. A fuzzy controller on urban traffic control systems was also applied for adaptive strategies in Sao Paulo, Brazil. This process was optimized and regulated [46,47]. Fuzzy control can also be processed in a polling-based traffic signal control strategy. The core of this system is the efficient resolution of single-point intersection traffic signals. It offers a part of the time cycle based on data system and fuzzy control to adjust the signal timing in a multi-agent environment. The online agent system communicates between different agent's intersections to reduce the average travel delay and to improve the average vehicle speed. This process uses Artificial Intelligence (AI) and the Internet-of-Things (IoT) to control traffic lights to improve cities' road systems by multi-agent Q-learning.

Dynamic Intersection Model
As can be seen, the two signal phases that characterize the shape of a single intersection are shown in Figure 1. One quadratic mode was required for real-state equations of the model in a reak traffic network to control traffic.
In Equation (1), i = 1, 2, 3, . . . , n represents the legs at an intersection with four legs. The first is leg 1, the second is leg 2, the third is leg 3, and the fourth is leg 4. At this intersection, cars are the input and output. The greater the number of entrances and exits from one leg to another, the more traffic increases. According to Figure 1, the vehicles enter from A, from the leg in that direction, and exit from B, thus entering the third leg. In leg 2, the cars enter from C and exit from D, entering leg 4. At this intersection, the issue of queue length is an important parameter in traffic flow. Vehicles are inputs to a leg and outputs from another leg and increase the length of the vehicles' queue. As mentioned in this case, the length of the queue is one of the important parameters of the traffic flow, which indicates the state and traffic situation at an intersection and is represented as follows.
where i = 1, 2, 3, . . . , n is the index of legs at the intersection; n = 0, 1, 2, ..., N − 1 is the index of discrete time intervals; N is the horizon of the simulation; Q i (n) is the length of the queue consisting of the number of vehicles; q i (n) is the number of vehicles entering the queue as inputs; and d i (n) is the number of vehicles leaving the queue as outputs. Each intersection has a traffic light that indicates the status of the control signal at the intersection. Legs 1 and 3 have a connected traffic light, and legs 2 and 4 have a connected traffic light. s i ∈ [0, 1] indicates the status of the signal at an intersection. When s = 1, the traffic light is green and vehicles move; when s = 0, the light is red and vehicles are stopped. According to Figure 1, at the intersection, a signal status of s1, s2, s3, s4 = (0, 1, 0, 1) means that the traffic light is green in lanes 1 and 3 and red in lanes 2 and 4 and, as a result, vehicles can move in lanes 1 and 3 but are stopped in lanes 2 and 4. If T is considered the discretized time interval and is short enough, then the vehicle's arrival can be assumed uniform at every time interval, and as a result, the overall wait time of vehicles is calculated using Equation (2): where W i (n) is the average vehicle wait time of i queue from the beginning of the average period to the onset of n time interval. The wait time and the number of vehicles are popular performance indices for the signal controls defined in Equation (2). To facilitate its formulation, the state-space equations and the optimization objective can be rewritten in the matrix form as follows: where Various coefficient matrices and vectors were considered, which are as follows: C n = [q 1 (n)q 2 (n)...q M (n)1/2Tq 1 (n)1/2Tq 2 (n)...1/2Tq M (n)] T where are state variables and Q i (n) denotes the queue length and delays in vehicles.

Data
According to the Table 2, the data were divided into two main parts: components and the number of components. The data are described in summary below: • The data contain the queue length and traffic signal. • The data consist of four main parts in a signal intersection. In a simulation of the proposed model, each traffic light cycle's sampling time was 0.1 s. • The simulation was executed in under 100 s. This shows that the queue length was reduced by a fixed amount of time using controller design data. • This process was considered randomly at one of the intersections in Tehran, Iran.

Controller Design
Predictive control is a model-based controller affecting model accuracy significantly. It can apply constraints on both input and output signals and can control signal generation. It can also be easily used in multivariate systems. The general diagram of the predictive control is shown in Figure 2. The predictive control structure has a process model, cost function, and control law. The predictive control was derived from a set of control rules such as predicting the future output of a system over a specified period using the initial process model of computed control signals in the forecast horizon by minimizing a cost function and by applying the first control signal, then calculating it within the system, and repeating the whole process in the next steps. The main purpose is to predict the queue length decrease concerning future system inputs at each sampling time, optimizing the system's future behavior. In this controller, the inputs include the length of the queue of vehicles and the number of inbound and outbound vehicles per leg. The state-space equation is defined in Equation (3). T indicates an optional sampling time. Assume that the sampling time is sufficiently uniform when the vehicle arrives at any time interval and that the intersection has four legs. Each leg has three lines, the vehicles are independent in each line, and a normal distribution is used for generating inputs. The cost function is defined as follows: J = X T (n + 1)QX(n + 1)∆S T (n)W∆S(n) (12) and we suggest: (3), which satisfies the above assumptions. The control input in Equation (13) that minimizes the cost function in Equation (12) causes the vehicles in the queue of each leg to be constrained in all four directions.

Theorem 1. Consider the dynamic equation in Equation
Proof. Sustainability of this model is proven as follows: Equations (14) and (15) show the output-based prediction in a previous sample, according to which the forward state vectors of the future state are defined as follows: x(n i + 1|n i ) = Ax(n i ) + B∆S(n i ) + ∆C(n i ) = Ax(n i + 1|n i ) + B∆S(n i + 1|n i ) + C(n i + 1|n i ) = A 2 x(n i ) + AB∆S(n i ) + B∆S(n i + 1) + AC(n i ) + C(n i + 1) (16) Continue the equation to N P : Considering the predicted state vectors, the predicted output is expressed as follows: Continue the equation to N P : By combining Equations (14)- (17), we can show the output prediction vector as follows: The optimization based on Equation (15) is given by considering a four-way path: Additionally, by putting Equations (22) and (23) into Equation (24), we obtain the following: In Equation (24), ξ= [1 1 1 1 0 0 0 0] is considered and results in the following: In Equation (14), we obtain the following: Finally, by deriving the cost function of the control effort and by equalizing Equation (28), we have the following: The result is shown as follows in Equations (28) and (29).
From Equation (28), the optimal solution is obtained to compute the control effort.

Simulation Results
The simulation aims to reduce the queue length of vehicles at an intersection with two constant-time modes using a predictive model based on a steady-state intelligent controller and sampling time T = 0.1 s. Table 3 shows the different traffic positions with specified values of β. The following equation gives the number of vehicles departing from the line to the interval: d i (n) = min(Q i (n) + q i (n), d si (n)) (30) Additionally, the saturation flow rate over time interval T is as follows: The parameters d cons >= 50 and 0 <= β <= 1 can be randomly defined as q i , d i in Equation (26). The simulation results are compared to constant time control using the designed control.

Constant Time Control
In constant time control, the simulation results for the number of vehicles in the line without the use of the controller are such that the control variables represent the green and red timing of the traffic light in a four-way direction. In this case, red represents the traffic light at the first and third legs in Figure 3 while green represents the traffic light at the second and fourth legs in Figure 4.  The lengths of the vehicle queue at the first leg in Figure 5 and at the second leg in an intersection in Figure 6 are presented, indicating constant time control and improving the predictive controller.    In Figure 8, the volume of traffic generated in the fourth leg also increased over time.

Model-Based Predictive Smart Controller
In this section, the controller designed in Equation (10) was implemented in an intersection's dynamic system. As shown in Figures 9 and 10, the control variables represent when the traffic light is green or red by applying a model-based predictor controller at an intersection.  The length of the vehicle queue within the first stretch of an intersection is reduced when the controller is implemented compared to that for the case without the controller, as shown in Figure 10. The vehicle queue length at the second leg of the intersection in the case using the controller decreased significantly without considering constant time, as shown in Figure 11. The length of the vehicle queue at the third leg of the crossing shown in Figure 12 where the controller was applied was minimized and somewhat improved.  Figure 13 shows the length of the vehicle queue at the fourth leg of an intersection. The number of vehicles in the traffic queue is reduced to a minimum using the predictive controller; it decreased significantly compared to the non-controller mode. The length of the car queue at each leg was compared with the fixed-time control method at each of the four legs using the predictive controller and the number of vehicles in terms of sampling time per 0.1 s. In the first leg, the number of vehicles stationary in the four-way intersection was reduced to 3 using the controller. In the second leg, the number of vehicles was reduced from 21 to 1. Additionally, in the third leg, the number of vehicles using a steady-state model decreased from 70 to 7 using the predictive controller to improve the queue. The fourth leg of the intersection minimized the number of vehicles optimally, as seen in Figure 14. In Table 4, the results are shown with constant time control and the predictive controller.

Conclusions
In this paper, a model predictive controller was designed to generate and tune traffic light signals at an intersection and their stability was investigated. Among the advantages of the model proposed, model predictive control has the ability to compensate for lowtraffic times and it identifies reference paths for use in the future. The proposed model predictive controller was designed for an intersection based on two basic parameters that determine the length of a queue, and vehicle latency was considered. We studied the stability of the intersection using model predictive control, and the Hamiltonian equation was used to prove this stability. By applying a controller based on discrete-time state-space equations, the length of the vehicle queue was minimized compared to the fixed-time mode, and the volume created in each leg also obtained similar results. The proposed method had a better performance compared to the fixed-time controller in all lanes of the intersection. Moreover, the effectiveness of the proposed controller was proven via simulation results.