Design and Simulation of a Fuzzy Controller for Automatic Train Driving Based on Multi-swarm Optimization

Design and Simulation of a Fuzzy Controller for Automatic Train Driving Based on Multi-swarm Optimization

Shaojun Wang 

Shandong Polytechnic, Jinan 250104, China

Corresponding Author Email:
15 March 2019
5 June 2019
31 August 2019
| Citation



The automatic train driving (ATD) can greatly improve the efficiency and safety of train operations in urban rail system. This paper mainly establishes a multi-objective optimization model and designs a fuzzy controller for the ATD. Firstly, the relevant parameters of train operations were analyzed, including, safety, punctuality, parking accuracy, passenger comfort and energy consumption. Then, a multi-swarm optimization algorithm was developed to optimize the train operation curve, coupling the particle swarm optimization (PSO) and the cuckoo search (CS) algorithm. Taking the optimized curve as the input, the author finalized the design of the fuzzy controller. The simulation results show that our method can effectively solve the multi-objective problem of the ATD in urban transit system.


automatic train driving (ATD), fuzzy control, multi-objective optimization, particle swarm optimization (PSO), cuckoo search (CS) algorithm

1. Introduction

The current urban transit systems generally operate at a high speed and a high density. This operation mode calls for advanced management and control systems. One of such systems is automatic train control (ATC), which integrates the technologies on control, rail traffic signal and communication into automated traffic command, control and management.

In urban transit systems, train operations are highly nonlinear, complex and uncertain. It is difficult to simulate train operations with traditional control methods, which cannot work effectively without high-accuracy mathematical models. Therefore, many scholars have attempted to develop a smart automatic control method for train operations in urban transit systems.

The first step to design such a method is to solve the automatic train driving (ATD) problem [1-3]. The ATD refers to the automatic start-up, acceleration, deceleration, cruise, parking and return of trains under the given schedule without driver intervention.

This paper firstly describes the ATD system, and reviews the existing ATD optimization algorithms. Then, the multi-objective optimization of the ATD was analyzed, and a novel smart control algorithm was developed for train operations in urban transit systems. After that, the author set up a multi-objective optimization model for the ATD and created a fuzzy controller. Finally, the control performance of our model and controller was verified through simulation experiments.

2. Literature Review

The ATC is the key to train operations in urban transit system. The ATC system can be breakdown into three subsystems: automatic train protection, the ATD and automatic train supervision. Among them, the ATD subsystem is the most important part of the ATC system.

Being a multi-objective optimization problem, the ATD can be solved by various algorithms, ranging from multi-objective particle swarm optimization (PSO) [4-6], predictive fuzzy control [7], multi-modal dynamic programming [8], the hybrid algorithm of the differential evolution (DE) and simulated annealing (SA) [9] to cellular automata algorithm [10].

In recent years, much progress has been made on the ATD. For example, Shen et al. [4] investigated passenger satisfaction in train operations of the urban rail system, established a calculation model for this factor, and optimized the multi-objective ATD problem with DE algorithm. Cao et al. [5] adjusted train operations between stations by fuzzy ATD control method.

To minimize travel time and energy consumption, Domínguez et al. [11] proposed a multi-objective PSO to optimize the velocity curve of the ATD, and found that the algorithm converged to the Pareto frontier solution under constraint conditions, which means the algorithm has diversity and convergence than Non-dominated Sorting Genetic Algorithm II (NSGA-II). Carvajal et al. [12] developed a fuzzy NSGA-II algorithm to analyze the relationship between travel time and energy consumption of trains, and obtained a novel train control strategy.

Kim et al. [13] optimized train operation curve with the DE algorithm, aiming to reduce the total energy consumption of trains within the constraint on travel time. Considering train load and line delay, Fernandez-Rodriguez et al. [14] adopted the PSO to minimize the travel time and energy consumption of the ATD, and successfully minimized the energy consumption without violating the line delay.

Based on genetic algorithm (GA) and fuzzy model, Sicre et al. [15] developed a train operation control strategy that greatly saves the energy of train operations. Tao and Han [16] improved the multi-objective GA to optimize the operation model of urban express trains, obtained the optimal train operation control curve with the minimal energy consumption, and produced multiple sub-optimal solutions.

Considering train operation modes, Huang et al. [17] derived the optimal control strategy for train operations that minimizes the energy consumption. Chen et al. [18] tracked train speed with predictive fuzzy proportional–integral–derivative (PID) controller, and designed an adaptive controller to improve the accuracy of train parking.

3. Construction of Multi-Objective Optimization Model

The stress pattern of a running train can be derived from the mechanical principles and the track parameters. Based on the stress pattern, the speed, travel distance, travel time and energy consumption of the train can be calculated, and used to design the train control strategy.

3.1 Train motion equation

Compared with the track length, the length of a train is so short as to be negligible. Here, each train is considered as a particle, and a single particle model is constructed to analyze the stress pattern of the train operation. The traction, braking force and resistance of the train were computed separately by the model.

According to Newton’s second law of motion, the differential equation of train particle motion [19] can be defined as:

$\frac { d v } { d t } = \varepsilon \cdot c$       (1)

$\frac { d s } { d t } = v$    (2)

where, $c$ is the unit resultant force of traction; $\varepsilon$ is the acceleration coefficient; $v$ is the speed; $s$ is the travel distance; $t$ is the travel time.

By the differential equation of train motion, the speed-distance curve of the train in the whole travel interval can be drawn, and the speed change of the train running can also be monitored.

3.2 Train dynamics model

The resultant force of the running train can be expressed as:

$m a = F - g ( v ) - w ( x , v )$   (3)

where, $m$ is the mass of the train; $a$ is the acceleration produced by the resultant force on the train; $F$ are the forces of the train; $g ( v )$ is the basic resistance formula of the train, which is a function of speed; $w ( x , v )$ is the additional resistance of train; $x$ is the location of track. The mass of the train can be computed by:

$m = m _ { 1 } + m _ { 2 }$       (4)

where, $m _ { 1 }$ is the mass of the train body; $m _ { 2 }$ is the mass of passengers.

The resultant force $F$ can be divided into traction $f _ { 1 }$ and braking force $f _ { 2 } .$ If the train is in traction state, $F > 0 ;$ if the train is idle, $F = 0 ;$ if the train is in braking state, $F < 0$ .

The greater the load of the train, the greater the braking force. The acceleration produced by the resultant force $a =$ $F / m ,$ indicating that $a$ will remain unchanged if $F$ and $m$ increase in the same proportion.

The braking force decreases once the train reaches a certain speed. This speed is determined by the maximum power of the train. From the power formula $\rho = F \cdot v$, it can be seen that the train power will not change after reaching the maximum, and the increase of speed v will cause F to decrease. Hence, the braking force will decline if the train speeds up under the maximum power. This situation should be considered in train control.

The running train mainly suffers from two external forces, namely, basic resistance g(v) and additional resistance w(x,v). The former is the result of multiple factors, such as the friction and impact between locomotive and rolling stock, between train surface and the air, and between wheels and the rail. During train operations, the generation of basic resistance is extremely complex, making it difficult to compute the basic resistance theoretically. Thus, this paper computes the basic resistance by empirical formula:

$g = a v ^ { 2 } + b v + c$     (5)

where, $v$ is the train speed; $a , b$ and $c$ are three constants, representing the coefficients of the basic resistance.

The additional resistance refers to the resistance induced by external operating conditions. This force is not affected by the type of locomotive and rolling stock. The main influencing factor of additional resistance is the track condition. The additional resistance of the entire train can be computed by:

$w = w _ { 1 } + w _ { 2 } + w _ { 3 }$

where, w1 is slope additional resistance; w2 is curve additional resistance; w3 is tunnel additional resistance.

3.3 ATD index model

The ATD also requires precise parking operation. The parking accuracy KC of the train can be defined as:

$K _ { C } = \left| S - S _ { a d } \right|$       (6)

where, S is the actual travel distance of the train between stations; Sad is the distance between adjacent stations.

According to the train motion equation, the travel time between stations can be calculated by:  

$T = \sum _ { i = 1 } ^ { N } T _ { i }$         (7)

where, i=1,2,…,N are the serial numbers of subintervals; Tis the travel time of each subinterval; T is the actual travel time between stations.

The punctuality of the train Kcan be defined as:

$K _ { t } = \left| T - T _ { \text {target} } \right|$      (8)

where, T is the actual travel time between stations; $T _ { \text {target} }$ is the target travel time between stations.

Passenger comfort is another key index of the ATD performance. The index value can be measured by the change rate of acceleration, which is affected by impact rate and travel time. Here, the passenger discomfort Kj is defined as:

