[chronojump] Fixed bad gearedDown to getDisplacementInertial since last commits



commit b77c54cec5ca4a72dbd48450c4bd527c3f677091
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 3 12:37:56 2016 +0100

    Fixed bad gearedDown to getDisplacementInertial since last commits

 encoder/graph.R            |    2 +-
 encoder/graphSmoothingEC.R |   35 +++++++++++++++++++++++++++++++++++
 encoder/util.R             |   18 +++++++++++++++++-
 3 files changed, 53 insertions(+), 2 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index be4ff69..e5c4051 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -2276,7 +2276,7 @@ doProcess <- function(options)
                                dataTempFile = getDisplacementInertial(
                                                                       dataTempFile, 
inputMultiData$econfName[i], 
                                                                       inputMultiData$econfd[i], 
inputMultiData$econfD[i], 
-                                                                      inputMultiData$gearedDown[i] )
+                                                                      inputMultiData$econfGearedDown[i] )
                                #getDisplacementInertialBody is not needed because it's done on curve save
                        } else {
                                dataTempFile = getDisplacement(inputMultiData$econfName[i], dataTempFile, 
op$diameter, op$diameterExt)
diff --git a/encoder/graphSmoothingEC.R b/encoder/graphSmoothingEC.R
index 8baf6d8..b2919ad 100644
--- a/encoder/graphSmoothingEC.R
+++ b/encoder/graphSmoothingEC.R
@@ -83,6 +83,26 @@ findSmoothingsECYPoints <- function(eccentric.concentric, conStart, conEnd, x, m
 findSmoothingsEC <- function(singleFile, displacement, curves, eccon, smoothingOneC,
                             singleFileEncoderConfigurationName, singleFileDiameter, 
singleFileInertiaMomentum, singleFileGearedDown)
 {
+print("singleFile")
+print(singleFile)
+print("displacement")
+print(displacement)
+print("curves")
+print(curves)
+print("eccon")
+print(eccon)
+print("smoothingOneC")
+print(smoothingOneC)
+print("singleFileEncoderConfigurationName")
+print(singleFileEncoderConfigurationName)
+print("singleFileDiameter")
+print(singleFileDiameter)
+print("singleFileInertiaMomentum")
+print(singleFileInertiaMomentum)
+print("singleFileGearedDown")
+print(singleFileGearedDown)
+
+
        ptm <- as.vector(proc.time()[3])
        write("time start", stderr())
        write(ptm, stderr())
@@ -127,6 +147,21 @@ findSmoothingsEC <- function(singleFile, displacement, curves, eccon, smoothingO
                                        conEnd = mean(which(position == max(position)))
                                }
 
+print("position")
+print(position)
+print("which(position == min(position))")
+print(which(position == min(position)))
+print("i conStart, conEnd, curves[i,1] curves[i,2] 1st part, 2nd part")
+print(i)
+print(conStart)
+print(conEnd)
+print(curves[i,1])
+print(curves[i,2])
+print((curves[i,1]+conStart))
+print((curves[i,1]+conStart))
+print((curves[i,1]+conEnd))
+print("displacement[(curves[i,1]+conStart):(curves[i,1]+conEnd)]")
+print(displacement[(curves[i,1]+conStart):(curves[i,1]+conEnd)])
                                concentric=displacement[(curves[i,1]+conStart):(curves[i,1]+conEnd)]
                                
 #1 get max power concentric at concentric phase with current smoothing
diff --git a/encoder/util.R b/encoder/util.R
index 5b17e5f..d5a9ce8 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -975,6 +975,19 @@ getDisplacement <- function(encoderConfigurationName, displacement, diameter, di
 getDisplacementInertial <- function(displacement, encoderConfigurationName, diameter, diameterExt, 
gearedDown)
 {
        write("at getDisplacementInertial", stderr())
+       
+       print("encoderConfigurationName")
+       print(encoderConfigurationName)
+       
+       print("diameter")
+       print(diameter)
+       print("diameterExt")
+       print(diameterExt)
+       print("gearedDown")
+       print(gearedDown)
+
+       print("displacement at beginning of getDisplacementInertial")
+       print(displacement)
 
        #scanned displacement is ticks of rotary axis encoder
        #now convert it to mm of body displacement
@@ -982,7 +995,7 @@ getDisplacementInertial <- function(displacement, encoderConfigurationName, diam
             encoderConfigurationName == "ROTARYAXISINERTIALLATERAL" ||
             encoderConfigurationName == "ROTARYAXISINERTIALMOVPULLEY") {
                ticksRotaryEncoder = 200 #our rotary axis encoder send 200 ticks per revolution
-               diameterMeters = diameter / 100 #cm -> m
+#              diameterMeters = diameter / 100 #cm -> m
                
                #Number of revolutions that the flywheel rotates every millisecond
                revolutionsPerMs = displacement / ticksRotaryEncoder # One revolution every 
ticksRotaryEncoder ticks
@@ -1008,6 +1021,9 @@ getDisplacementInertial <- function(displacement, encoderConfigurationName, diam
          
        }
        
+       print("displacement at end of getDisplacementInertial")
+       print(displacement)
+       
        return (displacement)
 }
 


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