From a877ce10e077c52c40ac3c765f202ebce0ed50db Mon Sep 17 00:00:00 2001 From: Nathan Marlor Date: Mon, 9 Mar 2026 15:07:51 +0000 Subject: [PATCH 1/3] feat: add ASIC current display to power card Shows ASIC current (A) with the same voltage-style progress bar: - Scale 0-42A so the bar can show over-limit values - Marker line at 40A max with label - Warning shown if current exceeds 40A - Reuses existing voltage-marker/progress-container CSS classes --- .../app/components/home/home.component.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index d513662..c69fb59 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -154,6 +154,24 @@

Loading dashboard...

+
+
+ ASIC Current + {{info.current | number: '1.1-1'}}A +
+
+ + + +
+ 40A +
+
+
+ ⚠️ High current draw +
+
+
ASIC Frequency From aa590f385789eded3f882bef90e4ffd05fa70eb2 Mon Sep 17 00:00:00 2001 From: Nathan Marlor Date: Mon, 9 Mar 2026 15:09:54 +0000 Subject: [PATCH 2/3] fix: use correct current thresholds from TPS546 VR config - Warning at 38A (TPS546_INIT_IOUT_OC_WARN_LIMIT) - Overcurrent fault message at 40A (TPS546_INIT_IOUT_OC_FAULT_LIMIT) --- .../axe-os/src/app/components/home/home.component.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index c69fb59..ead2be2 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -167,9 +167,12 @@

Loading dashboard...

40A
-
+
⚠️ High current draw
+
+ 🔥 Overcurrent — VR may shut down +
From ce11f6851e63d50bbf36ac8f9860e280c3f6b144 Mon Sep 17 00:00:00 2001 From: Nathan Marlor Date: Mon, 9 Mar 2026 17:00:04 +0000 Subject: [PATCH 3/3] feat: add VR voltage/current via TPS546 PMBus to power card - Add Power_get_vr_voltage() via TPS546 READ_VOUT (PMBus) - Add Power_get_vr_current() via TPS546 READ_IOUT (PMBus) - Replace ADC-based coreVoltageActual with direct PMBus reading - Expose vrCurrent field in system info API - Power card order: power, input V/I, VR V/I, ASIC frequency - Input current marker uses maxPower/voltage as dynamic limit - VR current warnings at 38A (warn) and 40A (fault) thresholds --- .../app/components/home/home.component.html | 55 +++++++++++++------ .../src/app/components/home/home.component.ts | 2 +- .../axe-os/src/app/services/system.service.ts | 3 +- .../axe-os/src/models/ISystemInfo.ts | 1 + main/http_server/http_server.c | 3 +- main/power/power.c | 22 ++++++++ main/power/power.h | 2 + 7 files changed, 69 insertions(+), 19 deletions(-) diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index ead2be2..87ff5f2 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -156,41 +156,64 @@

Loading dashboard...

