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

Merge branch 'feature/VECTO-405-add-clucht-losses-during-drive-off' into...

Merge branch 'feature/VECTO-405-add-clucht-losses-during-drive-off' into feature/VECTO-379-input-deleted-if-error-detected
parents 3896c64a d40bce8e
Branches
Tags
No related merge requests found
Showing with 62 additions and 44 deletions
......@@ -171,11 +171,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_nextGear = CheckUpshift(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, gear);
if ((ModelData.Gears[_nextGear].Ratio * outAngularVelocity - DataBus.EngineIdleSpeed) /
(DataBus.EngineRatedSpeed - DataBus.EngineIdleSpeed) <
Constants.SimulationSettings.ClutchClosingSpeedNorm && _nextGear > 1) {
_nextGear--;
}
//if ((ModelData.Gears[_nextGear].Ratio * outAngularVelocity - DataBus.EngineIdleSpeed) /
// (DataBus.EngineRatedSpeed - DataBus.EngineIdleSpeed) <
// Constants.SimulationSettings.ClutchClosingSpeedNorm && _nextGear > 1) {
// _nextGear--;
//}
return _nextGear != gear;
}
......
......@@ -339,7 +339,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (GearboxType.AutomaticTransmission()) {
disengagedResponse = EngineIdleRequest(absTime, dt);
} else {
disengagedResponse = NextComponent.Request(absTime, dt, 0.SI<NewtonMeter>(), null);
disengagedResponse = NextComponent.Request(absTime, dt, 0.SI<NewtonMeter>(), outAngularVelocity * ModelData.Gears[NextGear.Gear].Ratio);
}
if (TorqueConverter != null) {
TorqueConverter.Locked(CurrentState.InTorque, disengagedResponse.EngineSpeed);
......@@ -422,7 +422,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return new GearInfo(Gear, !TorqueConverterActive ?? true);
}
var future = DataBus.LookAhead(ModelData.TractionInterruption * 5);
var nextGear = 0u;
var nextGear = 1u;
var torqueConverterLocked = true;
foreach (var entry in future) {
if (entry.VehicleTargetSpeed != null && entry.VehicleTargetSpeed.IsEqual(0)) {
......
......@@ -175,7 +175,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var lookaheadDistance =
(currentSpeed.Value() * 3.6 * Driver.DriverData.LookAheadCoasting.LookAheadDistanceFactor).SI<Meter>();
var stopDistance = Driver.ComputeDecelerationDistance(0.SI<MeterPerSecond>());
lookaheadDistance = VectoMath.Max(2 * ds, lookaheadDistance, 1.2 * stopDistance);
lookaheadDistance = VectoMath.Max(2 * ds, lookaheadDistance, 1.2 * stopDistance + ds);
var lookaheadData = Driver.DataBus.LookAhead(lookaheadDistance);
Log.Debug("Lookahead distance: {0} @ current speed {1}", lookaheadDistance, currentSpeed);
......
......@@ -55,10 +55,10 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
[Test,
// clutch slipping
TestCase(DrivingBehavior.Driving, 100, 0, 0, 62.119969),
TestCase(DrivingBehavior.Driving, 100, 30, 48.293649, 62.119969),
// clutch opened
TestCase(DrivingBehavior.Halted, 100, 30, 0, 58.643062),
TestCase(DrivingBehavior.Driving, 100, 0, 100, 65.6889),
TestCase(DrivingBehavior.Driving, 100, 30, 100, 65.6889),
// clutch opened - would cause neg. clutch losses (which is not possible), torque is adapted
TestCase(DrivingBehavior.Halted, 100, 30, 51.1569, 58.643062),
// clutch closed
TestCase(DrivingBehavior.Driving, 100, 80, 100, 80),
TestCase(DrivingBehavior.Braking, 100, 80, 100, 80),
......
......@@ -337,7 +337,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
VehicleContainer container;
CombustionEngine engine;
ITnOutPort requestPort;
VehicleContainer(CoachEngine, out container, out engine, out requestPort);
MockGearbox gearbox;
VehicleContainer(CoachEngine, out container, out engine, out requestPort, out gearbox);
var absTime = 0.SI<Second>();
var dt = Constants.SimulationSettings.TargetTimeInterval;
......@@ -355,10 +356,11 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var engineSpeed = new[] { 560.RPMtoRad(), 560.RPMtoRad(), 560.RPMtoRad(), 560.RPMtoRad() };
var enginePower = new[] { -8601.6308.SI<Watt>(), 5000.SI<Watt>(), 5000.SI<Watt>(), 5000.SI<Watt>() };
gearbox.SetClutch(false);
for (var i = 0; i < engineSpeed.Length; i++) {
torque = 0.SI<NewtonMeter>();
response = (ResponseSuccess)requestPort.Request(absTime, dt, torque, null);
response = (ResponseSuccess)requestPort.Request(absTime, dt, torque, 0.RPMtoRad());
container.CommitSimulationStep(absTime, dt);
absTime += dt;
......@@ -390,7 +392,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
VehicleContainer container;
CombustionEngine engine;
ITnOutPort requestPort;
VehicleContainer(TruckEngine, out container, out engine, out requestPort);
MockGearbox gearbox;
VehicleContainer(TruckEngine, out container, out engine, out requestPort, out gearbox);
//var dataWriter = new ModalDataWriter("EngineIdle.vmod");
//container.DataWriter = dataWriter;
......@@ -420,11 +423,12 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var fld = engine.ModelData.FullLoadCurve;
gearbox.SetClutch(false);
var engSpeedResults = new List<dynamic>();
for (var i = 0; i < 20; i++) {
torque = 0.SI<NewtonMeter>();
response = (ResponseSuccess)requestPort.Request(absTime, dt, torque, null);
response = (ResponseSuccess)requestPort.Request(absTime, dt, torque, 0.RPMtoRad());
container.CommitSimulationStep(absTime, dt);
......@@ -442,7 +446,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
VehicleContainer container;
CombustionEngine engine;
ITnOutPort requestPort;
VehicleContainer(TruckEngine, out container, out engine, out requestPort);
MockGearbox gearbox;
VehicleContainer(TruckEngine, out container, out engine, out requestPort, out gearbox);
//var dataWriter = new ModalDataWriter("EngienIdle.vmod");
//container.DataWriter = dataWriter;
......@@ -476,10 +481,11 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
// 5000.SI<Watt>(), 5000.SI<Watt>(), 5000.SI<Watt>(), 5000.SI<Watt>()
//};
gearbox.SetClutch(false);
var engSpeedResults = new List<dynamic>();
torque = 0.SI<NewtonMeter>();
for (var i = 0; i < engineSpeed.Length; i++) {
response = (ResponseSuccess)requestPort.Request(absTime, dt, torque, null);
response = (ResponseSuccess)requestPort.Request(absTime, dt, torque, 0.RPMtoRad());
container.CommitSimulationStep(absTime, dt);
......@@ -519,10 +525,10 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
}
private static void VehicleContainer(string engineFile, out VehicleContainer container, out CombustionEngine engine,
out ITnOutPort requestPort)
out ITnOutPort requestPort, out MockGearbox gearbox)
{
container = new VehicleContainer(ExecutionMode.Engineering);
var gearbox = new MockGearbox(container);
gearbox = new MockGearbox(container);
var engineData = MockSimulationDataFactory.CreateEngineDataFromFile(engineFile);
engine = new CombustionEngine(container, engineData);
......
......@@ -99,7 +99,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vehicleContainer.CommitSimulationStep(absTime, response.SimulationInterval);
absTime += response.SimulationInterval;
Assert.AreEqual(4.9812, vehicleContainer.VehicleSpeed.Value(), Tolerance);
Assert.AreEqual(4.9842, vehicleContainer.VehicleSpeed.Value(), Tolerance);
Assert.AreEqual(0.2004, response.SimulationInterval.Value(), Tolerance);
Assert.AreEqual(engine.PreviousState.FullDragTorque.Value(), engine.PreviousState.EngineTorque.Value(),
Constants.SimulationSettings.LineSearchTolerance);
......@@ -158,7 +158,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vehicleContainer.CommitSimulationStep(absTime, response.SimulationInterval);
absTime += response.SimulationInterval;
Assert.AreEqual(4.9816, vehicleContainer.VehicleSpeed.Value(), Tolerance);
Assert.AreEqual(4.9846, vehicleContainer.VehicleSpeed.Value(), Tolerance);
Assert.AreEqual(0.2004, response.SimulationInterval.Value(), Tolerance);
Assert.AreEqual(engine.PreviousState.FullDragTorque.Value(), engine.PreviousState.EngineTorque.Value(),
Constants.SimulationSettings.LineSearchTolerance);
......@@ -182,6 +182,9 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var vehicleData = CreateVehicleData(33000.SI<Kilogram>());
// take into account the axle ratio and 1st-gear ratio
vehicleData.DynamicTyreRadius /= (3.24 * 6.38);
var driverData = CreateDriverData();
var fileWriter = new FileOutputWriter("Coach_MinimalPowertrain");
......@@ -215,7 +218,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vehicleContainer.CommitSimulationStep(absTime, response.SimulationInterval);
absTime += response.SimulationInterval;
Assert.AreEqual(0.9748, modData.GetValues<SI>(ModalResultField.acc).Last().Value(), Tolerance);
Assert.AreEqual(0.24182, modData.GetValues<SI>(ModalResultField.acc).Last().Value(), Tolerance);
response = driverPort.Request(absTime, 1.SI<Meter>(), 20.SI<MeterPerSecond>(), 0.SI<Radian>());
......@@ -224,7 +227,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
vehicleContainer.CommitSimulationStep(absTime, response.SimulationInterval);
absTime += response.SimulationInterval;
Assert.AreEqual(0.78766, modData.GetValues<SI>(ModalResultField.acc).Last().Value(), Tolerance);
Assert.AreEqual(0.2900, modData.GetValues<SI>(ModalResultField.acc).Last().Value(), Tolerance);
}
[TestMethod]
......
engine speed [1/min],full load torque [Nm],motoring torque [Nm],PT1 [s]
560,1180,-149,0.6
600,1282,-148,0.6
799.9999999,1791,-149,0.6
560,1500,-149,0.6
600,1600,-148,0.6
799.9999999,2150,-149,0.6
1000,2300,-160,0.6
1200,2300,-179,0.6
1400,2300,-203,0.6
......
......@@ -8,14 +8,14 @@ Speed Ratio, Torque Ratio,MP1000
0.6,1.23,302.24
0.7,1.14,264.46
0.8,1.04,226.68
0.9,0.95,188.90
1.0,0.95,0.00
1.100,1.000,-40.34
1.222,1.000,-80.34
1.375,1.000,-136.11
1.571,1.000,-216.52
1.833,1.000,-335.19
2.200,1.000,-528.77
2.750,1.000,-883.40
4.400,1.000,-2462.17
11.000,1.000,-16540.98
\ No newline at end of file
0.9,1.02,188.90
1.0,1.0,0.00
1.100,0.999,-40.34
1.222,0.998,-80.34
1.375,0.997,-136.11
1.571,0.996,-216.52
1.833,0.995,-335.19
2.200,0.994,-528.77
2.750,0.993,-883.40
4.400,0.992,-2462.17
11.000,0.991,-16540.98
\ No newline at end of file
......@@ -44,8 +44,12 @@ namespace TUGraz.VectoCore.Tests.Utils
public class MockGearbox : VectoSimulationComponent, IGearbox, ITnInPort, ITnOutPort, IClutchInfo
{
private ITnOutPort _outPort;
private bool _clutchClosed;
public MockGearbox(IVehicleContainer cockpit) : base(cockpit) {}
public MockGearbox(IVehicleContainer cockpit) : base(cockpit)
{
_clutchClosed = true;
}
public ITnInPort InPort()
{
......@@ -102,10 +106,10 @@ namespace TUGraz.VectoCore.Tests.Utils
bool dryRun = false)
{
if (_outPort != null) {
if (Gear > 0) {
//if (Gear > 0) {
return _outPort.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
}
return _outPort.Request(absTime, dt, 0.SI<NewtonMeter>(), null, dryRun);
//}
//return _outPort.Request(absTime, dt, 0.SI<NewtonMeter>(), 0.RPMtoRad(), dryRun);
}
throw new NotImplementedException();
}
......@@ -127,7 +131,12 @@ namespace TUGraz.VectoCore.Tests.Utils
public bool ClutchClosed(Second absTime)
{
return true;
return _clutchClosed;
}
public void SetClutch(bool closed)
{
_clutchClosed = closed;
}
public void Connect(IAuxPort aux)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment