[chronojump] Added anlePush in inertial configurations



commit f40c8e5feb172a21ca7b946a3b568ea2f48ae435
Author: Xavier Padullés <x padulles gmail com>
Date:   Thu Jun 18 19:21:05 2015 +0200

    Added anlePush in inertial configurations

 encoder/util.R |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/encoder/util.R b/encoder/util.R
index 1d9f8c5..45867fe 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -715,16 +715,22 @@ getDynamicsInertial <- function(encoderConfigurationName, displacement, diameter
     angle = position.m * 2 / diameter.m
     angleSpeed = speed * 2 / diameter.m
     angleAccel = accel * 2 / diameter.m
-    force = abs(inertiaMomentum * angleAccel) * (2 / diameter.m) + mass * (accel + g)
-    power = abs((inertiaMomentum * angleAccel) * angleSpeed) + mass * (accel + g) * speed
+    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
   } else if(encoderConfigurationName == "ROTARYAXISINERTIALMOVPULLEY" ||
               encoderConfigurationName == "ROTARYFRICTIONAXISINERTIALMOVPULLEY" ||
               encoderConfigurationName == "ROTARYFRICTIONSIDEINERTIALMOVPULLEY"){
+    #With a moving pulley, the displacement of the body is half of the displacement of the rope in the 
inertial machine side
+    #So, the multiplier is 4 instead of 2 to get the rotational kinematics.
     angle = position.m * 4 / diameter.m
     angleSpeed = speed * 4 / diameter.m
     angleAccel = accel * 4 / diameter.m
-    force = abs(inertiaMomentum * angleAccel) * (2 / diameter.m) + mass * (accel + g)
-    power = abs((inertiaMomentum * angleAccel) * angleSpeed) + mass * (accel + g) * speed
+    
+    #The configuration covers horizontal, vertical and inclinated movements
+    #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
   } else if(encoderConfigurationName == "ROTARYAXISINERTIALLATERAL" ||
               encoderConfigurationName == "ROTARYFRICTIONAXISINERTIALLATERAL" ||
               encoderConfigurationName == "ROTARYFRICTIONSIDEINERTIALLATERAL"){


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