Next Article in Journal
BPL-PLC Voice Communication System for the Oil and Mining Industry
Next Article in Special Issue
An Agent-Based Approach for the Planning of Distribution Grids as a Socio-Technical System
Previous Article in Journal
Multiple-Embedded-System Optimization Layout for Electromagnetic Wave Power Density in Complex Environments
Previous Article in Special Issue
Schedule Optimization in a Smart Microgrid Considering Demand Response Constraints
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

IoT-Based Digital Twin for Energy Cyber-Physical Systems: Design and Implementation

1
Department of Electrical and Computer Engineering, Florida International University, Miami, FL 33174, USA
2
Department of Electrical and Computer Engineering, University of Central Florida, Orlando, FL 32816, USA
*
Author to whom correspondence should be addressed.
Submission received: 1 August 2020 / Revised: 8 September 2020 / Accepted: 9 September 2020 / Published: 12 September 2020

Abstract

:
With the emergence of distributed energy resources (DERs), with their associated communication and control complexities, there is a need for an efficient platform that can digest all the incoming data and ensure the reliable operation of the power system. The digital twin (DT) is a new concept that can unleash tremendous opportunities and can be used at the different control and security levels of power systems. This paper provides a methodology for the modelling of the implementation of energy cyber-physical systems (ECPSs) that can be used for multiple applications. Two DT types are introduced to cover the high-bandwidth and the low-bandwidth applications that need centric oversight decision making. The concept of the digital twin is validated and tested using Amazon Web Services (AWS) as a cloud host that can incorporate physical and data models as well as being able to receive live measurements from the different actual power and control entities. The experimental results demonstrate the feasibility of the real-time implementation of the DT for the ECPS based on internet of things (IoT) and cloud computing technologies. The normalized mean-square error for the low-bandwidth DT case was 3.7%. In the case of a high-bandwidth DT, the proposed method showed superior performance in reconstructing the voltage estimates, with 98.2% accuracy from only the controllers’ states.

1. Introduction

Future power distribution systems consist of multiple entities that interact with each other in real time. The increased adoption of distributed energy resources (DERs) and active prosumers in the power network will result in more data sharing and processing. A microgrid represents the basic building block of future power systems, where a microgrid’s agent/operator should ensure load-generation balance in its territory while interacting with other microgrids’ agents or the distribution system operator [1]. From a holistic perspective, the future active distribution system can be viewed as a network of interconnected microgrids. The emergence of these interconnected microgrids can increase the efficiency of the system and ensure the reliable operation of the power grid during normal and extreme conditions. However, with such interconnected networks, there will be much more complexity, data communication and processing.
To mitigate these kinds of issues and to harness the usage of the insights available from the collected data, Industry 4.0 has emerged as the next industrial revolution, with internet of things (IoT) and cloud computing as cornerstones of its deployment [2]. In that domain, many researchers have started to investigate the potential of IoT in different applications. Among these different applications is the energy-cyber-physical system. The deployment of IoT in that domain can be used to converge the current power system into the synergetic cyber-physical system that is the smart grid [3,4]. In [5], an IoT high-level framework for the design of information and communication technologies systems for smart microgrids was proposed. The authors described the different applications that can be realized when the power system becomes a part of an IoT framework and the potential information flow associated with different applications.
Turning the current power grid into an IoT technology-dependent one means that a large number of data are harvested from the physical assets’ sensors and the cyber assets’ controllers. This will greatly affect our current understanding of the energy sector [6,7,8,9,10,11,12]. An example of the sensors and data shared in a microgrid can be found in [13], where energy management as a cloud service was explored to provide a control platform for a residential microgrid. With the incoming stream of data and operational real-time requirements as well as the potential cyber-attacks on the communication network, there is a need for a conceptual framework that can monitor, collect, harness and interact with the physical components to ensure their optimal operation. The digital twin (DT) concept arises as a promising solution that can provide such a framework and unleash many opportunities and gains that are associated with the flow of data and real-time interaction. The digital twin concept was first introduced publicly by NASA in 2010 [14].
A digital twin can be defined as a digital replica/model that includes the last information matching a thing. The information provided by a DT can provide numerous optimization possibilities for a cyber-physical system. The DT was successfully applied recently in industry for the manufacturing, power plants, healthcare and automotive sectors [15,16]. In addition, several industrial enterprises are devoting efforts to developing digital replications of power grids, such as General Electric (GE, Boston, MA, USA) or Siemens (Munich, Germany) [17,18].
Many studies in the literature have started developing and describing conceptual designs and applications of digital twins. A description of the expected main building blocks for a general cyber-physical system was introduced in [19]. In [20], the authors presented a digital twin architecture for the security of an industrial automation system, where they proposed a security-oriented digital twin for the Programable Logic Control (PLC) software update process. In [21], the author provided a cloud-based digital twin for a cyber-physical system with an application to the social internet of vehicles for driving assistance application.
Few researchers have started to deploy and implement the digital twin for power system applications. To date, and to the best of our knowledge, there is not much literature that describes an actual design and implementation of a digital twin in the electric power-grid domain. In [22], the authors provided a general first-steps description of the implementation of a digital twin of a single microgrid. No details or implementation are provided. Therefore, this draft tries to cover this gap by providing a detailed explanation and implementation of a low-cost, open-source-based and close-to-market proof of concept for a digital-twin framework for power system applications. The proposed framework can be used in many applications of power systems, ranging from the simple monitoring of the system and actual control and interaction with the physical system to attack detection on the communication layer. Therefore, the main contributions of this paper are:
  • Describing a methodology for how digital twins of the different power resources in the power system can be modelled on the cloud.
  • Providing an IoT-based digital twin of an interconnected system of microgrids.
  • Developing an IoT-based digital twin model of the communication topology that can serve a cluster of microgrids.
  • Providing a proof of concept case study where controllers/agents interact with each other and the cloud.
