1 of 33

Device Modeling Team�Final Presentation

2 of 33

Problem Statement:

The security of electrical grid

​

Device Team: Explore Physics-Informed Neural Networks (PINNs) and Holomorphic Embedding Load Flow (HELF)

Network Team: Integration of DNP3 communication Protocol

Monitoring Team: Introduce new HELICS python federate

Introduction

3 of 33

Problem and Project Goals

Background/Problem

Simulate a secure smart grid with a focus on the devices, communications, and monitoring within an individual substation.

Final Goals

Develop new functional models for 5 substation level devices

​

Complete DNP3 network integration

​

Create monitoring and fault tolerant behavior across modeled devices and communications

4 of 33

Project Roadmap

5 of 33

Device Modeling Subteam

Members: Vidur, Zaeem, Nicholas

​

Goal:

Integration with Protocols:

  • Continue working on the integration of various communication protocols to ensure smooth data exchange across all system components.

Modeling New Devices:

  • Develop models for new devices that are missing from the current system and complete the models for existing devices where necessary.

Integration with ROS Subteam:

  • Continue collaboration with the ROS subteam to ensure proper integration and functionality within the larger simulation framework.

Exploratory Machine Learning (ML) Work:

  • Continue exploratory ML work and explore ways to integrate it with the overall simulation environment.

Simulating Fault Tolerance and Recovery:

  • Begin working with the monitoring subteam to simulate fault tolerance and recovery mechanisms within the system.

​

​

6 of 33

Device Modeling Subteam Tasks

Task 1 - GLM Object Implementation

  • understand the purpose of each object in the glm and learn how to implement them.

Task 2 - DNP3 server commands

  • Implement methods to send commands from a server using DNP3.

Task 3: Fault Tolerance and Recovery

  • Implement mechanisms for fault tolerance and recovery to ensure simulation integrity

Task 4: Powerflow-ML

  • Explore Physics-Informed Neural Networks (PINNs) for physics-consistent solutions and Holomorphic Embedding Load Flow (HELF) for robust convergence in powerflow simulations.

​

​

7 of 33

Device Modeling Subteam- Powerflow ML

  • Graphical Neural Networks (GNNs): Previous work explored GCNs, GATs, and GINs for powerflow simulations, each with unique strengths in modeling physical environments.

​

  • Physics-Informed Neural Networks (PINNs): This semester focuses on PINNs, which integrate physical laws into neural networks for accurate, physics-consistent powerflow solutions.

​

  • Holomorphic Embedding Load Flow (HELF): HELF ensures guaranteed convergence in powerflow simulations, even in scenarios where traditional methods struggle.

​

  • Solver Advancements: PINNs offer physics-based accuracy, while HELF ensures stability, providing robust alternatives to traditional powerflow solvers.

​

​

8 of 33

HELF Implementation

  • Easier to test since numerical methods don’t require training data
  • Useful to benchmark other methods once dataset is found/cleaned
  • Not hooked up to the GUI yet

9 of 33

Network Protocol Integration Subteam Tasks

Task 1 - DNP3 Working Example

  • Prototype Python bindings for dnp3 library

Task 2 - Integration between DNP3 and device models

  • Work DNP3 into existing device models

Task 3 - Synthesis between device models and HELICS co-simulation

  • Add device models to HELICS co-simulation

Task 4 - Identify the devices in the substation to be modeled

Time permitting: Network Security (explore vulnerabilities and different scenarios), implementing other protocols (IEC 61850 & Modbus),

10 of 33

Helics Integration

Physics Modeling – GridLAB-D

Custom Device Models�+ ROS

Power Flow Equations - PyPower

Simulation Coordination - HELICS

Substation simulation occurs here

Using the simple_gridlabd_example as a base

11 of 33

Substation Simulation

  • Each device in the substation is simulated as a federate where it can pass signals within helics.
  • Each federate processes and passes values through subscriptions and publications defined by a json file

for t in range(0, total_inteval, pf_interval):

​

while grantedtime < t:

grantedtime = h.helicsFederateRequestTime(fed, t)

​

### Subscribing to Feeder Load from to GridLAB-D ###

for i in range(0, subkeys_count):

sub = subid["m{}".format(i)]

demand = h.helicsInputGetComplex(sub)

rload = demand.real

iload = demand.imag

​

if (not cb.is_closed_status()):

rload = 0

iload = 0

​

######### Publishing Voltage to GridLAB-D ##########

for i in range(0, pubkeys_count):

pub = pubid["m{}".format(i)]

status = h.helicsPublicationPublishComplex(pub, rload, iload)

​

cb = CircuitBreaker(name="CB1", protocol="Protocol1", max_current=200.0)

########## Registering federate from json ######

fed = h.helicsCreateValueFederateFromConfig("circuit_breakers_config.json")

h.helicsFederateRegisterInterfaces(fed, "circuit_breakers_config.json")

federate_name = h.helicsFederateGetName(fed)

logger.info("HELICS Version: {}".format(h.helicsGetVersion()))

logger.info("{}: Federate {} has been registered".format(federate_name, federate_name))

pubkeys_count = h.helicsFederateGetPublicationCount(fed)

subkeys_count = h.helicsFederateGetInputCount(fed)

######## Reference to Publications and Subscription form index ####

pubid = {}

subid = {}

for i in range(0, pubkeys_count):

pubid["m{}".format(i)] = h.helicsFederateGetPublicationByIndex(fed, i)

pubtype = h.helicsPublicationGetType(pubid["m{}".format(i)])

pubname = h.helicsPublicationGetName(pubid["m{}".format(i)])

