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

modified torque tolerance for VTP cycle

parent 450493de
No related branches found
No related tags found
No related merge requests found
......@@ -516,8 +516,7 @@ namespace TUGraz.VectoCore.Models.Declaration
public static readonly PerSecond WheelSpeedZeroTolerance = 0.1.RPMtoRad();
public static readonly PerSecond MaxWheelSpeedDifferenceStandstill = 1.RPMtoRad();
public static readonly NewtonMeter WheelTorqueZeroTolerance = 10.SI<NewtonMeter>();
public static readonly NewtonMeter MaxWheelTorqueZeroDifference = 100.SI<NewtonMeter>();
public static readonly NewtonMeter MaxWheelTorqueDifference = 200.SI<NewtonMeter>();
public static readonly PerSecond MinFanSpeed = 20.RPMtoRad();
public static readonly PerSecond MaxFanSpeed = 4000.RPMtoRad();
......
......@@ -149,22 +149,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private void VerifyWheelTorque(DrivingCycleData.DrivingCycleEntry entry)
{
if (!entry.TorqueWheelLeft.IsEqual(0.SI<NewtonMeter>(), DeclarationData.VTPMode.WheelTorqueZeroTolerance) &&
!entry.TorqueWheelRight.IsEqual(0.SI<NewtonMeter>(), DeclarationData.VTPMode.WheelTorqueZeroTolerance)) {
var torqueRatio = VectoMath.Max(
var torqueRatio = VectoMath.Max(
entry.TorqueWheelLeft / entry.TorqueWheelRight, entry.TorqueWheelRight / entry.TorqueWheelLeft);
if (torqueRatio > DeclarationData.VTPMode.WheelTorqueDifferenceFactor) {
Log.Error(
"Torque difference rel. (L/R) too high! t: {0} tq_left: {1}, tq_right: {2}", entry.Time, entry.TorqueWheelLeft,
entry.TorqueWheelRight);
}
} else {
if (VectoMath.Abs(entry.TorqueWheelLeft - entry.TorqueWheelRight) >
DeclarationData.VTPMode.MaxWheelTorqueZeroDifference) {
Log.Error(
"Torque difference abs. (L/R) too high! t: {0} tq_left: {1}, tq_right: {2}", entry.Time, entry.TorqueWheelLeft,
entry.TorqueWheelRight);
}
var torqueDiff = VectoMath.Abs(entry.TorqueWheelLeft - entry.TorqueWheelRight);
if (torqueRatio > DeclarationData.VTPMode.WheelTorqueDifferenceFactor &&
torqueDiff > DeclarationData.VTPMode.MaxWheelTorqueDifference) {
Log.Error(
"Torque difference (L/R) too high! t: {0} tq_left: {1}, tq_right: {2}", entry.Time, entry.TorqueWheelLeft,
entry.TorqueWheelRight);
}
}
......@@ -176,14 +168,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
entry.WheelSpeedLeft / entry.WheelSpeedRight, entry.WheelSpeedRight / entry.WheelSpeedLeft);
if (wheelSpeedRatio > DeclarationData.VTPMode.WheelSpeedDifferenceFactor) {
Log.Error(
"Wheel-speed difference rel. (L/R) too high! t: {0} n_left: {1}, n_right: {2}", entry.Time,
"Wheel-speed difference rel. (L/R) too high! t: {0} n_left: {1} rpm, n_right: {2} rpm", entry.Time,
entry.WheelSpeedLeft.AsRPM, entry.WheelSpeedRight.AsRPM);
}
} else {
if (VectoMath.Abs(entry.WheelSpeedLeft - entry.WheelSpeedRight) >
DeclarationData.VTPMode.MaxWheelSpeedDifferenceStandstill) {
Log.Error(
"Wheel-speed difference abs. (L/R) too high! t: {0} n_left: {1}, n_right: {2}", entry.Time,
"Wheel-speed difference abs. (L/R) too high! t: {0} n_left: {1} rpm, n_right: {2} rpm", entry.Time,
entry.WheelSpeedLeft.AsRPM, entry.WheelSpeedRight.AsRPM);
}
}
......
......@@ -171,7 +171,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vtpCycle.VerifyInputData();
Assert.AreEqual(1, LogList.Count);
Assert.IsTrue(LogList[0].Contains("Torque difference rel."));
Assert.IsTrue(LogList[0].Contains("Torque difference"));
}
......@@ -201,7 +201,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vtpCycle.VerifyInputData();
Assert.AreEqual(1, LogList.Count);
Assert.IsTrue(LogList[0].Contains("Torque difference rel."));
Assert.IsTrue(LogList[0].Contains("Torque difference"));
}
[TestCase()]
......@@ -209,14 +209,14 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
{
SetupLogging();
var torque = 0.95*DeclarationData.VTPMode.WheelTorqueZeroTolerance.Value();
var torque = 30; //0.95*DeclarationData.VTPMode.WheelTorqueZeroTolerance.Value();
var cycleEntries = string.Format(
@" 0 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3
0.5 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3
1 , 0, 600, 400, {0}, {1} , 50 , 50 , 100, 3
1.5 , 0, 600, 400, {1}, {1} , 50 , 50 , 100, 3
", torque, torque + DeclarationData.VTPMode.MaxWheelTorqueZeroDifference.Value() * 1.1);
", torque, torque + DeclarationData.VTPMode.MaxWheelTorqueDifference.Value() * 1.1);
var container = new VehicleContainer(ExecutionMode.Declaration) {
RunData = new VectoRunData() {
......@@ -230,7 +230,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vtpCycle.VerifyInputData();
Assert.AreEqual(1, LogList.Count);
Assert.IsTrue(LogList[0].Contains("Torque difference abs."));
Assert.IsTrue(LogList[0].Contains("Torque difference "));
}
[TestCase()]
......@@ -238,14 +238,14 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
{
SetupLogging();
var torque = 0.95 * DeclarationData.VTPMode.WheelTorqueZeroTolerance.Value();
var torque = 30; //0.95 * DeclarationData.VTPMode.WheelTorqueZeroTolerance.Value();
var cycleEntries = string.Format(
@" 0 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3
0.5 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3
1 , 0, 600, 400, {1}, {0} , 50 , 50 , 100, 3
1.5 , 0, 600, 400, {1}, {1} , 50 , 50 , 100, 3
", torque, torque + DeclarationData.VTPMode.MaxWheelTorqueZeroDifference.Value() * 1.1);
", torque, torque + DeclarationData.VTPMode.MaxWheelTorqueDifference.Value() * 1.1);
var container = new VehicleContainer(ExecutionMode.Declaration) {
RunData = new VectoRunData() {
......@@ -259,7 +259,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vtpCycle.VerifyInputData();
Assert.AreEqual(1, LogList.Count);
Assert.IsTrue(LogList[0].Contains("Torque difference abs."));
Assert.IsTrue(LogList[0].Contains("Torque difference"));
}
[TestCase()]
......
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