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-22 17:56:36 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-10-22 17:56:36 +0300
commitffbbc56bd5935cc4cb65e635c7360735578952fe (patch)
tree1e108f214a4a9d1eea7a7ec24efee9838161a8c6 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
parent785ddbf1014bbb91892a7c3fd28eab384e387ad4 (diff)
downloadTango-ffbbc56bd5935cc4cb65e635c7360735578952fe.tar.gz
Tango-ffbbc56bd5935cc4cb65e635c7360735578952fe.zip
winder avg
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index bf0f361fd..9d57cd29f 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -47,6 +47,7 @@ uint32_t CalculationDirectionChangeCounter = 1; //holds the current number of ru
double WinderMotorSpeed[MAX_WINDER_SPEED_CALCULATION];
uint16_t WinderMotorSpeedCounter = 0;
bool WinderMotorSpeedRollOver = false;
+int StartWinderCalculation = 0;
#define DEFAULT_SCREW_SPEED 1200
double ScrewSpeed = DEFAULT_SCREW_SPEED;
double ScrewRunningTime = 0;
@@ -127,7 +128,7 @@ uint32_t Winder_Prepare(void *JobDetails)
//float process_speed = JobTicket->processparameters->dyeingspeed;
double ScrewSpeed = DEFAULT_SCREW_SPEED;//(process_speed*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].pulleyradius); // we will use pulley radius of the screw for this purpose, as of now
WinderMotorSpeedRollOver=false;
-
+ StartWinderCalculation = 0;
//MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses);
//REPORT_MSG(ScrewSpeed, "Winder_Prepare");
/*
@@ -299,7 +300,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
if (WinderMotorSpeedRollOver == false)
{
Add100 = true;
- LOG_ERROR(Add100, "Add100 = true");
+ //LOG_ERROR(Add100, "Add100 = true");
}
// WinderMotorSpeedCounter=0;
}
@@ -327,7 +328,9 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
#ifdef READ_SCREW_ENCODER
int WinderRun;
WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]);
- if ((WinderRun < 30000)&&(WinderMotorSpeedRollOver == true))
+ if (WinderMotorSpeedRollOver == true)
+ StartWinderCalculation++;
+ if ((WinderRun < 30000)&&(StartWinderCalculation >= 2))
{
WinderRunSamples++;
WinderRunSum+=WinderRun;