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 212aa911 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

handle overload response when braking (i.e. vehicle already decelerates more than intended

parent 0a594c2a
No related branches found
No related tags found
No related merge requests found
......@@ -417,6 +417,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
: null;
response = Driver.DrivingActionBrake(absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed,
gradient, targetDistance: targetDistance);
response.Switch().
Case<ResponseOverload>(r => {
Log.Warn("Got OverloadResponse during brake action - desired deceleration could not be reached! response: {0}", r);
if (!DataBus.ClutchClosed(absTime)) {
Log.Warn("Clutch is open - trying RollAction");
response = Driver.DrivingActionRoll(absTime, ds, targetVelocity, gradient);
}
});
break;
}
......
......@@ -268,8 +268,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
};
}
Log.Debug("Found operating point for coasting. dt: {0}, acceleration: {1}", operatingPoint.SimulationInterval,
operatingPoint.Acceleration);
Log.Debug("Found operating point for {2}. dt: {0}, acceleration: {1}", operatingPoint.SimulationInterval,
operatingPoint.Acceleration, rollAction ? "ROL" : "COAST");
operatingPoint = LimitAccelerationByDriverModel(operatingPoint,
rollAction ? LimitationMode.NoLimitation : LimitationMode.LimitDecelerationLookahead);
......@@ -349,7 +349,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
response.Switch().
Case<ResponseSuccess>(r => retVal = r).
Case<ResponseOverload>(r => retVal = r).
Case<ResponseOverload>(r => retVal = r)
. // i.e., driving uphill, clutch open, deceleration higher than desired deceleration
Case<ResponseUnderload>(). // will be handled in SearchBrakingPower
Case<ResponseGearShift>(). // will be handled in SearchBrakingPower
Case<ResponseFailTimeInterval>(r =>
......@@ -472,9 +473,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Default(r => {
throw new UnexpectedResponseException("cannot use response for searching braking power!", r);
});
var delta = 0.SI<Watt>();
Watt delta;
debug.Add(new { brakingPower = 0.SI<Watt>(), searchInterval, delta = origDelta, operatingPoint });
debug.Add(new { brakePower = 0.SI<Watt>(), searchInterval, delta = origDelta, operatingPoint });
var brakePower = searchInterval * -origDelta.Sign();
......
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