diff options
| author | Shai Frieder <Shai.Frieder@twine-s.com> | 2019-10-17 09:44:24 +0300 |
|---|---|---|
| committer | Shai Frieder <Shai.Frieder@twine-s.com> | 2019-10-17 09:44:24 +0300 |
| commit | 6e5785a2dcb55e75f951d88e34d6b5066a1ce2af (patch) | |
| tree | 80094af73624e78b38bcc2cdf0623abbcb67a984 /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | 387e6e639028839dfeee9fe4b08259ecc8633b6b (diff) | |
| parent | 70c734055ae610eee328b69af74a39d927924911 (diff) | |
| download | Tango-6e5785a2dcb55e75f951d88e34d6b5066a1ce2af.tar.gz Tango-6e5785a2dcb55e75f951d88e34d6b5066a1ce2af.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
3 files changed, 15 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index c68156e68..a860c553c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -202,7 +202,7 @@ MotorStop(ThreadMotorIdToMotorId[FEEDER_MOTOR],Hard_Hiz);*/ MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,Hard_Hiz); - +//move to exact location? // Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); CallbackCounter = 0; Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); @@ -375,9 +375,9 @@ { REPORT_MSG(LoadStages, "Thread Load State Machine step"); CallbackCounter++; - MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RDANCER], Thread_Load_HomingCallback,4000); + MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RDANCER], Thread_Load_HomingCallback,10000); CallbackCounter++; - MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, 500, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1], Thread_Load_HomingCallback,10000); + MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, 500, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1], Thread_Load_HomingCallback,25000); return OK; } @@ -497,7 +497,7 @@ MotorControlConfig[FEEDER_MOTOR].m_SetParam = 0;//need to update SetParams on presegment stage MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize); - MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4); + MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius); LoadingControlId = AddControlCallback(ThreadLoadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+FEEDER_MOTOR),FEEDER_DANCER,FEEDER_MOTOR); Report("AddControlCallback feeder",__FILE__,__LINE__,LoadingControlId,RpMessage,IfTypeThread*0x100+FEEDER_MOTOR,0); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index fdd17fed4..bf0f361fd 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -302,7 +302,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) LOG_ERROR(Add100, "Add100 = true"); } // WinderMotorSpeedCounter=0; - WinderMotorSpeedRollOver=true; } // } if (flipflop == 0) @@ -331,20 +330,17 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) if ((WinderRun < 30000)&&(WinderMotorSpeedRollOver == true)) { WinderRunSamples++; - if (WinderRunSamples>10) + WinderRunSum+=WinderRun; + WinderRunAverage = WinderRunSum/WinderRunSamples; + if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0)) { - WinderRunSum+=WinderRun; - WinderRunAverage = WinderRunSum/(WinderRunSamples); - if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0)) - { - usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples, - (int)(100*WinderRun/ScrewNumberOfSteps)); - Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); - } + usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples, + (int)(100*WinderRun/ScrewNumberOfSteps)); + Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); } } - else - Report("winder run error value" ,__FILE__,WinderRun,ScrewLocationRun[0],RpWarning,ScrewLocationRun[1], 0); + //else + // Report("winder run error value" ,__FILE__,WinderRun,ScrewLocationRun[0],RpWarning,ScrewLocationRun[1], 0); //Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); //REPORT_MSG(abs(ScrewLocationRun[1] - ScrewLocationRun[0]), "Screw Run NumberOfSteps"); @@ -360,6 +356,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { ScrewNumberOfSteps += 100; Add100 = false; + WinderMotorSpeedRollOver=true; } if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.spoolbackingrate == 0) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 59542ec38..47fc37081 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -729,6 +729,8 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) EnableIntersegment = JobTicket->enableintersegment; IntersegmentLength = JobTicket->intersegmentlength; + MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, Hard_Stop); + //start thread control for all motors for (Motor_i = 0;Motor_i < MAX_THREAD_MOTORS_NUM;Motor_i++) |
