|
@@ -1251,11 +1251,11 @@ int main(void)
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag == _REASSIGNED_PREPARE_M_TO_A)
|
|
|
{
|
|
|
if (toAverVolPoint > 0 &&
|
|
|
- toAverVolPoint == chargingInfo[index]->EvBatterytargetCurrent)
|
|
|
+ toAverVolPoint == (chargingInfo[index]->EvBatterytargetCurrent * 10))
|
|
|
{
|
|
|
// 欲最大充 -> 均充需要等待充電中的輸出電流拉高到目標電流
|
|
|
if ((chargingInfo[index]->PresentChargingCurrent * 10) >=
|
|
|
- chargingInfo[index]->EvBatterytargetCurrent - CHK_CUR_RANGE)
|
|
|
+ (chargingInfo[index]->EvBatterytargetCurrent * 10) - CHK_CUR_RANGE)
|
|
|
{
|
|
|
if (toAverVolCount == 0)
|
|
|
isWaitingAver = true;
|
|
@@ -1265,7 +1265,7 @@ int main(void)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- toAverVolPoint = chargingInfo[index]->EvBatterytargetCurrent;
|
|
|
+ toAverVolPoint = (chargingInfo[index]->EvBatterytargetCurrent * 10);
|
|
|
toAverVolCount = 3;
|
|
|
}
|
|
|
}
|
|
@@ -1354,11 +1354,11 @@ int main(void)
|
|
|
if (ShmPsuData->SystemAvailableCurrent != chargingInfo[groupIndex]->AvailableChargingCurrent)
|
|
|
{
|
|
|
// 車端要求電流為該充電槍的額定輸出電流的範圍內
|
|
|
- if (chargingInfo[groupIndex]->EvBatterytargetCurrent <= ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent + DERATING_GAP ||
|
|
|
+ if ((chargingInfo[groupIndex]->EvBatterytargetCurrent * 10) <= ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent + DERATING_GAP ||
|
|
|
deratingKeepCount >= DERATING_COUNT)
|
|
|
{
|
|
|
// 車端降載完成
|
|
|
- PRINTF_FUNC("Index = %d, newEvCurrent = %f \n", groupIndex, chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ PRINTF_FUNC("Index = %d, newEvCurrent = %f \n", groupIndex, (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
PRINTF_FUNC("=============Smart Charging : _REASSIGNED_ADJUST_M_TO_A============= Step 3 \n");
|
|
|
ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_ADJUST_M_TO_A;
|
|
|
gettimeofday(&_derating_time, NULL);
|
|
@@ -1369,7 +1369,7 @@ int main(void)
|
|
|
deratingKeepCount++;
|
|
|
PRINTF_FUNC("** Step 2 ** : Index = %d, EvBatterytargetCurrent = %f, TargetCurrent = %d, Count = %d \n",
|
|
|
groupIndex,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetCurrent,
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10),
|
|
|
(ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent + DERATING_GAP),
|
|
|
deratingKeepCount);
|
|
|
}
|
|
@@ -1380,12 +1380,12 @@ int main(void)
|
|
|
{
|
|
|
bool isChanged = false;
|
|
|
|
|
|
- if (chargingInfo[groupIndex]->AvailableChargingCurrent <= chargingInfo[groupIndex]->EvBatterytargetCurrent)
|
|
|
+ if (chargingInfo[groupIndex]->AvailableChargingCurrent <= (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10))
|
|
|
{
|
|
|
PRINTF_FUNC("** _REASSIGNED_ADJUST_M_TO_A ** Gun_%d, PresentChargingCurrent = %f, AvailableChargingCurrent = %f, EvBatterytargetCurrent = %f \n", groupIndex,
|
|
|
(chargingInfo[groupIndex]->PresentChargingCurrent * 10),
|
|
|
chargingInfo[groupIndex]->AvailableChargingCurrent,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
|
|
|
for (byte subIndex = 0; subIndex < ShmPsuData->GroupCount; subIndex++)
|
|
|
{
|
|
@@ -1440,7 +1440,7 @@ int main(void)
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_ADJUST_M_TO_A)
|
|
|
{
|
|
|
// 當前充電中的目標電壓
|
|
|
- float targetVol = chargingInfo[groupIndex]->EvBatterytargetVoltage;
|
|
|
+ float targetVol = (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10);
|
|
|
byte reassignIndex = ELEMENT_NOT_FIND;
|
|
|
|
|
|
// 找到等待分配的槍
|
|
@@ -1461,7 +1461,7 @@ int main(void)
|
|
|
//PRINTF_FUNC("A : index = %d, cur = %d \n", groupIndex, ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent);
|
|
|
//PresentOutputVol(groupIndex, targetVol, ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent);
|
|
|
//PRINTF_FUNC("set out (%d) value = %f******** 1 \n", groupIndex, chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
- PresentOutputVol(groupIndex, targetVol, chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ PresentOutputVol(groupIndex, targetVol, (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
// }
|
|
|
//
|
|
|
// if ((GetTimeoutValue(_derating_time) / 1000) <= 50)
|
|
@@ -1474,7 +1474,7 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (chargingInfo[groupIndex]->EvBatterytargetVoltage == 0)
|
|
|
+ if ((chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) == 0)
|
|
|
{
|
|
|
//PRINTF_FUNC("sys ******** 1 \n");
|
|
|
bool isNeedToClosePower = false;
|
|
@@ -1498,8 +1498,8 @@ int main(void)
|
|
|
{
|
|
|
//PRINTF_FUNC("set out (%d) value = %f******** 3 \n", groupIndex, chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
PresentOutputVol(groupIndex,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetVoltage,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1507,10 +1507,10 @@ int main(void)
|
|
|
chargingInfo[groupIndex]->EvBatterytargetCurrent, ShmSysConfigAndInfo->SysInfo.ReAssignedFlag);
|
|
|
// 該充電槍的目標電壓與目標電流
|
|
|
PresentOutputVol(SYSTEM_CMD,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetVoltage,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
|
|
|
- if (chargingInfo[groupIndex]->EvBatterytargetVoltage == 0)
|
|
|
+ if ((chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) == 0)
|
|
|
{
|
|
|
//PRINTF_FUNC("sys ******** 2 \n");
|
|
|
bool isNeedToClosePower = false;
|
|
@@ -1564,12 +1564,12 @@ int main(void)
|
|
|
{
|
|
|
// 各群電壓接近平衡
|
|
|
if (((chargingInfo[subIndex]->PresentChargingVoltage * 10) < (chargingInfo[groupIndex]->PresentChargingVoltage * 10) - ZERO_VOLTAGE) ||
|
|
|
- ((chargingInfo[subIndex]->PresentChargingVoltage * 10) < chargingInfo[groupIndex]->EvBatterytargetVoltage - CHK_VOL_RANGE))
|
|
|
+ ((chargingInfo[subIndex]->PresentChargingVoltage * 10) < (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) - CHK_VOL_RANGE))
|
|
|
{
|
|
|
PRINTF_FUNC("** _REASSIGNED_ADJUST_A_TO_M ** Gun_%d, PresentChargingVoltage = %f, PresentChargingVoltage_V = %f, EvBatterytargetVoltage = %f \n", subIndex,
|
|
|
(chargingInfo[subIndex]->PresentChargingVoltage * 10),
|
|
|
((chargingInfo[groupIndex]->PresentChargingVoltage * 10) - ZERO_VOLTAGE),
|
|
|
- (chargingInfo[groupIndex]->EvBatterytargetVoltage - CHK_VOL_RANGE));
|
|
|
+ ((chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) - CHK_VOL_RANGE));
|
|
|
balanceVol = false;
|
|
|
}
|
|
|
break;
|
|
@@ -1662,8 +1662,8 @@ int main(void)
|
|
|
(preChargingCur >= preChargingTarget - ZERO_CURRENT))
|
|
|
preChargingTarget += PRE_CHARG_STEP_CUR;
|
|
|
|
|
|
- if (preChargingTarget >= chargingInfo[subIndex]->EvBatterytargetCurrent / 2)
|
|
|
- preChargingTarget = chargingInfo[subIndex]->EvBatterytargetCurrent / 2;
|
|
|
+ if (preChargingTarget >= (chargingInfo[subIndex]->EvBatterytargetCurrent * 10) / 2)
|
|
|
+ preChargingTarget = (chargingInfo[subIndex]->EvBatterytargetCurrent * 10) / 2;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1674,7 +1674,7 @@ int main(void)
|
|
|
//PRINTF_FUNC("set out (%d) value = %d******** 5 \n", reassignIndex, ZERO_CURRENT + preChargingTarget);
|
|
|
// 閒置模塊升壓,另對剛分配近來的模塊,預上升電流值 (preChargingCur)
|
|
|
PresentOutputVol(reassignIndex,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetVoltage,
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
ZERO_CURRENT + preChargingTarget);
|
|
|
|
|
|
byte _ovCahrgingCur = 0;
|
|
@@ -1683,12 +1683,12 @@ int main(void)
|
|
|
|
|
|
//PRINTF_FUNC("set out (%d) value = %f******** 6 \n", groupIndex, chargingInfo[groupIndex]->EvBatterytargetCurrent - preChargingCur - _ovCahrgingCur);
|
|
|
PresentOutputVol(groupIndex,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetVoltage,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetCurrent - preChargingCur - _ovCahrgingCur);
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10) - preChargingCur - _ovCahrgingCur);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (chargingInfo[groupIndex]->EvBatterytargetVoltage == 0)
|
|
|
+ if ((chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) == 0)
|
|
|
{
|
|
|
//PRINTF_FUNC("sys ******** 3 \n");
|
|
|
bool isNeedToClosePower = false;
|
|
@@ -1730,10 +1730,10 @@ int main(void)
|
|
|
{
|
|
|
//PRINTF_FUNC("set out (%d) value = %f******** 7 \n", groupIndex, chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
PresentOutputVol(groupIndex,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetVoltage,
|
|
|
- chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
|
|
|
- if (chargingInfo[groupIndex]->EvBatterytargetVoltage == 0)
|
|
|
+ if ((chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) == 0)
|
|
|
{
|
|
|
//PRINTF_FUNC("%d ******** 4 \n", groupIndex);
|
|
|
if (isStartOutputSwitch[groupIndex])
|