Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
24b6536
Port AI tuning ML, error system, G&G scale fix from OpenTrickler-v2
Jump73 Mar 12, 2026
5fb3de8
Fix build errors for RP2350 port of AI tuning feature
Jump73 Mar 12, 2026
489a4c3
Integrate AI tuning into charge_mode.cpp
Jump73 Mar 12, 2026
47df537
Add AI tuning web UI and REST config fields c14/c15/c16
Jump73 Mar 12, 2026
2afcc73
Add feature/ai-tuning-port changelog to README
Jump73 Mar 12, 2026
f07a53b
Rework AI tuning web UI: profiles with names, ML history, Scale Zero,…
Jump73 Mar 12, 2026
e47e1bb
Add ML Recommendation banner on trickler page
Jump73 Mar 12, 2026
3da4590
Pre-fill Advanced Settings with firmware defaults when fields are empty
Jump73 Mar 12, 2026
0d02f1f
Fix empty Threshold fields in AI Tuning settings UI
Jump73 Mar 12, 2026
6a0dfee
Change default time targets: coarse 6s, total 20s
Jump73 Mar 12, 2026
26d08b7
Add profile selector to Trickler page
Jump73 Mar 12, 2026
5d04125
ML data collection: auto-clear history on profile change
Jump73 Mar 12, 2026
85a546d
Fix ML data collection not recording; add history auto-refresh
Jump73 Mar 12, 2026
5f29d25
Fix stale ML banner and history count/table mismatch
Jump73 Mar 12, 2026
08acb78
Raise ML banner threshold from 3 to 10 drops
Jump73 Mar 12, 2026
73371ca
Fix empty profile dropdowns on page navigation
Jump73 Mar 12, 2026
ae8f868
Fix Drop History table empty and deduplicate ML history polling
Jump73 Mar 12, 2026
97c058b
Fix banners, profile dropdown delay and drop history reset on profile…
Jump73 Mar 12, 2026
6f46c67
Remove confirm dialog from Clear history button
Jump73 Mar 12, 2026
6c5fac4
Fix AI tuning Phase 1 infinite stall and add charge state UI
Jump73 Mar 12, 2026
91c7708
Fix COARSE_ONLY overshoot and UI polling stop on error
Jump73 Mar 12, 2026
0dba3e9
Reduce polling interval from 500ms to 200ms for faster UI updates
Jump73 Mar 12, 2026
a89c96c
Fix Phase 2 pre-charge: replace fixed-time with adaptive PID loop (ma…
Jump73 Mar 12, 2026
d8feef5
Port missing v2 features: pulse mode, auto-zero, scale fail safety
Jump73 Mar 21, 2026
e57c5d0
Add configurable scale stabilization after motors stop
Jump73 Mar 21, 2026
b814997
Fix: raise lwip CGI params limit from 16 to 32
Jump73 Mar 21, 2026
9a85522
Add AI Tuning shortcut button to bottom navigation bar
Jump73 Mar 21, 2026
8894336
Continuous ML history + stabilization before Remove Cup
Jump73 Mar 21, 2026
8b43bc9
ML suggestions: threshold 10 drops, update every 10 drops
Jump73 Mar 21, 2026
3ba3e86
Add Ohaus PR Series scale driver
Jump73 Mar 22, 2026
90996fc
Add Ohaus PR Series to display menu scale driver selection
Jump73 Mar 22, 2026
ea2107e
Fix MOTOR_INIT_PIO_ERR on RP2040: set PIO version 0 for stepper program
Jump73 Mar 22, 2026
74e01f4
Fix Ohaus driver, web UI stability and scale driver persistence
Jump73 Mar 23, 2026
f3af2dc
Fix fine stop threshold, defaults, AI tuning start and reboot error
Jump73 Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
# OpenTrickler RP2040 Controller
# OpenTrickler RP2040 Controller
This repo is for the firmware that utilises the Raspberry Pi RP2040 micro controller OpenTrickler RP2040 Controller.

## What's New — Branch `feature/ai-tuning-port`

This branch ports the AI auto-tuning system from [OpenTrickler-v2](https://github.com/Jump73/OpenTrickler-v2) and integrates it fully into the RP2040/RP2350 firmware.

### AI Auto-Tuning (`src/ai_tuning.*`)
Automatic PID parameter optimisation using a binary-step search algorithm:
- **Phase 1 (COARSE_ONLY)** — tunes coarse trickler Kp/Kd across configurable search bounds
- **Phase 2 (FINE_ONLY)** — tunes fine trickler Kp/Kd, with a coarse pre-charge at the start of each drop
- Configurable time targets: `coarse_time_target_ms` (c14) and `total_time_target_ms` (c15)
- Configurable search bounds (Kp/Kd min/max), noise margin, and max overthrow threshold via `/rest/ai_tuning_config_set`
- Results persisted in flash; apply best parameters to a profile via `/rest/ai_tuning_apply`

### ML Data Collection (`src/ml_data_collection.*`, `src/ai_drop_telemetry.*`)
- Records per-drop telemetry (weight, timing, motor params) to flash during normal charges when enabled
- Toggle via charge mode config field `c16` (`ml_data_collection_enabled`)

### Charge Mode Integration (`src/charge_mode.cpp`)
- Charge loop queries `ai_tuning_get_next_params()` and overrides PID parameters when tuning is active
- Coarse pre-charge phase injected at start of each drop in Phase 2
- `ai_tuning_record_drop()` called after every drop to feed results back to the tuner
- RST button cancels active tuning session
- Tuning completion detected after cup removal — charge mode exits automatically

### Error System (`src/errors.*`)
- Centralised error reporting ported from v2; integrates with display and REST API

### G&G Scale Fix
- Fixed serial parsing for G&G / JJB scale driver

### Web UI (`src/html/web_portal.html`)
New **AI Tuning** section in the web portal Settings drawer:
- Select profile and target charge weight, then start/cancel/apply tuning
- Live progress panel (drops completed, progress %, current Kp/Kd) overlaid on the Trickler page during active tuning
- Recommended parameters displayed on completion with one-tap Apply
- Advanced collapsible panel for Kp/Kd search range and noise margin configuration
- ML Data Collection toggle
- REST endpoints used: `/rest/ai_tuning_start`, `/rest/ai_tuning_status`, `/rest/ai_tuning_apply`, `/rest/ai_tuning_cancel`, `/rest/ai_tuning_clear_history`, `/rest/ai_tuning_config`, `/rest/ai_tuning_config_set`

### RP2350 Support
- All new modules compile cleanly for both `pico_w` (RP2040) and `pico2_w` (RP2350) targets

Join our [discord server](https://discord.gg/ZhdThA2vrW) for help and development information.

## Get Started
Expand Down
Empty file removed build/.placeholder
Empty file.
Loading