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

fix: computation of slope for changing engine speed during traction interruption

parent 6eff5f5d
No related branches found
No related tags found
No related merge requests found
......@@ -500,6 +500,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private Second _idleStart;
private Watt _lastEnginePower;
private PerSecond _engineTargetSpeed;
public ITnOutPort RequestPort { private get; set; }
......@@ -539,9 +540,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (!outTorque.IsEqual(0)) {
throw new VectoException("Torque has to be 0 for idle requests!");
}
var targetVelocity = _engine.PreviousState.EngineSpeed / _dataBus.GetGearData(_dataBus.Gear).Ratio *
if (_idleStart == null) {
_idleStart = absTime;
_engineTargetSpeed = _engine.PreviousState.EngineSpeed / _dataBus.GetGearData(_dataBus.Gear).Ratio *
_dataBus.GetGearData(_dataBus.NextGear.Gear).Ratio;
var velocitySlope = (targetVelocity - _engine.PreviousState.EngineSpeed) / _dataBus.TractionInterruption;
}
var velocitySlope = (_engineTargetSpeed - _engine.PreviousState.EngineSpeed) / (_dataBus.TractionInterruption - (absTime - _idleStart));
var nextAngularSpeed = (velocitySlope * dt + _engine.PreviousState.EngineSpeed);
if (nextAngularSpeed < _engine.ModelData.IdleSpeed) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment