aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-01-29 18:33:11 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-01-29 18:33:11 +0200
commit99554aaefd61f29be38669d46c7e4a573bec311f (patch)
tree16bf2b5582424c961f87f4dc543f36f2167e6d08 /Software/Embedded_SW/Embedded/Modules/Thread
parent4b7e196fe51e5a93b3c8090bbb43d05e3e6fd370 (diff)
downloadTango-99554aaefd61f29be38669d46c7e4a573bec311f.tar.gz
Tango-99554aaefd61f29be38669d46c7e4a573bec311f.zip
Version 1.3.5.3: IDS handling, control track and fixing, and other changes.
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c15
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h3
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c3
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c12
4 files changed, 28 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 34395b3e6..e19431abd 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -40,6 +40,7 @@
THREAD_LOAD_INIT,
THREAD_LOAD_REDUCE_HEAT, //HEATERS OFF, DRYER BLOWER OFF, BLOWER LOW,
THREAD_LOAD_SET_LOAD_ARM_TO_START_POSITION,//USE NOTATION HOW MANY ROTATIONS IN THE DRYER, OR CHECK AGAINST STOPPER. MOVE SLOWLY
+ THREAD_LOAD_CENTER_HEAD_ROCKERS, //puthead cleaning rockers to middle position
THREAD_LOAD_OPEN_COVERS, //OPEN DYEING HEAD COVER AND DRYER LID
THREAD_LOAD_LIFT_DANCERS,
THREAD_LOAD_LIFT_ROCKERS, //MACHINE IS READY. SEND MESSAGE, START TIMER TO CLOSE LIDS, WAIT FOR OPERATOR RESPONSE
@@ -201,6 +202,14 @@
LOG_ERROR(MotorId, "Thread_Load_HomingCallback Callback is already 0");
return OK;
}
+ uint32_t Thread_Load_Center_Head_Rockers(void)
+ {
+ CallbackCounter++;
+ MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD], Thread_Load_HomingCallback,10000);
+ CallbackCounter++;
+ MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH], Thread_Load_HomingCallback,10000);
+ return OK;
+ }
uint32_t Thread_Load_Open_Covers(void)
{
//Open Dyeing Head Cover And Dryer Lid
@@ -352,6 +361,10 @@
//LoadStages++;
Thread_Load_Set_Load_Arm_To_Start_Position();
break;
+ case THREAD_LOAD_CENTER_HEAD_ROCKERS:
+ //LoadStages++;
+ Thread_Load_Center_Head_Rockers();
+ break;
case THREAD_LOAD_OPEN_COVERS: //OPEN DYEING HEAD COVER AND DRYER LID
//LoadStages++;
Thread_Load_Open_Covers();
@@ -416,7 +429,7 @@ uint32_t ThreadLoadControlCBFunction(uint32_t index, uint32_t ReadValue)
//double tempcalcspeed = 0;
uint32_t calculated_speed;
double NormalizedError;
- char Message[60];
+ //char Message[60];
DancerId = ThreadMotorIdToDancerId[index];
if (ReadValue < 10)
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
index 511a4ef93..56b229ea8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
@@ -43,4 +43,7 @@ uint32_t Winder_Prepare(void);
uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId);
uint32_t Winder_End(void);
+void ThreadLoadPollRequest(MessageContainer* requestContainer);
+void ThreadLoadRequest(MessageContainer* requestContainer);
+
#endif
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index f525e4a04..04a0026bd 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -85,6 +85,9 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request)
memcpy (&MotorsControl[Motor_i],request,sizeof(HardwarePidControl));
if (MotorsControl[Motor_i].pvinputfilterfactormode > MAX_CONTROL_SAMPLES)
MotorsControl[Motor_i].pvinputfilterfactormode = MAX_CONTROL_SAMPLES;
+#ifdef TEST_LONGER_PID_THREAD
+ MotorsControl[Motor_i].pvinputfilterfactormode = 10; //test longer control
+#endif
for (i = 0;i < MotorsControl[Motor_i].pvinputfilterfactormode; i++)
MotorSamples[Motor_i][i] = 0; //reset the samples value for control beginning
NormalizedErrorCoEfficient[Motor_i] = (2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index c48eec522..f0cf4f733 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -305,7 +305,7 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue)
}
//double eNormalizedError[100];
//int TranslatedreadValue[100];
-#define MAX_THREAD_CONTROL_LOG 100
+/*#define MAX_THREAD_CONTROL_LOG 100
double calculatedError[MAX_THREAD_CONTROL_LOG+1];
double NormError[MAX_THREAD_CONTROL_LOG+1];
double mIntegral[MAX_THREAD_CONTROL_LOG+1];
@@ -313,7 +313,7 @@ int MotorId[MAX_THREAD_CONTROL_LOG+1];
int readValue[MAX_THREAD_CONTROL_LOG+1];
int AveragereadValue[MAX_THREAD_CONTROL_LOG+1];
int calculatedspeed[MAX_THREAD_CONTROL_LOG+1];
-int timestamp[MAX_THREAD_CONTROL_LOG+1];
+int timestamp[MAX_THREAD_CONTROL_LOG+1];*/
int controlIndex = 0;
bool keepdata = true;
/*int32_t KeepReadValue = 0;
@@ -403,6 +403,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
MotorSamplePointer[index]++;
if (MotorSamplePointer[index] >= MotorsControl[index].pvinputfilterfactormode)
MotorSamplePointer[index] = 0;
+#ifdef TEST_LONGER_PID_THREAD
+ else // test: handle tension once in pvinputfilterfactormode milliseconds
+ return OK;
+#endif
for (i=0;i<MotorsControl[index].pvinputfilterfactormode;i++)
avreageSampleValue += MotorSamples[index][i];
avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode;
@@ -475,7 +479,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index];
if (abs(calculated_speed-CurrentControlledSpeed[index])> MotorControlConfig[index].m_ingnoreValue)
{
- if (keepdata == true)
+ /*if (keepdata == true)
{
calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError;
MotorId[controlIndex] = index;
@@ -488,7 +492,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
timestamp[controlIndex] = msec_millisecondCounter;
if (controlIndex++>=MAX_THREAD_CONTROL_LOG)
controlIndex = 0;
- }
+ }*/
CurrentControlledSpeed[index] = calculated_speed;
MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed);
}