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

Skip to content
Snippets Groups Projects
Commit 0887d100 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

gearbox: fix for using correct gear in case of transition from disengaged to engaged

parent 86ec77bf
No related branches found
No related tags found
No related merge requests found
......@@ -181,6 +181,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_engageTime = absTime + dt;
}
if (ClutchClosed(absTime) && Disengaged && !outAngularVelocity.IsEqual(0)) {
ReEngageGear(absTime, dt, outTorque, outAngularVelocity);
Log.Debug("Gearbox engaged gear {0}", Gear);
}
var gear = Disengaged ? NextGear.Gear : Gear;
var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0;
var inTorqueLossResult = ModelData.Gears[gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque);
......@@ -319,10 +324,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
//{
// Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity);
//}
if (Disengaged && !outAngularVelocity.IsEqual(0)) {
ReEngageGear(absTime, dt, outTorque, outAngularVelocity);
Log.Debug("Gearbox engaged gear {0}", Gear);
}
var inAngularVelocity = outAngularVelocity * ModelData.Gears[Gear].Ratio;
......
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