Replace hv_mode gate with CS60 hv_limit logic for unrestricted HV setpoints (v1.0.25).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
raduet
2026-06-30 19:27:47 +02:00
co-authored by Cursor
parent 86b0bfc0fc
commit 49a4fd8ee1
9 changed files with 7938 additions and 7787 deletions
+8
View File
@@ -9,6 +9,14 @@
#define PSU_NUM 1
/* 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
#define PSU_HV_LIMIT_OFF_THRESHOLD 495u
#define PSU_HV_SWITCH_DELAY_MS 1000u
#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). */
#define PSD_ENABLE 1u
#define PSD_MAX_CMD_CURRENT_0P1A 20u /* 2.0 A */
+3
View File
@@ -68,6 +68,9 @@ typedef struct{
uint16_t WantedCurrent; //0.1A/bit
CONN_Error_t chargingError; // 0 if okay
uint8_t EvConnected;
uint8_t hv_limit; // Limits PSU voltage to LV range when set
uint32_t hv_tick; // Timer for delayed HV limit switching
uint8_t hv_limit_count; // Anti-chatter counter for LV limit switching
} ChargingConnector_t;
+1 -1
View File
@@ -27,7 +27,7 @@ extern "C" {
/* USER CODE BEGIN EC */
#define FW_VERSION_MAJOR 1
#define FW_VERSION_MINOR 0
#define FW_VERSION_PATCH 24
#define FW_VERSION_PATCH 25
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
-2
View File
@@ -84,8 +84,6 @@ typedef struct {
// Дополнительные параметры для одного модуля DC30
uint32_t power_limit; // лимит мощности [кВт]
uint8_t hv_mode; // HV-режим (ограничение напряжения)
uint32_t hv_tick; // таймер для задержки входа в HV-режим
uint32_t tempAmbient; // температура окружающего воздуха (из PSU_04)
union { uint8_t raw; PSU_Status0_t bits; } status0; // modularForm0