diff --git a/VectoCommon/VectoCommon/Models/GearboxType.cs b/VectoCommon/VectoCommon/Models/GearboxType.cs index d92c3c08d55e84aef2c59278781cec9761f35c33..127cc89a8103ed0f2a129b090cfb4c294ebd4972 100644 --- a/VectoCommon/VectoCommon/Models/GearboxType.cs +++ b/VectoCommon/VectoCommon/Models/GearboxType.cs @@ -51,11 +51,11 @@ namespace TUGraz.VectoCommon.Models public static string GetLabel(this GearboxType type) { switch (type) { - case GearboxType.MT: return "Manual Transmission (MT)"; - case GearboxType.AMT: return "Automated Transmission (AMT)"; - case GearboxType.ATSerial: return "Automatic Transmission - Serial (AT-S)"; + case GearboxType.MT: return "Manual Transmission (MT)"; + case GearboxType.AMT: return "Automated Transmission (AMT)"; + case GearboxType.ATSerial: return "Automatic Transmission - Serial (AT-S)"; case GearboxType.ATPowerSplit: return "Automatic Transmission - PowerSplit (AT-P)"; - case GearboxType.APTN: return "Automatic Power Transmission - No Torque Converter (APT-N)"; + case GearboxType.APTN: return "Automatic Transmission - No TorqueConverter (APT-N)"; case GearboxType.DrivingCycle: return "Gear from Driving Cycle"; default: throw new ArgumentOutOfRangeException("GearboxType", type, null); } diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index bc25fc5446f01baafdfa8c4517cfd5058a09e823..c519d7ec3cd9564725bf895cd08bcc51e8156d7e 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -579,6 +579,7 @@ namespace TUGraz.VectoCore.Models.Declaration { switch (type) { case GearboxType.AMT: + case GearboxType.APTN: // TODO MQ: 2020-10-14: compute for AMT with ICE and AMT with EM differently return ComputeEfficiencyShiftPolygon(gearIdx, fullLoadCurve, gears, engine, axlegearRatio, dynamicTyreRadius); case GearboxType.MT: diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index f785ba4ed0e9b1709858ea66921a214a03b0dcbd..1819f9daa2940c0bcbc41d66611e7534c79766c2 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -555,7 +555,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl new DummyGearboxInfo(container); new ATClutchInfo(container); break; - case PowertrainPosition.BatteryElectricE2: + case PowertrainPosition.BatteryElectricE2 when data.GearboxData.Type != GearboxType.APTN: var strategy = new PEVAMTShiftStrategy(container); em = GetElectricMachine(PowertrainPosition.BatteryElectricE2, data.ElectricMachinesData, container, es, ctl); @@ -564,6 +564,17 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl .AddComponent(em); new ATClutchInfo(container); break; + + case PowertrainPosition.BatteryElectricE2 when data.GearboxData.Type == GearboxType.APTN: + var strategyAPTN = new APTNShiftStrategy(container); + em = GetElectricMachine(PowertrainPosition.BatteryElectricE2, data.ElectricMachinesData, + container, es, ctl); + powertrain.AddComponent(new AxleGear(container, data.AxleGearData)) + .AddComponent(new APTNGearbox(container, strategyAPTN)) + .AddComponent(em); + new ATClutchInfo(container); + break; + default: throw new ArgumentOutOfRangeException(nameof(pos), pos, null); } @@ -1019,7 +1030,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl return new PEVAMTShiftStrategy(container); } throw new VectoException("no default gearshift strategy available for gearbox type {0} and job type {1}", runData.GearboxData.Type, runData.JobType); - //return new AMTShiftStrategy(runData, container); case GearboxType.MT: runData.ShiftStrategy = MTShiftStrategy.Name; return new MTShiftStrategy(container); @@ -1027,7 +1037,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl case GearboxType.ATSerial: runData.ShiftStrategy = ATShiftStrategyOptimized.Name; return new ATShiftStrategyOptimized(container); - //return new ATShiftStrategy(runData, container); + case GearboxType.APTN: + runData.ShiftStrategy = APTNShiftStrategy.Name; + return new APTNShiftStrategy(container); default: throw new ArgumentOutOfRangeException("GearboxType", $"Unknown Gearbox Type {runData.GearboxData.Type.ToString()}"); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNGearbox.cs index 2f78aaf8352ce808d8c010cd9894316906e7ea0f..6402723447c5fc6f7d6d5c18ba32ae042515ed04 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNGearbox.cs @@ -1,9 +1,22 @@ -using TUGraz.VectoCore.Models.Simulation; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.Simulation; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { public class APTNGearbox : PEVGearbox { - public APTNGearbox(IVehicleContainer container, IShiftStrategy strategy) : base(container, strategy) { } + public APTNGearbox(IVehicleContainer container, IShiftStrategy strategy) : base(container, strategy) { + ModelData.TractionInterruption = 0.SI<Second>(); + } + + public override void TriggerGearshift(Second absTime, Second dt) + { + + } + + public override bool GearEngaged(Second absTime) + { + return true; + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNShiftStrategy.cs new file mode 100644 index 0000000000000000000000000000000000000000..0499aa19f44be506291f99f671ee5beea937ed4a --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/APTNShiftStrategy.cs @@ -0,0 +1,11 @@ +using TUGraz.VectoCore.Models.Simulation; + +namespace TUGraz.VectoCore.Models.SimulationComponent.Impl +{ + public class APTNShiftStrategy : PEVAMTShiftStrategy + { + public APTNShiftStrategy(IVehicleContainer dataBus) : base(dataBus) { } + + public new static string Name => "APT-N"; + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs index 418c53617efd88fe532759d0522ea51f662c7f21..d4670d31614b1b404cee8eee453dc331f0e4ea2f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs @@ -187,7 +187,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - private bool DoCheckShiftRequired(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, GearshiftPosition gear, Second lastShiftTime, IResponse response) + private bool DoCheckShiftRequired(Second absTime, Second dt, NewtonMeter outTorque, + PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, + GearshiftPosition gear, Second lastShiftTime, IResponse response) { // no shift when vehicle stands if (DataBus.VehicleInfo.VehicleStopped) { @@ -424,7 +426,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return nextGear; } - if (response.ElectricMotor.TorqueRequestEmMap != null && response.ElectricMotor.TorqueRequestEmMap.IsEqual( + if (response.ElectricMotor.TorqueRequestEmMap != null && response.ElectricMotor.MaxRecuperationTorqueEM is null) + Console.WriteLine("DEBUG"); + if (response.ElectricMotor.TorqueRequestEmMap != null + && response.ElectricMotor.MaxRecuperationTorqueEM != null + && response.ElectricMotor.TorqueRequestEmMap.IsEqual( response.ElectricMotor.MaxRecuperationTorqueEM, response.ElectricMotor.MaxRecuperationTorqueEM * 0.1)) { // no early downshift when close to max recuperation line @@ -757,11 +763,4 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl #endregion } - - - - public class APTNShiftStrategy : PEVAMTShiftStrategy - { - public APTNShiftStrategy(IVehicleContainer dataBus) : base(dataBus) { } - } } \ No newline at end of file diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 2262ab76d17a1fea7d132b41a8fae4741fb13993..57593497fc5a31404b16f6415f02d04c10952a7a 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -289,6 +289,7 @@ <Compile Include="InputData\Reader\ComponentData\BatteryInternalResistanceReader.cs" /> <Compile Include="InputData\Reader\ComponentData\BatteryMaxCurrentReader.cs" /> <Compile Include="Models\SimulationComponent\Impl\APTNGearbox.cs" /> + <Compile Include="Models\SimulationComponent\Impl\APTNShiftStrategy.cs" /> <Compile Include="Models\SimulationComponent\Impl\BatterySystem.cs" /> <Compile Include="Models\SimulationComponent\Impl\DummyAxleGearInfo.cs" /> <Compile Include="Models\SimulationComponent\Impl\PEVGearbox.cs" />