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

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

shift strategy: disengage if engine speed is below idle speed in first gear,

combustion engine: log warning if below idle speed
parent d106e611
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
// emergency shift to not stall the engine ------------------------
if (gear == 1 && SpeedTooLowForEngine(_nextGear, inAngularVelocity / ModelData.Gears[gear].Ratio)) {
return true;
}
_nextGear = gear;
while (_nextGear > 1 && SpeedTooLowForEngine(_nextGear, inAngularVelocity / ModelData.Gears[gear].Ratio)) {
_nextGear--;
......
......@@ -348,7 +348,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected override void DoWriteModalResults(IModalDataContainer container)
{
var avgEngineSpeed = (PreviousState.EngineSpeed + CurrentState.EngineSpeed) / 2.0;
if (avgEngineSpeed.IsSmaller(EngineIdleSpeed, DataBus.ExecutionMode == ExecutionMode.Engineering ? 20.RPMtoRad():1e-3.RPMtoRad())) {
Log.Warn("EngineSpeed below idling speed! n_eng_avg: {0}, n_idle: {1}", avgEngineSpeed, EngineIdleSpeed);
}
container[ModalResultField.P_eng_fcmap] = CurrentState.EngineTorque * avgEngineSpeed;
container[ModalResultField.P_eng_out] = container[ModalResultField.P_eng_out] is DBNull
? CurrentState.EngineTorqueOut * avgEngineSpeed
......
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