diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs index d84db22b5db817ad212ee57630ebd1e4be60256d..156332e54cb77fb4cfa8cc73adbfd1fb5399f17d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs @@ -56,7 +56,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public PowertrainPosition Position { get; } public PerSecond MaxSpeed { - get { return _maxSpeed ?? (_maxSpeed = ModelData.FullLoadCurve.FullLoadEntries.MaxBy(x => x.MotorSpeed).MotorSpeed) / ModelData.Ratio; } + get { return _maxSpeed ?? (_maxSpeed = (ModelData.FullLoadCurve.FullLoadEntries.MaxBy(x => x.MotorSpeed).MotorSpeed) / ModelData.Ratio); } } public Watt DragPower(PerSecond electricMotorSpeed) @@ -192,6 +192,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl emTorque = 0.SI<NewtonMeter>(); } + if (Position == PowertrainPosition.BatteryElectricE2 && !DataBus.GearboxInfo.GearEngaged(absTime)) { + // electric motor is after the gearbox but no gear engaged - ignore inertia and drag... + emTorqueDt = 0.SI<NewtonMeter>(); + emTorque = 0.SI<NewtonMeter>(); + } + if (ElectricPower == null || emTorqueDt == null) { // no electric system or EM shall be off - apply drag only // if EM is off, calculate EM drag torque 'forward' to be applied on drivetrain @@ -218,8 +224,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var electricSupplyResponse = ElectricPower.Request(absTime, dt, electricPower, dryRun); - if (!dryRun && !(electricSupplyResponse is ElectricSystemResponseSuccess)) { - if (!emOff && DataBus.HybridControllerInfo != null && !avgEmSpeed.IsEqual(DataBus.HybridControllerInfo.ElectricMotorSpeed(Position))) { + if (!dryRun && !emOff && !(electricSupplyResponse is ElectricSystemResponseSuccess)) { + if (DataBus.HybridControllerInfo != null && !avgEmSpeed.IsEqual(DataBus.HybridControllerInfo.ElectricMotorSpeed(Position))) { return new ResponseInvalidOperatingPoint(this); } throw new VectoException( diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VelocitySpeedGearshiftPreprocessor.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VelocitySpeedGearshiftPreprocessor.cs index efdc23d265f2f8a472f65160ee1d8b023caf8c54..45b4997ec43d587610e45e4bc39a6d6cf292ead0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VelocitySpeedGearshiftPreprocessor.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VelocitySpeedGearshiftPreprocessor.cs @@ -155,7 +155,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl acceleration, delta, Constants.SimulationSettings.OperatingPointInitialSearchIntervalAccelerating, getYValue: response => { var r = (ResponseDryRun)response; - return r.Clutch.PowerRequest; + return r.Gearbox.PowerRequest; }, evaluateFunction: acc => { var response = vehicle.Request(time, simulationInterval, acc, gradient, true); @@ -164,7 +164,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl }, criterion: response => { var r = (ResponseDryRun)response; - return r.Clutch.PowerRequest.Value() * 100; + return r.Gearbox.PowerRequest.Value() * 100; }, abortCriterion: (response, cnt) => { var r = (ResponseDryRun)response; diff --git a/VectoCore/VectoCoreTest/Integration/BatteryElectric/BatteryElectricTest.cs b/VectoCore/VectoCoreTest/Integration/BatteryElectric/BatteryElectricTest.cs index 624940ba9dcfd3924e04156c5048657ed42d319f..2bb7c1795b0bc85701b38b41b9ed517d296d1069 100644 --- a/VectoCore/VectoCoreTest/Integration/BatteryElectric/BatteryElectricTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BatteryElectric/BatteryElectricTest.cs @@ -496,7 +496,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric const bool largeMotor = true; - var modFilename = string.Format("SimpleParallelHybrid-B2_cycle_{0}-{1}_{2}_{3}", declarationMission, initialSoC, payload, pAuxEl); + var modFilename = string.Format("SimpleBatteryElectric-B2_cycle_{0}-{1}_{2}_{3}", declarationMission, initialSoC, payload, pAuxEl); const PowertrainPosition pos = PowertrainPosition.BatteryElectricE2; var job = CreateEngineeringRun( cycle, modFilename, initialSoC, pos, 2, 2, largeMotor: true);