Skip to content

Commit 03a4ea0

Browse files
committed
2 parents 812cdaf + e523c01 commit 03a4ea0

2 files changed

Lines changed: 133 additions & 10 deletions

File tree

‎README.md‎

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,125 @@
1-
# thrust-stand-v3
2-
or aerothrust-v3. Next-gen propulsion test stand with architecture to facilitate future integration into other ground systems.
1+
# AeroThrust V3
2+
3+
The new ground station software for **UBC AeroDesign's** electric propulsion test stand rig.
4+
5+
AeroThrust V3 replaces the legacy PyQt5 test stand with a 60 FPS, real-time desktop application built with **Tauri**, **React**, **TypeScript**, and **FastAPI**. It features non-blocking telemetry streaming, automated test sweeps, granular 4-channel strain gauge calibration, and local SQLite data logging with automatic CSV export.
6+
7+
---
8+
9+
## 🚀 For Operators: How to Download & Run
10+
11+
You do **not** need Python, Node, or Rust installed to run the app.
12+
13+
1. Go to the [**Releases**](https://github.com/ubcaerodesign/thrust-stand-v3/releases) page on this repository.
14+
2. Under the latest version, download the installer for your computer:
15+
* **Windows:** Download `AeroThrust V3_1.0.x_x64-setup.exe`
16+
* **macOS:** Download `AeroThrust V3_1.0.x_aarch64.dmg`
17+
3. Run the installer, launch **AeroThrust V3**, and you're ready to test!
18+
19+
---
20+
21+
## ⚡ Quick Start: Running a Test
22+
23+
1. **Connect:** Choose **Virtual Simulator** (for offline practice) or **Physical USB Serial** (for the real test stand), select your COM port, and click **CONNECT**.
24+
2. **Tare:** Ensure the motor is off, then click **TARE ALL** (or click **⚙️ CHANNELS...** to zero individual load cells).
25+
3. **Log Data:** Click **NEW TEST RUN**, enter your motor/propeller/battery specs, and click **Start Recording**.
26+
4. **Run Motor:**
27+
* **Automated Sweep:** Pick a recipe in the **Auto Test Sequence** bar (e.g., *10% to 100% Stepped Sweep*) and click **▶ RUN AUTOMATED SWEEP**.
28+
* **Manual Control:** Check **ARM MOTOR** and use the slider or quick-step buttons (`+5%`, `25%`, `50%`).
29+
5. **Stop & Export:** Click **STOP & EXPORT** when finished, then click **📥 DOWNLOAD CSV** to get your testing data.
30+
6. **Emergency Stop:** Hit the **Spacebar** or click the red **E-STOP** button at any time to instantly cut the motor to 0% throttle.
31+
32+
---
33+
34+
## 🛠️ For Developers: Running in Development
35+
36+
If you are developing or maintaining the codebase:
37+
38+
### Prerequisites
39+
* **Python 3.10+**
40+
* **Node.js 18+** and **npm**
41+
* **Rust Toolchain** ([rustup.rs](https://rustup.rs/))
42+
43+
### 1. Setup Environment
44+
```bash
45+
# Set up Python virtual environment
46+
python -m venv .venv
47+
# Windows:
48+
.venv\Scripts\Activate.ps1
49+
# macOS/Linux:
50+
source .venv/bin/activate
51+
52+
# Install backend dependencies
53+
pip install -r backend/requirements.txt
54+
55+
# Install frontend dependencies
56+
cd frontend
57+
npm install
58+
cd ..
59+
```
60+
61+
### 2. Launch Local Dev Stack (3 Terminals)
62+
Open three terminal windows from the repository root:
63+
64+
* **Terminal 1 (Physics Simulator):**
65+
```bash
66+
python sim/virtual_stand.py
67+
```
68+
* **Terminal 2 (FastAPI Backend):**
69+
```bash
70+
python backend/run.py
71+
```
72+
* **Terminal 3 (Tauri Desktop App):**
73+
```bash
74+
cd frontend
75+
npm run tauri dev
76+
```
77+
78+
---
79+
80+
## 📦 How to Build & Release New Versions
81+
82+
### Publish an Official GitHub Release (Cloud CI/CD)
83+
Whenever you push a version tag to GitHub, the **GitHub Actions** pipeline (through `.github/workflows/release.yml`) automatically builds both Windows (`.exe`) and macOS (`.dmg`) installers and attaches them to a new GitHub Release:
84+
85+
```bash
86+
git tag v1.0.x
87+
git push origin v1.0.x
88+
```
89+
Check the **Actions** tab on GitHub to monitor the cloud build.
90+
91+
---
92+
93+
## 📂 Basic Project Structure
94+
95+
```text
96+
thrust-stand-v3/
97+
├── backend/ # FastAPI async daemon, SQLite WAL, COBS/CRC16 binary protocol
98+
│ ├── app/
99+
│ │ ├── hal/ # Hardware Abstraction Layer (Serial & TCP simulator)
100+
│ │ ├── routers/ # Control, session, telemetry, and sequence endpoints
101+
│ │ └── services/ # ConnectionManager, SafetyWatchdog, SequenceService, Storage
102+
│ └── run.py # Backend entrypoint
103+
│
104+
├── frontend/ # Tauri desktop container & React/TypeScript interface
105+
│ ├── src/
106+
│ │ ├── components/ # Gauges, plots, actuation sliders, safety banners
107+
│ │ ├── hooks/ # useTelemetryStream (50Hz ref buffer), useKeyboardEStop
108+
│ │ └── styles/ # theme.css (UBC AeroDesign 2023 Brand Identity)
109+
│ └── src-tauri/ # Rust native window configuration & sidecar definitions
110+
│
111+
├── sim/ # Standalone physics simulator (motor inertia, battery sag, noise)
112+
│ ├── virtual_stand.py
113+
│ └── test_client.py
114+
│
115+
├── docs/ # Architecture specs, legacy V2 audit, and SAE 2027 rules
116+
└── README.md
117+
```
118+
119+
---
120+
121+
## 🛡️ Safety Highlights
122+
* **Hardware Watchdog:** If USB communication drops or the app freezes for more than 250 ms, the stand controller cuts throttle to 0% automatically.
123+
* **Over-Current Tripwire:** Cuts motor output if current exceeds safe ESC limits.
124+
* **Low-Voltage Warning:** Alerts operators to prevent permanent LiPo battery damage.
125+
* **Global E-Stop:** Hotkeyed to `Spacebar` and `Escape` globally across the application.

‎frontend/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ To prevent **React render thrashing** (where updating state at 50 Hz pins the br
1010

1111
```mermaid
1212
flowchart TD
13-
WS[WebSocket /ws/telemetry @ 50 Hz] --> Hook[useTelemetryStream]
13+
WS["WebSocket /ws/telemetry @ 50 Hz"] --> Hook["useTelemetryStream"]
1414
15-
Hook -->|Continuous Numbers| Ref[Mutable useRef Buffer]
16-
Hook -->|Discrete Status Flags| State[React State: isEstop, isArmed]
15+
Hook -->|"Continuous Numbers"| Ref["Mutable useRef Buffer"]
16+
Hook -->|"Discrete Status Flags"| State["React State: isEstop, isArmed"]
1717
18-
Ref --> rAF[requestAnimationFrame Loop: 60 FPS]
19-
rAF --> DOM[Direct TextContent Mutation (NumericCard)]
20-
rAF --> Canvas[HTML5 Canvas Render (TelemetryPlot)]
18+
Ref --> rAF["requestAnimationFrame Loop: 60 FPS"]
19+
rAF --> DOM["Direct TextContent Mutation (NumericCard)"]
20+
rAF --> Canvas["HTML5 Canvas Render (TelemetryPlot)"]
2121
22-
State --> UI[Header, Banners, Disabled Sliders]
22+
State --> UI["Header, Banners, Disabled Sliders"]
2323
```
2424

2525
1. **High-Frequency Tier (Direct-to-DOM / Canvas):** Numerical values (Thrust, Voltage, Current, RPM) are stored in an in-memory mutable `useRef`. A `requestAnimationFrame` graphics loop renders them directly onto HTML5 `<canvas>` elements and mutates `.textContent` on gauge cards, completely bypassing React reconciliation.
@@ -77,4 +77,4 @@ npm run tauri dev
7777

7878
# Alternatively, run purely in browser (without native desktop shell):
7979
npm run dev
80-
```
80+
```

0 commit comments

Comments
 (0)