aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-07-15 13:43:16 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-07-15 13:43:16 +0300
commit54115f60966580e3d37f48d28179bf4c13ef9a7e (patch)
tree2aaecefed2856ac3d3524dbd0415d28db9f19c96 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
parent154ef1df567c78d2758c95acabce1a4da4815c39 (diff)
downloadTango-54115f60966580e3d37f48d28179bf4c13ef9a7e.tar.gz
Tango-54115f60966580e3d37f48d28179bf4c13ef9a7e.zip
Version 1.4.2.2 report filters introduced, improved flash handling. improved and simplified dispenser location. improved config parameters handling
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c30
1 files changed, 27 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 8943e5d30..a113e4dae 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -54,6 +54,10 @@ uint32_t ScrewNumberOfSteps = 0; //holds the current number of steps for the
bool SCREW_TimerActivated = false;
uint32_t ScrewControlId = 0xFF;
+static bool KeepWindingCone = false;
+static uint32_t WindingConeLocation;
+static uint32_t WinderBackToBaseTime = 800;
+
InternalWinderConfigStruc InternalWinderCfg = {0};
uint32_t ScrewLocationLimitSwitch = 0,ScrewLocationStart = 0;
@@ -65,7 +69,17 @@ uint32_t Winder_Init(void)
ScrewTimerInterruptInit();
return OK;
}
+void SetKeepWindingCone(bool value)
+{
+ KeepWindingCone = value;
+ ReportWithPackageFilter(ThreadFilter,"set KeepWindingCone",__FILE__,__LINE__,WindingConeLocation,RpWarning,KeepWindingCone, 0);
+}
+void SetWinderBackToBaseTime(uint32_t value)
+{
+ WinderBackToBaseTime = value;
+ ReportWithPackageFilter(ThreadFilter,"Set WinderBackToBaseTime",__FILE__,__LINE__,WinderBackToBaseTime,RpWarning,KeepWindingCone, 0);
+}
uint32_t InternalWinderConfigMessage(HardwareWinder* request)
{
@@ -120,6 +134,15 @@ uint32_t Winder_Prepare(void *JobDetails)
ScrewLocationRun[0] = 0;
ScrewLocationRun[1] = 0;
+ if (( KeepWindingCone == false)||(WindingConeLocation == 0))
+ {
+ WindingConeLocation = InternalWinderCfg.startoffsetpulses;
+ ReportWithPackageFilter(ThreadFilter,"WindingConeLocation set",__FILE__,__LINE__,WindingConeLocation,RpWarning,KeepWindingCone, 0);
+ }
+ else
+ {
+ ReportWithPackageFilter(ThreadFilter,"WindingConeLocation use previous",__FILE__,__LINE__,WindingConeLocation,RpWarning,KeepWindingCone, 0);
+ }
if (JobTicket->has_samplewinding == true)
{
@@ -149,7 +172,7 @@ uint32_t Winder_Prepare(void *JobDetails)
uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue)
{
uint32_t status=OK;
- uint32_t numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep;
+ uint32_t numOfSteps = WindingConeLocation*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep;
//MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses);
//REPORT_MSG(numOfSteps, "Winder_PrepareStage2");
@@ -297,7 +320,8 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.spoolbackingrate == 0)
{
ScrewNumberOfSteps--;
- Report("Head Backing",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
+ WindingConeLocation--;
+ ReportWithPackageFilter(ThreadFilter,"Head Backing",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
}
}
else //next time going back
@@ -514,7 +538,7 @@ uint32_t WinderDistanceToSpoolState(void )
double DTS_Time = ((dryerbufferlength*100)/dyeingspeed)*1000;//distance to spool time in milliseconds
REPORT_MSG ((int)DTS_Time,"WinderDistanceToSpoolState");
- ScrewDTSControlId = AddControlCallback(ScrewDTSCallback, DTS_Time-800,TemplateDataReadCBFunction,0,0,0);
+ ScrewDTSControlId = AddControlCallback(ScrewDTSCallback, DTS_Time-WinderBackToBaseTime,TemplateDataReadCBFunction,0,0,0);
REPORT_MSG ((int)msec_millisecondCounter,"ScrewDTSCallback start");
return OK;