*Article* **Testing the Smooth Driving of a Train Using a Neural Network**

#### **Emilia Koper \* and Andrzej Kochan \***

Faculty of Transport, Warsaw University of Technology, 00662 Warsaw, Poland **\*** Correspondence: emilia.koper@pw.edu.pl (E.K.); andrzej.kochan@pw.edu.pl (A.K.)

Received: 29 January 2020; Accepted: 1 June 2020; Published: 5 June 2020

**Abstract:** This article deals with the extraction of a new original parameter to characterize a railway traffic driving smoothness indicator, and its investigation is based on data obtained from a neural train emulator. This indicator of driving smoothness is an example of the sustainable value of control command and signaling technology. The pro-social and pro-environmental aspects of smooth driving are indicated and the article proposes the introduction of a new indicator for assessing the quality of rail traffic, taking into account traffic on a micro scale—the driving smoothness of a single train (also called driving flow), derived from a parameter identified in the literature—and traffic smoothness (also called traffic flow), describing traffic quality on a macro scale. At the same time, the concept of a neural train emulator is presented, providing input data to determine the value of the proposed indicator for different train models and track systems in order to test the indicator's properties. The concept proposes the structure of an artificial neural network, the technique of obtaining test data sets and the conditions of training the network as well. An emulator based on the neural network enables the simulation of train driving, taking into account its nonlinearity and data acquisition for indicator research.

**Keywords:** driving smoothness; train neural emulator; neural networks

#### **1. Introduction**

Rail traffic is routed traffic, directed on the basis of a previously prepared plan in the form of a timetable and a traffic diagram. The proper functioning of railway traffic, due to its nature, depends on many technical, economic and operational factors.

The need to improve the quality of transport services, resulting from the growing needs of passengers, who are increasingly interested in rail transport services and increasing passenger comfort, is also important. In addition, increasing importance is now being attached to ensuring so-called sustainability. A document encouraging such an approach is, for example, the Public Transport Act [1].

The sustainable development of public transport describes a process of transport evolution that takes into account the social expectations of ensuring the universal availability of public transport services, aimed at promoting different, more environmentally friendly means of transport equipped with modern technical solutions.

Rail traffic should also be operated with the degree of safety required by the users of the rail transport system and should be adapted to social and economic needs. To this end, modern command control and signaling systems are being set up with new expectations, also taking into account the so-called sustainable value. Some examples include the use of ecological solutions, materials, modern vehicles and infrastructure elements, increasing passenger comfort, improving the overall quality of provided services and not interfering with the environment (or interfering to a minimal extent). In turn, sustainable value combines the economic, environmental and social dimensions of sustainable development. Sustainable value integrates the environmental and social dimension into financial

analysis and investment decisions. Sustainable value combines scientific research and applications in the real world [2].

This is also connected with the trend in the development of systems that perform Automatic Train Operation (ATO), which, according to [3], is part of the Automatic Train Control (ATC) system. A key function of the ATO system is to control the train speed in such a way that it minimizes energy consumption and ensures passenger comfort [4].

The analyses conducted so far have focused on the study of the impact of traffic parameters such as line capacity, sequence time, blocking time, capacity use rate, or traffic smoothness in a given area.

The authors of the article propose to introduce a new parameter describing traffic quality—driving smoothness—considering that the quality is treated as a collective property, no-unit value, which is difficult to measure, but quantifiable as the resultant intensity of the most important factors influencing it. The parameter proposed by the authors is the driving smoothness of a rail vehicle, which fits into the idea of a sustainable value. This parameter can be used to analyze the above mentioned energy efficiency and ATO function, but these are not the subject of this article.

The testing of the driving smoothness indicator will be carried out with the use of data sets obtained during train driving simulation, realized under different conditions. Data recording requires, to a great extent, the use of train running simulators, due to the need to record data for very different running scenarios. For the reliability of the tests carried out, it is important to accurately reflect the real dynamic character of the object, which is a train. For this reason, a neural train emulator is used in the tests. The emulator reflects the dynamic and non-linear properties of a real train using an artificial neural network (ann).

