diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index d1e2e6beb3db1b56243f637af5ace3db557b361f..546921895053d5a970a58d0bdf0eaaf78150adbb 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -1098,9 +1098,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl #region Implementation of IEngineControl - public bool CombustionEngineOn - { - get { return false; } set { } } + public bool CombustionEngineOn { get; set; } #endregion } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 84662db82143d49bd6b92da8b2fb7d679134cbf4..404d035726afcba1f8d2fe9d4f95a33a4f7141e6 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -203,8 +203,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl HandlePCC(absTime, targetVelocity); } if (ADAS.EcoRoll != EcoRollType.None && - (pccState == PCCStates.OutsideSegment || pccState == PCCStates.WithinSegment) - ) { + (pccState == PCCStates.OutsideSegment || pccState == PCCStates.WithinSegment)) { HandleEcoRoll(absTime, targetVelocity); } @@ -287,8 +286,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private void HandlePCC(Second absTime, MeterPerSecond targetVelocity) { - var dataBus = DataBus; - var vehicleSpeed = dataBus.VehicleInfo.VehicleSpeed; + var vehicleSpeed = DataBus.VehicleInfo.VehicleSpeed; UpdatePCCState(targetVelocity); @@ -319,12 +317,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl switch (ADAS.EcoRoll) { case EcoRollType.None: break; case EcoRollType.WithoutEngineStop: - dataBus.GearboxCtl.DisengageGearbox = true; + DataBus.GearboxCtl.DisengageGearbox = true; break; case EcoRollType.WithEngineStop: - dataBus.GearboxCtl.DisengageGearbox = true; - if (dataBus.EngineCtl != null) { - dataBus.EngineCtl.CombustionEngineOn = false; + DataBus.GearboxCtl.DisengageGearbox = true; + if (DataBus.EngineCtl != null) { + DataBus.EngineCtl.CombustionEngineOn = false; } break; default: throw new ArgumentOutOfRangeException(); @@ -334,12 +332,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl case PCCStates.OutsideSegment: case PCCStates.WithinSegment: case PCCStates.PCCinterrupt: - if (dataBus.GearboxCtl != null) { - dataBus.GearboxCtl.DisengageGearbox = false; + if (DataBus.GearboxCtl != null) { + DataBus.GearboxCtl.DisengageGearbox = false; } - if (dataBus.EngineCtl != null) { - dataBus.EngineCtl.CombustionEngineOn = true; + if (DataBus.EngineCtl != null) { + DataBus.EngineCtl.CombustionEngineOn = true; } break; default: throw new ArgumentOutOfRangeException(); @@ -962,7 +960,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // unfortunately, this causes issues for P1 hybrid configurations with AT gearbox in torque converter gear. If the EM propells, the torque // converter cannot find an operating point close to the drag point. therefore, do not announce the different action except for driving off from // standstill. - var overrideAction = DataBus.GearboxInfo.GearboxType.AutomaticTransmission() + var overrideAction = DataBus.GearboxInfo.GearboxType.AutomaticTransmission() && (DataBus.GearboxInfo.Gear.TorqueConverterLocked.HasValue && !DataBus.GearboxInfo.Gear.TorqueConverterLocked.Value) && (DataBus.ElectricMotorInfo(PowertrainPosition.HybridP1) == null || DataBus.VehicleInfo.VehicleStopped) ? DrivingAction.Accelerate diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 3d572afbbfb4a2c27b60bbcd3928deae27e5d094..eca093eb97524c57018e7add92456db2b562de97 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -227,7 +227,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies } TestPowertrain.SuperCap?.Initialize(DataBus.BatteryInfo.StateOfCharge); - TestPowertrain.Brakes.BrakePower = DataBus.Brakes.BrakePower; var currentGear = PreviousState.GearboxEngaged ? DataBus.GearboxInfo.Gear : Controller.ShiftStrategy.NextGear; @@ -996,15 +995,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies protected virtual bool AllowICEOff(Second absTime) { - //if (!ModelData.VehicleData.ADAS.EngineStopStart) { - // return false; - //} - var emPos = ModelData.ElectricMachinesData.First().Item1; - if (/*ModelData.VehicleData.ADAS.EngineStopStart &&*/ emPos == PowertrainPosition.HybridP1) { - return false; - } - return PreviousState.ICEStartTStmp == null || - (PreviousState.ICEStartTStmp + StrategyParameters.MinICEOnTime).IsSmaller(absTime); + return PreviousState.ICEStartTStmp == null + || (PreviousState.ICEStartTStmp + StrategyParameters.MinICEOnTime).IsSmaller(absTime); } protected virtual void HandleBrakeAction(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, bool dryRun, List<HybridResultEntry> eval) @@ -1204,22 +1196,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies return; } - var iceOn = DataBus.EngineInfo.EngineOn; - // if Hybrid P1 and Engine is off, the search for braking power is not possible: - // Therefore, switch on engine (if reasonable), otherwise simply do NOT search for mechanicalAssistPower. - if (emPos == PowertrainPosition.HybridP1 && !DataBus.EngineCtl.CombustionEngineOn) { - - var gearboxOut = firstResponse.Gearbox.OutputSpeed * firstResponse.Gearbox.OutputTorque; - var elMotor = DataBus.ElectricMotorInfo(PowertrainPosition.HybridP1); - var powerToleranceEl = 0.1 * elMotor.MaxPowerDrive(DataBus.BatteryInfo.InternalVoltage, firstResponse.Engine.EngineSpeed); - if (gearboxOut - firstResponse.Engine.DragPower < powerToleranceEl) { - DataBus.EngineCtl.CombustionEngineOn = true; - iceOn = true; - } else { - return; - } - } - // full recuperation is not possible - ICE would need to propel - search max possible EM torque var emRecuperationTq = SearchAlgorithm.Search( maxRecuperationResponse.ElectricMotor.ElectricMotorPowerMech / @@ -1237,7 +1213,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies }, evaluateFunction: emTq => { var cfg = new HybridStrategyResponse { - CombustionEngineOn = iceOn, + CombustionEngineOn = DataBus.EngineInfo.EngineOn, GearboxInNeutral = false, NextGear = nextGear, MechanicalAssistPower = new Dictionary<PowertrainPosition, Tuple<PerSecond, NewtonMeter>> { @@ -1375,8 +1351,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies } var result = ResponseEmOff; - if (DataBus.DriverInfo.PCCState == PCCStates.UseCase1 || DataBus.DriverInfo.PCCState == PCCStates.UseCase2) - result.ICEOff = true; + if (DataBus.DriverInfo.PCCState.IsOneOf(PCCStates.UseCase1, PCCStates.UseCase2)) { + result.ICEOff = AllowICEOff(absTime); + result.Setting.CombustionEngineOn = !result.ICEOff; + + if (DataBus.PowertrainInfo.ElectricMotorPositions.Contains(PowertrainPosition.HybridP1)) { + // special logic for HybridP1 (VECTO-1493) + result.Setting.GearboxInNeutral = true; + result.ICEOff &= ModelData.VehicleData.ADAS.EngineStopStart; + } + } eval.Add(result); } @@ -1896,7 +1880,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies }, evaluateFunction: emTq => { var cfg = new HybridStrategyResponse { - CombustionEngineOn = nextGear.IsLockedGear()? true : false, + CombustionEngineOn = nextGear.IsLockedGear() ? true : false, GearboxInNeutral = false, MechanicalAssistPower = new Dictionary<PowertrainPosition, Tuple<PerSecond, NewtonMeter>> { { emPos, Tuple.Create(firstResponse.ElectricMotor.AngularVelocity, emTq) }