Skip to content

Commit 215c014

Browse files
author
Pieter Cawood
committed
Simulation rednering
1 parent 462f562 commit 215c014

File tree

11 files changed

+1357
-9
lines changed

11 files changed

+1357
-9
lines changed

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
55
[![Python](https://img.shields.io/badge/Python-3.9%2B-blue.svg)](https://www.python.org/)
66
[![PyTorch](https://img.shields.io/badge/PyTorch-%F0%9F%A7%AA-red)](https://pytorch.org/)
7-
[![GUI](https://img.shields.io/badge/Tkinter%20+%20Matplotlib-GUI-green)](#)
7+
[![GUI](https://img.shields.io/badge/Tkinter%20+%20Matplotlib-GUI-green)](#)
88

99
<div style="display: flex; align-items: flex-start;">
10-
<div style="flex: 1;">
10+
<div style="flex: 1;">
11+
<div style="flex: 1;">
1112

13+
1214
A **playground** for experimenting with **PID**, **model‑predictive**, and **machine‑learning–based controllers**.
1315
DeepPID provides both **traditional** and **neural adaptive controllers** in a single, consistent framework, complete with a live **Tkinter + Matplotlib GUI** for interactive benchmarking.
1416

@@ -25,7 +27,7 @@ These results confirm that **data‑driven adaptation—combined with physical c
2527

2628
</div>
2729
<div style="margin-left: 20px; flex-shrink: 0;">
28-
<img src="docs/deeppid.png" alt="DeepPID Architecture" width="340"><br>
30+
<img src="docs/deeppid.png" alt="DeepPID Architecture" width="342"><br>
2931
<em>DeepPID — Hybrid classical & ML-based control framework.</em>
3032
</div>
3133
</div>
@@ -76,18 +78,23 @@ A **short‑horizon optimizer** that rolls out a simple plant model while a **le
7678
7779
---
7880

79-
The GUI (`examples/test.py`) lets you:
81+
The GUI (`simulation/run.py`) lets you:
8082
- Choose different **plant problems** (tank, flow, quadcopter‑like, etc.).
8183
- **Set Stability / noise** to simulate system inconsistency and model mismatch.
8284
- Switch between **controllers** (PID, CascadePID, MLP, GRU, Transformer, MPC, etc.).
8385
- Observe **real‑time set‑point tracking**, **MAE curves**, and **controller outputs**.
8486
- See which approach adapts fastest to nonlinear or coupled dynamics.
8587

8688
<p align="center">
87-
<img src="docs/gui.gif" alt="DeepPID GUI"><br>
89+
<img src="docs/gui.png" alt="DeepPID GUI"><br>
8890
<em>Interactive GUI — live comparison of controller performance.</em>
8991
</p>
9092

93+
<p align="center">
94+
<img src="docs/gui2.png" alt="DeepPID GUI"><br>
95+
<em>Problem Simulation— visual simulation of the problem.</em>
96+
</p>
97+
9198
---
9299

93100
## What’s inside
@@ -143,7 +150,7 @@ pip install -e .
143150
## Quick start (GUI)
144151

145152
```bash
146-
python examples/test.py
153+
python simulation/run.py
147154
```
148155

149156
This launches the controller shoot‑out app. Choose any plant from the dropdown, pick a driver
@@ -159,8 +166,8 @@ deeppid/
159166
utils.py # Utility functions
160167
envs/
161168
problems.py # “Problems”/plants with labels, units, limits
162-
examples/
163-
test.py # Tk + Matplotlib live comparison app
169+
simulation/
170+
run.py # Tk + Matplotlib live comparison app
164171
tests/ # (optional) put your pytest tests here
165172
```
166173

@@ -321,7 +328,7 @@ It will then show up in the GUI *Driver* combo‑box automatically.
321328
## Testing
322329

323330
- Quick import smoke test: `python -c "import deeppid; print('OK')"`
324-
- Run GUI: `python examples/test.py`
331+
- Run GUI: `python simulation/run.py`
325332
- Add lightweight unit tests in `tests/` (e.g., `pytest -q`).
326333

327334
## License

deeppid/envs/problems.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def __init__(self, Ts: float):
325325
# IO sizes & presentation
326326
self.N = 4
327327
self.labels = ["FL(+)", "FR(-)", "RR(+)", "RL(-)"]
328+
self.output_name, self.output_unit, self.entity_title = "Thrust", "N", "Rotor"
328329

329330
# Speed→thrust map: thrust_i [N] ≈ k_i * speed_i[%]
330331
# Chosen so hover ~25% per rotor at m=1kg (9.81N total).

docs/gui.gif

-3.61 MB
Binary file not shown.

docs/gui.png

-47.1 KB
Loading

docs/gui2.png

998 KB
Loading

0 commit comments

Comments
 (0)