Artificial neural networks (ann) are mathematical structures with an established position in the field of artificial intelligence techniques. They can solve different tasks. Depending on the type of task, to solve a problem, a properly structured network and way of learning is selected [5,6]. A train behavior representation task belongs to a class of tasks consisting of the prediction of successive values in a sequence determined by points in time. Such tasks are solved by recursive networks. An interesting proposition are recurrent long short-term memory (LSTM) networks. This type of network or, more precisely, its implementation in a MATLAB environment will be used in the described research.

#### **2. State of the Art**

#### *2.1. Tra*ffi*c Smoothness and Driving Smoothness*

The term traffic smoothness, from which the concept of the smoothness of driving originates, is used in railway, road transport [7] and air transport [8,9]. Examples of publications dealing with the issue of railway traffic flow can be found in [10–12].

In [10], the authors state that "a good traffic is a smooth traffic". "Smooth traffic is the organisation of train movement on a railway line or station in such a way as to mitigate primary and secondary disturbances resulting from the deviation of train driving time from the planned values caused by unforeseen operational events or traffic situations" [10].

The measure of traffic smoothness is the probability that train paths do not need to be adjusted as a result of primary disruption. Smooth traffic is traffic without disturbances, i.e., without a loss of time, resulting from the mutual interaction of individual traffic units. The concept of disturbance is understood as a deviation in the traffic execution from the timetable. Traffic regulation means the removal of traffic collisions or the time losses of a unit caused by the removal of collisions.

Traffic smoothness is not a direct measure of the perception of traffic conditions from the passengers' point of view (e.g., travel comfort, punctuality, etc.). Nevertheless, secondary disturbances arising in real traffic, such as delays and their consequences, experienced by passengers and resulting from insufficient traffic smoothness affect the perception of rail transport and shape the transport preferences of residents [13]. In this context, the concept of traffic smoothness is of a pro-social nature and influences the positive feelings of rail transport participants.

The concept of traffic smoothness refers to the simultaneous driving of multiple vehicles and is indicated in the article to introduce the concept of driving smoothness. As proposed by the authors, the concept of smooth driving refers to the driving of a single vehicle.

In the analyzed bibliographical sources, the existence of the concept of driving smoothness in relation to rail transport has not been identified. The proposal presented in this article aims to complement the existing parameters with an indicator describing the quality of rail vehicle driving.

Table 1 presents the essential features of transport services, both qualitative and quantitative. The characteristics are classified according to the following criteria: distance-related, time-related, object-related. It is worth noting that, among these characteristics, there are those related to the idea of sustainable value. These include, first of all, passenger comfort—understood as minimizing unnecessary acceleration and braking (strongly related to smoothness of driving)—in a prosocial sense and, at the same time, due to the reduction in the energy consumption in a pro-environmental sense, and pro-environmental aspects such as the minimization of vibrations related to the passage of rolling stock (in a prosocial sense) or noise reduction. It should be kept in mind that, today, the factors influencing passenger satisfaction in public transport are becoming increasingly complex [4].


**Table 1.** Essential features of transport services (own elaboration based on: [13,14]).

Table 2 presents a ranking of measures of transport service quality, which translate into passenger satisfaction. Driving smoothness is related to the following quality features: punctuality, comfort, speed and travel time. Moreover, the driving smoothness is also related to such features as capacity and reliability. Furthermore, comfort, speed and travel time are linked to social and environmental policies.

**Table 2.** Importance (ranking) of quality measures (own elaboration based on: [13]).


Ensuring passenger comfort is directly linked to the quality of service in transport. As indicated in railway standards (e.g., [15]), the comfort of train passengers is influenced by, among other factors, vibrations and vehicle movement style, taking into account, among other factors, the average change in acceleration and deceleration, which can be used to assess the comfort of driving during the train's operation. The above features are in line with the concept of sustainable value.

