From e75a0a868711e61dd7ca52e5d526843ee4de79fa Mon Sep 17 00:00:00 2001 From: atef Date: Wed, 19 Jun 2024 17:16:45 +0200 Subject: [PATCH] Update the curtailing algo --- .../SaliMax/src/SystemConfig/AcDcConfig.cs | 4 +- csharp/App/SaliMax/src/SystemConfig/Config.cs | 8 +- .../SaliMax/src/SystemConfig/DcDcConfig.cs | 4 +- .../DataTypes/AcControlRegisters.cs | 80 ------------------- 4 files changed, 9 insertions(+), 87 deletions(-) delete mode 100644 csharp/Lib/Devices/Trumpf/TruConvertAc/DataTypes/AcControlRegisters.cs diff --git a/csharp/App/SaliMax/src/SystemConfig/AcDcConfig.cs b/csharp/App/SaliMax/src/SystemConfig/AcDcConfig.cs index ac4a274aa..20a755151 100644 --- a/csharp/App/SaliMax/src/SystemConfig/AcDcConfig.cs +++ b/csharp/App/SaliMax/src/SystemConfig/AcDcConfig.cs @@ -2,7 +2,7 @@ namespace InnovEnergy.App.SaliMax.SystemConfig; public class AcDcConfig { - public required Double MaxDcLinkVoltage { get; init; } - public required Double MinDcLinkVoltage { get; init; } + public required Double MaxDcLinkVoltage { get; set; } + public required Double MinDcLinkVoltage { get; set; } public required Double ReferenceDcLinkVoltage { get; init; } } \ No newline at end of file diff --git a/csharp/App/SaliMax/src/SystemConfig/Config.cs b/csharp/App/SaliMax/src/SystemConfig/Config.cs index 668016fc8..cefcda4d2 100644 --- a/csharp/App/SaliMax/src/SystemConfig/Config.cs +++ b/csharp/App/SaliMax/src/SystemConfig/Config.cs @@ -15,8 +15,9 @@ public class Config //TODO: let IE choose from config files (Json) and connect t private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; - public required Double MinSoc { get; set; } - public required CalibrationChargeType ForceCalibrationChargeState { get; set; } + public required Double MinSoc { get; set; } + public required Int16 CurtailP { get; set; } + public required CalibrationChargeType ForceCalibrationChargeState { get; set; } public required DateTime DayAndTimeForRepetitiveCalibration { get; set; } public required DateTime DayAndTimeForAdditionalCalibration { get; set; } public required Boolean DisplayIndividualBatteries { get; set; } @@ -122,7 +123,8 @@ public class Config //TODO: let IE choose from config files (Json) and connect t public static Config Default => new() { MinSoc = 20, - ForceCalibrationChargeState = CalibrationChargeType.RepetitivelyEvery, + CurtailP = 100, + ForceCalibrationChargeState = CalibrationChargeType.RepetitivelyEvery, DayAndTimeForRepetitiveCalibration = DefaultDatetime, DayAndTimeForAdditionalCalibration = DefaultDatetime, DisplayIndividualBatteries = false, diff --git a/csharp/App/SaliMax/src/SystemConfig/DcDcConfig.cs b/csharp/App/SaliMax/src/SystemConfig/DcDcConfig.cs index 82fb79df3..e1473d5f3 100644 --- a/csharp/App/SaliMax/src/SystemConfig/DcDcConfig.cs +++ b/csharp/App/SaliMax/src/SystemConfig/DcDcConfig.cs @@ -2,7 +2,7 @@ namespace InnovEnergy.App.SaliMax.SystemConfig; public class DcDcConfig { - public required Double LowerDcLinkVoltage { get; init; } + public required Double LowerDcLinkVoltage { get; set; } public required Double ReferenceDcLinkVoltage { get; init; } - public required Double UpperDcLinkVoltage { get; init; } + public required Double UpperDcLinkVoltage { get; set; } } \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/DataTypes/AcControlRegisters.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/DataTypes/AcControlRegisters.cs deleted file mode 100644 index 4d6e1fc1c..000000000 --- a/csharp/Lib/Devices/Trumpf/TruConvertAc/DataTypes/AcControlRegisters.cs +++ /dev/null @@ -1,80 +0,0 @@ -// namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.DataTypes; -// -// public static class AcControlRegisters -// { -// public const UInt16 Date = 1001; -// public const UInt16 Time = 1003; -// public const UInt16 IpAddress = 1005; -// public const UInt16 Subnet = 1007; -// public const UInt16 Gateway = 1009; -// public const UInt16 ResetParamToDefault = 1011; -// public const UInt16 CommunicationTimeout = 1017; -// public const UInt16 RestartFlag = 1018; -// public const UInt16 ConnectedSystemConfig = 1019; -// public const UInt16 UpdateSwTrigger = 1027; -// public const UInt16 AutomaticSwUpdate = 1028; -// public const UInt16 CustomerValuesSaveReset = 1029; -// public const UInt16 SerialNumberSystemControl = 2001; -// public const UInt16 SerialNumberAcDc = 2009; -// public const UInt16 IntegrationLevel = 2051; -// public const UInt16 IlBuildnumber = 2052; -// public const UInt16 PowerStageConfig = 4001; -// public const UInt16 SetValueConfig = 4002; -// public const UInt16 ResetsAlarmAndWarning = 4003; -// public const UInt16 PreChargeDcLinkConfigR = 4006; -// public const UInt16 ReferenceFrameConvention = 4007; -// public const UInt16 SlaveAddress = 4008; -// public const UInt16 ErrorHandlingPolicy = 4009; -// public const UInt16 GridType = 4010; -// public const UInt16 SubSlaveAddress = 4011; -// public const UInt16 ModbusSlaveId = 4012; -// public const UInt16 SubSlaveErrorPolicy = 4013; -// public const UInt16 SignedPowerNominalValue = 4196; -// public const UInt16 SignedPowerSetValueL1 = 4197; -// public const UInt16 SignedPowerSetValueL2 = 4198; -// public const UInt16 SignedPowerSetValueL3 = 4199; -// public const UInt16 Powe0rSetValue = 4200; -// public const UInt16 PowerSetValueL1 = 4201; -// public const UInt16 PowerSetValueL2 = 4202; -// public const UInt16 PowerSetValueL3 = 4203; -// public const UInt16 MaximumGridCurrentRmsL1 = 4204; -// public const UInt16 MaximumGridCurrentRmsL2 = 4205; -// public const UInt16 MaximumGridCurrentRmsL3 = 4206; -// public const UInt16 CosPhiSetValueL1 = 4207; -// public const UInt16 CosPhiSetValueL2 = 4208; -// public const UInt16 CosPhiSetValueL3 = 4209; -// public const UInt16 PhaseL1IsCapacitive = 4214; // True = Capacitive, false = Inductive -// public const UInt16 PhaseL2IsCapacitive = 4215; // True = Capacitive, false = Inductive -// public const UInt16 PhaseL3IsCapacitive = 4216; // True = Capacitive, false = Inductive -// public const UInt16 PhasesAreCapacitive = 4217; // True = Capacitive, false = Inductive -// public const UInt16 SetPointCosPhi = 4218; -// public const UInt16 SetPointSinPhi = 4219; -// public const UInt16 SetPointSinPhiL1 = 4220; -// public const UInt16 SetPointSinPhiL2 = 4221; -// public const UInt16 SetPointSinPhiL3 = 4222; -// public const UInt16 FrequencyOffsetIm = 4223; //Im: Island mode -// public const UInt16 VoltageAdjustmentFactorIm = 4224; //Im: Island mode -// public const UInt16 PreChargeDcLinkVoltage = 4226; -// public const UInt16 MaxPeakCurrentVoltageControlL1 = 4227; -// public const UInt16 MaxPeakCurrentVoltageControlL2 = 4228; -// public const UInt16 MaxPeakCurrentVoltageControlL3 = 4229; -// public const UInt16 GridFormingMode = 4230; -// public const UInt16 DcLinkReferenceVoltage = 4231; -// public const UInt16 DcLinkMinVoltage = 4232; -// public const UInt16 DcLinkMaxVoltage = 4233; -// public const UInt16 AcDcDcVoltageRefUs = 4234; -// public const UInt16 AcDcMinDcLinkVoltageUs = 4235; -// public const UInt16 AcDcMaxDcLinkVoltageUs = 4236; -// // public const UInt16 FrequencySlopeIslandMode = 4237, // Function fN = f(active grid-power) of droop control -// // public const UInt16 VoltageSlopeIslandMode = 4238, // VN = f(reactive grid power) of droop control in island operation. -// public const UInt16 AcDcGcBypassMode = 4281; -// public const UInt16 AcDcGcPMaxThresholdPercent = 4282; // res -// public const UInt16 AcDcGcStartupRampEnable = 4283; -// public const UInt16 DcConfigModule = 4301; // 0 = DC module is off, battery voltage can be measured -// // 1 = DC module is active (DC link voltage control) -// // 2 = DC module is active(current source mode orin DC droop mode) -// public const UInt16 DcDcPowerDistribution = 4304; -// public const UInt16 AcDcDistributionMode = 4307; -// } -// -//