- ASIC Current + Input Current {{info.current | number: '1.1-1'}}A
- + -
- 40A +
+ {{info.maxPower / info.voltage | number:'1.1-1'}}A
-
+
⚠️ High current draw
-
- 🔥 Overcurrent — VR may shut down -
- ASIC Frequency - {{info.frequency}} MHz + VR Voltage + {{info.coreVoltageActual}}V +
+
+ + + +
+ {{info.coreVoltage}}V +
+
+
+ +
+
+ VR Current + {{info.vrCurrent | number: '1.1-1'}}A +
+
+ + + +
+ 40A +
+
+
+ ⚠️ High VR current — approaching limit +
+
+ 🔥 VR overcurrent — protection may activate
- - -
- Measured ASIC Voltage - {{info.coreVoltageActual}}V + ASIC Frequency + {{info.frequency}} MHz
- +
diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts index 4e7cce6..7a1cd70 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.ts +++ b/main/http_server/axe-os/src/app/components/home/home.component.ts @@ -264,7 +264,7 @@ export class HomeComponent { info.power = Number.parseFloat(info.power.toFixed(1)) info.voltage = Number.parseFloat((info.voltage / 1000).toFixed(1)) info.current = Number.parseFloat((info.current / 1000).toFixed(1)) - info.coreVoltageActual = Number.parseFloat((info.coreVoltageActual / 1000).toFixed(2)) + info.coreVoltageActual = Number.parseFloat(info.coreVoltageActual.toFixed(3)) info.coreVoltage = Number.parseFloat((info.coreVoltage / 1000).toFixed(2)) info.temp = Number.parseFloat(info.temp.toFixed(1)) if (info.chiptemp1) info.chiptemp1 = Number.parseFloat(info.chiptemp1.toFixed(1)) diff --git a/main/http_server/axe-os/src/app/services/system.service.ts b/main/http_server/axe-os/src/app/services/system.service.ts index 3d492da..6929cd9 100644 --- a/main/http_server/axe-os/src/app/services/system.service.ts +++ b/main/http_server/axe-os/src/app/services/system.service.ts @@ -24,6 +24,7 @@ export class SystemService { power: 42.670, voltage: 12208.75, current: 2237.5, + vrCurrent: 34.5, temp: 60, vrTemp: 55, maxPower: 55, @@ -36,7 +37,7 @@ export class SystemService { freeHeapSpiram: 50504, isPSRAMAvailable: 1, coreVoltage: 1200, - coreVoltageActual: 1200, + coreVoltageActual: 1.234, hostname: "BitForge", macAddr: "2C:54:91:88:C9:E3", ssid: "default", diff --git a/main/http_server/axe-os/src/models/ISystemInfo.ts b/main/http_server/axe-os/src/models/ISystemInfo.ts index ab1f28f..f76d4d0 100644 --- a/main/http_server/axe-os/src/models/ISystemInfo.ts +++ b/main/http_server/axe-os/src/models/ISystemInfo.ts @@ -10,6 +10,7 @@ export interface ISystemInfo { power: number, voltage: number, current: number, + vrCurrent?: number, temp: number, vrTemp: number, maxPower: number, diff --git a/main/http_server/http_server.c b/main/http_server/http_server.c index f2f36e0..9c745e9 100644 --- a/main/http_server/http_server.c +++ b/main/http_server/http_server.c @@ -626,6 +626,7 @@ static esp_err_t GET_system_info(httpd_req_t * req) cJSON_AddNumberToObject(root, "power", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.power); cJSON_AddNumberToObject(root, "voltage", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.voltage); cJSON_AddNumberToObject(root, "current", Power_get_current(GLOBAL_STATE)); + cJSON_AddNumberToObject(root, "vrCurrent", Power_get_vr_current(GLOBAL_STATE)); cJSON_AddNumberToObject(root, "temp", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.chip_temp_avg); cJSON_AddNumberToObject(root, "vrTemp", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.vr_temp); cJSON_AddNumberToObject(root, "maxPower", Power_get_max_settings(GLOBAL_STATE)); @@ -643,7 +644,7 @@ static esp_err_t GET_system_info(httpd_req_t * req) cJSON_AddNumberToObject(root, "freeHeapInternal", heap_caps_get_free_size(MALLOC_CAP_INTERNAL)); cJSON_AddNumberToObject(root, "freeHeapSpiram", heap_caps_get_free_size(MALLOC_CAP_SPIRAM)); cJSON_AddNumberToObject(root, "coreVoltage", nvs_config_get_u16(NVS_CONFIG_ASIC_VOLTAGE, CONFIG_ASIC_VOLTAGE)); - cJSON_AddNumberToObject(root, "coreVoltageActual", VCORE_get_voltage_mv(GLOBAL_STATE)); + cJSON_AddNumberToObject(root, "coreVoltageActual", Power_get_vr_voltage(GLOBAL_STATE)); cJSON_AddNumberToObject(root, "frequency", nvs_config_get_u16(NVS_CONFIG_ASIC_FREQ, CONFIG_ASIC_FREQUENCY)); cJSON_AddStringToObject(root, "ssid", ssid); cJSON_AddStringToObject(root, "macAddr", formattedMac); diff --git a/main/power/power.c b/main/power/power.c index 2b84185..e7ccf57 100644 --- a/main/power/power.c +++ b/main/power/power.c @@ -90,6 +90,28 @@ int Power_get_nominal_voltage(GlobalState * GLOBAL_STATE) { } } +float Power_get_vr_voltage(GlobalState * GLOBAL_STATE) { + + switch (GLOBAL_STATE->device_model) { + case BITFORGE_NANO: + return TPS546_get_vout(); + default: + } + + return 0.0; +} + +float Power_get_vr_current(GlobalState * GLOBAL_STATE) { + + switch (GLOBAL_STATE->device_model) { + case BITFORGE_NANO: + return TPS546_get_iout(); + default: + } + + return 0.0; +} + float Power_get_vreg_temp(GlobalState * GLOBAL_STATE) { switch (GLOBAL_STATE->device_model) { diff --git a/main/power/power.h b/main/power/power.h index bcb8ddc..283c3a6 100644 --- a/main/power/power.h +++ b/main/power/power.h @@ -8,6 +8,8 @@ esp_err_t Power_disable(GlobalState * GLOBAL_STATE); float Power_get_current(GlobalState * GLOBAL_STATE); +float Power_get_vr_voltage(GlobalState * GLOBAL_STATE); +float Power_get_vr_current(GlobalState * GLOBAL_STATE); float Power_get_power(GlobalState * GLOBAL_STATE); float Power_get_input_voltage(GlobalState * GLOBAL_STATE); float Power_get_vreg_temp(GlobalState * GLOBAL_STATE);