In modern systems, often emphasizing optimization and pro-environmental aspects, the driving profile is determined and implemented automatically [16–21]. It is worth noting that there are many studies on the subject of energy consumption optimization, in which it is possible to use the driving smoothness indicator. Examples of publications on this subject include [21,22].

According to [23], "the efficiency of vehicle movement is related to the capacity of the railway line that allows trains to run smoothly, i.e., without unplanned stops or speed restrictions". The abovementioned aspects (energy consumption optimization, ATO) are reflected in the modeling of smooth driving, but they are not the subject of this article; therefore, in subsequent sections, the authors will not refer to them.

#### *2.2. Train Driving Model*

Passenger comfort during the journey and thus issues of traffic smoothness are highlighted when speed changes occur. One of the basic operational scenarios implemented by passenger trains is driving between two stopping points, e.g., stations [24]. The algorithm of such a scenario consists of the following steps:


Practical examples of driving according to the above algorithm are those specific to suburban and metro traffic, where the distance between stops is small (1–2 km) The model of train movement for a similar scenario has been analyzed in [24–26].

Moving the vehicle between stops according to a fixed timetable (basic ATO functions) is best carried out by the following traffic model, with a steady speed phase. The driving style in this phase is most consistent with the idea of maximizing the value of the driving smoothness indicator. This model shows the optimal train speed profile from an indicator point of view. Its individual stages are well characterized by the traction force (μf) and braking force (μb) [26]. The stages to be distinguished are:


Figure 1 presents the optimal vehicle speed profile.

**Figure 1.** Optimal vehicle speed profile (source: [26]).

Based on the optimal speed profile, the transition points between the individual stages were determined, i.e., Speed Threshold (ST), Cruising Threshold (CT) and Full Brake Threshold (FBT) and we developed an algorithm for these driving stages.

The authors of [24] present on the common graph of speed as a function of distance, curves (driving profile) showing train driving parameters depending on strategy and goals to be achieved, i.e., the minimization of driving time, maximizing passenger comfort, and balanced driving, allowing for the simultaneous minimization of driving time and maximizing passenger comfort. The last of the objectives presented is, of course, a compromise, leading to the minimisation of the two criteria to a sufficiently limited extent. The last approach is in line with the criterion discussed in this article, namely the smooth driving of an individual train and, indirectly, the smooth traffic of trains.

The movement model consists of two or more phases. The occurrence of individual phases is influenced by the length of the section between the stations and the time of travel, which is set in the timetable. There are three possible driving variants (Figure 2):


**Figure 2.** Train speed (V) as a function of the distance (s) for suburban traffic/metro. Stages: 1—start-up–coasting to stop, 2—start-up–coasting–braking, 3—start-up–braking (source: [24]).

In the case of a run consisting of two phases: starting (continuous line) and driving at momentum to stop (dotted line), the energy consumption will be minimal (jmin), while passenger comfort will the highest, but the run time will be the longest (tmax). In the case of a forced drive, i.e., driving with a direct transition from start to stop (dashed line), the travel time will be the shortest (tmin), but the energy consumption will be maximal (jmax), and the passenger comfort will be the lowest. The criterion of smooth driving requires the minimization of significant speed changes.

It shall be possible to simulate the presented train driving strategies in order to test the smooth driving characteristics. Such simulations will be possible by using the train emulator proposed later in the study.

#### *2.3. Neural Train Emulator*

The testing of the indicator requires data sets describing the dynamic profile of train driving under different conditions, as shaped by [27–29]:


The assessment of the indicator for the different profiles described above will require the actual mapping of the train's behavior over a specific section of the rail network for different driving techniques. In other words, to carry out the tests, it is necessary to acquire the actual driving speed profiles obtained using the train modeling simulator, the value of which are train speed (V), a parameter input value of the traction (drive) adjuster and brake adjuster, and track infrastructure parameters.

In the literature, there are examples of issues that require the accurate mapping of train behavior, where it is considered in a non-linear model [30,31] This is also the assumption made in the work on driving smoothness indicators. A non-linear train model realized as an ann was successfully used by the authors of [31–33]. Based on these examples, the authors of this article propose to simulate train movements using a non-linear predictive control model. Such a network will be referred to as a neural controller.

