[chronojump] Fixed the rest of power values in inertial



commit 67d3a3c6bc0437ea2a80064ae125cc000f3160b9
Author: Xavier Padullés <x padulles gmail com>
Date:   Wed Jul 15 18:55:29 2015 +0200

    Fixed the rest of power values in inertial

 encoder/util.R |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/encoder/util.R b/encoder/util.R
index e7426d7..4f7dbad 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -740,7 +740,7 @@ getDynamicsInertial <- function(encoderConfigurationName, displacement, diameter
     angleAccel = accel * 2 / diameter.m
     anglePush = 90 #TODO: send from C#
     force = abs(inertiaMomentum * angleAccel) * (2 / diameter.m) + mass * (accel + g * sin(anglePush * pi / 
180))
-    power = abs((inertiaMomentum * angleAccel) * angleSpeed) + mass * (accel + g * sin(anglePush * pi / 
180)) * speed
+    power = abs((inertiaMomentum * angleAccel) * angleSpeed) + abs(mass * (accel + g * sin(anglePush * pi / 
180)) * speed)
   } else if(encoderConfigurationName == "ROTARYAXISINERTIALMOVPULLEY" ||
               encoderConfigurationName == "ROTARYFRICTIONAXISINERTIALMOVPULLEY" ||
               encoderConfigurationName == "ROTARYFRICTIONSIDEINERTIALMOVPULLEY"){
@@ -754,7 +754,7 @@ getDynamicsInertial <- function(encoderConfigurationName, displacement, diameter
     #If the movement is vertical g*sin(alpha) = g
     #If the movement is horizontal g*sin(alpha) = 0
     force = abs(inertiaMomentum * angleAccel) * (2 / diameter.m) + mass * (accel + g * sin(anglePush * pi / 
180))
-    power = abs((inertiaMomentum * angleAccel) * angleSpeed) + mass * (accel + g * sin(anglePush * pi / 
180)) * speed
+    power = abs((inertiaMomentum * angleAccel) * angleSpeed) + abs(mass * (accel + g * sin(anglePush * pi / 
180)) * speed)
   } else if(encoderConfigurationName == "ROTARYAXISINERTIALLATERAL" ||
               encoderConfigurationName == "ROTARYFRICTIONAXISINERTIALLATERAL" ||
               encoderConfigurationName == "ROTARYFRICTIONSIDEINERTIALLATERAL"){


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]