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

Skip to content
Snippets Groups Projects
Commit 23d39975 authored by Harald Martini's avatar Harald Martini Committed by Markus Quaritsch
Browse files

use simple electric motor control instead of dummy electric motor control in test powertain

(cherry picked from commit 1072afa7)
parent 5dd70859
No related branches found
No related tags found
No related merge requests found
...@@ -1820,7 +1820,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -1820,7 +1820,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
.AddComponent(data.AngledriveData != null ? new Angledrive(container, data.AngledriveData) : null) .AddComponent(data.AngledriveData != null ? new Angledrive(container, data.AngledriveData) : null)
.AddComponent(data.GearboxData is null ? null : GetSimpleGearbox(container, data)) .AddComponent(data.GearboxData is null ? null : GetSimpleGearbox(container, data))
.AddComponent(GetElectricMachine(data.ElectricMachinesData.First(x => x.Item1 != PowertrainPosition.GEN).Item1, .AddComponent(GetElectricMachine(data.ElectricMachinesData.First(x => x.Item1 != PowertrainPosition.GEN).Item1,
data.ElectricMachinesData, container, es, new DummyElectricMotorControl())); data.ElectricMachinesData, container, es, new SimpleElectricMotorControl()));
if (data.AxleGearData == null) { if (data.AxleGearData == null) {
new DummyAxleGearInfo(container); // necessary for certain IEPC configurations new DummyAxleGearInfo(container); // necessary for certain IEPC configurations
} }
...@@ -2206,10 +2206,17 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -2206,10 +2206,17 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
public class SimpleElectricMotorControl : IElectricMotorControl public class SimpleElectricMotorControl : IElectricMotorControl
{ {
public bool EmOff { get; set; }
public NewtonMeter MechanicalAssistPower(Second absTime, Second dt, NewtonMeter outTorque, PerSecond prevOutAngularVelocity, public NewtonMeter MechanicalAssistPower(Second absTime, Second dt, NewtonMeter outTorque, PerSecond prevOutAngularVelocity,
PerSecond currOutAngularVelocity, NewtonMeter maxDriveTorque, NewtonMeter maxRecuperationTorque, PerSecond currOutAngularVelocity, NewtonMeter maxDriveTorque, NewtonMeter maxRecuperationTorque,
PowertrainPosition position, bool dryRun) PowertrainPosition position, bool dryRun)
{ {
if (EmOff) {
return null;
}
if (dryRun) { if (dryRun) {
return -outTorque; return -outTorque;
} }
...@@ -2238,6 +2245,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -2238,6 +2245,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
#endregion #endregion
} }
[Obsolete("Replaced with SimpleElectricMotorControl")]
public class DummyElectricMotorControl : IElectricMotorControl public class DummyElectricMotorControl : IElectricMotorControl
{ {
#region Implementation of IElectricMotorControl #region Implementation of IElectricMotorControl
......
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