The use of ann in automation is attractive due to the following features:


Their use in the issues of modeling and the identification of objects (e.g., a train) results primarily from the possibility of approximating any non-linearities [32] and tuning the model on the basis of experimental data or other learning images.

The proposed approach to building a neural emulator is the use of long short-term memory (LSTM) networks. LSTMs are a type of recursive networks, which are suitable for solving sequence to consequence problems, to which the task of the neural emulator belongs. This task is to process the sequence of movement and setpoint values for a train into movement values at successive moments in time. The LSTM-type network was first described by Hochreiter and Schmidhuber [34] in 1997.

This concept, with various modifications, has been used in many successful commercial solutions. For example, in recent years, LSTM has been used as a basic component in new products by the largest technology companies, including Google, Apple and Microsoft [35].

LSTM networks have been made available in various computing environments. One such example is MATLAB. MATLAB software provides a tool called "Deep Learning Toolbox", where one can find many modules to support the creation of ann, which can be used to determine the value of the sequence for series moments in time. Work on such a network can start with a LSTM architecture configured for regression, consisting of four layers:


Assuming the available default parameter values, the minimum set of parameters that need to be specified comes down to:


The first two parameters are fully application dependent. For the number of hidden units in the LSTM layer, the value depends on the nature of the value set. Figure 3 shows the structure of the LSTM layer, where xt means the input sequence, ct the cell state and ht the hidden state. The parameters ct and ht describe the output.

**Figure 3.** Long short-term memory (LSTM) layer structure of ann architecture in MATLAB environment (source: [36]).

The LSTM layer is made up of LSTM blocks, the structure of which is shown in Figure 4, where f is the reset gate, g is the gate that adds information to the cell's state, and g is the gate that controls the updating of the cell's state and o is the gate that controls the state added to the hidden state.

**Figure 4.** LSTM block structure (source: [36]).

On the configured LSTM architecture, learning is carried out using a series of parameter values, which are the extortion and the desired network responses for particular moments in time. For the described network, the appropriate optimization algorithm is ADAM [37]. The learning algorithm can be configured using parameters such as mini-bath options, validation options, optimization options, sequence options. Learning is performed with a built-in function with the following parameters: sequences, an object representing the configured network and learning parameters. During the learning process, it is possible to follow the progress by observing the graph of the average square error for the network being trained.

Considering that using an LSTM-type network can achieve good results in modeling the dynamic properties of non-linear objects, such a network architecture has been adopted in this study. This network will be referred to as the neural train emulator.

#### **3. Research**

#### *3.1. Smooth Driving*

So far, studies (referred to in Section 3.1) have considered the simultaneous movement of many trains in the area, with movement considered on a macro scale. When using such an approach, traffic smoothness reflecting traffic phenomena on a macro scale is a balanced value. The parameter ignored so far is the "driving smoothness" of a vehicle, relating to the movement (driving) of a single vehicle in an area—on a micro scale.

For the purposes of this article, it is proposed to adopt the following proprietary definition of driving smoothness. Driving smoothness is a measure characterizing the quality of driving of a railway vehicle in a way that eliminates disturbances. Disturbances are understood as the unnecessary braking (energy loss) of a train and the unnecessary acceleration (energy loss) of a train.

By analyzing the definition, it can be seen that the aim of ensuring smooth driving is also to provide energy efficiency, associated with a reduction in unnecessary acceleration and braking, resulting in minimizing the energy consumption and, consequently, reducing the costs resulting from the energy consumption of rail vehicles.

For the purpose of the research on driving smoothness, a driving smoothness indicator has been developed, which is a no-unit value measure of driving quality, describing the variability of the acceleration/deceleration value over a specific distance of road. The mathematical notation corresponds to the measure of the data set diversity used in the statistics. However, the very concept and application of this correlation to determine the smoothness of driving is innovative.

$$k = \frac{\sigma}{|u|}\tag{1}$$

