diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index e8c6f276bc060e44369d0528263ed26f5137eaa4..0d14dd0d88fa8e47ce4481dc80e6580ccc717183 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -347,6 +347,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data }; + // engine has to be added before gearbox + var engine = new StopStartCombustionEngine(container, data.EngineData); + // DistanceBasedDrivingCycle --> driver --> vehicle --> wheels // --> axleGear --> (retarder) --> gearBox --> (retarder) --> clutch --> engine <-- Aux var cycle = new DistanceBasedDrivingCycle(container, data.Cycle); @@ -362,7 +365,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl powertrain = powertrain.AddComponent(new Clutch(container, data.EngineData)); } - var engine = new StopStartCombustionEngine(container, data.EngineData); + var idleController = GetIdleController(data.PTO, engine, container); cycle.IdleController = idleController as IdleControllerSwitcher; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs b/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs index 096736f5ca0a017cb1f6258dfaa5552c3c5fc571..1b439b4bec87d7b942695fab82185ba994c53870 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs @@ -29,13 +29,13 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using TUGraz.VectoCore.Models.Connector.Ports; - -namespace TUGraz.VectoCore.Models.SimulationComponent -{ - public interface IIdleController : ITnOutPort - { - ITnOutPort RequestPort { set; } - void Reset(); - } +using TUGraz.VectoCore.Models.Connector.Ports; + +namespace TUGraz.VectoCore.Models.SimulationComponent +{ + public interface IIdleController : ITnOutPort + { + ITnOutPort RequestPort { set; } + void Reset(); + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 25f68f9dcdcf3f88b8e0ea31cbf5ee63aa8fab9d..009c0de5f1ae0fca9608dbddfd55f1a8fc80eb42 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -1258,7 +1258,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl gradient, targetDistance: targetDistance); } - if (DataBus.GearboxInfo.GearboxType.AutomaticTransmission() && response == null) { + if ((DataBus.GearboxInfo.GearboxType.AutomaticTransmission() || DataBus.HybridControllerInfo != null) && response == null) { for (var i = 0; i < 3 && response == null; i++) { DataBus.Brakes.BrakePower = 0.SI<Watt>(); response = Driver.DrivingActionBrake( diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 59c6a7b267bf1b068a7674b73eecbd147da1f0b1..af795aa3bb2184328df7d0fb3f4d56ea213d0c40 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -794,7 +794,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal = NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, gradient, false); var gearChanged = !(DataBus.GearboxInfo.Gear == gear && DataBus.GearboxInfo.TCLocked == tcLocked); - if (DataBus.GearboxInfo.GearboxType.AutomaticTransmission() && gearChanged && (retVal is ResponseOverload || retVal is ResponseUnderload)) { + if ((DataBus.GearboxInfo.GearboxType.AutomaticTransmission() || DataBus.HybridControllerInfo != null) && gearChanged && (retVal is ResponseOverload || retVal is ResponseUnderload)) { Log.Debug("Gear changed after a valid operating point was found - braking is no longer applicable due to overload"); return null; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs index 03f7d5f96e8ca44bfa7c49d880061090aedd8c68..606bba2cd7ee27458722abae998951a03de5c039 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs @@ -496,7 +496,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public override void Disengage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity) { - if (!_controller.ShiftRequired && DataBus.DriverInfo.DrivingAction != DrivingAction.Halt) { + if (!_controller.ShiftRequired && !_controller.CurrentStrategySettings.GearboxInNeutral && DataBus.DriverInfo.DrivingAction != DrivingAction.Halt) { // gearbox disengaged on its own! set next gear! var gear = _nextGear; while (GearList.HasPredecessor(gear) && SpeedTooLowForEngine(gear, outAngularVelocity)) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 638b74642fde5547fb7bd0ca0fd689cc5d1ffa81..7dc2a9aad7fe5fe970146dcdce7183ccf125cf01 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -1014,13 +1014,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies eval.Add(ResponseEmOff); return; } + + var emPos = ModelData.ElectricMachinesData.First().Item1; + var disengageSpeedThreshold = DataBus.GearboxInfo.GearboxType.AutomaticTransmission() + ? Constants.SimulationSettings.ATGearboxDisengageWhenHaltingSpeed + : Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed; + var vehiclespeedBelowThreshold = DataBus.VehicleInfo.VehicleSpeed.IsSmaller(disengageSpeedThreshold); + if (ElectricMotorCanPropellDuringTractionInterruption || DataBus.GearboxInfo.GearEngaged(absTime)) { - var emPos = ModelData.ElectricMachinesData.First().Item1; - var disengageSpeedThreshold = DataBus.GearboxInfo.GearboxType.AutomaticTransmission() - ? Constants.SimulationSettings.ATGearboxDisengageWhenHaltingSpeed - : Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed; - var vehiclespeedBelowThreshold = DataBus.VehicleInfo.VehicleSpeed.IsSmaller(disengageSpeedThreshold); if (vehiclespeedBelowThreshold && (emPos == PowertrainPosition.HybridP2 || emPos == PowertrainPosition.HybridP1)) { if (DataBus.GearboxInfo.GearboxType.AutomaticTransmission()) { var firstgear = ResponseEmOff; @@ -1028,7 +1030,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies eval.Add(firstgear); return; } else { - eval.Add(ResponseEmOff); + var off = ResponseEmOff; + off.Setting.GearboxInNeutral = true; + eval.Add(off); return; } } @@ -1062,6 +1066,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies var engineSpeedTooLow = EngineSpeedTooLow(firstResponse); + var endSpeed = DataBus.VehicleInfo.VehicleSpeed + + DataBus.DriverInfo.DriverAcceleration * ModelData.GearboxData.TractionInterruption; + if (engineSpeedTooLow && DataBus.GearboxInfo.GearboxType.ManualTransmission() && + endSpeed.IsSmallerOrEqual(Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed, 0.1.KMPHtoMeterPerSecond())) { + var response = ResponseEmOff; + response.Gear = new GearshiftPosition(0); + response.Setting.GearboxEngaged = false; + response.Setting.GearboxInNeutral = true; + eval.Add(response); + return; + } + if (GearList.HasPredecessor(nextGear) && engineSpeedTooLow && (!vehiclespeedBelowThreshold || AllowEmergencyShift)) { // engine speed would fall below idling speed - consider downshift var estimatedVelocityPostShift = VelocityDropData.Valid @@ -1114,6 +1130,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies var downshift = ResponseEmOff; //downshift.Gear = GearList.Predecessor(nextGear); downshift.Gear = best; // GearList.Predecessor(nextGear); + downshift.Setting.GearboxInNeutral = best.Gear == 0; + downshift.Setting.ShiftRequired = best.Gear == 0; eval.Add(downshift); return; } @@ -1288,7 +1306,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies } } } else { - eval.Add(ResponseEmOff); + var off = ResponseEmOff; + if (vehiclespeedBelowThreshold && (emPos == PowertrainPosition.HybridP2 || emPos == PowertrainPosition.HybridP1)) { + off.Setting.GearboxInNeutral = true; + } else { + off.Setting.GearboxInNeutral = PreviousState.Solution.Setting.GearboxInNeutral; + } + + eval.Add(off); } } @@ -1309,6 +1334,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies private GearshiftPosition FindBestGearForBraking(GearshiftPosition nextGear, IResponse firstResponse) { + var endSpeed = DataBus.VehicleInfo.VehicleSpeed + + DataBus.DriverInfo.DriverAcceleration * ModelData.GearboxData.TractionInterruption; + if (DataBus.GearboxInfo.GearboxType.ManualTransmission() && + endSpeed.IsSmallerOrEqual(Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed, 0.1.KMPHtoMeterPerSecond())) { + return new GearshiftPosition(0); + } + var tmpGear = new GearshiftPosition(nextGear.Gear, nextGear.TorqueConverterLocked); var candidates = new Dictionary<GearshiftPosition, PerSecond>(); var gbxOutSpeed = firstResponse.Engine.EngineSpeed /