$K _ { j } = \int \left| \frac { d a } { d t } \right| d t$         (9)

where, a is the acceleration of the running train; t is the travel time. The smaller the Kj value, the more comfortable the passengers feel.

3.4 Multi-swarm optimization of multi-objective ATD problem

During train operations, the ATC system optimizes the control strategy based on known information, and gets the optimal control force to keep the train along the optimal curve. In this paper, a multi-swarm optimization model is constructed for train operations, coupling the PSO and cuckoo search (CS) [20].

The PSO combines the merits of heuristic random search and several other intelligent algorithms [21]. Unlike many other intelligent algorithms, the PSO has no crossover, a simple computing process and a strong global search ability. In this algorithm, each particle retains its best-known position p_Best and the global best-known position g_Best, and continuously moves toward the global optimal position by exchanging information with other individuals and groups. The particle velocity and position are respectively updated by: 

$v _ { i } ^ { t + 1 } = \alpha v _ { i } ^ { t } + s _ { 1 } r _ { 1 } \left( p _ { - } B e s t - x _ { i } ^ { t } \right) + s _ { 2 } r _ { 2 } \left( g _ { - } B e s t - x _ { i } ^ { t } \right)$  (10)

$x _ { i } ^ { t + 1 } = x _ { i } ^ { t } + v _ { i } ^ { t + 1 }$    (11)

where, $v _ { i } ^ { t }$ and $v _ { i } ^ { t + 1 }$ are the velocities of the $i$ -th particle at time $t$ and $t + 1 ,$ respectively; $x _ { i } ^ { t }$ and $x _ { i } ^ { t + 1 }$ are the positions of the $\dot { t } =$ th particle at at time $t$ and $t + 1 ,$ respectively; $\alpha$ is the inertia weight; $s _ { 1 }$ is the self-learning factor; $s _ { 2 }$ is the group learning factor; $r _ { 1 }$ and $r _ { 2 }$ are two random numbers in $[ 0,1 ]$ .

The CS algorithm basically involves three operations: selection of the best nest, random local movement, and random selection in global flight. Firstly, the best nest (optimal solution) is preserved to control the search within the domain of local optimal solution. Next, the optimal solution is searched for by local random movement $x ^ { t + 1 } = x ^ { t } + \alpha \varepsilon _ { t }$. Finally, the step size is determined by Lévy flight [22], aiming to diversify the solutions in the search space. The position update formula of Lévy flight can be expressed as:

$x _ { i } ^ { t + 1 } = x _ { i } ^ { t } + \alpha \oplus L ( \tau )$    (12)

where, $x _ { i } ^ { t }$ and $x _ { i } ^ { t + 1 }$ are the positions of the $i$ -th bird's nest at time $t$ and $t + 1 ,$ respectively; $\alpha$ is the step size; $L ( \tau )$ is a random search vector subjected to a parameter of $\tau$.

Figure 1. Flow chart of the PSO-CS

The PSO and the CS each has its own strength. In the PSO, the particles can quickly converge to the global optimal position by comparing its current position with the best-known positions of itself and the swarm. In the CS, the optimal solution is always retained in the next generation, rather than be expelled from the population. In this paper, the two algorithms are integrated into a hybrid algorithm (PSO-CS), giving full play to their respective strength. In the hybrid algorithm, the particle positions are updated iteratively by the PSO, and then further optimized with a certain probability by the CS. The workflow of the PSO-CS is illustrated in Figure 1 below.

3.5 Optimization curve

The PSO and CS both have continuous search spaces, while the spaces between train stations are discrete. The working conditions of the train were considered as discrete values and coded (Table 1). The working condition with the highest traction acceleration was coded as 1, and that with the second highest traction acceleration was coded as 2. The rest can be deduced by analogy. Then, the working conditions form a solution space.

Table 1. The coded working conditions





3-stage traction acceleration



2-stage traction acceleration



1-stage traction acceleration



1-stage braking deceleration



2-stage braking deceleration



3-stage braking deceleration



4-stage braking deceleration


During train operations, the ATC must consider the various working conditions. Different control strategies should be implemented at different track positions, and the overall control effect should be achieved through the cooperation between different working conditions. Due to the difference in track conditions, the number of working conditions can be selected flexibly, and the particle size can be determined by number of working conditions. Then, the population can be initialized under the constraints on the working conditions, such that each particle also satisfy these conditions. Then, the feasible solution can be obtained through PSO-CS optimization.

