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

Skip to content
Snippets Groups Projects
Commit c14c542a authored by Michael KRISPER's avatar Michael KRISPER
Browse files

ATShiftStrategy: Corrected error with checks for upshift in highest gear

parent fbeca6e8
No related branches found
No related tags found
No related merge requests found
......@@ -155,8 +155,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
// Emergency Upshift: if higher than engine rated speed
if (inAngularVelocity.IsGreaterOrEqual(DataBus.EngineRatedSpeed)) {
// upshift is not possible
if (ModelData.Gears.ContainsKey(gear + 1)) {
// check if upshift is possible
if (!ModelData.Gears.ContainsKey(gear + 1)) {
return false;
}
Log.Debug("engine speed would be above rated speed - shift up");
......@@ -207,12 +207,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var nextEnginePower = currentEnginePower / nextEngineSpeed;
var isAboveUpShift = IsAboveUpShiftCurve(gear, nextEnginePower, nextEngineSpeed, _gearbox.TorqueConverterLocked);
var reachableAcceleration = EstimateAccelerationForGear(nextGear, outAngularVelocity);
var minAcceleration = _gearbox.TorqueConverterLocked
? ModelData.UpshiftMinAcceleration
: ModelData.TorqueConverterData.CLUpshiftMinAcceleration;
minAcceleration = VectoMath.Min(minAcceleration, DataBus.DriverAcceleration);
var minAccelerationReachable = reachableAcceleration.IsGreaterOrEqual(minAcceleration);
var minAccelerationReachable = true;
if (!DataBus.VehicleSpeed.IsEqual(0)) {
var reachableAcceleration = EstimateAccelerationForGear(nextGear, outAngularVelocity);
var minAcceleration = _gearbox.TorqueConverterLocked
? ModelData.UpshiftMinAcceleration
: ModelData.TorqueConverterData.CLUpshiftMinAcceleration;
minAcceleration = VectoMath.Min(minAcceleration, DataBus.DriverAcceleration);
minAccelerationReachable = reachableAcceleration.IsGreaterOrEqual(minAcceleration);
}
if (isAboveUpShift && minAccelerationReachable) {
Upshift(absTime, gear);
......
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