diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-03 12:28:18 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-03 12:28:18 +0200 |
| commit | af782aca2364948527c1107a02428897fb8382a1 (patch) | |
| tree | 788c3e9bdf2dcc41188f710a2f05cd5e1e8acc9d /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | fbfe1b3cc3024a6b0401fb0a2c53bead70462338 (diff) | |
| download | Tango-af782aca2364948527c1107a02428897fb8382a1.tar.gz Tango-af782aca2364948527c1107a02428897fb8382a1.zip | |
thread loading, mostly
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 30 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 2 |
2 files changed, 25 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index f2ca4e8d7..ffbb504db 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -247,7 +247,8 @@ } uint32_t Thread_Load_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_t BusyFlag) { - uint32_t angle, temp = Read_Dryer_ENC_Position(); + uint32_t temp = Read_Dryer_ENC_Position(); + int angle; ReportWithPackageFilter(DiagnosticsFilter,"Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,(int)numberOfCycles,(int)DrierPrevLocation,RpMessage,temp,0); @@ -258,12 +259,14 @@ { CallbackCounter--; } - if ((abs(angle)>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round + if (abs(angle)<10 ) // OK { Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0); Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); NumberOfDrierLoaderCycles=0; + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0); + //storeLoadArmParameters(); LoadStages++; @@ -272,7 +275,7 @@ else { load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM]); + usnprintf(LoadErrorMsg, 100, "^Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; @@ -317,7 +320,7 @@ { TimeoutsCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); + usnprintf(LoadErrorMsg, 100, "/Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; @@ -687,7 +690,7 @@ TimeoutsCounter = 0; CallbackCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]); + usnprintf(LoadErrorMsg, 100, "$Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 200); @@ -729,6 +732,13 @@ { LoadArmRounds -= CurrentlyLoaded; } + if (LoadArmRounds == CurrentlyLoaded) + { + Report("Thread_Load_Dryer_Loading no need for cycles",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); + LoadStages++; + ThreadLoadStateMachine(LoadStages); + return OK; + } ThreadMotorIdToMotorId[FEEDER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_RDRIVING ; ThreadMotorIdToMotorId[DRYER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING; @@ -932,7 +942,7 @@ MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,Hard_Hiz); load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]); + usnprintf(LoadErrorMsg, 100, "&Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); Report("Dryer unloading timeout(1) or no movement",__FILE__,temp,DrierPrevLocation,RpWarning,ReadValue,0); LoadStatus = ERROR; @@ -1489,6 +1499,8 @@ uint32_t ThreadLoadingRestartReport(void) //sending after a failure in the final if (ThreadLoadingToken[0] == 0) return OK; + if (LoadStages == THREAD_LOAD_INIT) + return OK; ThreadLoadingRestartFlag = true; response.has_state = true; @@ -1520,6 +1532,12 @@ uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer) { responseContainer = createContainer(MESSAGE_TYPE__TryThreadLoadingResponse, requestContainer->token, true, &Cresponse, &try_thread_loading_response__pack, &try_thread_loading_response__get_packed_size); responseContainer.continuous = false; + if (JobIsActive()||(MachineReadyForHeating == false)||(FPGABurningActive==true)) + { + responseContainer.has_error = true; + responseContainer.error = ERROR_CODE__GENERAL_ERROR; + responseContainer.errormessage = "The machine is not ready for loading"; + } uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); my_free(responseContainer.data.data); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index ba505493d..c3fb17460 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -1061,7 +1061,7 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension) return status; } //******************************************************************************************************************** -bool SkipOpenLids = true; +bool SkipOpenLids = false; uint32_t ThreadPrepareState(void *JobDetails) { int Motor_i,i, HW_Motor_Id, Pid_Id; |
