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

Merge pull request #80 in VECTO/vecto-sim from...

Merge pull request #80 in VECTO/vecto-sim from ~EMKRISPMI/vecto-sim:feature/VECTO-112-simple-shifting-strategy to develop

* commit '9add0ae8':
  corrected gear shift behaviour when engineSpeed near the clutch-slipping threshold (truck_drive_20_downhill_15, truck_acc_20_60_down, truck_dec_60_20_down)
parents aee6ffda 9add0ae8
No related branches found
No related tags found
No related merge requests found
......@@ -298,7 +298,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return dryRunResponse;
}
var shiftAllowed = !inEngineSpeed.IsEqual(0) && !DataBus.VehicleSpeed.IsEqual(0);
var shiftAllowed = !inEngineSpeed.IsEqual(0) && !DataBus.VehicleSpeed.IsEqual(0) && absTime.IsGreater(0);
if (shiftAllowed) {
var shiftRequired = _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inEngineSpeed,
......
using System;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.Connector.Ports.Impl;
using TUGraz.VectoCore.Models.Simulation.DataBus;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
......@@ -133,7 +134,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private bool SpeedTooLowForEngine(uint gear, PerSecond outAngularSpeed)
{
return (outAngularSpeed * Data.Gears[NextGear].Ratio).IsSmaller(DataBus.EngineIdleSpeed);
return (outAngularSpeed * Data.Gears[gear].Ratio).IsSmaller(DataBus.EngineIdleSpeed);
}
// original vecto2.2: (inAngularSpeed - IdleSpeed) / (RatedSpeed - IdleSpeed) >= 1.2
......@@ -141,8 +142,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// = inAngularSpeed >= 1.2*RatedSpeed - 0.2*IdleSpeed
private bool SpeedTooHighForEngine(uint gear, PerSecond outAngularSpeed)
{
return (outAngularSpeed * Data.Gears[NextGear].Ratio).IsGreaterOrEqual(1.2 * DataBus.EngineRatedSpeed -
0.2 * DataBus.EngineIdleSpeed);
return (outAngularSpeed * Data.Gears[gear].Ratio).IsGreaterOrEqual(1.2 * DataBus.EngineRatedSpeed -
0.2 * DataBus.EngineIdleSpeed);
}
......@@ -198,6 +199,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// if in shift curve and torque reserve is provided: return the current gear
if (!IsBelowDownShiftCurve(gear, inTorque, inAngularSpeed) && !IsAboveUpShiftCurve(gear, inTorque, inAngularSpeed) &&
reserve >= Data.StartTorqueReserve) {
if ((inAngularSpeed - DataBus.EngineIdleSpeed) / (DataBus.EngineRatedSpeed - DataBus.EngineIdleSpeed) <
Constants.SimulationSettings.CluchNormSpeed && gear > 1) {
gear--;
}
return gear;
}
......@@ -299,6 +305,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
}
if ((Data.Gears[NextGear].Ratio * outAngularVelocity - DataBus.EngineIdleSpeed) /
(DataBus.EngineRatedSpeed - DataBus.EngineIdleSpeed) <
Constants.SimulationSettings.CluchNormSpeed && NextGear > 1) {
NextGear--;
}
return (NextGear != 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