# uibkaccsev/-bergang architecture

> Architecture diagram of the GitHub repository uibkaccsev/-bergang, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uibkaccsev/-bergang
- Repository: https://github.com/uibkaccsev/-bergang

## Overview

This repository appears to be a Python-based testbench application for VESC/motor measurements, with a packaged Windows executable for end users.

1. **Top-level purpose**
   - The project centers on an automated motor/drive measurement workflow: starting a test, selecting motor/configuration data, acquiring signals, detecting motor behavior, and writing measurement protocols.
   - The presence of `VESC_Testbench.exe` suggests the repo is meant to be deployed as a desktop tool rather than a library.

2. **Launch and UI boundary**
   - `exe_entry.py` and `gui_launcher.py` are the main entry points.
   - `gui_launcher.py` likely starts the user-facing application, while `exe_entry.py` is the executable bootstrap used when the project is bundled into the `.exe`.
   - This is the outer boundary where an operator interacts with the system.

3. **Measurement workflow/orchestration**
   - `messablauf.py` is the clearest sign of a central measurement sequence controller.
   - It likely coordinates the order of operations: setup, triggering instrument reads, collecting data, evaluation, and final reporting.
   - This module is the main “spine” of the application and probably calls into the specialized measurement components below.

4. **Motor and signal analysis subsystems**
   - `Motordaten_detektion.py` suggests logic for detecting or extracting motor data from measurements.
   - `BEMF-aktualisierung.py` and `bemf_protokoll.py` indicate a back-EMF-related analysis/reporting path.
   - These modules likely consume raw measurement data and produce derived results used in the workflow and logs.

5. **Oscilloscope-based acquisition**
   - `oszi_BEMF_measure.py` and `oszi_dm_measure.py` indicate dedicated oscilloscope acquisition scripts for different measurement modes.
   - `OscilloscopeStream_dm.csv` is likely an example capture, template, or recorded dataset used by the measurement code.
   - This is a hardware-facing subsystem that probably interfaces with an oscilloscope or streamed waveform data source.

6. **Power supply / external hardware control**
   - `lan_PSU.py` likely manages a laboratory power supply over the network.
   - This is an important hardware boundary because it implies the testbench does not only read data but also actively controls test conditions.
   - If diagramming the system, this should be shown as a separate device integration path alongside the oscilloscope and motor controller.

7. **Motor controller configuration**
   - `mcconf_set.py` suggests configuration of the motor controller, likely VESC-related settings.
   - This is probably the setup layer that applies parameters before or during a test run.
   - It sits between the operator workflow and the motor hardware.

8. **Logging and reporting**
   - `messprotokoll_V3.py` appears to be the main measurement protocol/report generator.
   - `bemf_protokoll.py` is a specialized protocol path for BEMF measurements.
   - These modules likely persist results, measurements, and evaluation summaries, forming the output side of the architecture.

9. **Configuration/data assets**
   - `config/Lastmotor.json` and `config/Motorauswahl.json` are persistent configuration inputs.
   - They likely store selectable motor/load-motor definitions and parameters used by the workflow.
   - These JSON files are a clear data boundary: user-facing measurement code depends on them for test setup.

10. **Runtime shape**
   - The repository is primarily a Python application with hardware integration, likely running on a Windows machine connected to lab equipment.
   - The `.exe` packaging suggests the runtime can be distributed without requiring the user to run Python directly.
   - The architecture is therefore best drawn as: operator/UI → workflow controller → measurement/control modules → external devices, with config files and protocol outputs as supporting data paths.

11. **Key external dependencies inferred from structure**
   - Oscilloscope / streaming measurement source
   - Network-controlled lab power supply
   - Motor controller / VESC device
   - Local filesystem for configs, CSVs, and protocols
   - Windows executable packaging for deployment

12. **How to diagram the boundaries**
   - Put the GUI/executable at the top.
   - Show `messablauf.py` as the orchestration core.
   - Branch from it to:
     - acquisition modules (`oszi_*`, `Motordaten_detektion.py`)
     - control/config modules (`lan_PSU.py`, `mcconf_set.py`)
     - reporting modules (`messprotokoll_V3.py`, `bemf_protokoll.py`)
   - Place `config/*.json` and CSV files as inputs, and measurement protocols as outputs.

13. **What is not clear from the repo**
   - The README provides no architectural detail.
   - The exact hardware protocols and whether the oscilloscope/PSU are vendor-specific cannot be confirmed from filenames alone.
   - Still, the module names strongly indicate a lab/testbench application focused on motor and BEMF measurement automation.