The rest of the paper is organized as follows: Section 2 provides a general description of the proposed architecture, while Section 3 explains the proposed digital twin models. Section 4 describes the cloud utilization, Section 5 provide case studies and Section 6 concludes the research work.

2. Architecture Description

In modern power systems, the microgrid is a vital infrastructure that enables higher renewables penetration in the deep distribution grid. The microgrid contains different distributed generation resources (DERs), energy storage systems (ESSs) and flexible loading, which transform the distribution grid into a fleet of virtual power plants. At this level of the networked microgrids, a huge number of assets, sensors, meters, actuators and controllers will be connected to the Internet through heterogenous IoT communication networks. Figure 1 shows the proposed cloud-based digital twin architecture, which could be the strategic technology that coordinates, facilitates, aggregates and provides centric oversight guidance for the new distribution system infrastructure. The proposed digital twin is illustrated as a virtual replica for both the physical and cyber layers of the networked microgrids. The physical layer consists of many assets (things) such as DERs, ESSs, fixed loads, flexible loads, DC/DC converters, DC/AC inverters, cables, transmission lines, transformers and circuit breakers. The power electronic converters are considered as the main vital actuators that fully control the distribution grid. It can flexibly route the power flow in the power lines and guarantee proper power sharing among DERs and ESSs inside a microgrid or between the networked microgrids. The interconnected microgrids forms clusters that are connected to the power system point of common coupling (PCC) through an I C p c c and a step-up transformer.
The edge cyber system space contains networked sensors/intelligent electronic devices (IEDs) that communicate with each other through an internet protocol such as transmission control protocol/internet protocol (TCP/IP). The sensors monitor the physical assets by widespread current transformers, voltage transformers, temperature and weather transducers, micro-phasor-measurement units ( μ P M U s ), fault locators and protective relays. In addition, the cyber system makes decisions using the networked controllers as a distributed secondary control system that is responsible for voltage regulation, frequency synchronization, and active and reactive power sharing control. On top of the secondary controllers is the tertiary control system, which is responsible for the energy management, market operations and the major global control/optimization object. The cyber control layer and its communication network take the power system automation control and protection decisions during the normal and abnormal conditions based on the feedback from the networked sensors. With this level of complex transactions among the cyber things and between the physical and cyber things, centric oversight is required to autonomously monitor, operate, analyze and understand the cyber-physical energy system. The virtual space is proposed as a centric oversight layer, which can deal with such complex systems using multiple coordinated cloud services.
The Amazon Web Services (AWS) cloud system is utilized to implement the proposed virtual space. The physical things are monitored by the sensors’ measurements and hosted in AWS IoT GreenGrass (GG). Each microgrid’s measurements are accommodated in the GG group. The AWS GG can act locally on the data and respond quickly to events and has a low cost, especially for a large number of data points. The AWS GG is proposed here because it helps to preserve privacy and maintains efficient computing inside each microgrid. Regarding the control system in the cyberspace, the controllers’ states are hosted as cyber things in the AWS IoT core. The last states of both the cyber and physical things are kept as a shadow on the cloud.
For both the cyber and physical things, a serviceless computing function—which is a low cost, simplified microservice—is used to monitor the data activity and take/activate local actions or launch another computing service/application according to pre-defined logic settings. The IoT shadow states are considered as the shadow twin for the energy cyber-physical system (ECPS). The shadow twin contains the metadata and the last states for the physical and the cyber assets. This shadow can be used for different power system applications, even with intermittent measurement updates. Additionally, the cyber twin state-space model and the physical twin state-space model are used to enhance the digital replica of the ECPS.
Multiple services are deployed to manage, filter, analyze and store data for better utilization among the energy system applications and solutions. The proposed digital twins are cooperatively utilized to represent the actual ECPS, which could extend the virtual space capabilities for many different applications in the future. For instance, energy management, security auditing, distributed control guidance, power system state estimation, what-if scenarios, predictive maintenance for energy assets, outage management, wide area fault tolerance and power system restoration are promising applications that could enhance future distribution grid reliability and security. Additionally, the scalability feature of the IoT in the energy systems will provide an incentive for power system designers, operators and researchers to better understand the new distribution grid capabilities.

3. Digital Twin Formulation

Generally, the DT consists of three main components: the DT shadow, the DT model and the DT updating. The original features and state updates of an asset are collected to form the live digital replica of a physical or a cyber asset. The behavioral characteristics and the dynamical features of a thing are mathematically modelled, and the model is enhanced by the last shadow states. The DT model is updated based on the working states and conditions of a thing.

3.1. Digital Twin Shadow

To represent a thing digitally in the virtual space, many immutable and mutable attributes related to different aspects such as features, capabilities, structures, working states and operating conditions can be utilized to describe this thing. In the ECPS, a physical thing φ or a cyber thing θ has the metadata M = { ρ 1 , ρ 2 , . ,   ρ n ρ } that contains a set of n ρ immutable properties ρ . The contents of these metadata involve the design characteristics, standard limitations and the recommended rating conditions. For instance, a physical thing of DERs has power ratings, ramping capabilities, thermal withstand characteristics, voltage limitations, manufacturing information, etc. Additionally, a cyber thing as the controller has specific bandwidth, data model structure, processing capabilities, functional blocks, etc. The knowledge of the metadata is vital for DT formulation, as it provides the virtual space with the ability to be aware of a thing’s original specifications, which impact the physical thing’s lifetime and the cyber thing’s security.
On the other hand, the working live states of an asset are updated in the virtual space when a change happens in the real space to provide the DT last update. The information is collected from sensors and controllers to update the physical asset by setting the last reported set of states x r e p = { x 1 r e p , x 2 r e p ,   ,   x n x r e p } , which contains n x reported states for a thing. Furthermore, the DT holds the required target of the states by recording the desired states in the DT shadow by setting the reported states x d e s = { x 1 d e s , x 2 d e s ,   ,   x n x d e s } . The DT recognizes the reported state compliance with the desired state by calculating the difference between the desired state and the reported state, x Δ = x d e s x r e p .

3.2. Physical System Digital Twin Model

By combining the last sensory/control updates and the model, the DT can replicate the real system digitally. The model is mathematically formulated to describe the static and dynamic features of the thing, and enhanced by full or partial information from the edge. The DT can simulate the normal and abnormal behaviors of an asset. In addition, the data-driven models leverage data analytics to describe, understand and predict the dynamical activity numerically. Exploiting the historical knowledge data, event logging and their counteractions in the deep-learning technologies can equip the DT model with the capability of recommending corrective actions during a contingency and effectively operating the ECPS during normal healthy operation.
The ECPS is assumed to contain a set of subsystems that are physically interconnected to balance the generation and demand mix and controlled through coordinated multi-agents that are linked using a cyber communication graph to ensure a common goal. The degree of the complexity of the DT model depends on the nature of the application, the possible actions and the physical asset itself.
As an example of a physical ECPS, a networked DC microgrid system DT model is introduced. Mathematically, suppose a number of physical things n φ has a state vector x φ and are monitored by a set of sensors S . The state-space representation is proposed to emulate the physical thing’s characteristics with the parameter’s matrices A φ , B φ , C φ , D φ . The physical twin has an output vector y φ that responds to the effect of an input vector U φ and can be described as
x ˙ φ ( t ) = A φ x φ ( t ) + B φ U φ ( t )
y φ ( t ) = C φ x φ ( t ) + D φ U φ ( t )
The proposed ECSP DT model is divided according to the application nature into two models: a low-bandwidth DT model and high-bandwidth DT model. On one hand, the applications that require the low-bandwidth model are energy management, market operation, situational awareness monitoring and predictive maintenance. These applications are performed periodically every large time span, and they usually depend on long-term historical data to predict long-term future operation strategies and management actions. On the other hand, the high-bandwidth applications are real-time outage management, what-if contingency analysis, secondary control guidance and system restoration. The following subsections present the proposed DT model.

3.2.1. Low-Bandwidth Physical Model

Suppose a distribution grid has o t h interconnected energy units. These energy units can be distributed generation (such as a solar, wind or conventional generator), Energy Storage Systems (ESSs) such as a battery storage system or thermal storage system, fixed loads or flexible loads (such as an electric vehicle parking garage or nanogrids). Figure 2 shows the low-bandwidth physical model of an energy unit [23]. Generally, the energy unit can be represented as a generic energy node with an original infeed source ξ from the energy resource as the solar irradiance or the required demand. If the infeed energy is storable with capacity H , the node can represent an ESS or flexible load. If the energy cannot be stored, the node represents a generation or the fixed load and H = 0 . In the case of representing the renewable resource as solar or wind and where excessive power is present, the power curtailment can be represented by ψ < 0 . In the case of representing the loading, ψ represents the load shedding and ψ > 0 . When the generic node has P l d = 0 , it represents a generation mode. Additionally, if the generated power P g n = 0 , the unit represents the load. If both the generation mode and loading mode exist, the node represents an ESS. The generic mathematical formulation of the o t h energy unit representations is:
H o   S o C o ˙ =   η g n , o 1 P g n , o + η l d , o P l d , o ± ξ o + ψ o ϱ o ( S o C o S o C o ( 0 ) )
where S o C o and S o C o ( 0 ) are the state of charge and the initial state of charge of the o t h energy unit. In addition, η l d and, η g n are the efficiency of the generation and loading operation, and ϱ o is a variable that represents the flexible load controllability. Table 1 shows possible mathematical formulations for different energy unit types according to Equation (3) and from applying the energy unit constraints.

3.2.2. High-Bandwidth Physical Model

