Digital twin incubator using ROS2 and model-driven development
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
Cyber-physical systems, computer systems that can interact with their environment us- ing actuators and sensors, can be very difficult to develop and ensure proper functionality, especially within a safety critical context. Digital twins are an increasingly popular tech- nique to help ensure the correct operation of these systems. Digital twin systems contain two parts: the physical twin, which is the cyber-physical system itself, and a digital twin, which is a digital representation of the physical twin that is used to perform runtime analy- sis, simulations of the physical twin using real-time sensor data, and perform self-adaptation on the physical twin to mitigate predicted faults. A digital twin system can be a very com- plex system with several components each needing to communicate with each other over a network in real time. Setting up these communication pathways by-hand can be very time consuming and potentially error-prone. This report examines how the Sireum High Assurance Modeling and Rapid engineering for embedded systems (HAMR) code generation tool and the Robot Operating System 2 (ROS2) may be used to improve the engineering of twinned systems. The investigation is based on a case study of a twinned system for an incubator for fermented soy-based food. The incubator system was originally designed by Feng et al (2021) at Aarhus University as an open source test bed for digital twin concepts. In addition to a cyber-physical system for controlling the environment in an enclosure for fermenting a soy-based food product, this incubator contains a digital twin service to predict if the incubator lid is open using a simulation and real-time sensor data, and can recalibrate the physical twin in response. Given a model of the twinned system written in the Architec- ture Analysis and Design Language (AADL), the experimental HAMR code generator for ROS2 can output a ROS2 package with ROS nodes for each system component, and all com- munication pathways completely configured. Utilizing the HAMR code generator for ROS2, an implementation was made that maintains temperature when the lid is closed, and detects & adapts to a lid open event and with fewer lines of hand-written code than the original Aarhus University implementation. This report finds that the use of these tools for digital twin development is promising, but more investigation is needed and some improvements to tooling need to be made.