How universalgeek56/ug56-lab-psu works
This is ESP32 firmware that turns a DC-DC converter into a remotely configurable lab supply. Its main user workflow is to set voltage/current limits through the local controls or web UI, regulate and monitor the output, and display readings and protection status. Distinct subsystems cover feedback control, sensing and cutoff protection, local UI, web access, Wi-Fi/OTA, and persistent settings. The README documents these capabilities, but the main loop and several subsystem implementations were not sampled, so orchestration links are marked unverified rather than asserted as source-visible calls.
Main entry points: main.ino Firmware entry · DcControl.cpp CV/CC PID control · WebInterface.cpp Dashboard and charts · DisplayManager.cpp OLED display
Components 18
Regulation and safety
- CV/CC PID control
src/DcControl.cpp - Output cutoff
src/OutputControl.cpp - Protection flags
src/ErrMgr.cpp - Electrical sensing
src/Ina226Manager.cpp
Local controls
- Encoder menus
src/EncoderManager.cpp - Touch and LEDs
src/TouchUI.cpp - OLED display
src/DisplayManager.cpp - Segment rendering
src/SegmentFont.cpp
Network interface
- Dashboard and charts
src/WebInterface.cpp - Wi-Fi and OTA
src/WifiOtaManager.cpp
Settings and state
- Settings persistence
src/PreferencesManager.cpp
Firmware runtime
- Firmware entry
src/main.ino - Shared runtime state
src/Globals.cpp
Other components
- Supply operator
- Web browser
- DC-DC converter
- INA226 sensor
- ESP32 NVS
Connections 22
- Supply operator → Encoder menus: adjusts locally
README.md - Supply operator → Touch and LEDs: uses touch UI
README.md - Supply operator → Web browser: opens dashboard
README.md - Web browser → Dashboard and charts: requests controls
README.md - Dashboard and charts → Web browser: serves dashboard
README.md - Firmware entry → Electrical sensing: updates periodically
- Electrical sensing → INA226 sensor: reads measurements
README.md - Electrical sensing → CV/CC PID control: provides feedback
README.md - CV/CC PID control → DC-DC converter: modulates feedback
README.md - CV/CC PID control → Output cutoff: coordinates cutoff
- Protection flags → OLED display: reports faults
README.md - Encoder menus → OLED display: selects menu views
src/EncoderManager.cpp - OLED display → Segment rendering: draws segments
src/DisplayManager.cpp - Firmware entry → CV/CC PID control: updates periodically
- Firmware entry → OLED display: updates periodically
- Firmware entry → Dashboard and charts: updates periodically
- Firmware entry → Wi-Fi and OTA: services network
- Firmware entry → Settings persistence: loads and saves
- Settings persistence → ESP32 NVS: reads and writes
src/PreferencesManager.cpp - Settings persistence → Shared runtime state: applies settings
src/PreferencesManager.cpp - Wi-Fi and OTA → Shared runtime state: updates status
src/WifiOtaManager.cpp - Dashboard and charts → Shared runtime state: uses shared state
src/WebInterface.cpp