The last years a lot of new “digitial terms” arised in the IT industry. Internet of Things, Machine Learning and Cloud Computing are some of them. This technologies are not completely new. Machine to Machine Communication, Neuronal networks or applications which are hosted outside a company exists since decades.
What seems to be changed in the recent years is that this technologies can be used without deep technical knowledge.
How easy is it really to bring your IoT device into the cloud?
Can Machine Learing replace self-coded algorithms to monitor machine behaviour?
To get an answer to this questions is the motivation for this blog where I describe how to build a simple running application cointaining the above mentioned technologies with things everybody has at home, thus you need no production plant to try out the same I did.
A main focus was to get a running example with the minimum necessary effort, but also fulfill some practical use case.
-> In short: To create the minimum viable product for monitoring a machine with the SAP Cloud platform 😉
2. System overview
I realised the sample application with the trial account of the Cloud platform. I activated two services – Predictive Services and Internet of Things and as common datastore the HANA MDC (<trial>) database.
As sensor I used an Android phone with a simple self-created Android app to send the data. The rest of the application architecture resides in the cloud as you can see in the following picture.
(images from: https://www.sap.com/germany/developer)
The target is to monitor a production machine and identify machine failures by detecting “uncommon movements”. To identifiy this uncommon movements nowadays normally specific algorithms with a lot of design and implemention effort are used.
But as most of production machines repeat the same movements continuously wouldn’t it be easier to compare the actual movements to movements in the past. -> A perfect task for machine learning.
The sensor data in this example was received by fixing the mobile phone onto the turning part of a drilling machine nearly everybody has at home for small tasks like fixing pictures on the wall.
As each smart phone has an integrated accelerator sensor which delivers constantly the acceleration values for the x-value, y-value and z-value, I have the perfect sensor to track the turnings of the drilling machine and create the base data to detect unusual movements.
There is a plenty amount of other sensors for temperature orientation, light or proximity in relative to the view screen. But for the beginning I kept it simple and used only the accelerator sensor.
The sensor and configuration of the Internet of Things service
As mentioned above I used my Android phone as sensor. This is not the perfect sensor but it is one sensor everybody has at home.
The description of the necessary Android App and the necessary configuration of the Internet of Things service is described in the following document: Monitoring a production machine with SAP Cloud Platform, IoT service.
Setup of the HANA database
There are no special tasks needed while setting up the HANA MDC database. The only things to consider is to link the data source bindings of the two generated java applications (aac4paservices and iotmms) of the Internet of Things service and the Predictive services to this database.
Configuration of the predictive services
Within the predictive services there is a perfect service the Outliers API for detecting unregular machine movements. This service returns all datapoints which do not correlate to the others. So if for example you have 10 minutes regular datapoints (values for x-, y- and z-Acceleration and then you get an datapoint which does not correlate to the previous datapoints, the system returns an outlier and the user can be alerted. Details how to call the Outlier API can be found in the following document.
Monitoring a production machine with SAP Cloud Platform, predictive services
Visualisation and failure alert
For the visualisation of the data I wrote a simple SAP UI5 APP in the Cloud Platform. Well, I did not write it entirely on my own. There is already a very good blog which helped me a lot as starting point when visualising IoT data in the Cloud platform: Visualising iPhone sensor data with SapUI5.
Here in a sample testrun with my Android phone fixed on a drilling machine got me the following result. At approximately the timepoint 54000 I gave the drilling machine a kick. The outlier service gave me as first outlier result moreless this timepoint back – thus it detected perfectly the unregular machine movement.
I am really surprised how fast you get the SAP Cloud Platform, predictive services running and how intuitive the handling of the different API functions is. The setup of the Internet of Things services took me more time, especially because you have to delete and add a device if you change an already assigned message – and this means you have to adapt the connection data on your sensor.
The outlier service gives really good results if the sensor data trend is smoove and/or of course if the outliers have a significant distinction to the common trend.
The best results I got with sensor data correlating to a sinus function which you get for example from a turning machine part. With another machine that has a lot of noise in the sensor data I did not get satisfactory results but to be honest it would also not be easy to write an fault detection algorithm for this machine.
A major topic I excluded in this sample is security which would be the next step to a productive version. But due to the fact that except of the sensor everything else is in the Cloud security should be only a topic for the sensor to cloud connection.
My key take away of playing around with the Cloud Platform is that a solution of monitoring a production machine in the cloud could be an viable option for some special use cases.
If I am thinking about a production machine which should be maintained inside a production plant I think an on-premise solution is the better choice.
But when I am thinking about machines or sensors which are distributed over different locations, moving around, eg. inside cars or machines you do not want to integrate into your companys private network I think a cloud approach like the above shown could be the better choice.