Implement CurrentLimiter and spare power mode
This commit is contained in:
@@ -101,41 +101,9 @@ namespace TestApp.Configuration
|
||||
ChargerDriver = Settings.DEFAULT_CHARGER_DRIVER,
|
||||
ChargerAddress = Settings.DEFAULT_CHARGER_ADDRESS,
|
||||
ChargerPort = Settings.DEFAULT_CHARGER_PORT,
|
||||
MaxCurrent = Settings.DEFAULT_MAX_CURRENT,
|
||||
MinNegativePower = Settings.DEFAULT_MIN_NEGATIVE_POWER,
|
||||
Mode = 1,
|
||||
ModeSettings = new ModeSettings[] {
|
||||
new ModeSettings
|
||||
{
|
||||
ProcessVariable = ProcessVariable.ActivePowerPositive,
|
||||
SetPoint = 32,
|
||||
NegativePid = new PidSetting() {
|
||||
KP = 0,
|
||||
KI = 1,
|
||||
KD = 0,
|
||||
},
|
||||
PositivePid = new PidSetting()
|
||||
{
|
||||
KP = 0,
|
||||
KI = 1,
|
||||
KD = 0,
|
||||
}
|
||||
},
|
||||
new ModeSettings
|
||||
{
|
||||
ProcessVariable = ProcessVariable.ActivePowerNegative,
|
||||
SetPoint = 100,
|
||||
NegativePid = new PidSetting() {
|
||||
KP = 0,
|
||||
KI = 1,
|
||||
KD = 0,
|
||||
},
|
||||
PositivePid = new PidSetting()
|
||||
{
|
||||
KP = 0,
|
||||
KI = 1,
|
||||
KD = 0,
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -5,207 +5,16 @@
|
||||
internal const string DEFAULT_CHARGER_DRIVER = "VestelEvc04";
|
||||
internal const string DEFAULT_CHARGER_ADDRESS = "192.168.178.100";
|
||||
internal const int DEFAULT_CHARGER_PORT = 512;
|
||||
internal const double DEFAULT_MAX_CURRENT = 32;
|
||||
internal const double DEFAULT_MIN_NEGATIVE_POWER = 100;
|
||||
|
||||
public string? ChargerDriver { get; set; }
|
||||
public string? ChargerAddress { get; set; }
|
||||
public int? ChargerPort { get; set; }
|
||||
|
||||
public double? MaxCurrent { get; set; }
|
||||
public double? MinNegativePower { get; set; }
|
||||
|
||||
public int Mode { get; set; }
|
||||
|
||||
public ModeSettings[]? ModeSettings { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class PidSetting {
|
||||
public double KP { get; set; }
|
||||
public double KI { get; set; }
|
||||
public double KD { get; set; }
|
||||
}
|
||||
|
||||
public class ModeSettings {
|
||||
public ProcessVariable ProcessVariable { get; set; }
|
||||
public double SetPoint { get; set; }
|
||||
public PidSetting? PositivePid { get; set; }
|
||||
public PidSetting? NegativePid { get; set; }
|
||||
}
|
||||
|
||||
public enum ProcessVariable
|
||||
{
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerPositive,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyPositive,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerNegative,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyNegative,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerPositive,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyPositive,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerNegative,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyNegative,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerPositive,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyPositive,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerNegative,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyNegative,
|
||||
|
||||
/// <summary>in -</summary>
|
||||
PowerFactor,
|
||||
|
||||
/// <summary>in Hz</summary>
|
||||
SupplyFrequency,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerPositiveL1,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyPositiveL1,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerNegativeL1,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyNegativeL1,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerPositiveL1,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyPositiveL1,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerNegativeL1,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyNegativeL1,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerPositiveL1,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyPositiveL1,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerNegativeL1,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyNegativeL1,
|
||||
|
||||
/// <summary>in A</summary>
|
||||
CurrentL1,
|
||||
|
||||
/// <summary>in V</summary>
|
||||
VoltageL1,
|
||||
|
||||
/// <summary>in -</summary>
|
||||
PowerFactorL1,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerPositiveL2,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyPositiveL2,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerNegativeL2,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyNegativeL2,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerPositiveL2,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyPositiveL2,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerNegativeL2,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyNegativeL2,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerPositiveL2,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyPositiveL2,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerNegativeL2,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyNegativeL2,
|
||||
|
||||
/// <summary>in A</summary>
|
||||
CurrentL2,
|
||||
|
||||
/// <summary>in V</summary>
|
||||
VoltageL2,
|
||||
|
||||
/// <summary>in -</summary>
|
||||
PowerFactorL2,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerPositiveL3,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyPositiveL3,
|
||||
|
||||
/// <summary>in W</summary>
|
||||
ActivePowerNegativeL3,
|
||||
|
||||
/// <summary>in Wh</summary>
|
||||
ActiveEnergyNegativeL3,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerPositiveL3,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyPositiveL3,
|
||||
|
||||
/// <summary>in var</summary>
|
||||
ReactivePowerNegativeL3,
|
||||
|
||||
/// <summary>in varh</summary>
|
||||
ReactiveEnergyNegativeL3,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerPositiveL3,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyPositiveL3,
|
||||
|
||||
/// <summary>in VA</summary>
|
||||
ApparentPowerNegativeL3,
|
||||
|
||||
/// <summary>in VAh</summary>
|
||||
ApparentEnergyNegativeL3,
|
||||
|
||||
/// <summary>in A</summary>
|
||||
CurrentL3,
|
||||
|
||||
/// <summary>in V</summary>
|
||||
VoltageL3,
|
||||
|
||||
/// <summary>in -</summary>
|
||||
PowerFactorL3,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user