The purpose of the DT is to represent the power system’s dynamics and the effect of the networked microgrids on the distribution grid’s point of common coupling. The DC microgrid mainly consists of four components: sources, a DC/DC converter, loads and distribution cables. The large-signal dynamical equations that represent the transient response are derived as a linear time-invariant differential equation. The main focus of this physical model is to represent the transactions among the networked microgrids. Therefore, the intra-microgrid transactions are ignored here, as they are already covered in the low-bandwidth model. Each microgrid contains several interconnected sources and loads that can be characterized by a Thevenin equivalent circuit. Thus, the individual microgrid i is modelled by a controllable voltage source and its passive components of resistance, inductance and capacitance, which are denoted as R i , L i and C i , respectively. Commonly, the networked microgrid dynamics of the i t h microgrids can be described by:
L i d I ˜ i d t = E i * R i I ˜ i v i
C i d v i d t = I ˜ i g I g
where I ˜ i is the i t h microgrid converter average inductor current and E i * is the reference voltage at the i t h microgrid. The microgrid is considered as two-way power flow; accordingly, I g is the current transmitted from/to microgrid i to/from distribution grid node g .
Figure 3 illustrates a networked DC microgrid that is under study. The grid contains two clusters of microgrids: the first cluster has five microgrids, and the second one has three microgrids. Usually, the practical DC power system is connected to the major grid via a point of common coupling (PCC). The equivalent model of each microgrid’s equivalent voltage sources is shown in the bottom of Figure 3, which identifies the primary control system of the DC/DC converter. Since the control objective of the secondary controllers in the cyberspace is power sharing, the voltage and the current references are formulated in the model to make the power sharing factor the reference of the controlled microgrid output.
In order to represent the power-sharing of the primary control system in the physical twin, the equivalent microgrid reference voltage can be expressed as:
E i * = v i * k i P i , m a x x i *
where v i * and P i , m a x are the reference voltage and maximum power of the i t h microgrid converter, k i is the constant control gain and x i * is the sharing factors that are commanded by the secondary controllers to the primary controllers.
Therefore, Equation (4) can be rewritten as:
L i d I ˜ i d t = v i * k i P i , m a x x i * R i I ˜ i v i
The distribution grid interconnection can be represented as:
[ I ˜ i I g ] = [ Y i i Y i g Y g i Y g g ] [ v i v g ]
where v g is the voltage of the grid connection node, and Y is the bus admittance matrix of the grid topology.

3.3. Cyber System Digital Twin Model

The cyber control edge contains the secondary distributed controllers at each power node and the tertiary controller at the PCC. As shown in Figure 4, the cyber control edge includes a number of distributed controllers n θ with control states x θ that are shared through a communication cyber graph G to reach an agreement with a steady-state control law x θ , s s , which is obtained from the tertiary controller at the PCC with the state. Thus, the tertiary control objective is to satisfy x θ , s s = x p c c * . The control objective state can be the bus voltage v θ , s s = v p c c * and the power sharing factor r θ , s s = r p c c * , where r p c c = P p c c / P p c c , m a x , and r θ = P θ / P θ , m a x and P p c c , m a x , P θ , m a x are the maximum power sharing capabilities at the PCC and θ t h controllers.
The cyber system can also be represented similarly to the physical system by the state-space equations as follows:
x ˙ θ ( t ) = A θ x θ ( t ) + B θ U θ ( t )
y θ ( t ) = C θ x θ ( t ) + D θ U θ ( t )
where A θ , B θ ,   C θ   and   D θ are the cyber system model parameters and U θ   and   y θ are the cyber twin input and output vectors.
The PCC control agent is considered to be the main leader of the microgrid clusters’ leaders. The graph can be described by the triplet ( V , E , A ) , where E is the communication graph edges, where E V × V , V is the graph vertices and A R ( n m + 1 ) × ( n m + 1 ) is an adjacency matrix, which is a weighted matrix of the links. If an agent i can send/receive information to an agent j , then the pair ( i , j ) E and the connection can be weighted by a factor w i j according to the following:
[ A ] i j = { w i j > 0 i f     i , j E 0 o t h e r w i s e
Each cluster leader is connected to a number of m followers’ controllers. Typically, the distributed secondary control system is performed by the consensus protocol. The dynamics of the consensus protocol can be formulated as a graph that has In-neighbors degrees, which can be denoted as D = d i a g { d i j } . The consensus protocol can be formulated in terms of state-space representation in terms of the Laplacian matrix L , where L = D A , and the distributed consensus can be characterized as:
x ˙ i = j = n i w i j ( x j x i ) + b i · ( x p c c x i )
X ˙ = ( L + B ) · X + B 1 _ x p c c
where n i is the node that has an accessible path to an agent i , B = d i a g { b i } represents the pinning matrix and b i is the leader connection weighting factor.

3.4. Digital Twin Model Hybridization

The digital twin model is proposed to be a multi-purpose function. It can be used by many applications. According to the required solution, the DT model is defined by the sampling time, the known inputs and the desired outputs. The previous ECPS physical and cyber twins can be hybridized to replicate the cyber-physical system’s behavior as follows:
[ X ˙ θ X ˙ φ ] = [ A θ 0 B φ C θ A φ ] [ X θ X φ ] + [ B θ 0 ] [ U φ ]
[ y θ φ ] = [ 0 B φ ] [ X θ X φ ]
where y θ φ is the hybrid twin model output. Using the hybrid twin models, the unknown states and the forecasted behavior can be predicted based on the present shadow states. The digital twin implementation in the cloud virtual space and its data transactions are clarified in the next sections.

4. ECPS Things-To-Cloud Service Transactions

To implement the digital twin, the model’s degree of complexity should be carefully considered to avoid adding extra complexity to the system. The proposed digital twin uses the state-space representation of the ECSP by aggregating the individual microgrid resources into a single equivalent model. That will reduce the communication and the computational burden without reducing the benefits of the potential applications and solutions. As shown in Figure 5, the IoT GG makes decisions locally within the microgrid, but it will be kept aware of the global centric objective with regular over-the-air programming (OTA) updates of its settings.
The ECSP is represented in the cloud by the sensor measurements from the physical assets φ and the control states from the cyber assets θ . Figure 5 depicts the AWS cloud hosting the energy IoT, computing services and their transactions. Suppose the distribution grid has n microgrid ( μ G ) clusters, each μ G cluster has m microgrids and the i t h μ G has ο t h assets. Each asset is connected to the microgrid main bus by an interlinking power electronics converter I C ο , and each μ G is linked to the distribution grid by an interlinking converter I C i .
On one hand, the microgrid physical assets can be classified into four main types, the distributed generator (DG), ESS, fixed load (LD) and flexible loads (FLD). An asset o is monitored by a current transformer C.T and voltage transformer V.T, which are used to calculate various physical power system states using μ P M U s . The asset physical state is represented by a set of calculated parameters x φ = { P , Q , f , V } that are the active power, reactive power, power frequency and voltage, respectively.
On the other hand, the cyberspace is a set of distributed controllers, which are communicating with each other to cooperatively satisfy a control objective x θ . The control objective can be active/reactive power sharing, voltage regulation and/or frequency synchronization. This is cooperatively performed by the interlinking converters’ secondary distributed controllers I C C . The ICCs are connected via cyber communication links, and the control states interpret the cyberspace transactions alongside the interactions with the physical assets. The AWS GG is used to extend the cloud system functionality to the IoT devices ( μ P M U s ,   I C C ) to perform the data gathering and analysis and act locally on the cyber edge. The IoT GG channels are proposed to perform higher-speed calculations locally to be able to act quickly in the case of a critical power system status. The data transaction between the sensors, controllers’ edge and cloud is implemented based on the message queuing telemetry transport (MQTT) protocol. To preserve privacy and reduce the complexity and computational burden, the data pipelines service is used to filter and prepare the data for the cloud computing services. The IoT core along with the lambda serviceless functions is implemented to easily and securely interact with various cloud computing applications.
Besides the DT functions, different services on the cloud are proposed to build different applications. For instance, the AWS SageMaker is used to build, train and test the deep-learning models that are launched on the edge cyberspace. Data filtering, routing and management services are implemented to prepare the data for each application according to the requirements. AWS SageMaker is also used to build applications for the centric guidance to the distributed controllers; what-if contingency scenarios for outage management provide security auditing based on the anomaly detection functionality. In addition, IoT data analytics and data storage are used to implement offline applications for power system planning and physical assets’ predictive maintenance. The cyber things can be used to coordinate between different applications.
Figure 6 illustrates the cyber/physical thing registration process on the IoT core on the AWS cloud. The IoT Software Development Kit (SDK) is launched on the physical or the cyber asset. The asset registry contains the asset policy, which is used to authorize the device to perform the IoT connectivity. Each asset has the required certificates and keys that are required to initiate the message transactions. The communication is implemented by the asset gateway using MQTT WebSocket or hypertext transfer protocol secure (HTTPs) protocols, and it should be authorized by the IoT core to verify the thing’s identity. Then, the gateway sends the message to the rule engine, which is responsible for assessing the incoming messages published into the IoT core. That determines the action of structured query language (SQL) filtering or rerouting the data to different cloud services based on pre-defined settings.
The vital process of the DT is the update process for the device shadow. The shadow state of an asset is a JavaScript object notation (JSON) file that is used to store/retrieve the last state of a thing. The shadow can be accessed regardless of whether the thing is connected to the Internet or not. It contains the shadow desired and reported states, immutable metadata, updated version, transaction token and timestamp.
The Lambda serviceless function automatically executes a predefined logic function when required without provisioning. The messages are used later for different cloud computing solutions and end-user/operator applications. The IoT application programming interface is used to interact with the data for different applications.

5. Digital Twin Implementation and Results

The ECPS DT is demonstrated by implementing the physical and the cyber layers of the networked microgrids (MG) using interconnected embedded computers as a multi-agent platform. Figure 7 shows eight microgrids’ agents and a single PCC agent that are executed on nine Raspberry Pis™ and communicate using Wi-Fi. The Data Distribution Service (DDS) communication middleware is used to launch the data sharing among the distributed controllers/sensors as a cyber layer. The DDS uses the publication/subscription mechanism without a message broker for the data sharing, which guarantees high-speed connectivity among the networked microgrids, and communication configuration is performed in extensible markup language (XML) files for each agent. The Python programming language is used beside the AWS cloud system. The ECPS-to-AWS communication is performed via the Message Queuing Telemetry Transport (MQTT) protocol, and the data are initially hosted on the AWS IoT core [16].
Figure 8 shows the distributed consensus control algorithm that is implemented on each control agent in the cyber system and its interaction with the DT on the AWS cloud. Firstly, the agent is initialized with the adjacency weighting factors. Then, DDS communication is used to listen to the agent’s neighbor and continuously check for an event that requires a consensus on new sharing power.
After the agent neighbor’s data are accepted, the local control objective is updated based on the consensus rule that is discussed in Figure 4 to agree on the leader steady state. Finally, the pre-event and post-event states are reported by using the MQTT update function on the AWS cloud. Moreover, the desired state or DT-based guides are submitted to the edge via the MQTT get function. These signals can be configured according to the applicable nature of the DT.
Figure 9 shows the implemented DT on the cloud system. Practically, the AWS SageMaker is used to perform the required computations and DT functions. This service can hold parallel instances of computation by utilizing the IoT core shadow data or the data stored in the database. The parallel instances can be implemented and scaled according to the required application. The state-space modelling of the physical and cyber twin model is implemented and imported as functions to implement the low and high-bandwidth physical DT alongside the cyber DT models on the AWS SageMaker. These models acquire the up-to-date shadow from the AWS IoT core service to update their estimations and configuration every certain time.
To reduce the communication bandwidth and minimize the computational burden, the AWS Lambda function is used to trigger the application by continuously monitoring the detected event. Using the models previously discussed in (3), (7)–(8) and (12)–(15), the digital replica of the energy cyber physical system is constructed to be utilized by different applications. Both the reported sensor measurements (voltages v i and injected power P i ) and the reported post-event cyber states ( x i , p o s t r e p ) are ported to the online Digital Twin models. According to the applicable nature, the desired commanding and decisions can be submitted back to the edge to achieve the requirements.
In the same way, after the application decisions are made, the desired commands are set back to the desired shadow state on the IoT core. The controller on the edge gets the desired states as centric oversight guidelines, which are used to guarantee the global system operation objectives. Thus, the DT creates digital parallel environments for the safe application of the control command on the twin before giving the edge controllers the final guides.
The first case study is implemented using the low-bandwidth model. Two clusters of microgrids are implemented on MATLAB/SIMULINK as a detailed physical model, and the CPS data are sent to the AWS cloud IoT core in terms of shadow states. The system contains a collection of diesel generators (conventional generators), PV–wind mixtures (renewable generators), ESSs and loads (fixed and flexible). On the other hand, the AWS has the state-space representation as shown in Table 1 to construct the physical twin and the system in (12)–(15) to represent the cyber model. The model uses the loading profile and the forecasted renewable power to estimate the dispatching of the resources.
Figure 10 shows matching between the DT model and the physical states. The low-bandwidth model has a 15 min time slot for the AWS shadow update rate. Figure 10a depicts a close relationship between the digital twin estimated states and the physical states of first cluster states, which are the aggregated demand, conventional generation, renewable generation, aggregated ESS charge/discharge power and state of charge. The second cluster, which is shown in Figure 10b, presents the ability of the DT to mimic the physical response. The high-bandwidth twin model is evaluated as shown in Figure 11 and Figure 12.
In the second case study, the secondary distributed control system controls the microgrids’ interlinking converters to share the power among the microgrids to support the voltage at the PCC. The implemented control agents on the embedded computers send their information (sharing factors) to the AWS cloud. The implemented DT in AWS SageMaker uses the sharing factor shadows to estimate the voltage at each bus in the interconnected microgrids. The figures show that the DT can replicate the actual system. A comparison is made between the cyber states and the AWS shadow updates, which is updated every 5 s. Figure 11 illustrates the power sharing factor consensus under two consecutive changes (0.5 and 0.85 per unit in the reference at the PCC.
The delay between the cyber edge states (black) and the shadow updates (red dots) is due to the Wi-Fi communications. The provisioned shadow states are used to drive the high-bandwidth model to mimic the physical voltage measurements at each bus, which show a very close response as illustrated in Figure 12.

6. Conclusions

This paper provides a methodology for the design of digital twin models for the power system components and the communication topology. The power system sources, as well as clusters of interconnected microgrids that represent the main building blocks of future power systems, were modelled. The implementation of the models on the Amazon Web Service and their interactions with the physical components were demonstrated. The results showed the ability of the proposed models to be a live digital replica of future power systems. The authors are currently developing a combination of deep learning and the DT to implement a wide-area situational awareness system by considering the stability, reliability and resiliency of the globally interconnected power system. The proposed DT aims to guarantee to mimic the dynamics and events in real time. Although the DT’s purpose is not the accuracy of reconstructing states, both the low-bandwidth DT and the high-bandwidth DT were able to accurately replicate the cyber-physical system’s live states, as shown by the average error not exceeding 4% and the maximum error being 9.2%.

Author Contributions

Conceptualization, A.S.; methodology, A.S.; software, A.S.; validation, A.S; formal analysis, A.S. and S.F.; investigation, A.S.; resources, A.S.; data curation, A.S. and S.F.; writing—original draft preparation, A.S. and S.F.; writing—review and editing, A.S., S.F. and O.M.; visualization, A.S.; supervision, O.M.; project administration, O.M.; funding acquisition, O.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

This work was partially funded by grants from the Office of Naval Research and the US Department of Energy.

Conflicts of Interest

The authors declare no conflict of interest.

Nomenclature

IoTInternet of Things
DERsDistributed Energy Resources
DTDigital Twin
ECPSEnergy Cyber Physical System
AWSAmazon Web Services
ESSsEnergy Storage Systems
DCDirect Current
ACAlternating Current
PCCPoint of Common Coupling
IEDIntelligent Electronic Device
TCP/IPTransmission Control Protocol/Internet Protocol
ICInterlinking Converter
μPMUsMicro Phasor Measurement Units
GGGreenGrass
PVPhotovoltaic
OTAOver-The-Air Programming
DGDistributed Generator
LDFixed Load
FLDFlexible Load
μGMicrogrid
ICCInterlinking Converter Controller
MQTTMessage Queuing Telemetry Transport
HTTPSHypertext Transfer Protocol Secure
SQLStructured Query Language
JSONJavaScript Object Notation
DDSData Distribution Service
XMLExtensible Markup Language

References

  1. Gonzales-Zurita, Ó.; Clairand, J.-M.; Peñalvo-López, E.; Escrivá-Escrivá, G. Review on multi-objective control strategies for distributed generation on inverter-based microgrids. Energies 2020, 13, 3483. [Google Scholar] [CrossRef]
  2. Lee, J.; Bagheri, B.; Kao, H.-A. A cyber-physical systems architecture for Industry 4.0-based manufacturing systems. Manuf. Lett. 2015, 3, 18–23. [Google Scholar] [CrossRef]
  3. Höller, J. (Ed.) From Machine-to-Machine to the Internet of Things: Introduction to a New Age of Intelligence; Elsevier Academic Press: Amsterdam, The Netherlands, 2014. [Google Scholar]
  4. Zanella, A.; Bui, N.; Castellani, A.; Vangelista, L.; Zorzi, M. Internet of things for smart cities. IEEE Internet Things J. 2014, 1, 22–32. [Google Scholar] [CrossRef]
  5. Hussein, M.; Galal, A.I.; Abd-Elrahman, E.; Zorkany, M. Internet of things (IoT) platform for multi-topic messaging. Energies 2020, 13, 3346. [Google Scholar] [CrossRef]
  6. Poon, J.; Jain, P.; Konstantakopoulos, I.C.; Spanos, C.; Panda, S.K.; Sanders, S.R. Model-based fault detection and identification for switching power converters. IEEE Trans. Power Electron. 2017, 32, 1419–1430. [Google Scholar] [CrossRef]
  7. Shakeri, M.; Amin, N.; Pasupuleti, J.; Mehbodniya, A.; Asim, N.; Tiong, S.K.; Low, F.W.; Yaw, C.T.; Samsudin, N.A.; Rokonuzzaman, M.; et al. An autonomous home energy management system using dynamic priority strategy in conventional homes. Energies 2020, 13, 3312. [Google Scholar] [CrossRef]
  8. Tao, F.; Zhang, H.; Liu, A.; Nee, A.Y.C. Digital twin in industry: State-of-the-art. IEEE Trans. Ind. Inf. 2019, 15, 2405–2415. [Google Scholar] [CrossRef]
  9. Oh, J. IoT-based smart plug for residential energy conservation: An empirical study based on 15 months’ monitoring. Energies 2020, 13, 4035. [Google Scholar] [CrossRef]
  10. Tsipis, A.; Papamichail, A.; Angelis, I.; Koufoudakis, G.; Tsoumanis, G.; Oikonomou, K. An alertness-adjustable cloud/fog IoT solution for timely environmental monitoring based on wildfire risk forecasting. Energies 2020, 13, 3693. [Google Scholar] [CrossRef]
  11. Machorro-Cano, I.; Alor-Hernández, G.; Paredes-Valverde, M.A.; Rodríguez-Mazahua, L.; Sánchez-Cervantes, J.L.; Olmedo-Aguirre, J.O. HEMS-IoT: A big data and machine learning-based smart home system for energy saving. Energies 2020, 13, 1097. [Google Scholar] [CrossRef] [Green Version]
  12. Motlagh, H.N.; Mohammadrezaei, M.; Hunt, J.; Zakeri, B. Internet of things (IoT) and the energy sector. Energies 2020, 13, 494. [Google Scholar] [CrossRef] [Green Version]
  13. Al Faruque, M.A.; Vatanparvar, K. Energy management-as-a-service over fog computing platform. IEEE Internet Things J. 2016, 3, 161–169. [Google Scholar] [CrossRef]
  14. Conte, E.; Mendes, P.R.C.; Normey-Rico, J.E. Economic management based on hybrid MPC for microgrids: A Brazilian Energy Market Solution. Energies 2020, 13, 3508. [Google Scholar] [CrossRef]
  15. Bachelor, G.; Brusa, E.; Ferretto, D.; Mitschke, A. Model-based design of complex aeronautical systems through digital twin and thread concepts. IEEE Syst. J. 2019, 14, 1–12. [Google Scholar] [CrossRef]
  16. AWS IoT-Developer Guide. p. 1157. Available online: https://docs.aws.amazon.com/iot/latest/developerguide/iot-dg.pdf (accessed on 17 December 2019).
  17. Digital Twin|GE Digital. Available online: https://www.ge.com/digital/applications/digital-twin (accessed on 7 December 2019).
  18. Digital Twin|Siemens, Siemens Digital Industries Software. Available online: https://www.plm.automation.siemens.com/global/en/our-story/glossary/digital-twin/24465 (accessed on 7 December 2019).
  19. Josifovska, K.; Yigitbas, E.; Engels, G. Reference framework for digital twins within cyber-physical systems. In Proceedings of the IEEE/ACM 5th International Workshop on Software Engineering for Smart Cyber-Physical Systems (SEsCPS), Montreal, QC, Canada, 28 May 2019; pp. 25–31. [Google Scholar]
  20. Gehrmann, C.; Gunnarsson, M. A digital twin based industrial automation and control system security architecture. IEEE Trans. Ind. Inf. 2019, 1, 669–680. [Google Scholar] [CrossRef]
  21. Alam, K.M.; El Saddik, A. C2PS: A digital twin architecture reference model for the cloud-based cyber-physical systems. IEEE Access 2017, 5, 2050–2062. [Google Scholar] [CrossRef]
  22. Calderón-Godoy, A.J.; Pérez, I. Design and implementation of smart micro-grid and its digital replica: First steps. In Proceedings of the 16th International Conference on Informatics in Control, Automation and Robotics, Prague, Czech Republic, 29 June–31 July 2019; pp. 715–721. [Google Scholar]
  23. Saad, A.; Youssef, T.; Elsayed, A.T.; Amin, A.; Abdalla, O.H.; Mohammed, O. Data-centric hierarchical distributed model predictive control for smart grid energy management. IEEE Trans. Ind. Inform. 2019, 15, 4086–4098. [Google Scholar] [CrossRef]
Figure 1. The architecture of the proposed energy cyber-physical system (ECPS) digital twin.
Figure 1. The architecture of the proposed energy cyber-physical system (ECPS) digital twin.
Energies 13 04762 g001
Figure 2. Low-bandwidth physical model of the digital twin (DT).
Figure 2. Low-bandwidth physical model of the digital twin (DT).
Energies 13 04762 g002
Figure 3. Networked microgrid equivalent circuit for physical twin model.
Figure 3. Networked microgrid equivalent circuit for physical twin model.
Energies 13 04762 g003
Figure 4. An example of a cyber edge space model.
Figure 4. An example of a cyber edge space model.
Energies 13 04762 g004
Figure 5. Data transactions between ECPS and cloud services.
Figure 5. Data transactions between ECPS and cloud services.
Energies 13 04762 g005
Figure 6. Physical/cyber thing registration on the IoT core.
Figure 6. Physical/cyber thing registration on the IoT core.
Energies 13 04762 g006
Figure 7. Practical ECPS DT implementation.
Figure 7. Practical ECPS DT implementation.
Energies 13 04762 g007
Figure 8. Distributed controller algorithm on the edge interaction with the DT on the AWS cloud.
Figure 8. Distributed controller algorithm on the edge interaction with the DT on the AWS cloud.
Energies 13 04762 g008
Figure 9. DT implementation on AWS cloud.
Figure 9. DT implementation on AWS cloud.
Energies 13 04762 g009
Figure 10. A comparison between the low-bandwidth physical DT model and the physical measurements: (a) MG cluster 1; (b) MG cluster 2.
Figure 10. A comparison between the low-bandwidth physical DT model and the physical measurements: (a) MG cluster 1; (b) MG cluster 2.
Energies 13 04762 g010aEnergies 13 04762 g010b
Figure 11. A comparison between the cyber states and the shadow states on the AWS.
Figure 11. A comparison between the cyber states and the shadow states on the AWS.
Energies 13 04762 g011
Figure 12. A comparison between the high-bandwidth cyber DT model and the cyber states.
Figure 12. A comparison between the high-bandwidth cyber DT model and the cyber states.
Energies 13 04762 g012
Table 1. Energy unit mathematical formulation.
Table 1. Energy unit mathematical formulation.
TypeConstraintsState-Space Model
Conventional H o = 0 ,   P l d , o = 0 ,   ψ o = 0 0 = η c g n , o 1 P c g n , o + ξ c g n , o
Renewable H o = 0 ,   P l d , o = 0 ,   ψ o < 0 0 = η r g n , o 1 P r g n , o + ξ r g n , o + ψ c u r , o
ESS ξ o = 0 ,   ψ o = 0 H s , o   S o C s , o ˙ = η s g n , i 1 P s g n , o + η s l d , o P s l d , o
Fixed Load H o = 0 ,   P g n , o = 0 ,   ψ o > 0 0 = η l d , o P l d , o ξ l d , o + ψ s h d , o
Flexible Load P g n , o = 0 ,   ψ o = 0 H f l d , o   S o C f l d , o ˙ = η f l d , o P f l d , o + ξ f l d , o ϱ o ( S o C f l d , o S o C f l d , o ( 0 ) )

Share and Cite

MDPI and ACS Style

Saad, A.; Faddel, S.; Mohammed, O. IoT-Based Digital Twin for Energy Cyber-Physical Systems: Design and Implementation. Energies 2020, 13, 4762. https://0-doi-org.brum.beds.ac.uk/10.3390/en13184762

AMA Style

Saad A, Faddel S, Mohammed O. IoT-Based Digital Twin for Energy Cyber-Physical Systems: Design and Implementation. Energies. 2020; 13(18):4762. https://0-doi-org.brum.beds.ac.uk/10.3390/en13184762

Chicago/Turabian Style

Saad, Ahmed, Samy Faddel, and Osama Mohammed. 2020. "IoT-Based Digital Twin for Energy Cyber-Physical Systems: Design and Implementation" Energies 13, no. 18: 4762. https://0-doi-org.brum.beds.ac.uk/10.3390/en13184762

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop