How to build Digital Twin using Eclipse Ditto?
Digital Twins technology brings the exact replica in digital format of a process, a product, or a service. Basically, it takes real-world data about a physical object or system as inputs and produces outputs in the form of predictions or simulations of how that physical object or system will be affected by those inputs.
Some of the most common use cases across the industry are given below:
- Visualization of products in use, by real users, in real-time
- Troubleshooting far away equipment
- Managing complexities and linkage within systems-of-systems
- Connecting disparate systems and promoting traceability
- What makes up Digital Twins?
- How to build Digital Twin?
- Step #1. Definition of Twin model – Things and Features
- Step #2. Use the Ditto client SDK to pull the sensor values and publish them to eclipse ditto.
- Step#3. Use prebuilt Ditto APIs to Retrieve & Modify the state of the Thing/Feature/Attribute.
- Step #4. Build ML model based on Digital Twin to predict failure.
- Looking forward
- Additional Resources :
What makes up Digital Twins?
Sensors are the heart of any measurement, control, and diagnostic device. Device telemetry is collected using the smart sensors available on the hardware/software environment and then used to create the digital twin model of the physical equipment.
All of the data is then aggregated and compiled to generate actionable information. The digital twin model is then continuously updated to mirror the current state of the physical thing. It can then be used to effectively model, monitor, and manage devices from a remote location. It also enables continuous intelligence & estimated time for the next needed maintenance, which the maintenance system can use to schedule at the optimal time.
- Physical equipment is the actual equipment that we are interested in creating a twin for.
- Twin Model – Comprises of a hierarchy of systems, sub-assemblies, and components that describe the twin and its characteristics enriched by asset, operational, historical, and context data.
- Knowledge – Data sources that feed the twin with operational settings, domain expertise, historical data, and industry best practices.
- Analytics – Model gets empowered by physics-based models, statistical models, and machine learning/AI models to help describe, predict, and prescribe the behavior (current and future) of the asset, system, or process.
We can see in detail how to build digital twins in the next section.
How to build Digital Twin?
In this section, we are going to look at how to build a digital twin model of an Intel NUC kit so that we can:
- Predict whether it may fail in the near future.
- Estimate the remaining useful life.
Some of the parameters that determine the health of the Intel NUC Kit are (this forms the basis for building digital twins):
Devops Engineer Masters Program will make you proficient in DevOps principles like CI/CD, Continuous Monitoring and Continuous Delivery, using tools like Puppet, Nagios, Chef, Docker, Git & Jenkins. It includes training on Linux, Python, Docker, AWS DevOps Certification Training and Splunk. The curriculum has been determined by extensive research on 5000+ job descriptions across the globe.
- State of the CPU can be monitored via analyzing:
- CPU Core Sensors
- Mainboard Sensors
- System-wide CPU utilization
- Hard Drives Temperature
- SSD wear level, host reads/writes, by SSD Hard Drive Sensors
- Disk usage statistics
- Disk I/O statistics
- Fan controllers
- Total physical memory (exclusive swap).
- Connection States
For building a digital twin of the Intel NUC kit, we are going to leverage the Eclipse Ditto framework that enables us to work with, and manage, the state of digital twins.
Following are the key capabilities of the Ditto Framework:
- Provides capabilities (APIs) to interact with digital twins.
- Live Channel architecture – routes a command/message towards an actual device.
- Twin channel connects to the digital representation of a Thing and its state and properties can be read and updated.
- Ensures that access to twins can only be done by authorized parties.
- Allows to not only interact with single twins but also with populations of many of them.
- Integrates into other back-end infrastructure (like messaging systems, brokers)
- Based on Docker, Client SDK’s are available for Java/Python.
Step #1. Definition of Twin model – Things and Features
The first step is to define things and features. Things are generic entities and can be used to depict multiple features belonging to a thing. For example, physical devices like the lawnmower, a sensor. In the below example, we are going to treat the entire Intel NUC Kit as a Thing.
Feature is used to manage all data and functionality of a thing that can also be grouped based on technical context. In the below example, we have CPU, Memory, etc.,
Step #2. Use the Ditto client SDK to pull the sensor values and publish them to eclipse ditto.
Once we have defined Things/Features, we can now use any of the client SDK (ex. Python) to pull the respective sensor values and publish them to Eclipse Ditto.
The Ditto Protocol defines a JSON-based text protocol for communicating with digital twins and the actual physical devices they mirror. Below is a sample JSON format that is being used to represent the thing (here its Intel NUC Kit)
Each thing has a unique thingId and set of features that we discussed in the earlier section. We can also have attributes that describe the thing in more detail.
Also, we can find access control lists on who can perform read/write or use administer permissions.
"manufacturer": "Demo Manfacturer",
"lastUpdate": "2019-10-16 15:07:31.436733",
The features section holds the current temperature value of the Temperature Sensor.
Ditto has hosted a sandbox server that may be used by anyone to try out Ditto without starting it locally.
Step#3. Use prebuilt Ditto APIs to Retrieve & Modify the state of the Thing/Feature/Attribute.
Once we have the data about features/attributes from the sensors we can use Ditto APIs to retrieve or modify the state of Thing/Feature/Attribute. All the states and properties can be read, updated, and collated.
There is also an option to route a command/message towards an actual device.
Congrats! we have successfully built Digital Twin using Ditto!
More examples can be located here.
Step #4. Build ML model based on Digital Twin to predict failure.
Now we have the time-series data available and stored in our Digital Twin Server, our next step is to build an ML model based on the data collected to predict failure based on core attributes such as CPU, Memory, Disk Space, connection state, or the performance of external interfacing systems.
We can use any of the ML algorithms to build a model that can predict failures based on the attributes.
Businesses are moving towards developing a predictive maintenance model using digital twins that optimizes the maintenance cycle with the advances in IoT space, extending the life of the part by reducing unplanned maintenance and labor costs. By using digital twins and the predictive maintenance strategy, companies gain cost savings and strategic advantages in the industry.
Like this post? Don’t forget to share it!