Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

cycle gearbox fix: consider shift losses in dry-run!

parent 1d714eb0
No related branches found
No related tags found
No related merge requests found
......@@ -224,7 +224,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
} else {
CurrentState.InertiaTorqueLossOut = 0.SI<NewtonMeter>();
}
if (Gear != PreviousState.Gear &&
ConsiderShiftLosses(new GearInfo(Gear, torqueConverterLocked), outTorque)) {
CurrentState.PowershiftLosses = ComputeShiftLosses(dt, outTorque, outAngularVelocity);
}
inTorque += CurrentState.PowershiftLosses ?? 0.SI<NewtonMeter>();
if (dryRun) {
if (TorqueConverter != null && !torqueConverterLocked) {
return TorqueConverter.Request(absTime, dt, inTorque, inAngularVelocity, true);
......@@ -243,11 +247,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
CurrentState.TransmissionTorqueLoss = inTorque - (outTorque / effectiveRatio);
if (Gear != PreviousState.Gear &&
ConsiderShiftLosses(new GearInfo(Gear, torqueConverterLocked), outTorque)) {
CurrentState.PowershiftLosses = ComputeShiftLosses(dt, outTorque, outAngularVelocity);
}
inTorque += CurrentState.PowershiftLosses ?? 0.SI<NewtonMeter>();
CurrentState.SetState(inTorque, inAngularVelocity, outTorque, outAngularVelocity);
CurrentState.Gear = Gear;
// end critical section
......@@ -473,8 +473,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public override bool ClutchClosed(Second absTime)
{
return (DataBus.DriverBehavior == DrivingBehavior.Braking
? DataBus.CycleData.LeftSample.Gear
: DataBus.CycleData.RightSample.Gear) != 0;
? DataBus.CycleData.LeftSample.Gear
: DataBus.CycleData.RightSample.Gear) != 0;
}
#endregion
......
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