# boraayhan/depressurization-research-guadaloop architecture

> Architecture diagram of the GitHub repository boraayhan/depressurization-research-guadaloop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/boraayhan/depressurization-research-guadaloop
- Repository: https://github.com/boraayhan/depressurization-research-guadaloop

## Overview

This repository combines research datasets with an embedded depressurization-control testbed. Its shown control loop reads pressure and temperature, computes pressure and temperature PID commands, weights them by pressure range, and sends the combined command to a solenoid interface. PID implementation and weighting policy are separate internal layers. Sensor acquisition and solenoid actuation are still stubs; the Smith predictor is also a stub and is not called in the shown loop. Dataset files are present, but no runtime link to them is shown.

Main entry points: [`Guadaloop Testbed/src/main.cpp`](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp) (Control loop), [`Guadaloop Testbed/include/math/pid/pid.cpp`](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/math/pid/pid.cpp) (PID controller), [`Guadaloop Testbed/include/constants.h`](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/constants.h) (Pressure weighting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control logic"]
  node_loop["Control loop<br/>[main.cpp]"]
  node_pressure_model["Pressure differential<br/>[main.cpp]"]
  node_pid["PID controller<br/>[pid.cpp]"]
  node_weighting["Pressure weighting<br/>[constants.h]"]
  node_settings["Control settings<br/>[constants.h]"]
  node_structures["Control data types<br/>[data_structs.h]"]
  node_predictor["Smith predictor<br/>[main.cpp]"]
end

subgraph group_io["Hardware interfaces"]
  node_pressure["Pressure reading<br/>[main.cpp]"]
  node_temperature["Temperature reading<br/>[main.cpp]"]
  node_solenoid["Solenoid command<br/>[main.cpp]"]
end

subgraph group_research["Research data"]
  node_sensor_logs["Sensor logs<br/>[sensorlog.csv]"]
  node_tuning_data["Tuning results<br/>[tuningResults.csv]"]
end

node_environment(("Testbed environment"))
node_valve(("Solenoid valve"))

node_loop -->|"reads"| node_pressure
node_loop -->|"reads"| node_temperature
node_loop -->|"computes"| node_pressure_model
node_loop -->|"calls"| node_pid
node_loop -->|"selects weights"| node_weighting
node_loop -->|"sets duty"| node_solenoid
node_environment -.->|"would supply"| node_pressure
node_environment -.->|"would supply"| node_temperature
node_solenoid -.->|"would actuate"| node_valve

click node_loop "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp"
click node_pressure "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp"
click node_temperature "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp"
click node_pressure_model "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp"
click node_pid "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/math/pid/pid.cpp"
click node_weighting "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/constants.h"
click node_settings "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/constants.h"
click node_structures "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/data_structs.h"
click node_predictor "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp"
click node_solenoid "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp"
click node_sensor_logs "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/data/sensor_logs/sensorlog.csv"
click node_tuning_data "https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/data/tuning/tuningResults.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loop,node_pressure_model,node_pid,node_weighting,node_settings,node_structures,node_predictor toneBlue
class node_pressure,node_temperature,node_solenoid toneAmber
class node_sensor_logs,node_tuning_data toneMint
class node_environment,node_valve toneIndigo
```

## Components

### Control logic

- [Control loop](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp): `Guadaloop Testbed/src/main.cpp`
- [Pressure differential](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp): `Guadaloop Testbed/src/main.cpp`
- [PID controller](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/math/pid/pid.cpp): `Guadaloop Testbed/include/math/pid/pid.cpp`
- [Pressure weighting](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/constants.h): `Guadaloop Testbed/include/constants.h`
- [Control settings](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/constants.h): `Guadaloop Testbed/include/constants.h`
- [Control data types](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/include/data_structs.h): `Guadaloop Testbed/include/data_structs.h`
- [Smith predictor](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp): `Guadaloop Testbed/src/main.cpp`

### Hardware interfaces

- [Pressure reading](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp): `Guadaloop Testbed/src/main.cpp`
- [Temperature reading](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp): `Guadaloop Testbed/src/main.cpp`
- [Solenoid command](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/Guadaloop%20Testbed/src/main.cpp): `Guadaloop Testbed/src/main.cpp`

### Research data

- [Sensor logs](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/data/sensor_logs/sensorlog.csv): `data/sensor_logs/sensorlog.csv`
- [Tuning results](https://github.com/boraayhan/depressurization-research-guadaloop/blob/main/data/tuning/tuningResults.csv): `data/tuning/tuningResults.csv`

### Other components

- **Testbed environment**
- **Solenoid valve**

## Connections

- Control loop → Pressure reading: reads (evidence: `Guadaloop Testbed/src/main.cpp`)
- Control loop → Temperature reading: reads (evidence: `Guadaloop Testbed/src/main.cpp`)
- Control loop → Pressure differential: computes (evidence: `Guadaloop Testbed/src/main.cpp`)
- Control loop → PID controller: calls (evidence: `Guadaloop Testbed/src/main.cpp`)
- Control loop → Pressure weighting: selects weights (evidence: `Guadaloop Testbed/src/main.cpp`)
- Control loop → Solenoid command: sets duty (evidence: `Guadaloop Testbed/src/main.cpp`)
- Testbed environment → Pressure reading: would supply
- Testbed environment → Temperature reading: would supply
- Solenoid command → Solenoid valve: would actuate
