aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-21 16:43:18 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-21 16:43:18 +0200
commitc73929a0e75705cdb8adbbdb45ea017e3bb09374 (patch)
tree9df7c0a3880a031e44c7896fd588b370367f9035 /Software/Embedded_SW/Embedded/Modules/Thread
parent977d88f94cfb192d09f0253aaf3442f2c17e60f2 (diff)
parent5881b11e25a34acc0230f5316db5783389afe18f (diff)
downloadTango-c73929a0e75705cdb8adbbdb45ea017e3bb09374.tar.gz
Tango-c73929a0e75705cdb8adbbdb45ea017e3bb09374.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/ThreadLoad.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c18
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c5
3 files changed, 20 insertions, 4 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index ff319918e..74a07e99c 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -357,6 +357,7 @@
{
Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
REPORT_MSG(MotorId, "Thread_Load_Dryer_Loading_Callback Motor Id");
+ MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,0,0);
if(ControlId != 0xFF)
{
MotorStop(ThreadMotorIdToMotorId[FEEDER_MOTOR],Hard_Hiz);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 0277d1daa..d8a96a4d9 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -137,8 +137,16 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue)
//MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses);
//REPORT_MSG(numOfSteps, "Winder_PrepareStage2");
REPORT_MSG(millisecondCounter/*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].maxfrequency*/, "Winder_PrepareStage2");
-
- status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_SCREW, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize),numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+ if (ReadValue != LIMIT)
+ {
+ LOG_ERROR(ReadValue,"Screw failed to reach the limit switch!!");
+ //returned with a timeout
+ Winder_ScrewAtOffsetCallback(0,0);
+ }
+ else
+ {
+ status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_SCREW, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize),numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+ }
//set motor location 0 here
return status;
@@ -410,6 +418,7 @@ void ScrewsStartControlTimer (void)
return;
}
+int random = 0;
void ScrewTimerInterrupt(int ARG0)
{
ROM_TimerIntClear(Screw_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt
@@ -419,7 +428,7 @@ void ScrewTimerInterrupt(int ARG0)
{
ROM_TimerLoadSet(Screw_timerBase, TIMER_A,(int)ScrewRunningTime);
MotorSetDirection (HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewCurrentDirection);
- MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
+ MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed+random);
ScrewChangeCounter = 0;
ScrewChangeLimit = ScrewRunningTime/12000000;
ScrewDirectionChangeCounter++;
@@ -429,6 +438,9 @@ void ScrewTimerInterrupt(int ARG0)
TimerDisable(Screw_timerBase, TIMER_A);
}
ROM_IntMasterEnable();
+ random++;
+ if (random >= 2)
+ random = -1;
//Report("ScrewTimerInterrupt dir, duration, speed", __FILE__,ScrewCurrentDirection,ScrewRunningTime, RpMessage, ScrewSpeed, 0);
//
// Enable all interrupts.
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index f4dc6a170..a6ca46246 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -709,7 +709,10 @@ uint32_t ThreadPreSegmentState(void *JobDetails, uint32_t SegmentId)
MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_LLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].directionthreadwize);
MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 1);
}
- IDS_StartLubrication();
+ if (JobTicket->enablelubrication == true)
+ {
+ IDS_StartLubrication();
+ }
}
// activate control fr all motors
//set speed for both rocker motors