aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-08-15 15:17:05 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-08-15 15:17:05 +0300
commit6d0e801c1ec87fd2489fce81831150f6c6730b91 (patch)
treef959a51ae55228cec75fcc94143536cbcff55958 /Software/Embedded_SW/Embedded/Modules/Thread
parent3bbcc0ab6188e8554a101acffc8c09c267353a22 (diff)
parentb1b2f343dc25c1c052a0af360ebd512d575e6de9 (diff)
downloadTango-6d0e801c1ec87fd2489fce81831150f6c6730b91.tar.gz
Tango-6d0e801c1ec87fd2489fce81831150f6c6730b91.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 0ed0f5318..0ac23baf5 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -90,8 +90,6 @@ uint32_t InternalWinderConfigMessage(HardwareWinder* request)
return status;
}
-char ScrewStr[150];
-
uint32_t InternalWindingConfigMessage(JobSpool* request)
{
uint32_t status = PASSED;
@@ -102,9 +100,6 @@ uint32_t InternalWindingConfigMessage(JobSpool* request)
InternalWinderCfg.SpoolBottomBackingRate = request->bottombackingrate;
InternalWinderCfg.NumberOfRotationPerPassage = 3.1415926*2;//request->rotationsperpassage;
InternalWinderCfg.diameter = request->diameter;
- usnprintf(ScrewStr, 150, "WindingConfig start,offset,head,tail {, %d, %d, %d, %d, %d}",InternalWinderCfg.startoffsetpulses,(int)InternalWinderCfg.segmentoffsetpulses,
- (int)InternalWinderCfg.spoolbackingrate,(int)InternalWinderCfg.SpoolBottomBackingRate);
- Report(ScrewStr,__FILE__,__LINE__,(int)InternalWinderCfg.diameter,RpWarning,(int)(InternalWinderCfg.NumberOfRotationPerPassage*1000), 0);
return status;
}
@@ -262,7 +257,7 @@ InternalWinderCfg.segmentoffsetpulses
numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep;
*/
-
+char ScrewStr[150];
//char TempScrewStr[100];
double WinderReferenceSpeed=0;
double TotalWinderSpeed=0;
@@ -272,8 +267,6 @@ int flipflop = 0;
uint32_t motspeed;
float speedf;
int WinderCalculation = 0;
-float WinderRunAverage = 0.0,WinderRunSum = 0.0;
-int WinderRunSamples = 0;
uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
{
//uint32_t Steps;
@@ -281,8 +274,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
double screw_horizontal_speed = 0;
double RotationsPerSecond;
double Averagewinderspeed = 0;
- int WinderRun;
-
// {
// TotalWinderSpeed-=WinderMotorSpeed[WinderMotorSpeedCounter];
@@ -321,15 +312,14 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
//double calcsteps = (ScrewRunningTime/SYS_CLK_FREQ)*ScrewSpeed;
#ifdef READ_SCREW_ENCODER
WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]);
- if ((WinderRun < 50000)&&(Add100 == false))
+ if (WinderRun < 50000)
{
WinderRunSum+=WinderRun;
WinderRunSamples++;
WinderRunAverage = WinderRunSum/WinderRunSamples;
- if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0))
+ if ((fabs(WinderRun-WinderRunAverage)>=50)||(WinderRunSamples%50 == 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));
+ usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d }",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples);
Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
}
}
@@ -353,7 +343,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
{
ScrewNumberOfSteps--;
WindingConeLocation--;
- ReportWithPackageFilter(ThreadFilter,"Head Backing",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
+ // ReportWithPackageFilter(ThreadFilter,"Head Backing",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
}
}
else //next time going back
@@ -361,7 +351,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.SpoolBottomBackingRate == 0)
{
ScrewNumberOfSteps++;
- Report("Bottom Backing ",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
+ // Report("Bottom Backing ",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
}
}
/* if (WinderMotorSpeedRollOver)