aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-07-16 09:21:20 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-07-16 09:21:20 +0300
commitac9e4fdb7b7489ee7e3c963443a557dd606e8326 (patch)
tree50997aca545eb7d356ee0f0221bd68194c0050fe /Software/Embedded_SW/Embedded/Modules/Thread
parent003175fbd7cde50d810c1351beaf3415d93f6585 (diff)
parent5833d5e4da25fc3f104fadffcd81da893f2aeb76 (diff)
downloadTango-ac9e4fdb7b7489ee7e3c963443a557dd606e8326.tar.gz
Tango-ac9e4fdb7b7489ee7e3c963443a557dd606e8326.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.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c30
2 files changed, 29 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
index e927ae436..56fb79c23 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
@@ -78,6 +78,8 @@ uint32_t MotorsConfigMessage( HardwareConfiguration* HW_request);
uint32_t InternalWindingConfigMessage(JobSpool* request);
uint32_t ThreadInitialTestStub(HardwareMotor * request);
uint32_t MotorPidRequestMessage(HardwarePidControl* request);
+void SetKeepWindingCone(bool value);
+void SetWinderBackToBaseTime(uint32_t value);
uint32_t DancerConfigMessage(HardwareDancer * request);
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;