where *k*—driving smoothness indicator, σ—standard deviation of acceleration, μ—average acceleration/deceleration.

$$
\sigma = \sqrt{\frac{\sum\_{i=1}^{n} \left(X\_i - \mu\right)^2}{N}} \tag{2}
$$

where σ—standard deviation, *Xi* —the value of a random variable in the population, μ—arithmetic mean of the population, *N*—number of elements in the population.

An ideally smooth driving experience is achieved when the vehicle is in straight-line uniform motion (the acceleration (or deceleration) is zero and change in acceleration (or deceleration) is zero), corresponding to the second phase of driving (described in Section 2.2 of this article), and this case is excluded from consideration. Moreover, at the current stage of the indicator formulation, the authors do not deal with other cases where the average acceleration/deceleration value is zero. The greater the variation in acceleration, the less smooth the driving is (and the lower the value of indicator *k*).

In addition, a higher value of the smooth driving indicator means greater economic and environmental benefits (lower energy consumption, reduced noise emissions, reduced vibrations) and social benefits resulting from increased passenger comfort (less vibro-acoustic impact, better perception of rail transport).

#### *3.2. Model of the Train*

The preparation of the neural network structure requires an analysis of the simulation conditions and the preparation of an appropriate train model and its environment. At this stage, the results of the authors' research dedicated to the analysis of the movement authority model [27] and simulation of braking curves in the ERTMS/ETCS system [28] will be used. In this approach, the train is described by static and dynamic parameters. The static parameters include:

*Sustainability* **2020**, *12*, 4622


Among the dynamic parameters of the train, the following are distinguished:


#### *3.3. Infrastructure Model*

The model of the trackside infrastructure on which the train runs well reflects the detailed model of the authorisation to run, as detailed in [27]. Movement authority *zj* is called tuple:

$$zj = (O, ok, pk, do, pm) \tag{3}$$

where *zj*—movement authority, *O*—set of sections of a movement authority without the end section, *ok*—end section of movement authority, *pk*—end of movement authority, *do*—overlap of movement authority, *pn*—danger point.

The driving path for a driving permit in the form of a set of sections is described as follows:

$$O = \{o\_1, \dots, o\_n\} \tag{4}$$

where *O*—set of road sections *zj* with exclusion of the end section, *n*—number of sections other than the end section, *n*—an integer greater than or equal to zero.

The section *oi* is described by the following tuple:

$$
\rho\_i = (d\_\prime l\_\prime v\_{\max}, tw) \tag{5}
$$

where *oi*—*i*-th section *zj*, *d*—mileage of the beginning of *oi*, *l*—length of *oi*, *vmax*—maximum speed on *oi*, *tw*—time-out for *oi*.

#### *3.4. Artificial Neural Network of Train Emulator*

The dynamics of the train driving process shall be seen as changes in train speed due to changes in the position of the traction and braking adjuster and other factors in the process environment. This relationship is not linear because the speed does not change proportionally with the position of the adjuster. This relationship is influenced by different resistance forces acting on the train and counteracting forces of the traction unit [38]. This phenomenon (the presence of non-linearity) indicates

neural networks as a suitable method for obtaining an accurate representation of the dynamic properties of a train.

Additionally, taking into account the purpose of using the emulator, it was reasonable to choose LSTM architecture as a base for its implementation. The computing environment is that of MATLAB. By using it, the architecture parameterization and learning process of the emulator was carried out. Simulations were also carried out in this environment, as a result of which data were obtained for the purpose of testing the indicator.

The design of the emulator required the following parameters:


The input parameters of the created network will consist of quantities describing the process state. In a natural way, train driving will be described mainly by speed-related values. On the basis of the previously described models, the minimum set of such values is formed by the following parameters:


The above list may be extended with parameters that may affect the acceleration and braking performance. A parameter which varies during driving is the gradient of the track. The values of this parameter are related to specific locations on the track system. In the dynamic model of train driving, they will depend on the current position of the train.

