From e681de03a9c207059d54fca497923d7e1a7f90f9 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Mon, 27 Jul 2020 12:32:07 +0200
Subject: [PATCH] use torque to decide if propel or recuperate

---
 .../SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs
index c0ccf72a35..cbf85fbc33 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs
@@ -95,7 +95,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data {
 		public NewtonMeter LookupTorque(Watt batPower, PerSecond avgSpeed, NewtonMeter maxEmTorque)
 		{
 			var elPowerMaxEM = LookupElectricPower(avgSpeed, maxEmTorque, true);
-			if (batPower < 0) {
+			if (maxEmTorque < 0) { // distinguish between propulsion and recuperation
 				if (!elPowerMaxEM.Extrapolated & elPowerMaxEM.ElectricalPower.IsGreaterOrEqual(batPower)) {
 					// the battery can provide more electric power than the EM  - no limitation here
 					return null;
-- 
GitLab