Added possibility to charge with cv
This commit is contained in:
@@ -210,6 +210,12 @@ VAR
|
||||
|
||||
_xGetPowerMeterData : BOOL;
|
||||
|
||||
_fbPIControl : FB_PI;
|
||||
_fbLimit : FB_Limit;
|
||||
_xCVChargingLatched : BOOL;
|
||||
_rCVSetpoint : REAL;
|
||||
_xStringsFullCV : BOOL;
|
||||
|
||||
_rPowerDH : REAL;
|
||||
_xDHActive : BOOL;
|
||||
_fbTONDHCycleTime : TON := (PT := T#15M);
|
||||
@@ -1087,7 +1093,7 @@ _fbTowerLight(
|
||||
|
||||
IF _xStringsErrorActive OR _fbStringReadyTimeout.Q THEN
|
||||
_fbStringReadyTimeout(IN := FALSE);
|
||||
_xStringNotReadyInTime := TRUE;
|
||||
_xStringNotReadyInTime := _fbStringReadyTimeout.Q;
|
||||
_xEnableString := FALSE;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_xCanChangeMode := TRUE;
|
||||
@@ -1148,11 +1154,54 @@ _fbTowerLight(
|
||||
_xEnableString := FALSE;
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus := E_CHARGE_STATUS.DISCHARGING;
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg10.uiActiveParallelMembers := 0;
|
||||
_xCVChargingLatched := FALSE;
|
||||
_fbPIControl.Reset();
|
||||
_iState := 35;
|
||||
END_IF
|
||||
|
||||
// Charge with constant Voltage at charging end
|
||||
IF GVL_CONFIG.xCVCharging AND (_rAutoPowerRequest < 0.0) AND (_rHighestSegmentVoltage >= (GVL_CONFIG.rMaximumUnitVoltage)) THEN
|
||||
_xCVChargingLatched := TRUE;
|
||||
END_IF
|
||||
|
||||
// Delatch if charging power requested is lower than cv power
|
||||
//IF _xCVChargingLatched AND (_rAutoPowerRequest > _rPowerInverter) THEN
|
||||
// _xCVChargingLatched := FALSE;
|
||||
//END_IF
|
||||
|
||||
IF _xCVChargingLatched THEN
|
||||
// Reglerfreigabe
|
||||
_rCVSetpoint := GVL_CONFIG.rMaximumUnitVoltage;
|
||||
ELSE
|
||||
// Nachführbetrieb
|
||||
_rCVSetpoint := _rHighestSegmentVoltage;
|
||||
END_IF
|
||||
|
||||
_fbPIControl(
|
||||
rSP:= _rCVSetpoint,
|
||||
rPV:= _rHighestSegmentVoltage,
|
||||
rKp:= GVL_CONFIG.rCVKp,
|
||||
rTn:= GVL_CONFIG.rCVTn,
|
||||
xSaturated:= _fbLimit.xClamped);
|
||||
|
||||
_rPowerInverter := _rAutoPowerRequest - _fbPIControl.rMV;
|
||||
|
||||
_fbLimit(
|
||||
rIn := _rPowerInverter,
|
||||
rMin := _rMinPower,
|
||||
rMax := _rMaxPower,
|
||||
rOut => _rPowerInverter);
|
||||
|
||||
IF ((GVL_SCADA.stHMIInterface[0].stInverterData.rActDCCurrent > GVL_CONFIG.rMinCVCurrentForFull) AND GVL_CONFIG.axStringEnabled[0]) OR ((GVL_SCADA.stHMIInterface[1].stInverterData.rActDCCurrent > GVL_CONFIG.rMinCVCurrentForFull) AND GVL_CONFIG.axStringEnabled[1]) THEN
|
||||
_xStringsFullCV := TRUE;
|
||||
ELSE
|
||||
_xStringsFullCV := FALSE;
|
||||
END_IF
|
||||
|
||||
// Shutdown triggered by battery fully charged
|
||||
IF GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus = E_CHARGE_STATUS.CHARGING AND ((_rMaxCurrentInverterDCVoltage >= GVL_CONFIG.rStringFullyChargedVoltage) OR _rHighestSegmentVoltage >= GVL_CONFIG.rMaximumUnitVoltage) THEN
|
||||
IF GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus = E_CHARGE_STATUS.CHARGING
|
||||
AND ((_rMaxCurrentInverterDCVoltage >= GVL_CONFIG.rStringFullyChargedVoltage) OR (_rHighestSegmentVoltage >= GVL_CONFIG.rMaximumUnitVoltage AND (NOT _xCVChargingLatched)) OR _xStringsFullCV) THEN
|
||||
//OR (_xCVChargingLatched AND ((ABS(GVL_SCADA.stHMIInterface[0].rCurrent) < 8.0) OR (ABS(GVL_SCADA.stHMIInterface[0].rCurrent) < 8.0)))
|
||||
_xGetPowerMeterData := TRUE;
|
||||
IF (_eBMSControlMode = E_BMS_CONTROL_MODE.CYCLING) THEN
|
||||
GVL_SCADA.eCycleStatus := E_CYCLE_STATUS.DISCHARGE_STARTED;
|
||||
@@ -1176,9 +1225,10 @@ _fbTowerLight(
|
||||
// Change battery status
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus := E_CHARGE_STATUS.FULL;
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg10.uiActiveParallelMembers := 0;
|
||||
_xCVChargingLatched := FALSE;
|
||||
_fbPIControl.Reset();
|
||||
_iState := 35;
|
||||
END_IF
|
||||
|
||||
END_IF
|
||||
|
||||
// Shutdown triggered by battery empty
|
||||
@@ -1206,6 +1256,8 @@ _fbTowerLight(
|
||||
// Change battery status
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus := E_CHARGE_STATUS.EMPTY;
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg10.uiActiveParallelMembers := 0;
|
||||
_xCVChargingLatched := FALSE;
|
||||
_fbPIControl.Reset();
|
||||
_iState := 35;
|
||||
END_IF
|
||||
END_IF
|
||||
@@ -1218,6 +1270,8 @@ _fbTowerLight(
|
||||
_tonBeginShutdown(In := FALSE);
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_xCanChangeMode := TRUE;
|
||||
_xCVChargingLatched := FALSE;
|
||||
_fbPIControl.Reset();
|
||||
_iState := 45;
|
||||
END_IF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user