Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit ac3338c1 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

refactoring wheels, brakes, vehicle, tc angledrive, axlegear response

parent 2d04fc43
No related branches found
No related tags found
No related merge requests found
Showing
with 126 additions and 52 deletions
......@@ -40,16 +40,12 @@ namespace TUGraz.VectoCommon.Models
/// </summary>
public interface IResponse
{
object Source { get; }
Second AbsTime { get; set; }
Meter SimulationDistance { get; set; }
Second SimulationInterval { get; set; }
object Source { get; }
Watt AxlegearPowerRequest { get; set; }
Watt WheelsPowerRequest { get; set; }
Watt VehiclePowerRequest { get; set; }
Watt BrakePower { get; set; }
Watt AngledrivePowerRequest { get; set; }
DriverResponse Driver { get; }
......@@ -59,6 +55,18 @@ namespace TUGraz.VectoCommon.Models
GearboxResponse Gearbox { get; }
TorqueConverterResponse TorqueConverter { get; }
AxlegearResponse Axlegear { get; }
AngledriveResponse Angledrive { get; }
WheelsResponse Wheels { get; }
VehicleResponse Vehicle { get; }
BrakesResponse Brakes { get; }
}
public abstract class AbstractComponentResponse
......@@ -125,4 +133,48 @@ namespace TUGraz.VectoCommon.Models
public NewtonMeter OutputTorque { get; set; }
}
public class TorqueConverterResponse : AbstractPowertrainComponentResponse
{
public TorqueConverterOperatingPoint TorqueConverterOperatingPoint { get; set; }
public NewtonMeter TorqueConverterTorqueDemand { get; set; }
}
[DebuggerDisplay("P_out: {PowerRequest}; T_card: {CardanTorque}")]
public class AxlegearResponse : AbstractPowertrainComponentResponse
{
public NewtonMeter CardanTorque { get; set; }
public NewtonMeter OutputTorque { get; set; }
public PerSecond OutputSpeed { get; set; }
}
[DebuggerDisplay("P_out: {PowerRequest}")]
public class AngledriveResponse : AbstractPowertrainComponentResponse
{
public NewtonMeter OutputTorque { get; set; }
public PerSecond OutputSpeed { get; set; }
}
[DebuggerDisplay("P_out: {PowerRequest}")]
public class WheelsResponse : AbstractPowertrainComponentResponse { }
[DebuggerDisplay("v_veh: {VehicleSpeed}")]
public class VehicleResponse : AbstractComponentResponse
{
public MeterPerSecond VehicleSpeed { get; set; }
}
[DebuggerDisplay("P_brake: {BrakePower}")]
public class BrakesResponse : AbstractComponentResponse
{
public Watt BrakePower { get; set; }
}
}
\ No newline at end of file
using TUGraz.VectoCommon.Utils;
namespace TUGraz.VectoCommon.Models {
public class TorqueConverterOperatingPoint
{
public PerSecond OutAngularVelocity;
public NewtonMeter OutTorque;
public PerSecond InAngularVelocity;
public NewtonMeter InTorque;
public double SpeedRatio;
public double TorqueRatio;
public bool Creeping;
public override string ToString()
{
return $"n_out: {OutAngularVelocity}, n_in: {InAngularVelocity}, tq_out: {OutTorque}, tq_in {InTorque}, nu: {SpeedRatio}, my: {TorqueRatio}";
}
}
}
\ No newline at end of file
......@@ -83,6 +83,7 @@
<Compile Include="Models\OperatingPoint.cs" />
<Compile Include="Models\RetarderType.cs" />
<Compile Include="Models\SimulationType.cs" />
<Compile Include="Models\TorqueConverterOperatingPoint.cs" />
<Compile Include="Models\VehicleCategory.cs" />
<Compile Include="Models\WHRType.cs" />
<Compile Include="OutputData\IOutputFileWriter.cs" />
......
......@@ -49,16 +49,18 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl
Engine = new EngineResponse();
Clutch = new ClutchResponse();
Gearbox = new GearboxResponse();
//Axlegear = new AxlegearResponse();
//Angledrive = new AngledriveResponse();
//Wheels = new WheelsResponse();
//Vehicle = new VehicleResponse();
//Brakes = new BrakesResponse();
//ElectricMotor = new ElectricMotorResponse();
////ElectricSystem = new
//TorqueConverter = new TorqueConverterResponse();
//HybridController = new HybridControllerResponse();
}
Axlegear = new AxlegearResponse();
Angledrive = new AngledriveResponse();
Wheels = new WheelsResponse();
Vehicle = new VehicleResponse();
Brakes = new BrakesResponse();
//ElectricMotor = new ElectricMotorResponse();
////ElectricSystem = new
TorqueConverter = new TorqueConverterResponse();
//HybridController = new HybridControllerResponse();
}
public object Source { get; }
......@@ -66,11 +68,7 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl
public Second AbsTime { get; set; }
public Second SimulationInterval { get; set; }
public Meter SimulationDistance { get; set; }
public Watt AngledrivePowerRequest { get; set; }
public Watt AxlegearPowerRequest { get; set; }
public Watt WheelsPowerRequest { get; set; }
public Watt VehiclePowerRequest { get; set; }
public Watt BrakePower { get; set; }
public GearboxResponse Gearbox { get; }
public DriverResponse Driver { get; }
......@@ -79,8 +77,18 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl
public ClutchResponse Clutch { get; }
public TorqueConverterOperatingPoint TorqueConverterOperatingPoint { get; set; }
public AxlegearResponse Axlegear { get; }
public AngledriveResponse Angledrive { get; }
public TorqueConverterResponse TorqueConverter { get; }
public WheelsResponse Wheels { get; }
public VehicleResponse Vehicle { get; }
public BrakesResponse Brakes { get; }
public override string ToString()
{
var t = GetType();
......
......@@ -35,6 +35,7 @@ using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Declaration;
......@@ -347,26 +348,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox
}
public class TorqueConverterOperatingPoint
{
public PerSecond OutAngularVelocity;
public NewtonMeter OutTorque;
public PerSecond InAngularVelocity;
public NewtonMeter InTorque;
public double SpeedRatio;
public double TorqueRatio;
public bool Creeping;
public override string ToString()
{
return string.Format("n_out: {0}, n_in: {1}, tq_out: {2}, tq_in {3}, nu: {4}, my: {5}", OutAngularVelocity,
InAngularVelocity, OutTorque, InTorque, SpeedRatio, TorqueRatio);
}
}
[DebuggerDisplay("nu: {SpeedRatio}, mu: {TorqueRatio}, T_ref: {Torque}")]
public class TorqueConverterEntry
{
......
......@@ -46,7 +46,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
bool dryRun = false)
{
var retVal = base.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
retVal.AngledrivePowerRequest = outTorque * (PreviousState.OutAngularVelocity + CurrentState.OutAngularVelocity) / 2.0;
retVal.Angledrive.PowerRequest = outTorque * (PreviousState.OutAngularVelocity + CurrentState.OutAngularVelocity) / 2.0;
retVal.Angledrive.OutputTorque = outTorque;
retVal.Angledrive.OutputSpeed = outAngularVelocity;
return retVal;
}
......
......@@ -46,7 +46,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
bool dryRun = false)
{
var retVal = base.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
retVal.AxlegearPowerRequest = outTorque * (PreviousState.OutAngularVelocity + CurrentState.OutAngularVelocity) / 2.0;
retVal.Axlegear.PowerRequest = outTorque * (PreviousState.OutAngularVelocity + CurrentState.OutAngularVelocity) / 2.0;
retVal.Axlegear.CardanTorque = PreviousState.InTorque;
return retVal;
}
......
......@@ -77,7 +77,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
CurrentState.SetState(outTorque + brakeTorque, outAngularVelocity, outTorque, outAngularVelocity);
var retVal = NextComponent.Request(absTime, dt, outTorque + brakeTorque, outAngularVelocity, dryRun);
retVal.BrakePower = brakeTorque * avgAngularSpeed;
retVal.Brakes.BrakePower = brakeTorque * avgAngularSpeed;
return retVal;
}
......
......@@ -556,7 +556,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
operatingPoint.Acceleration, DataBus.BrakePower);
if (DataBus.BrakePower < 0) {
var overload = new ResponseOverload(this) {
BrakePower = DataBus.BrakePower,
Brakes = { BrakePower = DataBus.BrakePower, },
Driver = { Acceleration = operatingPoint.Acceleration }
};
DataBus.BrakePower = 0.SI<Watt>();
......
......@@ -106,7 +106,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var inTorque = CalculateAverageInTorque(operatingPoint);
if (dryRun) {
return HandleDryRun(absTime, dt, outTorque, outAngularVelocity, inTorque, operatingPoint);
var retValD = HandleDryRun(absTime, dt, outTorque, outAngularVelocity, inTorque, operatingPoint);
retValD.TorqueConverter.TorqueConverterTorqueDemand = outTorque;
return retValD;
}
// normal request
......@@ -117,9 +119,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
(PreviousState.OutAngularVelocity + operatingPoint.OutAngularVelocity) / 2.0;
if (!delta.IsEqual(0, Constants.SimulationSettings.LineSearchTolerance)) {
return delta > 0
? new ResponseOverload(this) { Delta = delta, TorqueConverterOperatingPoint = operatingPoint }
? new ResponseOverload(this) { Delta = delta, TorqueConverter = { TorqueConverterOperatingPoint = operatingPoint }}
: (IResponse)
new ResponseUnderload(this) {Delta = delta, TorqueConverterOperatingPoint = operatingPoint };
new ResponseUnderload(this) {Delta = delta, TorqueConverter = { TorqueConverterOperatingPoint = operatingPoint } };
}
}
......@@ -169,7 +171,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return new ResponseDryRun(this) {
DeltaFullLoad = delta,
DeltaDragLoad = delta,
TorqueConverterOperatingPoint = operatingPoint
TorqueConverter = {
TorqueConverterOperatingPoint = operatingPoint
}
};
}
......@@ -194,7 +198,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return new ResponseDryRun(this) {
DeltaFullLoad = 10 * deltaMax,
DeltaDragLoad = 10 * deltaMin,
TorqueConverterOperatingPoint = DataBus.DriverInfo.DrivingAction == DrivingAction.Brake ? dryOperatingPointMin : dryOperatingPointMax
TorqueConverter = {
TorqueConverterOperatingPoint = DataBus.DriverInfo.DrivingAction == DrivingAction.Brake ? dryOperatingPointMin : dryOperatingPointMax
}
};
}
......
......@@ -134,6 +134,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var retval = NextComponent.Request(absTime, dt, CurrentState.VehicleTractionForce,
CurrentState.Velocity, dryRun);
retval.Vehicle.VehicleSpeed = CurrentState.Velocity;
return retval;
}
......
......@@ -82,7 +82,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var retVal = NextComponent.Request(absTime, dt, CurrentState.TorqueIn, CurrentState.AngularVelocity,
dryRun);
retVal.WheelsPowerRequest = CurrentState.TorqueIn * avgAngularSpeed;
retVal.Wheels.PowerRequest = CurrentState.TorqueIn * avgAngularSpeed;
return retVal;
}
......
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