aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c26
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c19
4 files changed, 35 insertions, 15 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 349215d7d..c1d547f59 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -190,6 +190,9 @@
ProcessParametersClear.lblowerflow = 0;
ProcessParametersClear.dyeingspeed = 40;
ProcessParametersClear.dryerbufferlength = ProcessParametersKeep.dryerbufferlength;
+ ProcessParametersClear.pullertension = ProcessParametersKeep.pullertension;
+ ProcessParametersClear.windertension = ProcessParametersKeep.windertension;
+
if (HandleProcessParameters(&ProcessParametersClear,false)!= OK)
{
LOG_ERROR (LoadStages, "Thread_Load_Reduce_Heat failed");
@@ -286,7 +289,7 @@
{
TimeoutsCounter = 0;
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - motor %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]);
+ usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
@@ -647,6 +650,7 @@
{
REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Dryer_Loading");
+ int CurrentlyLoaded = 0;
if (dryerbufferlength)
LoadArmRounds = (int)dryerbufferlength;
if (LoadArmRounds <= 2)
@@ -656,7 +660,12 @@
// OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000;
// CurrentControlledSpeed[FEEDER_MOTOR] = 1000;
- //MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds);
+ MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&CurrentlyLoaded);
+ Report("Thread_Load_Dryer_Loading cycles",__FILE__,LoadArmRounds,CurrentlyLoaded,RpMessage,LoadArmRounds-CurrentlyLoaded,0);
+ if (CurrentlyLoaded)
+ {
+ LoadArmRounds -= CurrentlyLoaded;
+ }
ThreadMotorIdToMotorId[FEEDER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_RDRIVING ;
ThreadMotorIdToMotorId[DRYER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING;
@@ -806,14 +815,14 @@
else //done enough cycles, go to the center point
{
MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,30000);
- MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles);
+ MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0);
Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0);
}
}
else //timeout or no movement
{
Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0);
- MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-(numberOfCycles-1));
+ MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles);
TimeoutsCounter = 0;
CallbackCounter = 0;
/*if(PullerControlId != 0xFF)
@@ -919,7 +928,12 @@
if (SecondTry == true)
{
- LoadArmRounds = 30;
+ MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&LoadArmRounds);
+ if (LoadArmRounds == 0) //prev trial stopped
+ {
+ LoadArmRounds = (int)dryerbufferlength;
+ }
+ //LoadArmRounds = 30;
}
else
{
@@ -1048,7 +1062,7 @@
}
uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue)
{
- if (JobIsActive())
+ if (JobIsActive()||(MachineReadyForHeating == false))
{
Report("ThreadLoadButton called on job",__FILE__,__LINE__,LoadStages,RpMessage,ReadValue,0);
return ERROR;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 9ee2e1f37..ca41a8e70 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -149,12 +149,12 @@ uint32_t Winder_Prepare(void *JobDetails)
if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT)
{
REPORT_MSG(LIMIT, "No cone in winder");
- if (Is_PP_Machine())
+ /*if (Is_PP_Machine())
{
PrepareReady(Module_Winder,ModuleFail);
AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true);
return ERROR;
- }
+ }*/
}
#ifdef READ_SCREW_ENCODER
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
index 1e730e252..5c9b360f6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
@@ -81,6 +81,7 @@ void ThreadLoadRequest(MessageContainer* requestContainer);
uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer);
uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer);
uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer);
+uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer);
uint32_t Thread_Load_End(void);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 545fb40e6..efcbd5030 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -217,6 +217,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
if (FeederSpeedIndex>=SPEED_STORE_SIZE)
{
FeederSpeedIndex = 0;
+ FeederSpeedAverage = 0;
for (Speed_i = 0;Speed_i<SPEED_STORE_SIZE;Speed_i++)
FeederSpeedAverage+=FeederSpeedStore[Speed_i];
FeederSpeedAverage = FeederSpeedAverage/SPEED_STORE_SIZE;
@@ -316,6 +317,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
if (PullerSpeedIndex>=SPEED_STORE_SIZE)
{
PullerSpeedIndex = 0;
+ PullerSpeedAverage = 0;
for (Speed_i = 0;Speed_i<SPEED_STORE_SIZE;Speed_i++)
PullerSpeedAverage+=PullerSpeedStore[Speed_i];
PullerSpeedAverage = PullerSpeedAverage/SPEED_STORE_SIZE;
@@ -976,16 +978,19 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension)
//return ERROR;
}*/
- if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_LID]) == LIMIT)
+ if ((FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_LID]) == LIMIT)&&(JoggingJobActive == false))
{
- ReportWithPackageFilter(ThreadFilter,"Dyeing head is wide open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpFatalError,LIMIT,0);
- JobEndReason = JOB_LIDS_OPEN;
- PrepareReady(Module_Thread,ModuleFail);
- return ERROR;
+ if(Head_Type != HEAD_TYPE_STAPLE_SPUN)
+ {
+ ReportWithPackageFilter(ThreadFilter,"Dyeing head is wide open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpError,LIMIT,0);
+ JobEndReason = JOB_LIDS_OPEN;
+ PrepareReady(Module_Thread,ModuleFail);
+ return ERROR;
+ }
}
- if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID]) == LIMIT)
+ if ((FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID]) == LIMIT)&&(JoggingJobActive == false))
{
- ReportWithPackageFilter(ThreadFilter,"Dryer lid is wide open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpFatalError,LIMIT,0);
+ ReportWithPackageFilter(ThreadFilter,"Dryer lid is wide open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpError,LIMIT,0);
JobEndReason = JOB_LIDS_OPEN;
PrepareReady(Module_Thread,ModuleFail);
return ERROR;