During the learning process, the input parameters will be given for the subsequent ti moments. The train's neural emulator, as an output value, will return the train speed value for a given moment ti+1. On the basis of a trend analysis of the individual parameters, it was assumed that data sequences would consist of samples for moments in time distant from each other by Δt = 1 s. As a result of the above considerations, the following parameters were adopted for the emulator:


#### *3.5. Learning Process*

As mentioned earlier, the learning of the neural emulator was realized in the MATLAB environment. The learning process will take place under supervision (with a teacher). The learning data was derived from ERSA's Traffic Simulator tool. For each version of the emulator, the data was taken from a single train run—from start to stop. For the learning process, rides were duplicated three times by sequential pasting. The resulting set was divided into two parts. The first one constituted 95% of the data and contained the data presented at the input of the network during learning.

The rest of the data (5%) were used as test data and were used to verify the quality of the emulator response. The data from the first part were used to prepare input sequences and response sequences. Input sequences contained samples from 1 to N-1 and sample hint sequences from 2 to N, where N is the sample count in the first part of the data. All sequences were normalized before teaching. The learning time was less than 1 min. After the end of the learning process, the verification was carried out, which was successful.

#### **4. Test Results**

#### *4.1. Simulation of Train Driving Using a Neural Emulator*

The simulation of an individual ride was carried out according to the scenario presented in Section 2.2. The train was driving between two stable points, taking into account the actual track system parameters.

The testing of the smoothness driving indicator requires data sets for train driving according to a planned strategy. Therefore, for the purpose of testing, the following strategies were planned:


In addition, runs were carried out on different track systems, where their diversity was defined by different gradients:


Another factor taken into account was the static speed profile, defining the infrastructure constraints:


Another issue that influenced the number of simulations and the scope of the research was the modeling of different trains. Their diversity was due to the different rolling stock forming the trainsets. A separate version of the emulator was prepared for each infrastructure configuration and train composition.

#### *4.2. Driving Smoothness Indicator*

Figure 5 shows an example of a train movement diagram illustrating acceleration as a function of the distance, based on simulated data, described in Section 4.1. This data allows for the study of the smooth driving indicator for different driving variants.

**Figure 5.** Train movement diagram (source: own elaboration).

For the ride in question, the indicator of driving smoothness was determined for the individual driving stages. For this purpose, the route was divided into four parts (I–IV) and, for each of them, the value of the k indicator was determined.

Table 3 presents the data necessary to determine the driving smoothness indicator for the ride in question—obtained as a result of a simulation with the use of the neural train emulator—the values of the k indicator for individual sections, and the ranking of solutions.


**Table 3.** Driving smoothness indicator k for sections I–IV (source: own elaboration).

The highest value for the indicator, determined in accordance with the relation described in Section 3.1, was achieved for part III—corresponding to the uniform ride described in Section 3.2 of the article—and for part II, corresponding to the uniform drive with disturbances. The worst (lowest) ratio values were obtained for parts I and IV, which correspond to starting and braking. The obtained results (trend) are in line with our prediction.

#### **5. Conclusions**

The article describes a new, original indicator for the assessment of the quality of rail traffic driving smoothness and emphasizes the pro-environmental and pro-social characteristics of rail transport. The parameter discussed in the article is a sustainable value.

An important element of the study of driving smoothness is the preparation of data sets by simulating train driving. The article indicates the possibility of using artificial neural networks to model the non-linear nature of a train. The structure of the neural network in this study, allowing us to model the dynamic properties of a moving train, is presented. For the simulation process, a basic test scenario and different train environment conditions allowed us to prepare the different data sets necessary for a multi-aspect analysis of the studied indicator.

As a result of the simulation, we obtained charts and data illustrating the train's passage. These data, relevant from the point of view of the subject matter of the article, concern speed/acceleration as a function of time or distance, and are the input data for determining the driving smoothness indicator. The article presents, as an example, the way in which the indicator is determined and the obtained values of data from the train's neural emulator.

**Author Contributions:** Writing—original draft E.K., A.K. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
