aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-06-17 14:42:54 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-06-17 14:42:54 +0300
commitcfde5403e86ce1ace1b5321a31ad0529c0e3ace5 (patch)
tree442f6579a37b756f8b81662e01a2ddf2035ebeda /Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
parent0b32f796a19788c20e01a985b0c62354e057b392 (diff)
downloadTango-cfde5403e86ce1ace1b5321a31ad0529c0e3ace5.tar.gz
Tango-cfde5403e86ce1ace1b5321a31ad0529c0e3ace5.zip
blower alarm and handling, P01 config word, improve tension handling,
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index efcbd5030..72b0439ad 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -674,9 +674,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}*/
calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index];
//calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*CurrentControlledSpeed[index];
+ //if (JobCounter % eHundredMillisecond == 50)
if (FirstCalcInJob == true)
{
- if (index == FEEDER_MOTOR)
+ if (index == POOLER_MOTOR)
{
FirstCalcInJob = false;
len = usnprintf(TMessage, 150, "read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d",
@@ -833,7 +834,7 @@ uint32_t Release_Right_TFU_Tension()
{
Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0);
RTFU_Up = false;
- status = MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4, Release_Right_TFU_TensionCallback,1000);
+ status = MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/2, Release_Right_TFU_TensionCallback,1000);
}
return status;
@@ -859,6 +860,21 @@ uint32_t Adjust_Right_TFU_Tension(double tension)
return status;
}
+int PrepareWaitCount = 0;
+uint32_t ThreadPrepare_TensionCallback (int DancerId, double tension)
+{
+ if (PrepareWaitCount)
+ {
+ ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback",__FILE__,__LINE__,DancerId,RpWarning,PrepareWaitCount,0);
+ PrepareWaitCount--;
+ }
+ if (PrepareWaitCount == 0)
+ {
+ PrepareState = false;
+ ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback Prepare Ready",__FILE__,__LINE__,DancerId,RpWarning,PrepareWaitCount,0);
+ PrepareReady(Module_Thread,ModuleDone);
+ }
+}
uint32_t ThreadPrepare_Tension (int DancerId, double tension)
{
int current, request = (int)tension,movement;
@@ -892,6 +908,7 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension)
return status;
else
{
+ PrepareWaitCount++;
if (current < request) //go down
{
direction = MotorsCfg[HW_Motor_Id].directionthreadwize;
@@ -903,12 +920,12 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension)
movement = current - request;
}
MotorSetMaxSpeed (HW_Motor_Id, 500);
- MotorMoveWithCallback (HW_Motor_Id, direction, (movement*MotorsCfg[HW_Motor_Id].microstep), NULL,20000);
+ MotorMoveWithCallback (HW_Motor_Id, direction, (movement*MotorsCfg[HW_Motor_Id].microstep), ThreadPrepare_TensionCallback,20000);
status |= MCU_E2PromProgram(address,request);
}
usnprintf(Lenstr, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d",
DancerId,request,current,movement,direction,HW_Motor_Id,address);
- ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,address,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpFatalError,LIMIT,0);
+ ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,address,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpWarning,PrepareWaitCount,0);
return status;
}
@@ -1107,7 +1124,8 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension)
#ifdef TEST_PID_THREAD
testDancersControl();
#endif
- PrepareReady(Module_Thread,ModuleDone);
+ if (PrepareWaitCount == 0)
+ PrepareReady(Module_Thread,ModuleDone);
//set 3 dancers to the profile positions
return OK;
}
@@ -1188,7 +1206,8 @@ uint32_t ThreadPreSegmentState(void *SegmentDetails, uint32_t SegmentId)
{
SetOriginMotorSpeed(process_speed);
ThreadControlActive = true;
- PrepareState = false;
+ if (PrepareWaitCount == 0)
+ PrepareState = false;
PullerSpeedIndex = 0;
FeederSpeedIndex = 0;