Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 46898eb3 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

allow clutch losses when slipping clutch in 1st gear

parent 73a2ed4c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment