diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs index 17b781b2f96df2e2fd9ceff4a48f4bac57f4fda2..225a758ce3ddf313ad3da34cf3632a997277c38c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs @@ -127,7 +127,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; var avgInAngularVelocity = (PreviousState.InAngularVelocity + angularVelocityIn) / 2.0; var clutchLoss = torqueIn * avgInAngularVelocity - outTorque * avgOutAngularVelocity; - if (!startClutch && !clutchLoss.IsEqual(0)) { + if (!startClutch && !clutchLoss.IsEqual(0) && (DataBus.Gear != 1 || clutchLoss.IsSmaller(0))) { // we don't want to have negative clutch losses, so adapt input torque to match the average output power torqueIn = outTorque * avgOutAngularVelocity / avgInAngularVelocity; } diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs index ba8c1983cdd42e4f2d067b1e93548f6bf4b6018f..49c182ac64cf1c36d32f2df1807ef3b0424839e5 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs @@ -59,7 +59,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent [Test, // clutch slipping TestCase(DrivingBehavior.Driving, 100, 0, 3, 0, 65.6889), - TestCase(DrivingBehavior.Driving, 100, 5, 1, 7.6116, 65.6889), + TestCase(DrivingBehavior.Driving, 100, 5, 1, 7.6116, 65.6889), // would cause clutch losses! TestCase(DrivingBehavior.Braking, 100, 80, 1, 100, 80), // clutch opened - would cause neg. clutch losses (which is not possible), torque is adapted TestCase(DrivingBehavior.Halted, 100, 30, 0, 51.1569, 58.643062),