# tejavadlamudi03/motor-hmi architecture

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

- Interactive diagram: https://gitdiagram.com/tejavadlamudi03/motor-hmi
- Repository: https://github.com/tejavadlamudi03/motor-hmi

## Overview

Motor HMI is a secure desktop operator and engineering application for moteus and ST motor controllers, with a separate simulator and optional mobile monitoring. The operator signs in, selects a controller and transport, connects, then monitors or performs control and engineering tasks; the worker executes the control loop and returns telemetry to the UI. The graph also preserves documented safety, configuration, filtering, calibration, firmware, audit, and mobile capabilities. Some feature-tab and worker internals were not excerpted, so their links rely on README or indexed references.

Main entry points: [`moteus_hmi/ui/main_window.py`](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/main_window.py) (Main window), [`moteus_hmi/core/bus_worker.py`](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/bus_worker.py) (Control worker), [`moteus_hmi/app.py`](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/app.py) (Application startup), [`moteus_hmi/ui/context.py`](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/context.py) (Shared context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Operator interface"]
  node_app["Application startup<br/>[app.py]"]
  node_login["Sign-in<br/>[login.py]"]
  node_window["Main window<br/>[main_window.py]"]
  node_connection["Connection panel"]
  node_context["Shared context<br/>[context.py]"]
  node_bus_tab["Bus and devices<br/>[bus_tab.py]"]
end

subgraph group_runtime["Control runtime"]
  node_worker["Control worker<br/>[bus_worker.py]"]
  node_registry["Controller profiles<br/>[controllers.py]"]
  node_moteus["Moteus driver<br/>[moteus_backend.py]"]
  node_st["ST serial driver"]
  node_types["Motor data types<br/>[types.py]"]
  node_safety["Safety supervision<br/>[safety.py]"]
end

subgraph group_engineering["Engineering features"]
  node_calibration["Calibration<br/>[calibration_tab.py]"]
  node_tuning["Tuning<br/>[tuning_tab.py]"]
  node_parameters["Parameters<br/>[params_tab.py]"]
  node_filters["Feedback filters<br/>[filters.py]"]
  node_analysis["Step analysis<br/>[analysis.py]"]
end

subgraph group_security["Security and records"]
  node_auth[("Users and roles<br/>[auth.py]")]
  node_keystore[("Install keys<br/>[keystore.py]")]
  node_audit[("Audit trail<br/>[audit.py]")]
end

subgraph group_simulation["Simulation and mobile"]
  node_mobile["Mobile server<br/>[mobile_server.py]"]
  node_simulator["Motor simulator<br/>[canfd_sim.py]"]
  node_plant["Motor plant<br/>[plant.py]"]
end

node_operator(("Operator"))
node_phone(("Mobile viewer"))

node_operator -->|"starts"| node_app
node_app -->|"opens"| node_login
node_app -->|"creates"| node_window
node_operator -->|"selects link"| node_connection
node_window -->|"hosts"| node_connection
node_window -->|"uses"| node_context
node_context -->|"dispatches requests"| node_worker
node_connection -->|"selects profile"| node_registry
node_registry -->|"creates driver"| node_moteus
node_registry -->|"creates driver"| node_st
node_worker -->|"enforces limits"| node_safety
node_worker -->|"filters feedback"| node_filters
node_worker -->|"exchanges data"| node_types
node_window -->|"shows devices"| node_bus_tab
node_window -->|"opens feature"| node_calibration
node_window -->|"opens feature"| node_tuning
node_window -->|"opens feature"| node_parameters
node_worker -->|"runs step tests"| node_analysis
node_app -->|"loads accounts"| node_auth
node_app -->|"initializes keys"| node_keystore
node_context -->|"records actions"| node_audit
node_window -->|"starts service"| node_mobile
node_phone -->|"views status"| node_mobile
node_simulator -->|"simulates dynamics"| node_plant
node_simulator -.->|"emulates CAN bus"| node_worker

click node_app "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/app.py"
click node_login "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/login.py"
click node_window "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/main_window.py"
click node_connection "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/connection_panel.py"
click node_context "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/context.py"
click node_bus_tab "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/bus_tab.py"
click node_worker "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/bus_worker.py"
click node_registry "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/controllers.py"
click node_moteus "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/moteus_backend.py"
click node_st "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/st_mcsdk_backend.py"
click node_types "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/types.py"
click node_safety "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/safety.py"
click node_calibration "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/calibration_tab.py"
click node_tuning "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/tuning_tab.py"
click node_parameters "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/params_tab.py"
click node_filters "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/filters.py"
click node_analysis "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/analysis.py"
click node_auth "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/security/auth.py"
click node_keystore "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/security/keystore.py"
click node_audit "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/security/audit.py"
click node_mobile "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/remote/mobile_server.py"
click node_simulator "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/sim/canfd_sim.py"
click node_plant "https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/sim/plant.py"

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_app,node_login,node_window,node_connection,node_context,node_bus_tab,node_phone toneBlue
class node_worker,node_registry,node_moteus,node_st,node_types,node_safety toneAmber
class node_calibration,node_tuning,node_parameters,node_filters,node_analysis toneMint
class node_auth,node_keystore,node_audit toneRose
class node_mobile,node_simulator,node_plant,node_operator toneIndigo
```

## Components

### Operator interface

- [Application startup](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/app.py): `moteus_hmi/app.py`
- [Sign-in](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/login.py): `moteus_hmi/ui/login.py`
- [Main window](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/main_window.py): `moteus_hmi/ui/main_window.py`
- [Connection panel](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/connection_panel.py): `moteus_hmi/ui/connection_panel.py`
- [Shared context](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/context.py): `moteus_hmi/ui/context.py`
- [Bus and devices](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/bus_tab.py): `moteus_hmi/ui/tabs/bus_tab.py`

### Control runtime

- [Control worker](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/bus_worker.py): `moteus_hmi/core/bus_worker.py`
- [Controller profiles](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/controllers.py): `moteus_hmi/core/controllers.py`
- [Moteus driver](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/moteus_backend.py): `moteus_hmi/core/moteus_backend.py`
- [ST serial driver](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/st_mcsdk_backend.py): `moteus_hmi/core/st_mcsdk_backend.py`
- [Motor data types](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/types.py): `moteus_hmi/core/types.py`
- [Safety supervision](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/safety.py): `moteus_hmi/core/safety.py`

### Engineering features

- [Calibration](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/calibration_tab.py): `moteus_hmi/ui/tabs/calibration_tab.py`
- [Tuning](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/tuning_tab.py): `moteus_hmi/ui/tabs/tuning_tab.py`
- [Parameters](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/ui/tabs/params_tab.py): `moteus_hmi/ui/tabs/params_tab.py`
- [Feedback filters](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/filters.py): `moteus_hmi/core/filters.py`
- [Step analysis](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/core/analysis.py): `moteus_hmi/core/analysis.py`

### Security and records

- [Users and roles](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/security/auth.py): `moteus_hmi/security/auth.py`
- [Install keys](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/security/keystore.py): `moteus_hmi/security/keystore.py`
- [Audit trail](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/security/audit.py): `moteus_hmi/security/audit.py`

### Simulation and mobile

- [Mobile server](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/remote/mobile_server.py): `moteus_hmi/remote/mobile_server.py`
- [Motor simulator](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/sim/canfd_sim.py): `moteus_hmi/sim/canfd_sim.py`
- [Motor plant](https://github.com/tejavadlamudi03/motor-hmi/blob/main/moteus_hmi/sim/plant.py): `moteus_hmi/sim/plant.py`

### Other components

- **Operator**
- **Mobile viewer**

## Connections

- Operator → Application startup: starts (evidence: `README.md`)
- Application startup → Sign-in: opens (evidence: `moteus_hmi/app.py`)
- Application startup → Main window: creates (evidence: `moteus_hmi/app.py`)
- Operator → Connection panel: selects link (evidence: `README.md`)
- Main window → Connection panel: hosts (evidence: `moteus_hmi/ui/main_window.py`)
- Main window → Shared context: uses (evidence: `moteus_hmi/ui/main_window.py`)
- Shared context → Control worker: dispatches requests (evidence: `moteus_hmi/ui/context.py`)
- Connection panel → Controller profiles: selects profile (evidence: `moteus_hmi/ui/connection_panel.py`)
- Controller profiles → Moteus driver: creates driver (evidence: `moteus_hmi/core/controllers.py`)
- Controller profiles → ST serial driver: creates driver (evidence: `moteus_hmi/core/controllers.py`)
- Control worker → Safety supervision: enforces limits (evidence: `README.md`)
- Control worker → Feedback filters: filters feedback (evidence: `README.md`)
- Control worker → Motor data types: exchanges data (evidence: `moteus_hmi/core/bus_worker.py`)
- Main window → Bus and devices: shows devices (evidence: `moteus_hmi/ui/main_window.py`)
- Main window → Calibration: opens feature (evidence: `moteus_hmi/ui/main_window.py`)
- Main window → Tuning: opens feature (evidence: `moteus_hmi/ui/main_window.py`)
- Main window → Parameters: opens feature (evidence: `moteus_hmi/ui/main_window.py`)
- Control worker → Step analysis: runs step tests (evidence: `moteus_hmi/core/bus_worker.py`)
- Application startup → Users and roles: loads accounts (evidence: `moteus_hmi/app.py`)
- Application startup → Install keys: initializes keys (evidence: `moteus_hmi/app.py`)
- Shared context → Audit trail: records actions (evidence: `moteus_hmi/ui/context.py`)
- Main window → Mobile server: starts service (evidence: `moteus_hmi/ui/main_window.py`)
- Mobile viewer → Mobile server: views status (evidence: `README.md`)
- Motor simulator → Motor plant: simulates dynamics (evidence: `moteus_hmi/sim/canfd_sim.py`)
- Motor simulator → Control worker: emulates CAN bus (evidence: `README.md`)
