![](bg5.png)
the last ladder was produced at 08:56. As a result
no ladders were produced within the last 15 minutes
dropping the hourly production rate of ladders to zero.
3.3 Time Elapsed
The purpose of the time elapsed method is to keep
track of when the last time the sensor triggered and
display it as a live update every 5 seconds. The idea is
to be able to follow the sensor triggering pattern and
see how many seconds have elapsed since the sen-
sor was last triggered. This value is then compared
to the expected range of the patterns. The method
works as follows. First, the Dolle API gets the sen-
sor data from the master data source in a sliding win-
dow size of 900 seconds. Following this, the acquired
data is passed to the speed layer. The initial data for-
mat is JSON, which is then transformed into inter-
pretable variables, such as integers and real numbers.
Finally, calculations on the data are performed, only
considering timestamps where the port value is TRUE
and directly followed by a value of FALSE. Each
time the method is executed it calculates the differ-
ence between the last timestamp of TRUE to FALSE
transition and the current timestamp (time elapsed =
current time - last output time). For example, if the
value of port 103 was TRUE at 2020-02-24 14:14:01
and at 2020-02-24 14:14:04 it became FALSE, then,
if the method is executed at 2020-02-24 14:14:53 in
that case it will show time elapsed since last ladder
was produced = 2020-02-24 14:14:53 - 2020-02-24
14:14:01 = 52 seconds. In addition, the method resets
the time elapsed to zero if the machine turns off. This
ensures that the time elapsed value is displayed only
if the machine is running and expected active in the
production.
The following outlines the five main steps of the
time elapsed method:
1. Read the sensor data in the sliding window size of
900 seconds from the master data storage approx-
imately every 5 seconds;
2. Filter the data where the values are TRUE and
transitioning to FALSE;
3. Get the time stamp for the last transitioning event
for the specific port;
4. Calculate the time elapsed that is by subtracting
the last timestamp from the current timestamp;
5. GOTO step 1.
Furthermore, the tachometers in Fig. 8 demon-
strate the time elapsed. In Fig. 8(b), it can be seen that
the time elapsed for port 103 (rolling out ladder) is 52
seconds, whereas, the average rolling out time of this
Figure 8: Time elapsed.
ladder type is 40 seconds. An alert situation (in red) is
shown in Fig. 8(a). The tachometer shows an elapsed
time of 176 seconds. That means that there were no
ladders produced in the last 176 seconds. This indi-
cates a need for immediate action as could be caused
by a fault in the machine.
4 MACHINE LEARNING
This section introduces the real-time pattern detec-
tion machine learning model. To detect abnormal pat-
terns is an important feature of smart manufacturing.
For example, if the performance of the machine is di-
verging from the standard pattern then it could cause
an unwanted stop to the whole production system.
Hence, to achieve production efficiency it is vital to
detect errors/faults or abnormal patterns in real-time
in order to take early and appropriate actions to keep
the production running without unwanted stops. The
incoming real-time sensor data is compared to stan-
dard patterns by using machine leaning models and
an alert could be triggered when some abnormal event
is predicted to happen such as, the machine is going
to stop. Further, Fig. 9 describes the pattern detec-
tion machine learning algorithm in detail. As men-
tioned in Fig. 2, the speed layer and batch layer based
on Python Storm and MapReduce, respectively. The
serving layer consists of a SQL Server. The proposed
algorithm uses batch layer (MapReduce) to train the
model to detect abnormal patterns. The MapReduce
job runs at predefined intervals and updates the coef-
ficients of the pattern detection models in the serving
layer (SQL Server). Further, the speed layer reads
the incoming streaming data from the MongoDB and
detects abnormal patterns by applying the pattern de-
tection algorithm. The pattern detection algorithm dy-
namically uses the latest calculated model coefficients
obtained from the serving layer. In Fig. 9, the solid
arrows represent streaming data, while dashed arrows
represent batch data.
Several forecasting models are available, in this
paper Auto-regressive model (AR) is chosen. An AR
model is a widely used linear model that works on
stationary time series. AR models use the dependent
relationship between a value y and some number of
Real-time Visualization of Sensor Data in Smart Manufacturing using Lambda Architecture
219