Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

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

- introduce new exception in case searching for an operating point gives no result

- open the clutch if the vehicle's speed gets too low and the engine speed goes below idle speed
parent 8dc8f8bb
Branches
Tags
No related merge requests found
...@@ -86,6 +86,8 @@ namespace TUGraz.VectoCore.Configuration ...@@ -86,6 +86,8 @@ namespace TUGraz.VectoCore.Configuration
public static readonly PerSecond EngineIdlingSearchInterval = 10.SI<PerSecond>(); public static readonly PerSecond EngineIdlingSearchInterval = 10.SI<PerSecond>();
public const int EngineSearchLoopThreshold = 100; public const int EngineSearchLoopThreshold = 100;
public static readonly MeterPerSecond VehicleStopClutchDisengageSpeed = 10.KMPHtoMeterPerSecond();
} }
} }
} }
\ No newline at end of file
...@@ -87,4 +87,6 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl ...@@ -87,4 +87,6 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl
} }
internal class ResponseGearShift : AbstractResponse {} internal class ResponseGearShift : AbstractResponse {}
internal class ResponseEngineSpeedTooLow : ResponseDryRun {}
} }
\ No newline at end of file
...@@ -149,7 +149,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -149,7 +149,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (retVal == null) { if (retVal == null) {
// unhandled response (overload, delta > 0) - we need to search for a valid operating point.. // unhandled response (overload, delta > 0) - we need to search for a valid operating point..
var nextOperatingPoint = SearchOperatingPoint(absTime, ds, gradient, operatingPoint.Acceleration, response);
OperatingPoint nextOperatingPoint;
try {
nextOperatingPoint = SearchOperatingPoint(absTime, ds, gradient, operatingPoint.Acceleration, response);
} catch (VectoSimulationException) {
// in case of an exception during search the engine-speed got too low - gear disengaged, try roll action.
nextOperatingPoint = SearchOperatingPoint(absTime, ds, gradient, operatingPoint.Acceleration, response);
}
var limitedOperatingPoint = LimitAccelerationByDriverModel(nextOperatingPoint, var limitedOperatingPoint = LimitAccelerationByDriverModel(nextOperatingPoint,
LimitationMode.LimitDecelerationDriver); LimitationMode.LimitDecelerationDriver);
...@@ -255,9 +262,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -255,9 +262,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// return response; // return response;
//} //}
try {
operatingPoint = SearchOperatingPoint(absTime, operatingPoint.SimulationDistance, gradient, operatingPoint = SearchOperatingPoint(absTime, operatingPoint.SimulationDistance, gradient,
operatingPoint.Acceleration, response, coasting: true); operatingPoint.Acceleration, response, coasting: true);
} catch (VectoSimulationException) {
// in case of an exception during search the engine-speed got too low - gear disengaged, try roll action.
operatingPoint = SearchOperatingPoint(absTime, operatingPoint.SimulationDistance, gradient,
operatingPoint.Acceleration, response, coasting: true);
}
if (!ds.IsEqual(operatingPoint.SimulationDistance)) { if (!ds.IsEqual(operatingPoint.SimulationDistance)) {
// vehicle is at low speed, coasting would lead to stop before ds is reached. // vehicle is at low speed, coasting would lead to stop before ds is reached.
Log.Debug("SearchOperatingPoint reduced the max. distance: {0} -> {1}. Issue new request from driving cycle!", Log.Debug("SearchOperatingPoint reduced the max. distance: {0} -> {1}. Issue new request from driving cycle!",
...@@ -516,7 +528,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -516,7 +528,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Log.Warn("Exceeded max iterations when searching for operating point!"); Log.Warn("Exceeded max iterations when searching for operating point!");
Log.Warn("exceeded: {0} ... {1}", ", ".Join(debug.Take(5)), ", ".Join(debug.Slice(-6))); Log.Warn("exceeded: {0} ... {1}", ", ".Join(debug.Take(5)), ", ".Join(debug.Slice(-6)));
Log.Error("Failed to find operating point for breaking!"); Log.Error("Failed to find operating point for breaking!");
throw new VectoSimulationException("Failed to find operating point for breaking!exceeded: {0} ... {1}", throw new VectoSearchFailedException("Failed to find operating point for breaking!exceeded: {0} ... {1}",
", ".Join(debug.Take(5)), ", ".Join(debug.Slice(-6))); ", ".Join(debug.Take(5)), ", ".Join(debug.Slice(-6)));
} }
...@@ -607,6 +619,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -607,6 +619,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
(ResponseDryRun)NextComponent.Request(absTime, retVal.SimulationInterval, retVal.Acceleration, gradient, true); (ResponseDryRun)NextComponent.Request(absTime, retVal.SimulationInterval, retVal.Acceleration, gradient, true);
delta = actionRoll ? response.GearboxPowerRequest : (coasting ? response.DeltaDragLoad : response.DeltaFullLoad); delta = actionRoll ? response.GearboxPowerRequest : (coasting ? response.DeltaDragLoad : response.DeltaFullLoad);
if (response is ResponseEngineSpeedTooLow) {
LogManager.EnableLogging();
Log.Debug("Got EngineSpeedTooLow during SearchOperatingPoint. Aborting!");
throw new VectoSimulationException("EngineSpeed too low during search.");
}
if (delta.IsEqual(0.SI<Watt>(), Constants.SimulationSettings.EnginePowerSearchTolerance)) { if (delta.IsEqual(0.SI<Watt>(), Constants.SimulationSettings.EnginePowerSearchTolerance)) {
LogManager.EnableLogging(); LogManager.EnableLogging();
Log.Debug("found operating point in {0} iterations. Engine Power req: {2}, Gearbox Power req: {3} delta: {1}", Log.Debug("found operating point in {0} iterations. Engine Power req: {2}, Gearbox Power req: {3} delta: {1}",
...@@ -622,7 +640,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -622,7 +640,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Log.Warn("exceeded: {0} ... {1}", ", ".Join(debug.Take(5).Select(x => x.delta)), Log.Warn("exceeded: {0} ... {1}", ", ".Join(debug.Take(5).Select(x => x.delta)),
", ".Join(debug.Slice(-6).Select(x => x.delta))); ", ".Join(debug.Slice(-6).Select(x => x.delta)));
Log.Error("Failed to find operating point! absTime: {0}", absTime); Log.Error("Failed to find operating point! absTime: {0}", absTime);
throw new VectoSimulationException("Failed to find operating point! exceeded: {0} ... {1}", throw new VectoSearchFailedException("Failed to find operating point! exceeded: {0} ... {1}",
", ".Join(debug.Take(5).Select(x => x.delta)), ", ".Join(debug.Take(5).Select(x => x.delta)),
", ".Join(debug.Slice(-6).Select(x => x.delta))); ", ".Join(debug.Slice(-6).Select(x => x.delta)));
} }
......
...@@ -293,6 +293,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -293,6 +293,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
} }
if (dryRun) { if (dryRun) {
if (inEngineSpeed < DataBus.EngineIdleSpeed && DataBus.VehicleSpeed < Constants.SimulationSettings.VehicleStopClutchDisengageSpeed) {
_disengaged = true;
_shiftTime = absTime + dt;
_strategy.Disengage(absTime, dt, outTorque, outAngularVelocity);
Log.Debug("EngineSpeed is below IdleSpeed, Gearbox disengage!");
return new ResponseEngineSpeedTooLow() { Source = this, GearboxPowerRequest = outTorque * outAngularVelocity };
}
var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inEngineSpeed, true); var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inEngineSpeed, true);
dryRunResponse.GearboxPowerRequest = outTorque * outAngularVelocity; dryRunResponse.GearboxPowerRequest = outTorque * outAngularVelocity;
return dryRunResponse; return dryRunResponse;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment