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 56043a3d authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

a) Roll on gear shift, b) added vdris to GenericVehicles

parent ef7a01b2
Branches
Tags
No related merge requests found
Showing
with 140919 additions and 28 deletions
......@@ -30,15 +30,9 @@
"UnderSpeed": 5.0
},
"Cycles": [
"LongHaul",
"Coach",
"Construction",
"HeavyUrban",
"Interurban",
"RegionalDelivery",
"Suburban",
"Urban",
"UrbanDelivery"
"PWheel_LongHaul.vdri",
"PWheel_RegionalDelivery.vdri",
"PWheel_UrbanDelivery.vdri"
]
}
}
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -38,11 +38,7 @@
"OverSpeed": 5.0
},
"Cycles": [
"Interurban.vdri",
"Suburban.vdri",
"LongHaul",
"RegionalDelivery",
"UrbanDelivery"
"MeasuredSpeed_UrbanDelivery.vdri"
]
}
}
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -86,6 +86,8 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus
{
bool DisengageGearbox { set; }
void TriggerGearshift(Second absTime, Second dt);
event Action GearShiftTriggered;
}
public interface ITorqueConverterInfo
......
......@@ -29,6 +29,7 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using TUGraz.VectoCommon.Models;
......@@ -52,12 +53,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected GearshiftPosition _gear;
public event Action GearShiftTriggered;
protected AbstractGearbox(IVehicleContainer container) : base(container)
{
ModelData = container.RunData.GearboxData;
LastShift = -double.MaxValue.SI<Second>();
}
protected void InvokeGearShiftTriggered()
{
GearShiftTriggered?.Invoke();
}
#region ITnOutPort
public abstract IResponse Request(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity,
......
......@@ -528,6 +528,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (NextComponent == null && BusAux != null) {
BusAux.DoWriteModalResultsICE(time, simulationInterval, container);
}
container.SetDataValue("Driving Action", DataBus.DriverInfo.DrivingAction.ToString());
container.SetDataValue("DriverAction", (int) DataBus.DriverInfo.DrivingAction);
}
protected override void DoCommitSimulationStep(Second time, Second simulationInterval)
......
......@@ -30,6 +30,7 @@
*/
using System.Linq;
using System;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
......@@ -378,6 +379,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var response = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, false);
InvokeGearShiftTriggered();
response.Gearbox.PowerRequest = outTorque * avgAngularVelocity;
response.Gearbox.Gear = new GearshiftPosition(0);
response.Gearbox.InputSpeed = inAngularVelocity;
......
......@@ -95,6 +95,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public IResponse Initialize()
{
if (DataBus.GearboxCtl != null) {
DataBus.GearboxCtl.GearShiftTriggered -= GearShiftTriggered;
DataBus.GearboxCtl.GearShiftTriggered += GearShiftTriggered;
}
var first = Data.Entries.First();
AbsTime = first.Time;
......@@ -108,6 +113,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response;
}
private void GearShiftTriggered()
{
if (DrivingAction == DrivingAction.Accelerate) {
DriverBehavior = DrivingBehavior.Driving;
DrivingAction = DrivingAction.Roll;
}
}
public IResponse Request(Second absTime, Meter ds)
{
Log.Fatal("MeasuredSpeed Cycle can not handle distance request.");
......@@ -164,12 +177,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var acceleration = deltaV / deltaT;
var gradient = CycleIterator.LeftSample.RoadGradient;
DriverAcceleration = acceleration;
DriverBehavior = acceleration < 0
? DriverBehavior = DrivingBehavior.Braking
: DriverBehavior = DrivingBehavior.Driving;
if (DataBus.VehicleInfo.VehicleStopped && acceleration.IsEqual(0)) {
DriverBehavior = DrivingBehavior.Halted;
}
DetermineDriverAction(absTime);
IResponse response;
var responseCount = 0;
......@@ -227,6 +236,43 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response;
}
private void DetermineDriverAction(Second absTime)
{
if (DataBus.EngineCtl == null) {
DetermineDriverActionForBEV(absTime);
}
else {
DetermineDriverActionForOther();
}
}
private void DetermineDriverActionForBEV(Second absTime)
{
if (DataBus.VehicleInfo.VehicleStopped && DriverAcceleration.IsEqual(0)) {
DriverBehavior = DrivingBehavior.Halted;
DrivingAction = DrivingAction.Halt;
}
else if ((DriverAcceleration < 0) && (DrivingAction != DrivingAction.Roll)) {
DriverBehavior = DrivingBehavior.Braking;
DrivingAction = DrivingAction.Brake;
}
else {
DriverBehavior = DrivingBehavior.Driving;
DrivingAction = DataBus.GearboxInfo.GearEngaged(absTime) ? DrivingAction.Accelerate : DrivingAction.Roll;
}
}
private void DetermineDriverActionForOther()
{
DriverBehavior = DriverAcceleration < 0
? DriverBehavior = DrivingBehavior.Braking
: DriverBehavior = DrivingBehavior.Driving;
if (DataBus.VehicleInfo.VehicleStopped && DriverAcceleration.IsEqual(0)) {
DriverBehavior = DrivingBehavior.Halted;
}
}
private IResponse HandleUnderload(Second absTime, Second dt, ResponseUnderload r,
Radian gradient, ref MeterPerSquareSecond acceleration)
{
......@@ -384,7 +430,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public DrivingBehavior DriverBehavior { get; internal set; }
public DrivingAction DrivingAction => DrivingAction.Accelerate;
public DrivingAction DrivingAction { get; internal set; } = DrivingAction.Accelerate;
public MeterPerSquareSecond DriverAcceleration { get; protected set; }
......
using System.Linq;
using System;
using System.Linq;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Simulation;
......@@ -14,6 +15,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
protected GearData GearData;
public event Action GearShiftTriggered;
public SingleSpeedGearbox(IVehicleContainer container, GearboxData modelData) : base(container,
modelData.Gears.First().Value)
{
......
......@@ -29,8 +29,8 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric
[Category("Integration")]
[
TestCase(E2_JOB, 0, 0, 1.1667, 120.2219, TestName = "E2 BEV TimeRun MeasuredSpeed LongHaul"),
TestCase(E2_JOB, 1, 1, 3.9969, 120.1184, TestName = "E2 BEV TimeRun MeasuredSpeed RegionalDelivery"),
TestCase(E2_JOB, 2, 2, 26.2759, 143.7594, TestName = "E2 BEV TimeRun MeasuredSpeed UrbanDelivery"),
TestCase(E2_JOB, 1, 1, 3.9969, 120.1189, TestName = "E2 BEV TimeRun MeasuredSpeed RegionalDelivery"),
TestCase(E2_JOB, 2, 2, 26.2759, 143.7661, TestName = "E2 BEV TimeRun MeasuredSpeed UrbanDelivery"),
TestCase(E2_JOB, 6, 0, 1.128, 120.0374, TestName = "E2 BEV TimeRun MeasuredSpeedGear LongHaul"),
TestCase(E2_JOB, 7, 1, 4.3124, 117.0889, TestName = "E2 BEV TimeRun MeasuredSpeedGear RegionalDelivery"),
......
......@@ -48,6 +48,8 @@ namespace TUGraz.VectoCore.Tests.Utils
private ITnOutPort _outPort;
private bool _clutchClosed;
public event Action GearShiftTriggered;
public MockGearbox(IVehicleContainer cockpit) : base(cockpit)
{
_clutchClosed = true;
......
......@@ -96,6 +96,8 @@ namespace TUGraz.VectoCore.Tests.Utils
public IGearboxInfo GearboxInfo => this;
public event Action GearShiftTriggered;
public IGearboxControl GearboxCtl => this;
public IElectricMotorInfo ElectricMotorInfo(PowertrainPosition pos)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment