Frequently Asked Question

Video: 7.4. Multi-protocol gateway example
Last Updated 2 years ago


Press "Ctrl + F" to find the keyword of your interest.

If you wish to have a direct link access to the video timestamps, please follow these instructions.

Found this video helpful? Why not take the whole HIL Specialist course? A Certificate is waiting for you for free at HIL Academy.

Would you or your organization benefit from having these videos narrated in your native language? Contact us and let us know if you wish to contribute.

TRANSCRIPT

00:00:02

Hello everyone. In this lesson we will learn how to implement a communications  

00:00:06

test environment for a distributed energy resource management system gateway.  

00:00:11

We will do this by using the Multi-protocol gateway example in the Examples Explorer. 

00:00:17

This example comprises both a CAN bus and a Modbus SunSpec protocol implementation within a single  

00:00:22

HIL device. It is an example of what a complete microgrid system model might look like in the  

00:00:28

Typhoon HIL toolchain, with both the power stage and communication layers modeled simultaneously. 

00:00:35

Modbus Sunspec is an application-layer communications protocol designed to achieve  

00:00:40

interoperability between Distributed Energy Resource components and smart  

00:00:44

grid applications, based on the Modbus standard. Information in SunSpec is defined through a set of  

00:00:49

Information Models representing functionality implemented by devices or plants. SunSpec  

00:00:55

Alliance Interoperability Specifications describe how these information models,  

00:01:00

data exchange formats, and communication protocols are used in distributed energy resource systems. 

00:01:08

Let s open the model now.In general, distributed energy resource management  

00:01:14

systems, or DERMS, rely on gateway devices to pass multi-protocol messages between two types of  

00:01:23

remote networks: system operators, such as SCADA, Data Management Systems, or microgrid controllers;  

00:01:30

and one or more distributed energy resources, or DERs. The remotely operated DER interfaces  

00:01:38

with the communication infrastructure via a remote terminal unit, or RTU. 

00:01:44

Usually, multiple protocols are used in microgrid setups, since there are  

00:01:49

a multitude of different equipment vendors and applications. That s why gateway devices must  

00:01:54

provide multi-protocol support for efficient system integration and interoperability. 

00:01:59

This example model shows you how to model a communications test environment for a DERMS  

00:02:06

gateway, by making use of generic DER components, communication protocols,  

00:02:12

and their client/server implementations. It is important to mention that this example model  

00:02:17

does not implement an actual gateway device. Instead, the gateway is represented as a black  

00:02:22

box abstraction that manages data exchange between the SCADA client and the Remote Terminal Units. 

00:02:30

A Modbus TCP client is implemented in HIL SCADA and can send and read messages to and from the  

00:02:37

DERMS. Additionally, the DERMS communicates with the RTUs, which are in the Schematic  

00:02:45

Editor model and included in the generic User Interface components. Generic components are  

00:02:50

used here to represent the Microgrid model and as the best solution for implementation  

00:02:54

and testing of communication protocols.Now let s look at the model and detailed  

00:02:58

explanation about how this example is implemented. 

00:03:03

The model consists of a PV Power Plant (Generic) and a Battery ESS (Generic) component to simulate  

00:03:10

a small microgrid connected to a Three Phase Grid and a constant impedance load, representing the  

00:03:15

grid demand. For more information on generic DER components, and how you can use them yourself,  

00:03:22

please check back to the dedicated lessons and the license notice in the HIL Fundamentals course. 

00:03:29

In this example, the User Interface components are represented as Remote  

00:03:33

Terminal Units and are named depending on the communication protocol they use:  

00:03:37

Remote Terminal Unit Modbus SunSpec and Remote Terminal Unit CAN Bus. 

00:03:42

Let s take a Look Under the Mask of each of these components to see how we can  

00:03:45

implement each communication protocol so that it connects to the model. 

00:03:51

For RTU Modbus SunSpec, we can see the Modbus SunSpec Device component present there.  

00:03:56

All the measurements from the model that we want to read in the remote  

00:03:59

SCADA are connected to the left side of the component, and the variables that we want  

00:04:03

to control from the SCADA are connected to the right side of the component. 

00:04:07

Let s open the Modbus SunSpec component to check how we configure it. 

00:04:11

As you can see, the configuration is similar to the standard Modbus Server,  

00:04:16

that s because the SunSpec Modbus Device component in Typhoon HIL Schematic Editor  

00:04:20

is implemented in a similar way to the Modbus components we covered in earlier lessons. 

00:04:25

The network configuration remains the same as in the Modbus Server.  

00:04:29

The main difference is in the Register Configuration. Registers of the Common  

00:04:33

model are automatically created and are predefined in the Common model tab. Here  

00:04:37

it is possible to specify the Manufacturer, Model, and Serial number of the SunSpec device. 

00:04:45

After switching to the Standard Models tab, you can specify what Standard Models the server will  

00:04:50

support. Clicking the Add Standard Model button, a list of all Standard Models will  

00:04:55

be presented where a specific model can be selected. Each selected model appears as a  

00:05:00

separate tab. As you can see here, we have added Immediate Controls and Inverter tabs. 

00:05:05

The immediate controls function block includes the following: connect and disconnect from the grid,  

00:05:10

adjust maximum generation level up and down, adjust power factor and adjust fixed VAR delivery.  

00:05:16

It is possible to select which variables we want to include from the predefined variables and  

00:05:21

control them from the model via signal processing inputs and outputs by selecting them like here. 

00:05:26

From this block we select the variables we want to control from the Modbus client directly  

