Some bugfixes
- Config for max string power is now correctly calculated - Adjusted timing for string and inverter timeout
This commit is contained in:
@@ -245,11 +245,11 @@ VAR_GLOBAL PERSISTENT
|
||||
|
||||
// Maximum allowed charging power (Watt) per String
|
||||
// 24.000 W -> 2.000 W per Unit
|
||||
diMaxStringChargingPower : DINT := -48_000;
|
||||
diMaxStringChargingPower : DINT := -36_000;
|
||||
|
||||
// Maximum allowed discharging power (Watt) per String
|
||||
// 24.000 W -> 2.000 W per Unit
|
||||
diMaxStringDischargePower : DINT := 48_000;
|
||||
diMaxStringDischargePower : DINT := 36_000;
|
||||
|
||||
// Inverter ip address for string 1
|
||||
sInverterIpString1 : STRING := '192.168.42.10';
|
||||
@@ -257,7 +257,7 @@ VAR_GLOBAL PERSISTENT
|
||||
// Inverter ip address for string 2
|
||||
sInverterIpString2 : STRING := '192.168.42.20';
|
||||
|
||||
timInverterStartupTimeout : TIME := T#2m;
|
||||
timInverterStartupTimeout : TIME := T#3M;
|
||||
|
||||
// Absolute shutdown discharge power (Watt)
|
||||
// 12.000 W -> 1.000 W per unit
|
||||
@@ -280,7 +280,7 @@ VAR_GLOBAL PERSISTENT
|
||||
timUnitBalancingStartupTime : TIME := T#3M;
|
||||
|
||||
// All modules in string not ready timeout
|
||||
timStringReadyTimeout : TIME := T#3M;
|
||||
timStringReadyTimeout : TIME := T#6M;
|
||||
|
||||
// Timeout for isolation error
|
||||
timIsoErrorTimeout : TIME := T#20S;
|
||||
|
||||
@@ -273,8 +273,8 @@
|
||||
<ProjectExtensions>
|
||||
<PlcProjectOptions>
|
||||
<XmlArchive>
|
||||
<Data>
|
||||
<o xml:space="preserve" t="OptionKey">
|
||||
<Data>
|
||||
<o xml:space="preserve" t="OptionKey">
|
||||
<v n="Name">"<ProjectRoot>"</v>
|
||||
<d n="SubKeys" t="Hashtable" ckt="String" cvt="OptionKey">
|
||||
<v>{192FAD59-8248-4824-A8DE-9177C94C195A}</v>
|
||||
@@ -2656,16 +2656,16 @@
|
||||
</d>
|
||||
<d n="Values" t="Hashtable" />
|
||||
</o>
|
||||
</Data>
|
||||
<TypeList>
|
||||
<Type n="Boolean">System.Boolean</Type>
|
||||
<Type n="Hashtable">System.Collections.Hashtable</Type>
|
||||
<Type n="Int32">System.Int32</Type>
|
||||
<Type n="OptionKey">{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}</Type>
|
||||
<Type n="String">System.String</Type>
|
||||
<Type n="UInt32">System.UInt32</Type>
|
||||
</TypeList>
|
||||
</XmlArchive>
|
||||
</Data>
|
||||
<TypeList>
|
||||
<Type n="Boolean">System.Boolean</Type>
|
||||
<Type n="Hashtable">System.Collections.Hashtable</Type>
|
||||
<Type n="Int32">System.Int32</Type>
|
||||
<Type n="OptionKey">{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}</Type>
|
||||
<Type n="String">System.String</Type>
|
||||
<Type n="UInt32">System.UInt32</Type>
|
||||
</TypeList>
|
||||
</XmlArchive>
|
||||
</PlcProjectOptions>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
30
PLC/PLC.tmc
30
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
@@ -19,6 +19,10 @@ VAR
|
||||
{attribute 'OPC.UA.DA' := '0'}
|
||||
_afbStrings : ARRAY[0..1] OF FB_String[('String 1'), ('String 2')];
|
||||
|
||||
// Calculate max and min power depending on number of active strings
|
||||
_rMinPower : REAL;
|
||||
_rMaxPower : REAL;
|
||||
|
||||
// Battery shutdown due to error
|
||||
_xErrorShutdown : BOOL := FALSE;
|
||||
|
||||
@@ -659,6 +663,12 @@ FOR _ui := 0 TO (GVL_CONFIG.uiNumberOfStrings-1) DO
|
||||
END_IF
|
||||
END_FOR
|
||||
|
||||
// ===============================
|
||||
// Calculate max and min power depending on number of active strings
|
||||
// ===============================
|
||||
_rMinPower := _uiNumberOfActiveStrings * DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower);
|
||||
_rMaxPower := _uiNumberOfActiveStrings * DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower);
|
||||
|
||||
// ===============================
|
||||
// Calculate sum power for string balancing
|
||||
// ===============================
|
||||
@@ -1048,8 +1058,8 @@ _fbTowerLight(
|
||||
END_IF
|
||||
|
||||
5: // Check if power command is within limits
|
||||
IF _rAutoPowerRequest <= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower)
|
||||
AND _rAutoPowerRequest >= DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower) THEN
|
||||
IF _rAutoPowerRequest <= _rMaxPower
|
||||
AND _rAutoPowerRequest >= _rMinPower THEN
|
||||
_xEnableString := TRUE;
|
||||
_xStartBalancing := FALSE;
|
||||
_iState := 10;
|
||||
|
||||
Reference in New Issue
Block a user