Rossy's Notebook - cps-vip/cps-cosimulation-env GitHub Wiki
- Kickoff Presentation
- Get Cosimulation environment and GRIDLAB-D Working
- Look into DNP3
- Look into MODBUS
- Begin CS 6263: Intro to Cyber-Physical Systems Security Course Videos
Schedule:
Week 1: January 11th
During this week I was introduced to the team and class.
Week 2: January 18th \
Week 3: January 25th
This week, I helped create and present slides for the kickoff presentation. I assigned myself on the networking subteam because I felt that having taken computer networking 1 here at GT, I would be more familiar with the concepts in the subteam.
Week 4: February 1s
This week I attempted to install the cosimulation environment. First, I tried using Docker to set up a Linux environment but couldn't quite get that working due to my own inexperience in Docker. So instead, I pivoted to setting up an Ubuntu Virtual Machine on my computer and getting the cosimulation environment working there. Currently, I am also reading up on DNP3 and what exactly GRIDLAB-D is.
DNP3
From what I can see, DNP3 seems to be mainly used in utility infrastructure. It is a master/slave protocol. In the context of powerlines, slave devices are outstations that send data either by request of the master control station, or by its own accord. DNP3 does not follow the traditional OSI model followed by most computer networking protocols I have read about. Instead, it takes a simple 3 layer approach. The physical layer is implemented through RS-232.
It appears that currently, DNP3 is implemented in dnp3_interface.py, but this file seems to be empty?
2/8/2024
-Installed ubuntu virtual machine my windows PC. Managed to get nix and HELICS built on my machine. Initially, there was some awkwardness due to me not fully knowing how git submodules worked, but I figured out and managed to get the entire project built.
The next steps for me are to look into the example gridlab-d stuff and see what they do, and how to use gridlab-d.
Currently, I am watching this video in an attempt to understand more gridlab-d stuff: https://www.youtube.com/watch?v=YFg8ISDhlAg&t=36s
2/21/2024
I worked on the draft for our final paper due this semester, mainly the case study and the conclusion to the paper. It was my first experience writing a research paper.
3/6/2024
I attempted to run run_simulation.py in the device modeling subfolder. For some reason, it doesn't seem to work, and I suspect the issue is how I'm getting nix to work with it. I decided to spend some time looking into nix and seeing what it actually was and how to use it.
In the process, I learned that nix helps configure systems to run and build software. What makes it special compared to other ways of creating development environments is its declarative syntax used for specifying dependencies and other commands to configure a system. After playing around for a bit, I found a way to run run_simulation.py, only to then get errors. Looking into it further, I realized that the file was actually still incomplete because there are still a ton of placeholder functions that need to be implemented.
As a goal for the end of the semester, I think I would like to be able to get this file working once I ask the rest of the team and find out what the purpose of this file is.
I also kept continuing to look at gridlab-d. Mainly trying to understand how the power grid works and how gridlab-d simulates it. The concept of power flow equations is really intimidating to me, and while I know understanding them would require learning about differential equations, I still think there is value in looking at how gridlab-d works internally.
4/4/2024
I accomplished a lot this week.
First, I looked further into why my ubuntu virtualbox wasn't displaying a graph whenever the examples were run. I believe that this is because inside the nix environment, there is python310, but not python-tk, which as tkinter installed so that matplotlib has a graphics backend.
Apparently, it works for other people running linux, and it might be due to some graphics card settings on virtualbox. So, I will continue looking to that next week.
I also read up on Modbus. I learned that Modbus is pretty simple. It is a master/slave protocol, where the master sends messages to every device on a shared bus, but with an address so that the right slave knows that the master is talking to it. I'm a little confused about the memory mappings, but from my understanding, there are 4 different memory areas, each of which with different attributes.
The attributes of each memory area are shown below.
https://i.ytimg.com/vi/GlblujGwX9c/mqdefault.jpg
Each address in a memory address controls a specific output. If the address is readable, it will display the state of some input like a switch.
In the process of trying to learn about Modbus, I went down a rabbit hole of learning about what a PLC is, because Modbus is built on top of PLC's.
4/11/2024
Today, I installed TightVNC on my desktop. This should make troubleshooting faster and allow me to show my work in the meetings. I should have done this a long time ago.
Playing around with my virtualbox ubuntu environment more, I am doubting that it is my virtualbox that is preventing the matplotlib backend from working. Outside of my nix environment, I am able to create and display matplotlib graphs. It is only within the nix environment that I have this issue. So far, I have found that inserting this somewhere inside nix.flakes will work, but I'm not sure where to place this because I don't know how the nix language works.
[
(python3.override { x11Support = true; })
python3Packages.tkinter
]
4/24/2024
I worked on 3 parts of the final paper today: the case study, research sections, and the transition from a time-step simulation to an event-based simulation. By working on the paper, I was able to get a better understanding of the past work done on the project along with work accomplished by my team members this semester.