aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-08 21:55:25 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-08 21:55:25 +0200
commiteb160d2692e12bd5402c9686eb2850695fb999cc (patch)
tree041c84e33c8103cbea3be8c488eaa0d104e8a054 /Software/Embedded_SW/Embedded/Modules/Thread
parent5257bfef6cf9fc4896fe417233e7535401c4e5e1 (diff)
downloadTango-eb160d2692e12bd5402c9686eb2850695fb999cc.tar.gz
Tango-eb160d2692e12bd5402c9686eb2850695fb999cc.zip
alarm handling
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c23
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c22
3 files changed, 36 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index a6cb25c45..8ecb3f404 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -141,6 +141,25 @@ uint32_t InternalWindingConfigMessage(JobSpool* request)
* report ready to the job STM
*/
int Screw_wait_counter;
+uint32_t Winder_Check_Cone(void)
+{
+ if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT)
+ {
+ REPORT_MSG(LIMIT, "No cone in winder");
+ if (Is_PP_Machine())
+ {
+ if (IgnoreConeMissing == false)
+ {
+ //JobEndReason = JOB_THREAD_BREAK;
+ usnprintf(AlarmReasonStr, 100, "No cone in winder");
+ //PrepareReady(Module_Winder,ModuleFail);
+ AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true);
+ return JOB_THREAD_BREAK;
+ }
+ }
+ }
+ return JOB_OK;
+}
uint32_t Winder_Prepare(void *JobDetails)
{
JobTicket* JobTicket = JobDetails;
@@ -159,7 +178,7 @@ uint32_t Winder_Prepare(void *JobDetails)
* report ready to the job STM
*/
- if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT)
+ /*if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT)
{
REPORT_MSG(LIMIT, "No cone in winder");
if (Is_PP_Machine())
@@ -173,7 +192,7 @@ uint32_t Winder_Prepare(void *JobDetails)
return ERROR;
}
}
- }
+ }*/
#ifdef READ_SCREW_ENCODER
ScrewLocationRun[0] = 0;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
index 0861b677b..a87406454 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
@@ -53,6 +53,7 @@ uint32_t LoadDancerConfigMessage(void);
extern float NumberOfRotationPerPassage; //debug for rotation per passage trials
uint32_t Winder_Init(void);
+uint32_t Winder_Check_Cone(void);
uint32_t Winder_Prepare(void *JobDetails);
uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId);
uint32_t WinderDistanceToSpoolState(void );
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index bc4e6cb8f..0dca3537e 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -337,7 +337,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}**/
//}
-#ifdef BTSR_NO_TFU
+#ifdef BTSR_NO_PULLER_TFU
if (CurrentControlledSpeed[WINDER_MOTOR]>100)
length = dyeingspeed/10;
#endif
@@ -917,7 +917,7 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag)
uint32_t Release_Right_TFU_Tension()
{
uint32_t status = OK;
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
if (RTFU_Up == true)
{
Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0);
@@ -931,7 +931,7 @@ int SecondFeederCorrection = 4;
int PrepareWaitCount = 0;
uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadValue)
{
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
MotorStop (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,Soft_Stop); //per L6470 errata between mov and run commands
Report("Adjust_Right_TFU_Tension_2ndCallback x more steps",__FILE__,__LINE__,MotorId,RpMessage,SecondFeederCorrection,0);
if (JobIsActive()==false)
@@ -955,7 +955,7 @@ uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadVa
}
uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue)
{
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
Report("Adjust_Right_TFU_Tension_Callback",__FILE__,__LINE__,MotorId,RpMessage,0,0);
MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,SecondFeederCorrection* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Adjust_Right_TFU_Tension_2nd_Callback,1000);
RTFU_Up = true;
@@ -966,7 +966,7 @@ uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue)
uint32_t Adjust_Right_TFU_Tension(double tension)
{
uint32_t status = OK;
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
if (tension > 0.5) //0 = lower position, 1 = high position
{
if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT)
@@ -1093,11 +1093,13 @@ uint32_t ThreadPrepareState(void *JobDetails)
IntersegmentLength = JobTicket->intersegmentlength;
PrepareWaitCount = 0;
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_PULLER_TFU
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension);
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0);
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension);
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpWarning,(int)pullertension,0);
+#endif
+#ifndef BTSR_NO_FEEDER_TFU
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension);
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpWarning,(int)feedertension,0);
#endif
@@ -1219,7 +1221,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
/////////////////////////////////////////////////////
MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize);
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0);
@@ -1233,6 +1235,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
SpeedControlId = AddControlCallback(NULL,ThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
}
#endif
+#ifndef BTSR_NO_PULLER_TFU
if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0);
@@ -1246,7 +1249,8 @@ uint32_t ThreadPrepareState(void *JobDetails)
PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep);
PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
}
-#ifndef BTSR_NO_TFU
+#endif
+#ifndef BTSR_NO_FEEDER_TFU
if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
if (ControlIdtoMotorId[Motor_i] != 0xFF)
@@ -1261,6 +1265,8 @@ uint32_t ThreadPrepareState(void *JobDetails)
//AddControlCallback(NULL,ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
#endif
}
+#endif
+#ifndef BTSR_NO_PULLER_TFU
if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled
{
if (ControlIdtoMotorId[Motor_i] != 0xFF)