Added Kaco inverter for sensor ripple testing

- Iso error in string will now only be active if the dc circuit breaker is not closed
- Added some delay between closing dc circuit breaker and enabling inverter so that the dc bus voltage can stabilize itself
This commit is contained in:
Matthias Heisig
2025-05-08 10:07:16 +02:00
parent 0d201a140a
commit 1677d34d9c
9 changed files with 1422 additions and 302 deletions

View File

@@ -170,7 +170,8 @@ VAR
_sName : STRING;
// String inverter
_fbInverter : FB_PowerSupplySunspec(Name);
//_fbInverter : FB_PowerSupplySunspec(Name);
_fbInverter : FB_PowerSupplyKaco(Name);
// Internal inverter power command
_rPowerInverterInternal : REAL;
@@ -179,7 +180,7 @@ VAR
_xEnableInverter : BOOL;
// Fault timer for inverter startup
_tonInverterStartupTimeout : TON := (PT := T#2M);
_tonInverterStartupTimeout : TON := (PT := T#3M);
// Fault timer for inverter shutdown
_tonInverterShutdownError : TON := (PT := T#10S);
@@ -214,6 +215,8 @@ VAR
// Internal SOC
_rSOC : REAL;
_fbTONDCSettlingTime : TON := (PT := T#10S);
END_VAR
VAR PERSISTENT
@@ -262,7 +265,7 @@ END_IF
// ISO Error handling
// ===============================
// Mute iso error when inverter is enabled
_xIsoError := ((NOT xIsoErrorL1) OR (NOT xIsoErrorL2)) AND (NOT _fbInverter.xActive);
_xIsoError := ((NOT xIsoErrorL1) OR (NOT xIsoErrorL2)) AND (NOT _fbInverter.xActive) AND (xDCCBOpen);
_fbTONIsoError(IN := _xIsoError, PT := GVL_CONFIG.timIsoErrorTimeout);
// _fbInverter
@@ -670,7 +673,6 @@ CASE _iState OF
20: // Check if DC relais closed and safety is ok
IF NOT xDCCBOpen THEN
_tonErrorDCCBNotClosed.IN := FALSE;
_xEnableInverter := TRUE;
_rPowerInverterInternal := rPowerInverter;
//_rPowerInverterInternal := 0.0;
IF xInSafetyCheckMode THEN
@@ -701,7 +703,15 @@ CASE _iState OF
_iState := 1000;
END_IF
21: // Wait for inverter to be ready
21: // Wait some time for inverter dc bus voltage settling
_fbTONDCSettlingTime(IN := TRUE);
IF _fbTONDCSettlingTime.Q THEN
_fbTONDCSettlingTime(IN := FALSE);
_xEnableInverter := TRUE;
_iState := 22;
END_IF
22: // Wait for inverter to be ready
_tonInverterStartupTimeout(IN := TRUE);
IF _fbInverter.xActive AND (NOT _fbInverter.xError) THEN
_iState := 30;