diff --git a/VECTO/GUI/GearboxGearDialog.vb b/VECTO/GUI/GearboxGearDialog.vb index e4b2381f3d279b79f962480bb137531e1a206573..c3f8789340b14310d2cf6948516e3d344689aebd 100644 --- a/VECTO/GUI/GearboxGearDialog.vb +++ b/VECTO/GUI/GearboxGearDialog.vb @@ -68,9 +68,7 @@ Public Class GearboxGearDialog Dim gearData As GearData = New GearData() With { .Ratio = TbRatio.Text.ToDouble(0), .LossMap = lossmap, - .ShiftPolygon = shiftPolygon, - .MaxTorque = - If(String.IsNullOrWhiteSpace(TbMaxTorque.Text), Nothing, TbMaxTorque.Text.ToDouble().SI(Of NewtonMeter)) + .ShiftPolygon = shiftPolygon } Dim results As IList(Of ValidationResult) = gearData.Validate(If(Cfg.DeclMode, ExecutionMode.Declaration, ExecutionMode.Engineering), GearboxType, False) diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 62edaf670a3fc56a823dba84428ab35d864a819b..5ec459f13ea5b8533c7cbb821cf3bc9f6669f503 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -220,7 +220,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter new GearData { LossMap = gearLossMap, ShiftPolygon = shiftPolygon, - MaxTorque = gear.MaxTorque, + MaxSpeed = gear.MaxInputSpeed, Ratio = gear.Ratio, }); }).ToDictionary(kv => kv.Key, kv => kv.Value); diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 149aaf79ed140f4392fbd9655b69204e1fc0a8e0..9f6a5c08f244839827520b19c618bff72baa4c98 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -188,7 +188,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter dynamicTyreRadius); var gearData = new GearData { ShiftPolygon = shiftPolygon, - MaxTorque = gear.MaxTorque, + MaxSpeed = gear.MaxInputSpeed, Ratio = gear.Ratio, LossMap = lossMap, }; diff --git a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs index 45554f3d5e8f957ac8eb56883be707eefa00e6a5..b56c36fd50f3c76832ef43967279acd7d30df89d 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs @@ -150,10 +150,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Data for (var inTorque = engineData.FullLoadCurve.FullLoadStationaryTorque(angularVelocity) / 3; inTorque < engineData.FullLoadCurve.FullLoadStationaryTorque(angularVelocity); inTorque += 2.0 / 3.0 * engineData.FullLoadCurve.FullLoadStationaryTorque(angularVelocity) / 10.0) { - if (gear.Value.MaxTorque != null && inTorque > gear.Value.MaxTorque) { - continue; - } - NewtonMeter angledriveTorque; try { angledriveTorque = gear.Value.LossMap.GetOutTorque(angularVelocity, inTorque); diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs index d50bab2bdd1962f7bf84a9638c138848ace6b1cc..4781b613aa975ebe15a2741969f478fa152b593a 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs @@ -53,8 +53,6 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus MeterPerSquareSecond StartAcceleration { get; } - NewtonMeter GearMaxTorque { get; } - Watt GearboxLoss(); Second LastShift { get; } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs index cb1f4ecb750baf3d012f251ac7522b871bdc7706..17a34bbcf625943c3ffeee09bb2b9b2059658cc9 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs @@ -116,11 +116,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } } - public NewtonMeter GearMaxTorque - { - get { return Gearbox != null ? Gearbox.GearMaxTorque : null; } - } - public Watt GearboxLoss() { return Gearbox.GearboxLoss(); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs index 2f0f7332970df1762646b4b8e599fcd3709dce97..2dfc3f7668a3bb5eecb00acf033abf8014bf064b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs @@ -70,7 +70,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox public TransmissionLossMap TorqueConverterGearLossMap { get; internal set; } - public NewtonMeter MaxTorque { get; internal set; } + public PerSecond MaxSpeed { get; internal set; } public ShiftPolygon TorqueConverterShiftPolygon { get; set; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index 92b0c3d694ff527e5b262f53ea1161527ca3be7d..55e58e1d61cda83e9416f79fd822e6e6310ea391 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -73,7 +73,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private bool SpeedTooHighForEngine(uint gear, PerSecond outAngularSpeed) { return - (outAngularSpeed * ModelData.Gears[gear].Ratio).IsGreaterOrEqual(DataBus.EngineN95hSpeed); + (outAngularSpeed * ModelData.Gears[gear].Ratio).IsGreaterOrEqual(ModelData.Gears[gear].MaxSpeed ?? DataBus.EngineN95hSpeed); } public override GearInfo NextGear diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs index db37ce5e6c6be0d081461988ea02063eead8592f..3b0feaae827d767a72c99d11c724863711ed45aa 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs @@ -47,8 +47,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public override IGearbox Gearbox { get { return _gearbox; } - set - { + set { _gearbox = value as ATGearbox; if (_gearbox == null) { throw new VectoException("AT Shift strategy can only handle AT gearboxes, given: {0}", value.GetType()); @@ -135,7 +134,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // 3) 1C -> 0: disengange when negative T_out and positive T_in var gear1C = gear == 1 && !_gearbox.TorqueConverterLocked; - var disengageTOutNegativeAndTInPositive = DataBus.DriverAcceleration <= 0 && gear1C && outTorque.IsSmaller(0) && inTorque.IsGreater(0); + var disengageTOutNegativeAndTInPositive = DataBus.DriverAcceleration <= 0 && gear1C && outTorque.IsSmaller(0) && + inTorque.IsGreater(0); var disengageTCEngineSpeedLowerIdle = braking && torqueNegative && gear1C && inAngularVelocity.IsSmallerOrEqual(DataBus.EngineIdleSpeed); @@ -154,12 +154,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return true; } // Emergency Upshift: if higher than engine rated speed - if (inAngularVelocity.IsGreaterOrEqual(DataBus.EngineRatedSpeed)) { + if (inAngularVelocity.IsGreaterOrEqual(ModelData.Gears[gear].MaxSpeed ?? DataBus.EngineRatedSpeed)) { // check if upshift is possible if (!ModelData.Gears.ContainsKey(gear + 1)) { return false; } - Log.Debug("engine speed would be above rated speed - shift up"); + Log.Debug("engine speed would be above max speed / rated speed - shift up"); Upshift(absTime, gear); return true; } @@ -184,8 +184,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, Second lastShiftTime) { var shiftTimeReached = (absTime - lastShiftTime).IsGreaterOrEqual(ModelData.ShiftTime); - if (!shiftTimeReached) + if (!shiftTimeReached) { return false; + } var currentGear = ModelData.Gears[gear]; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs index c3c2fb34774c43136935d6815cab69c752ee46b2..c1194b4181101058e91c296872cf2830d80f5dd7 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs @@ -95,11 +95,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { return ModelData.StartAcceleration; } } - public NewtonMeter GearMaxTorque - { - get { return Gear == 0 || !ModelData.Gears.ContainsKey(Gear) ? null : ModelData.Gears[Gear].MaxTorque; } - } - public Watt GearboxLoss() { var ratio = ModelData.Gears[PreviousState.Gear].HasLockedGear diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index e35060782f54176735a71f1934eeaa8178c3142b..7d58da8dc847d6f67579484151d337e9a3c6b572 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -206,11 +206,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl //ValidatePowerDemand(totalTorqueDemand, dynamicFullLoadTorque, fullDragTorque); // get max. torque as limited by gearbox. gearbox only limits torqueOut! - var gearboxFullLoad = DataBus.GearMaxTorque; - var deltaFull = ComputeDelta(torqueOut, totalTorqueDemand, dynamicFullLoadTorque, gearboxFullLoad, true); - var deltaDrag = ComputeDelta(torqueOut, totalTorqueDemand, fullDragTorque, - gearboxFullLoad != null ? -gearboxFullLoad : null, false); + var deltaFull = totalTorqueDemand - dynamicFullLoadTorque; + //ComputeDelta(torqueOut, totalTorqueDemand, dynamicFullLoadTorque, gearboxFullLoad, true); + var deltaDrag = totalTorqueDemand - fullDragTorque; //ComputeDelta(torqueOut, totalTorqueDemand, fullDragTorque, + //gearboxFullLoad != null ? -gearboxFullLoad : null, false); if (dryRun) { return new ResponseDryRun { @@ -231,8 +231,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.DynamicFullLoadTorque = dynamicFullLoadTorque; CurrentState.InertiaTorqueLoss = inertiaTorqueLoss; - if ( - (deltaFull * avgEngineSpeed).IsGreater(0.SI<Watt>(), Constants.SimulationSettings.LineSearchTolerance) && + if ((deltaFull * avgEngineSpeed).IsGreater(0.SI<Watt>(), Constants.SimulationSettings.LineSearchTolerance) && (deltaDrag * avgEngineSpeed).IsSmaller(0.SI<Watt>(), Constants.SimulationSettings.LineSearchTolerance)) { //throw new VectoSimulationException( Log.Error( @@ -242,10 +241,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var minTorque = CurrentState.FullDragTorque; var maxTorque = CurrentState.DynamicFullLoadTorque; - if (gearboxFullLoad != null) { - minTorque = VectoMath.Max(minTorque, -gearboxFullLoad); - maxTorque = VectoMath.Min(maxTorque, gearboxFullLoad); - } CurrentState.EngineTorque = totalTorqueDemand.LimitTo(minTorque, maxTorque); CurrentState.EnginePower = CurrentState.EngineTorque * avgEngineSpeed; @@ -292,16 +287,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl }; } - private NewtonMeter ComputeDelta(NewtonMeter torqueOut, NewtonMeter totalTorqueDemand, NewtonMeter maxEngineTorque, - NewtonMeter maxGbxtorque, bool motoring) + private NewtonMeter ComputeDelta(NewtonMeter torqueOut, NewtonMeter totalTorqueDemand, NewtonMeter maxEngineTorque) { - var deltaGbx = maxGbxtorque != null ? torqueOut - maxGbxtorque : null; var deltaEngine = totalTorqueDemand - maxEngineTorque; - - if (deltaGbx == null) { - return deltaEngine; - } - return motoring ? VectoMath.Max(deltaGbx, deltaEngine) : VectoMath.Min(deltaGbx, deltaEngine); + return deltaEngine; } public IResponse Initialize(NewtonMeter outTorque, PerSecond outAngularVelocity) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index ca7fb234f03d27a7bfe660867f1bf11885048451..e93fb37e679cba04dc7ac93459b709a37cd4f4b4 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -138,10 +138,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // Default(r => { throw new UnexpectedResponseException("Gearbox.Initialize", r); }); var fullLoad = DataBus.EngineStationaryFullPower(inAngularVelocity); - if (ModelData.Gears[gear].MaxTorque != null) { - var fullLoadGearbox = ModelData.Gears[gear].MaxTorque * inAngularVelocity; - fullLoad = VectoMath.Min(fullLoadGearbox, fullLoad); - } return new ResponseDryRun { Source = this, diff --git a/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs b/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs index 2cd72e1fb4f5f0ea3186a4045e657b181030a27a..3e8fa4dce39603c436687f5af20e6bcd62770b0e 100644 --- a/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs @@ -316,7 +316,7 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns Gears = ratios.Select((ratio, i) => Tuple.Create((uint)i, new GearData { - MaxTorque = ratio > 5 ? 2300.SI<NewtonMeter>() : null, +// MaxTorque = ratio > 5 ? 2300.SI<NewtonMeter>() : null, LossMap = TransmissionLossMapReader.ReadFromFile(GearboxLossMap, ratio, string.Format("Gear {0}", i)), Ratio = ratio, ShiftPolygon = ShiftPolygonReader.ReadFromFile(GearboxShiftPolygonFile) @@ -353,7 +353,6 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns Gears = new Dictionary<uint, GearData> { { 1, new GearData { - MaxTorque = null, LossMap = TransmissionLossMapReader.ReadFromFile(GearboxLossMap, ratio, "Gear 1"), Ratio = ratio, ShiftPolygon = ShiftPolygonReader.ReadFromFile(GearboxShiftPolygonFile) diff --git a/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs b/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs index 7b07eea317ac7711345fc2520300431882a973aa..26dc14cd505c7c640355a2d6d3745e97538b1374 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs @@ -185,14 +185,14 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var ratios = new[] { 14.93, 11.64, 9.02, 7.04, 5.64, 4.4, 3.39, 2.65, 2.05, 1.6, 1.28, 1.0 }; return new GearboxData { Gears = ratios.Select((ratio, i) => - Tuple.Create((uint)i, - new GearData { - MaxTorque = 2300.SI<NewtonMeter>(), - LossMap = TransmissionLossMapReader.ReadFromFile(!ratio.IsEqual(1.0) ? directlossMap : indirectLossMap, ratio, - string.Format("Gear {0}", i)), - Ratio = ratio, - ShiftPolygon = ShiftPolygonReader.ReadFromFile(ShiftPolygonFile) - })) + Tuple.Create((uint)i, + new GearData { +// MaxTorque = 2300.SI<NewtonMeter>(), + LossMap = TransmissionLossMapReader.ReadFromFile(!ratio.IsEqual(1.0) ? directlossMap : indirectLossMap, ratio, + string.Format("Gear {0}", i)), + Ratio = ratio, + ShiftPolygon = ShiftPolygonReader.ReadFromFile(ShiftPolygonFile) + })) .ToDictionary(k => k.Item1 + 1, v => v.Item2) }; } diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs index 94482431b6f45097aa8b138a015d24003660ce76..21edf9ef5df34bb46396232bb4913faf1c01a19a 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs @@ -87,7 +87,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent Gears = ratios.Select((ratio, i) => Tuple.Create((uint)i, new GearData { - MaxTorque = 2300.SI<NewtonMeter>(), +// MaxTorque = 2300.SI<NewtonMeter>(), LossMap = TransmissionLossMapReader.ReadFromFile(i != 6 ? IndirectLossMap : DirectLossMap, ratio, string.Format("Gear {0}", i)), Ratio = ratio,