Let $K _ { a } , K _ { p } , K _ { c }$ and $K _ { e }$ be the finesses of parking accuracy, punctuality, passenger comfort and energy consumption, respectively. Then, the multi-objective ATD problem can be expressed as:

$\min \left\{ K _ { a } , K _ { p } , K _ { c } , K _ { e } \right\}$     (13)

The above problem can be converted into single-objective optimization problem by weighted summation method:

$f = w _ { 1 } K _ { a } + w _ { 2 } K _ { p } + w _ { 3 } K _ { c } + w _ { 4 } K _ { e }$        (14)

$\sin \left\{ \begin{array} { c } { v ( 0 ) = v ( S ) = 0 } \\ { v ( s ) < v _ { \lim } ( s ) , s \in [ 0 , S ] } \end{array} \right.$      (15)

where, $w _ { 1 } , w _ { 2 } , w _ { 3 }$ and $w _ { 4 }$ are the weights of each fitness index; $v ( 0 )$ and $v ( S )$ are the initial and final train speeds, respectively; $v ( s )$ and $v _ { l i m } ( s )$ are actual and restricted train speeds at location s, respectively. In this way, the multi-objective ATD problem was converted into the search for the $\min \{ f \}$ under the constraints in formula (15).

The f value is negatively correlated with the control effect. In the PSO-CS, the reciprocal of the f value was taken as the fitness evaluation function:

$\mathrm { F } = 1 / f$    (16)

4. Design of Fuzzy Controller

Based on fuzzy set theory, fuzzy linguistic variables and fuzzy logic reasoning, the fuzzy control is an intelligent control method mimicking fuzzy human behaviors like reasoning and decision-making. In the fuzzy theory, the fuzzy rules of the fuzzy controller are known as fuzzy conditional statements. Thus, the fuzzy controller is essentially a linguistic controller. The block diagram of the fuzzy controller is shown in Figure 2.

Figure 2. The block diagram of fuzzy controller

Figure 3. The design of fuzzy controller

As shown in Figure 3, our fuzzy controller has two inputs and one output. The inputs and output were separately fuzzified and divided into 7 fuzzy sets. A total of 49 fuzzy rules were designed.

The fuzzy set is the result of fuzzy reasoning. The center of gravity method was adopted to transform the fuzzy result into an exact value. The transform formula is as follows:

$v _ { 0 } = \frac { \sum _ { k = 1 } ^ { n } v _ { k } u _ { v } \left( v _ { k } \right) } { \sum _ { k = 1 } ^ { n } u _ { v } \left( v _ { k } \right) }$      (17)

where, vk is the exact value of control output;  uk(vk) is the corresponding membership. The membership function is shown in Figure 4.

As shown in Figure 4, the seven fuzzy sets are Negative Big (NB), Negative Middle (NM), Negative Small (NS), Zero (ZO), Positive Small (PS), Positive Middle (PM), Positive Big (PB). More fuzzy sets mean more precise control effect, and more complex control rules.

To verify the effect of the fuzzy controller, the PSO-CS, the PSO and the CS were adopted to optimize the train operations. The optimization results of the three algorithms are listed in Table 2 below.

Figure 4. The membership functions

Table 2. Optimization results of the three algorithms

Number of iterations


Parking accuracy


Passenger comfort

Energy consumption

Total fitness













































































From Table 2, it can be seen that the PSO-CS and the PSO both converged to feasible solutions satisfying all constraints in the 100th iteration. The results demonstrate the convergence quality and speed of the PSO-CS. After 500 iterations, the PSO-CS achieved higher total fitness than the contrastive algorithms, indicating that our algorithm boasts the best effect of multi-objective global optimization and the optimal control effect.
5. Conclusions

This paper examines the functions of the ATC system and analyzes the indices of ATD optimization, namely, safety, punctuality, parking accuracy, passenger comfort and energy consumption. On this basis, the train operation curve was optimized by the multi-swarm optimization algorithm, coupling the PSO and the CS, and a fuzzy controller was designed to use the optimized operation curve as the input. The simulation results show that our method can effectively solve the multi-objective problem of the ATD in urban transit system, and outperform the traditional optimization algorithms like the PSO and the CS.


[1] Stead, A.L. (2013). Automatic train control. Electrical Engineering, 194(2): 133-163.

[2] Yang, X., Li, X., Ning, B., Tang, T. (2016). A survey on energy-efficient train operation for urban rail transit. IEEE Transactions on Intelligent Transportation Systems, 17(1): 2-13.

[3] Larue, G.S., Wullems, C. (2015). Driving simulator evaluation of the failure of an audio in-vehicle warning for railway level crossings. Urban Rail Transit, 1(3): 139-148.

[4] Shen, W., Xiao, W., Wang, X. (2016). Passenger satisfaction evaluation model for Urban rail transit: A structural equation modeling based on partial least squares. Transport Policy, 46: 20-31.

[5] Cao, Y., Ma, L., Zhang, Y. (2018). Application of fuzzy predictive control technology in automatic train operation. Cluster Computing, (1): 1-10.

[6] Masoomi, Z., Mesgari, S.M., Hamrah, M. (2013). Allocation of urban land uses by multi-objective particle swarm optimization algorithm. International Journal of Geographical Information Science Ijgis, 27(3): 542-566.

[7] Marusak, P.M. (2009). Advantages of an easy to design fuzzy predictive algorithm in control systems of nonlinear chemical reactors. Applied Soft Computing, 9(3): 1111-1125.

[8] Sun, G., Bin, S. (2017). Router-level internet topology evolution model based on multi-subnet composited complex network model. Journal of Internet Technology, 18(6): 1275-1283.

[9] Zeng, Y.R., Peng, L., Zhang, J., Wang, L. (2016). An effective hybrid differential evolution algorithm incorporating simulated annealing for joint replenishment and delivery problem with trade credit. International Journal of Computational Intelligence Systems, 9(6): 1001-1015.

[10] Jin, X.G., Kim, T.W. (2003). Classification of cellular automata and complexity. International Journal of Modern Physics B, 17(22): 4232-4237.

[11] Domínguez, M., Fernández-Cardador, A., Cucala, A.P., Gonsalves, T., Fernándeza, A. (2014). Multi objective particle swarm optimization algorithm for the design of efficient ATO speed profiles in metro lines. Engineering Applications of Artificial Intelligence, 29(3): 43-53.

[12] Carvajal, W., Cucala, A.P., Fernández, A. (2014). Optimal design of energy-efficient ATO CBTC driving for metro lines based on NSGA-II with fuzzy parameters. Engineering Applications of Artificial Intelligence, 36: 164-177.

[13] Kim, Y.G., Jeon, C.S., Kim, S.W., Park, T.W. (2013). Operating speed pattern optimization of railway vehicles with differential evolution algorithm. International Journal of Automotive Technology, 14(6): 903-911.

[14] Fernandez-Rodriguez, A., Fernandez-Cardador, A., Cucala, A.P., Domínguez, M., Gonsalves, T. (2015). Design of robust and energy-efficient ATO speed profiles of metropolitan lines considering train load variations and delays. IEEE Transactions on Intelligent Transportation Systems, 16(4): 2061-2071.

[15] Sicre, C., Cucala, A.P., Fernández-Cardador, A. (2014). Real time regulation of efficient driving of high speed trains based on a genetic algorithm and a fuzzy model of manual driving. Engineering Applications of Artificial Intelligence, 29: 79-92.

[16] Tao, Y., Han, W. (2015). Carrier airwake simulation methods based on improved multi-objective genetic algorithm. Journal of Beijing University of Aeronautics & Astronautics, 41(3): 443-448.

[17] Huang, X., Yao, Y., Lu, Q., Huang, X., Fang, Y. (2016). Control simulation of PMSM traction system of high speed train when passing neutral section. COMPEL International Journal of Computations and Mathematics in Electrical, 35(2): 782-795.

[18] Chen, D., Gao, C. (2012). Soft computing methods applied to train station parking in urban rail transit. Applied Soft Computing, 12(2): 759-767.

[19] Sun, G., Bin, S. (2018). A new opinion leaders detecting algorithm in multi-relationship online social networks. Multimedia Tools and Applications, 77(4): 4295-4307.

[20] Sun, G, Bin, S. (2018). Topic interaction model based on local community detection in MOOC discussion forums and its teaching application. Educational Sciences: Theory & Practice, 18(6): 2922-2931.

[21] Banks, A., Vincent, J., Anyakoha, C. (2018). A review of particle swarm optimization. Part I: background and development. Natural Computing, 6(4): 467-484.

[22] Li, X., Yin, M. (2015). Modified cuckoo search algorithm with self adaptive parameter method. Information Sciences, 298: 80-97.