aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-10-10 13:26:40 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-10-10 13:26:40 +0300
commit48561099b141773d71438dcdf09c65ace4138b8b (patch)
tree23f6211cf4f6bebe239462b29b188cfc09819a5a /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
parent3415dbf992958b34d69362e521eeafcd72d82cc9 (diff)
downloadTango-48561099b141773d71438dcdf09c65ace4138b8b.tar.gz
Tango-48561099b141773d71438dcdf09c65ace4138b8b.zip
motor testing
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 32dea353a..46ecb1d46 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -329,13 +329,16 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
if ((WinderRun < 30000)&&(WinderMotorSpeedRollOver == true))
{
WinderRunSamples++;
- WinderRunSum+=WinderRun;
- WinderRunAverage = WinderRunSum/(WinderRunSamples);
- if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0))
+ if (WinderRunSamples>10)
{
- usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples,
- (int)(100*WinderRun/ScrewNumberOfSteps));
- Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
+ WinderRunSum+=WinderRun;
+ WinderRunAverage = WinderRunSum/(WinderRunSamples);
+ if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0))
+ {
+ usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples,
+ (int)(100*WinderRun/ScrewNumberOfSteps));
+ Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
+ }
}
}
else