Add TonHe 30kW PSU control with LV/HV restart (v1.0.37).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
raduet
2026-09-23 14:05:53 +02:00
co-authored by Cursor
parent 644fcf1692
commit 10691b77f2
15 changed files with 10132 additions and 8832 deletions
+17 -1
View File
@@ -7,8 +7,21 @@
#define PSU_MIN_CURRENT 1 //1A/bit
#define PSU_MAX_POWER 40000 //1W/bit
#define PSU_BLOCK_POWER_30KW 30000u
#define PSU_BLOCK_POWER_40KW 40000u
#define PSU_BLOCK_CURRENT_30KW 100u
#define PSU_BLOCK_CURRENT_40KW 133u
#define PSU_NUM 1
/* Values match bootloader-flasher firmwares.json psuTypes[].value (InfoBlock byte 10). */
typedef enum {
PSU_TYPE_NONE = 0,
PSU_TYPE_NIUERA_30KW = 1,
PSU_TYPE_NIUERA_40KW = 2,
PSU_TYPE_TONHE_30KW = 3
} PsuType_t;
/* Dynamic LV clamp (CS60 hv_limit): active only on overload at low bus voltage. */
#define PSU_LV_CLAMP_V 499u
#define PSU_HV_LIMIT_ON_THRESHOLD 480u
@@ -17,7 +30,10 @@
#define PSU_HV_LOAD_CURRENT 300u /* 30.0 A, MeasuredCurrent is 0.1 A/bit */
#define PSU_HV_LIMIT_MAX_COUNT 3u
/* Fast discharge: PSU off/on cycle on step-down setpoint (unloaded bus). */
/* TonHe group start: ≤500 V = LV, >500 V = HV. LV→HV while ON dies; HV→LV stays ON. */
#define TONHE_HV_THRESHOLD_V 500u
/* Fast discharge: Niuera off/on cycle on step-down (unloaded bus). TonHe skips this. */
#define PSD_ENABLE 1u
#define PSD_MAX_CMD_CURRENT_0P1A 20u /* 2.0 A */
#define PSD_MAX_MEASURED_CURRENT_0P1A 30u /* 3.0 A */