logger.info("{}: Registered Publication ---> {}".format(federate_name, pubname))

for i in range(0, subkeys_count):

subid["m{}".format(i)] = h.helicsFederateGetInputByIndex(fed, i)

h.helicsInputSetDefaultComplex(subid["m{}".format(i)], 0, 0)

sub_key = h.helicsSubscriptionGetTarget(subid["m{}".format(i)])

logger.info("{}: Registered Subscription ---> {}".format(federate_name, sub_key))

12 of 33

Inter-device Communication

  • Process Level
    • Using Interprocess Communication (IPC) as model for serial communication
      • asyncIO
  • Rest of substation will use DNP3 as the networking protocol
    • Discussed in next section

​

13 of 33

Future Considerations

  • Helics is only implemented in two devices (circuit breakers and voltage current sensors)
  • Setting up the subscriptions is tedious and error prone. A script/program could possibly be made to make this easier.
  • An alternative setup would be running one federate for the substation and simulating all of the python devices in one file
    • This would use less system resources and may be needed if we expand the simulation

14 of 33

15 of 33

Transformer

What is a Transformer?

  1. Step-up Transformer
  2. Step-down Transformer

Components of a Transformer

  • Primary winding
  • Secondary winding
  • Core
  • Taps

16 of 33

How it works

17 of 33

Tap Changers

18 of 33

Tap Changers

19 of 33

Switchgear

  • What is switchgear?
    • Used for controlling, protecting, isolating electrical equipment
    • Collection of electrical devices that are used to manage/protect/isolate electrical equipment within a power system (circuit breakers are commonly part of switchgear)

20 of 33

Switchgear

  • Functions
    • turn_on
    • turn_off
    • trip
    • reset

21 of 33

Network Protocol Integration Subteam

Substation Network Architecture

  • DNP3 Protocol: Integration of DNP3 using C bindings to Python for reliable substation communication.
  • Other Protocols: Potential for future integration with IEC 61850 and Modbus.
  • Data concentrator architecture would allow for multiple substations to be simulated and controlled under a single master while also allowing the substation to use an array of IED’s

​

22 of 33

Technical Details - DNP3 Integration

  • Library - Step Function I/O’s Rust-based dnp3 implementation
  • Interface - Python wrapper around C FFI
    • Created shared libraries for Master, Outstation, and TCP Server using C bindings
    • Used Python’s ctypes package to interface with shared libraries
    • Created DNP3Outstation class as a wrapper around Outstation and TCP Server
  • Currently, all devices inherit from DNP3Outstation, including the Master

23 of 33

24 of 33

DNP3 Integration Progress

  • Previous Objectives
    • Have a working DNP3 example
    • Integrate DNP3 functionality into device models
  • Completed Efforts
    • dnp3-example repo where we created and tested our basic bindings
    • DNP3Outstation.py and Master.py are functional in cps-cosimulation-env
    • All existing devices now inherit from DNP3Outstation
    • Demo script showcasing basic DNP3 use case. Circuit breaker sends a binary update to the master when the breaker trips after reading a high current.

25 of 33

Demo

26 of 33

Evidence of Networking

From the Master station log

From Wireshark pcap

27 of 33

Next Steps with Networking

  • Future Efforts
    • Allow sending more robust values from the DNP3Outstation class
    • Implement commands into the Master class
    • Continue to understand how Stepfunc’s C FFI interfaces with DNP3
  • Skills Learned
    • Making objects
    • Python to C Bindings
    • Skeleton Architecture of Network
  • Skills Needed in Future
    • How to synthesize everything (HELICS co simulation and device models)

28 of 33

Monitoring Subteam

Members: Dhruv, Albert, Ethan, Reva

​

Goals:

1. Log co-simulation environment changes: Continuously monitor and record the evolving state of the co-simulation environment to ensure system stability and any changes that will impact overall performance.

​

2. Python scripts for incident resolution: Develop Python HELICS frameworks to support monitoring efforts by analyzing and resolving unexpected incidents and fault and creating physical parameter comparisons.

​

3. Alerts for anomaly detection: Develop an automated alert system to detect and notify members of and potential anomalies or irregularities in the environment to maintain system reliability by resolving issues before they escalate.

​

29 of 33

Monitoring Subteam Tasks

Task 1

  • Introduce new HELICS python federate. Used to compare and contrast any errors by monitoring physical parameters from other device models that we are receiving.

Task 2

  • Implement the respective process level python and .json files
    • Currently working on json file for monitoring and figuring out what parameters to add

30 of 33

Monitoring Subteam Tasks Cont.

Task 3 - Co-simulation Scenario Design:

  • Write HELICS framework code for specific error scenarios based on a device to ensure that HELICS can react to it.

Task 4 - Implement Real Time Data Monitoring

  • Enable live time data visualization and data recording for analysis within the co-simulation environment.

Task 5 - Implement more problems/faults to the system

  • Ensures that systems can work smoothly when problems arise (equipment failures/natural disasters).

31 of 33

Conclusion

Problem

Simulate a secure smart grid with a focus on the devices, communications, and monitoring within an individual substation.

Device Modeling Tasks

  • Complete more functional device models
  • Continue ML exploration
  • Code device level fault recovery

Network Integration Tasks

  • More robust DNP3 functionality
  • Inter-Process Communication
  • Network security

Monitoring Tasks

  • Continue HELICS co-simulation integration
  • Ensure smooth system operation when problems arise
  • Intentionally introduce faults to test system

32 of 33

References

Research/Images

​

Tutorials

​

Introductory Information:

33 of 33

Questions?