00:05:30

to the PV plant. This will include output terminals to the Modbus Sunspec component. 

00:05:37

The Inverter Three Phase function block includes  

00:05:40

measurements and commands related to the PV inverter such as Voltage,  

00:05:43

Current, Power, Frequency, and Temperature measurement and controls. 

00:05:48

For this example, we want to select from the Inverter model the variables: AC Power,  

00:05:54

Line Frequency, AC apparent power, and AC reactive power. With this setup we can read those variables  

00:06:00

from the PV plant, in the model, in the Modbus Client remote SCADA. Also, this will add input  

00:06:07

terminals to the Sunspec device that can be connected to the signal processing measurements. 

00:06:13

The order of the models can be easily changed by dragging and dropping a model tab to the desired  

00:06:17

position like shown here. The register addresses will be automatically updated. 

00:06:24

The Vendor Models tab is the same as Standard Models tab with the difference that after  

00:06:28

clicking the Add Vendor Model button, a browser window will be presented where any vendor model,  

00:06:33

with an ID between 65000 and 65535, can be imported. 

00:06:42

After the register map is configured, on OK button,  

00:06:46

validation of the initial values will occur and if the validation passes, a configuration is  

00:06:50

created and written in the configuration property of Modbus Device component. 

00:06:55

Here in the component mask we can also see all the input and output terminals that  

00:06:59

were configured for this example.Now let s go to the RTU CAN Bus,  

00:07:05

which is connected to the Battery storage system.Under the mask of the RTU CAN Bus, we can see a  

00:07:11

loopback of CAN controllers implemented using 2 sets of CAN Send and CAN Receive components.  

00:07:16

All variables parsed to the first CAN controller are sent back to the second CAN controller,  

00:07:21

which then sends them back to the model. The main idea here is to exercise the CAN  

00:07:25

communication in the same device in order to check data integrity. In order for that  

00:07:29

to work it is important to physically connect the CAN1 and CAN2 controller via a loopback. 

00:07:36

Coming back to the root of the model, the component settings of each UI block let you choose  

00:07:41

between two ways of control: Model control, which allows for control by signal processing and SCADA  

00:07:46

inputs, or communication, which allows for control over the implemented communication protocol.  

00:07:52

In the case of the Modbus Sunspec component, we can also setup the network from here. 

00:07:58

Before we compile, we should mention that this model can be executed only on HIL404  

00:08:04

and supported HIL 6-series devices, since HIL402 doesn t have the CAN bus hardware capability. 

00:08:10

Now, let s compile the model and go to the SCADA panel. 

00:08:22

The Modbus SunSpec client implementation is done through SCADA API during Panel Initialization. 

00:08:28

This means that before running the simulation we need to set the same Modbus IP address  

00:08:32

that we used in Schematic Editor in the SCADA Panel Model Initialization file.  

00:08:37

By doing this, we can connect the Modbus Client SCADA API to the Modbus Server in the HIL device.  

00:08:43

To recall, this procedure was covered in the previous lesson on Modbus Client SCADA API. 

00:08:49

Let s do this now. 

00:08:53

The SCADA panel consists of three groups of widgets: the Control room,  

00:08:57

the Multiprotocol gateway, and On-site measurements. 

00:09:02

The control room is the part where the Modbus Client TCP requests are sent to the gateway.  

00:09:07

The gateway receives the requests and sends them to the RTU meter, which is represented  

00:09:12

in the On-site measurements group in this example here. From On-site measurements,  

00:09:17

an RTU response is sent to the gateway, which forwards the TCP response to the control room. 

00:09:24

As mentioned in the introduction, the gateway device is an abstraction,  

00:09:28

hence there is no CAN or ethernet converter modeled for the client-side.  

00:09:32

The client-server CAN bus messaging is realized via a direct physical loopback  

00:09:36

between two CAN controllers on the HIL device. In this example the CAN bus is connected to the  

00:09:41

battery storage system, which can represent Battery Management System communication. 

00:09:48

Let s interact with the model and see how we can control our plant using this remote approach. 

00:09:53

It is important to first verify the IP address of the Modbus Client at the panel initialization,  

00:09:58

here you can see how to change this.After we click to run the simulation,  

00:10:03

if all the communications are properly working, you will see the animation that  

00:10:07

represents the information flow from the SCADA to the On-site measurements and vice-versa. 

00:10:13

Now it is possible to control directly the PV plant and the battery. The PV plant is  

00:10:18

controlled via Modbus requests and the Battery via CAN bus messages (from the loopback connection). 

00:10:24

You can turn on and off the battery inverter, enable or disable the PV inverter,  

00:10:28

and connect or disconnect the grid and the load.It is also possible to choose if you want to  

00:10:34

command the plant directly from SCADA inputs or from the communication protocols implemented. 

00:10:40

Also, if you double click the Control room widget, you can see all the measurements  

00:10:44

performed by the Modbus Client for the PV plant on the right side, and the measurements for  

00:10:48

the battery by the CAN bus at the left side.Getting back to the SCADA root panel, you can  

00:10:54

access the Battery ESS interface and the PV plant interface directly and check the measurements that  

00:11:00

are read on site, they should be the same as the ones read remotely in the Control Room widget. 

00:11:06

With this, we ve covered the basic features of the multi-protocol gateway example.  

00:11:11

For more information on other use cases of this multi-protocol gateway application, check out the  

00:11:17

Application Note in the Materials tab.

00:11:20

Thank you for  watching!

Please Wait!

Please wait... it will take a second!