Main entry points: [`messablauf.py`](https://github.com/uibkaccsev/-bergang/blob/main/messablauf.py) (Workflow), [`oszi_dm_measure.py`](https://github.com/uibkaccsev/-bergang/blob/main/oszi_dm_measure.py) (DM measure), [`oszi_BEMF_measure.py`](https://github.com/uibkaccsev/-bergang/blob/main/oszi_BEMF_measure.py) (BEMF measure), [`gui_launcher.py`](https://github.com/uibkaccsev/-bergang/blob/main/gui_launcher.py) (GUI launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interface"]
  node_exe_entry["Exe entry<br/>bootstrap<br/>[exe_entry.py]"]
  node_gui_launcher["GUI launcher<br/>ui entry<br/>[gui_launcher.py]"]
end

subgraph group_workflow["Workflow"]
  node_messablauf["Workflow<br/>orchestrator<br/>[messablauf.py]"]
  node_mcconf_set["MC config<br/>controller setup<br/>[mcconf_set.py]"]
  node_messprotokoll["Protocol<br/>report writer"]
  node_bemf_protokoll["BEMF report<br/>specialized report<br/>[bemf_protokoll.py]"]
end

subgraph group_hardware["Hardware"]
  node_oszi_dm["DM measure<br/>oscilloscope capture<br/>[oszi_dm_measure.py]"]
  node_oszi_bemf["BEMF measure<br/>oscilloscope capture"]
  node_motordaten["Motor detect<br/>signal analysis"]
  node_bemf_update["BEMF update<br/>analysis step"]
  node_lan_psu["LAN PSU<br/>power control<br/>[lan_PSU.py]"]
  node_oscilloscope[("Oscilloscope<br/>external device")]
  node_psu_device[("Power supply<br/>external device")]
  node_motor_controller[("Motor controller<br/>external device")]
end

subgraph group_data["Data"]
  node_lastmotor["Lastmotor<br/>config json<br/>[Lastmotor.json]"]
  node_motorauswahl["Motor selection<br/>config json<br/>[Motorauswahl.json]"]
  node_stream_csv["Stream data<br/>capture csv"]
end

node_exe_entry -->|"starts"| node_gui_launcher
node_gui_launcher -->|"invokes"| node_messablauf
node_messablauf -->|"configures"| node_mcconf_set
node_messablauf -->|"runs dm capture"| node_oszi_dm
node_messablauf -->|"runs BEMF capture"| node_oszi_bemf
node_oszi_dm -->|"reads"| node_oscilloscope
node_oszi_bemf -->|"reads"| node_oscilloscope
node_oszi_dm -->|"feeds"| node_motordaten
node_oszi_bemf -->|"feeds"| node_bemf_update
node_motordaten -->|"summarizes"| node_messprotokoll
node_bemf_update -->|"summarizes"| node_bemf_protokoll
node_messablauf -->|"controls"| node_lan_psu
node_lan_psu -->|"drives"| node_psu_device
node_mcconf_set -->|"applies settings"| node_motor_controller
node_messablauf -->|"loads"| node_lastmotor
node_messablauf -->|"loads"| node_motorauswahl
node_oszi_dm -.->|"uses sample"| node_stream_csv

click node_exe_entry "https://github.com/uibkaccsev/-bergang/blob/main/exe_entry.py"
click node_gui_launcher "https://github.com/uibkaccsev/-bergang/blob/main/gui_launcher.py"
click node_messablauf "https://github.com/uibkaccsev/-bergang/blob/main/messablauf.py"
click node_mcconf_set "https://github.com/uibkaccsev/-bergang/blob/main/mcconf_set.py"
click node_messprotokoll "https://github.com/uibkaccsev/-bergang/blob/main/messprotokoll_V3.py"
click node_bemf_protokoll "https://github.com/uibkaccsev/-bergang/blob/main/bemf_protokoll.py"
click node_oszi_dm "https://github.com/uibkaccsev/-bergang/blob/main/oszi_dm_measure.py"
click node_oszi_bemf "https://github.com/uibkaccsev/-bergang/blob/main/oszi_BEMF_measure.py"
click node_motordaten "https://github.com/uibkaccsev/-bergang/blob/main/Motordaten_detektion.py"
click node_bemf_update "https://github.com/uibkaccsev/-bergang/blob/main/BEMF-aktualisierung.py"
click node_lan_psu "https://github.com/uibkaccsev/-bergang/blob/main/lan_PSU.py"
click node_lastmotor "https://github.com/uibkaccsev/-bergang/blob/main/config/Lastmotor.json"
click node_motorauswahl "https://github.com/uibkaccsev/-bergang/blob/main/config/Motorauswahl.json"
click node_stream_csv "https://github.com/uibkaccsev/-bergang/blob/main/OscilloscopeStream_dm.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_exe_entry,node_gui_launcher toneBlue
class node_messablauf,node_mcconf_set,node_messprotokoll,node_bemf_protokoll toneAmber
class node_oszi_dm,node_oszi_bemf,node_motordaten,node_bemf_update,node_lan_psu,node_oscilloscope,node_psu_device,node_motor_controller toneMint
class node_lastmotor,node_motorauswahl,node_stream_csv toneRose
```

## Components

### Interface

User-facing launch and application entry points.

- [Exe entry](https://github.com/uibkaccsev/-bergang/blob/main/exe_entry.py): bootstrap · Windows executable bootstrap for bundled execution. · `exe_entry.py`
- [GUI launcher](https://github.com/uibkaccsev/-bergang/blob/main/gui_launcher.py): ui entry · Starts the operator-facing application. · `gui_launcher.py`

### Workflow

Measurement orchestration and result generation.

- [Workflow](https://github.com/uibkaccsev/-bergang/blob/main/messablauf.py): orchestrator · Coordinates the measurement sequence from setup to completion. · `messablauf.py`
- [MC config](https://github.com/uibkaccsev/-bergang/blob/main/mcconf_set.py): controller setup · Applies motor-controller configuration before or during tests. · `mcconf_set.py`
- [Protocol](https://github.com/uibkaccsev/-bergang/blob/main/messprotokoll_V3.py): report writer · Generates the main measurement protocol and results output. · `messprotokoll_V3.py`
- [BEMF report](https://github.com/uibkaccsev/-bergang/blob/main/bemf_protokoll.py): specialized report · Writes back-EMF-specific protocol output. · `bemf_protokoll.py`

### Hardware

Device integration and acquisition modules.

- [DM measure](https://github.com/uibkaccsev/-bergang/blob/main/oszi_dm_measure.py): oscilloscope capture · Oscilloscope acquisition path for dm measurements. · `oszi_dm_measure.py`
- [BEMF measure](https://github.com/uibkaccsev/-bergang/blob/main/oszi_BEMF_measure.py): oscilloscope capture · Oscilloscope acquisition path for back-EMF measurements. · `oszi_BEMF_measure.py`
- [Motor detect](https://github.com/uibkaccsev/-bergang/blob/main/Motordaten_detektion.py): signal analysis · Extracts or detects motor data from measurement signals. · `Motordaten_detektion.py`
- [BEMF update](https://github.com/uibkaccsev/-bergang/blob/main/BEMF-aktualisierung.py): analysis step · Updates or transforms back-EMF related measurement data. · `BEMF-aktualisierung.py`
- [LAN PSU](https://github.com/uibkaccsev/-bergang/blob/main/lan_PSU.py): power control · Controls the lab power supply over the network. · `lan_PSU.py`
- **Oscilloscope**: external device · External waveform acquisition instrument.
- **Power supply**: external device · Externally controlled laboratory power supply.
- **Motor controller**: external device · VESC or related motor-control target under test.

### Data

Configuration and captured measurement assets.

- [Lastmotor](https://github.com/uibkaccsev/-bergang/blob/main/config/Lastmotor.json): config json · Load motor configuration data used by the workflow. · `config/Lastmotor.json`
- [Motor selection](https://github.com/uibkaccsev/-bergang/blob/main/config/Motorauswahl.json): config json · Motor selection and parameter data for test setup. · `config/Motorauswahl.json`
- [Stream data](https://github.com/uibkaccsev/-bergang/blob/main/OscilloscopeStream_dm.csv): capture csv · Example or captured oscilloscope stream data. · `OscilloscopeStream_dm.csv`

## Connections

- Exe entry → GUI launcher: starts · Executable bootstrap launches the UI application.
- GUI launcher → Workflow: invokes · The UI hands control to the measurement workflow.
- Workflow → MC config: configures · Workflow applies controller setup before measurement.
- Workflow → DM measure: runs dm capture · Workflow triggers oscilloscope-based dm measurement.
- Workflow → BEMF measure: runs BEMF capture · Workflow triggers oscilloscope-based BEMF measurement.
- DM measure → Oscilloscope: reads · DM measurement acquires signals from the oscilloscope.
- BEMF measure → Oscilloscope: reads · BEMF measurement acquires signals from the oscilloscope.
- DM measure → Motor detect: feeds · Captured signals are analyzed for motor data.
- BEMF measure → BEMF update: feeds · Captured signals are processed for BEMF updates.
- Motor detect → Protocol: summarizes · Detected motor data is written to the main protocol.
- BEMF update → BEMF report: summarizes · BEMF analysis is written to the specialized report.
- Workflow → LAN PSU: controls · Workflow can enable or adjust the power supply.
- LAN PSU → Power supply: drives · Network control targets the laboratory power supply.
- MC config → Motor controller: applies settings · Configuration is pushed to the motor controller under test.
- Workflow → Lastmotor: loads · Workflow reads load-motor configuration data.
- Workflow → Motor selection: loads · Workflow reads motor selection data.
- DM measure → Stream data: uses sample · DM measurement can consume or mirror stream capture data.
