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

fix AMT Shift strategy pre-processors:

handle the case where the vehicle has enough power to drive at 100% slope in lower gears (max gradability, max cardan torque)
handle the case that no gear for a certain velocity is found (velocity speed gearshift preprocessor)
consider infeasible results due to double tolerances (average acceleration torque preprocessor)
parent 86a81c36
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
for (var tmpSpeed = engineSpeed; tmpSpeed < UpperLimit; tmpSpeed += speedStepSize) {
sum += VectoMath.Min(torque, fld.FullLoadStationaryTorque(tmpSpeed));
}
entries.Add(new KeyValuePair<Tuple<PerSecond, NewtonMeter>, NewtonMeter>(Tuple.Create(engineSpeed, torque), sum * speedStepSize / (UpperLimit - engineSpeed)));
var tmp = sum * speedStepSize / (UpperLimit - engineSpeed);
if (engineSpeed.IsEqual(UpperLimit, speedStepSize / 2)) {
tmp = 0.SI<NewtonMeter>();
}
entries.Add(new KeyValuePair<Tuple<PerSecond, NewtonMeter>, NewtonMeter>(Tuple.Create(engineSpeed, torque), tmp));
}
}
......
......@@ -39,21 +39,27 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
engineSpeed += engineSpeedSteps) {
var maxTorque = Data.EngineData.FullLoadCurves[gearData.Key].FullLoadStationaryTorque(engineSpeed);
var vehicleSpeed = engineSpeed * powertrainRatioWOGearbox / gearData.Value.Ratio;
var first = TestContainer.VehiclePort.Initialize(vehicleSpeed, 0.SI<Radian>());
var delta = first.EngineTorqueDemandTotal - maxTorque;
var grad = SearchAlgorithm.Search(
0.SI<Radian>(), delta, 0.1.SI<Radian>(),
getYValue: r => {
return ((r as AbstractResponse).EngineTorqueDemandTotal - maxTorque);
},
evaluateFunction: g => {
return TestContainer.VehiclePort.Initialize(vehicleSpeed, g);
},
criterion: r => {
return ((r as AbstractResponse).EngineTorqueDemandTotal - maxTorque).Value();
}
);
var grad = VectoMath.InclinationToAngle(1);
var max = TestContainer.VehiclePort.Initialize(vehicleSpeed, grad);
if ((max.EngineTorqueDemandTotal - maxTorque).IsGreater(0)) {
var first = TestContainer.VehiclePort.Initialize(vehicleSpeed, 0.SI<Radian>());
var delta = first.EngineTorqueDemandTotal - maxTorque;
grad = SearchAlgorithm.Search(
0.SI<Radian>(), delta, 0.1.SI<Radian>(),
getYValue: r => {
return ((r as AbstractResponse).EngineTorqueDemandTotal - maxTorque);
},
evaluateFunction: g => {
return TestContainer.VehiclePort.Initialize(vehicleSpeed, g);
},
criterion: r => {
return ((r as AbstractResponse).EngineTorqueDemandTotal - maxTorque).Value();
}
);
max = TestContainer.VehiclePort.Initialize(vehicleSpeed, grad);
}
retVal[gearData.Key].Add(new KeyValuePair<PerSecond, NewtonMeter>(max.EngineSpeed, max.CardanTorque));
}
}
......
......@@ -73,6 +73,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
private Radian SearchGradient(Vehicle vehicle, MeterPerSecond vehicleSpeed, NewtonMeter maxTorque)
{
var gradientMax = VectoMath.InclinationToAngle(1);
var responseMax = vehicle.Initialize(vehicleSpeed, gradientMax);
var deltaMax = responseMax.EnginePowerRequest / responseMax.EngineSpeed - maxTorque;
if (deltaMax.IsSmaller(0)) {
return gradientMax;
}
var gradient = VectoMath.InclinationToAngle(0);
var response = vehicle.Initialize(vehicleSpeed, gradient);
......
......@@ -74,6 +74,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var gearForSpeed = runData.GearboxData.Gears.FirstOrDefault(
x => (speed * ratio * x.Value.Ratio).IsBetween(
runData.EngineData.IdleSpeed, runData.EngineData.FullLoadCurves[0].RatedSpeed)).Key;
if (gearForSpeed == 0) {
continue;
}
for (var grad = MinGradient; grad <= MaxGradient; grad += GradientStep) {
var gradient = VectoMath.InclinationToAngle(grad / 100.0);
gearbox.Disengaged = false;
......
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