[[2025-01-29]]
# What's Going Down
I wrote most of the results section, and am now reworking a lot of the experimental methods section. I wrote a big summary of where things were at on 1/24 at [[2025-01-24 Where's Everyone At]]. The big items I wrote down were:

3. Experimental Setup and Methods
	1. HITL
		1. Needs reworked a bit. Maybe combine with the next ARCADE section?
	2. ARCADE
		1. a One paragraph stub. Needs rewritten
	3. SmAHTR
		1. I wrote only like two sentences. That's weak sauce man

# Existing Outline and Text
3. Experimental Setup and Methods
   Preview of what's to come, ordering
	1. SmAHTR
		1. What is it
		2. Why is it a good fit?
		3. What are we controlling?
	2. HiL
		1. What is HiL
		2. What is ARCADE
		3. What is PyMODBUS
		4. Why BeagleBoneBlack
		5. What does BBB do?
	3. Then the figure??

## Problems
1. SmAHTR first is a little confusing. At least the way we've got it oriented. Maybe do smahtr-hil-we have a model-arcade-what are controlling-using BBB-pymodbus-how we implemented FHE (figure)
## Previous Writing
```LaTeX
\subsection{Small Modular Advanced High Temperature Reactor}

The Small Modular Advanced High Temperature Reactor (SmAHTR) is a proposed salt-cooled small-footprint modular reactor. A Simulink model of this reactor has already been created at the University of Pittsburgh, including 4 reactor cores with one common salt vault \cite{farberRealtimeSupervisoryControl2017}. 

%why are we using it? What's unique about it / why is it a good fit?

%lol bcus we already have it made.

%What are we controlling? Reactivity thru control rods. Adjust rods in one reactor to hit a set point. %Write control law and what we're doing

As with nearly all nuclear reactors, reactor temperature can be controlled by controlling reactivity. The SmAHTR reactor is no different, and for our use case, we create a control system that modulates reactivity (as rod position) to control the reactor to a certain average temperature. 

\subsection{Hardware-in-the-Loop Using the ARCADE Platform}

% Briefly mention again why HiL
First we must discuss what Hardware-in-the-Loop (HiL) simulation. Testing is a critical part of the control system engineering process. Before a controller can be implemented in production, it must be experimented with in a controlled environment to be sure that the behavior expected is what is actually realized. But, it is not always possible to test on the real plant--the actual system may be too dangerous, expensive, or plainly inaccessible to do experiments with before implementing the final control system. For these cases, HiL simulation can mitigate these constraints. In a HiL simulation, we use our model of a physical plant to create sensor and actuator dynamics and interfaces that replicate what is expected for the real plant. This simulated plant is then connected to the controller implementation for testing. This controller can then be continuously refined in parallel with the HiL simulation until, ideally, the controller is simply disconnected from the simulation and instead connected to the actual sensors and actuators of the real plant.

%%% talk about arcade here. Mention that HiL is used in nuclear a lot, but often has a lot of infrastructure and testing teams assossciated. We used ARCADE because it's open source, allowing us it to modify whatever we want easily

%%% talk about pymodbus here. we're using modbus because it's a standard messasging protocol for PLCs. it is the standard for what ARCADE uses to talk to

The BeagleBone Black (BBB) is a compact, cost-effective embedded platform designed for real-time control applications, making it well-suited for hardware-in-the-loop (HIL) simulations. Developed by the BeagleBoard.org Foundation, the BBB provides an optimal balance of processing power, low-latency operation, and compatibility with industry-standard communication protocols. It features a 1 GHz ARM Cortex-A8 processor, 512 MB of DDR3L RAM, and 4 GB of onboard eMMC flash storage, with a Debian-based Linux operating system preinstalled. Additionally, the inclusion of a microSD card slot enables both storage expansion and deployment of alternative operating systems, enhancing system flexibility.

In the proposed HIL framework, the BBB functions as the primary controller, facilitating secure and real-time communication with the Advanced Reactor Cyber Analysis and Development Environment (ARCADE) via Modbus TCP/IP. This setup ensures that encrypted control signals can be transmitted, processed, and executed without exposing their contents to potential cybersecurity threats. The BBB’s computational resources enable the system to meet the required sampling periods while maintaining low-latency performance. To further optimize efficiency, memory management techniques were employed, and asynchronous communication was implemented using the Python pymodbus library. These enhancements allow the system to adapt dynamically to changes in reactor conditions while ensuring control stability.

Debian Linux was chosen as the operating system due to its compatibility, stability, and suitability for resource-constrained environments. As the default OS for the BBB, Debian provides a lightweight yet robust foundation for real-time applications. Compared to other Linux distributions, Debian’s emphasis on long-term support (LTS) and system reliability makes it an ideal choice for implementing encrypted control systems where stability and performance are critical. 
```
# Future Outline
3. Experimental Setup and Methods
	1. Intro
	2. SmAHTR
	3. Hardware in the loop
	4. We have a model
	5. Arcade
	6. What are we controlling
	7. BBB
	8. Pymodbus
	9. How we implemented FHE (figure)