|
@@ -42,9 +42,10 @@
|
|
|
#define MAX_PSU_POWER_OFF_CURRENT 50 // unit: 0.1A, 5A
|
|
|
#define MAX_PSU_POWER_OFF_VOLTAGE 100 // unit: 0.1A, 10V
|
|
|
#define PRECHARGE_OFFSET_VOLTAGE 20 // unit: 0.1V, 2V
|
|
|
-#define PRECHARGE_RANGE_VOLTAGE 100 // unit: 0.1V, 10V
|
|
|
+#define PRECHARGE_RANGE_VOLTAGE 200 // unit: 0.1V, 10V
|
|
|
#define WAIT_PRECHARGE_TIME 10 // unit: second
|
|
|
#define EXTEND_CAPABILITY_DELAY 30 // unit: second
|
|
|
+#define EXTEND_AFTER_DERATING_DELAY 3 // unit: second
|
|
|
#define EXTEND_LOADING 8000 // unit: 0.01%, 80%
|
|
|
#define RELEASE_LOADING 5000 // unit: 0.01%, 50%
|
|
|
#define RELEASE_LOADING_OFFSET 1000 // unit: 0.01%, 10%
|
|
@@ -3158,6 +3159,8 @@ void CheckSmoothDerating(unsigned char master)
|
|
|
|
|
|
void CheckReleaseOrExtend(unsigned char master)
|
|
|
{
|
|
|
+ int time = 0;
|
|
|
+
|
|
|
if((ShmChargerInfo->Control.TestCtrl.bits.ChargingSimulation || Is_EnableReleaseAndExtendWhenForceCharging(master)) &&
|
|
|
ShmPsuGrouping->GroupCollection[master].GroupCtrl.RoleCtrl.DeratingCtrlValue == 0 &&
|
|
|
ShmPsuGrouping->GroupCollection[master].GroupCtrl.RoleCtrl.ExtendCapabilityCtrlValue == 0)
|
|
@@ -3185,16 +3188,24 @@ void CheckReleaseOrExtend(unsigned char master)
|
|
|
else if(ShmPsuGrouping->GroupCollection[master].DiffPower_Capability <= MAX_DIFF_POWER_TO_EXTEND &&
|
|
|
ShmPsuGrouping->GroupCollection[master].DiffPower_PhysicalLimit >= MIN_DIFF_PHYSICAL_POWER)
|
|
|
{
|
|
|
- int available = GetPsuGroupAvailable(master);
|
|
|
+ time = GetTimeoutValue(_ExtendCapability_time[master]) / uSEC_VAL;
|
|
|
|
|
|
- if(available > 0)
|
|
|
+ if(time >= EXTEND_AFTER_DERATING_DELAY)
|
|
|
{
|
|
|
- if(!ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable)
|
|
|
+ int available = GetPsuGroupAvailable(master);
|
|
|
+
|
|
|
+ if(available > 0)
|
|
|
{
|
|
|
- LOG_INFO("Gun %d Extend Capability Available", master + 1);
|
|
|
- GetClockTime(&_ExtendCapability_time[master]);
|
|
|
+ if(!ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable)
|
|
|
+ {
|
|
|
+ LOG_INFO("Gun %d Extend Capability Available, DifPcap: %.1f kW, DifPphy: %.1f",
|
|
|
+ master + 1,
|
|
|
+ ShmPsuGrouping->GroupCollection[master].DiffPower_Capability,
|
|
|
+ ShmPsuGrouping->GroupCollection[master].DiffPower_PhysicalLimit);
|
|
|
+ GetClockTime(&_ExtendCapability_time[master]);
|
|
|
+ }
|
|
|
+ ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable = true;
|
|
|
}
|
|
|
- ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4122,6 +4133,7 @@ void PsuGroupDeratingProcess(unsigned char master)
|
|
|
{
|
|
|
ShmPsuGrouping->GroupCollection[master].GroupCtrl.RoleCtrl.DeratingCtrlValue = 0;
|
|
|
UpdateGunAvailableCapability(master);
|
|
|
+ GetClockTime(&_ExtendCapability_time[master]);
|
|
|
LOG_INFO("Gun %d Derating Completed", master + 1);
|
|
|
}
|
|
|
}
|
|
@@ -4778,7 +4790,8 @@ void PsuGroupControlProcess(void)
|
|
|
if(ShmPsuGrouping->GroupCollection[group].PreRole != role)
|
|
|
{
|
|
|
ShmPsuGrouping->GroupCollection[group].PreRole = role;
|
|
|
- PSU_LOG("===== PSU Group[%02X] ===== Extend Stop", group);
|
|
|
+ PSU_LOG("===== PSU Group[%02X] ===== Extend Stop, %d.%d V",
|
|
|
+ group, (ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage / 10), (ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage % 10));
|
|
|
GetClockTime(&_PsuGroupRole_time[group]);
|
|
|
}
|
|
|
|