diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-06-10 13:23:34 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-06-10 13:23:34 +0300 |
| commit | ceac18f1063d85c49db5d29c51f74e711b6405ab (patch) | |
| tree | cb61be1313f9be496652a4a1abe9bf65af92002c /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | bfc8d0cc2055b7fa5171aeace011435e23f71359 (diff) | |
| download | Tango-ceac18f1063d85c49db5d29c51f74e711b6405ab.tar.gz Tango-ceac18f1063d85c49db5d29c51f74e711b6405ab.zip | |
fix threadloading, enable dispenser pulling down, WHS blower PID control
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 50750a49e..c1d547f59 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -650,6 +650,7 @@ { REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Dryer_Loading"); + int CurrentlyLoaded = 0; if (dryerbufferlength) LoadArmRounds = (int)dryerbufferlength; if (LoadArmRounds <= 2) @@ -659,7 +660,12 @@ // OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000; // CurrentControlledSpeed[FEEDER_MOTOR] = 1000; - //MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds); + MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&CurrentlyLoaded); + Report("Thread_Load_Dryer_Loading cycles",__FILE__,LoadArmRounds,CurrentlyLoaded,RpMessage,LoadArmRounds-CurrentlyLoaded,0); + if (CurrentlyLoaded) + { + LoadArmRounds -= CurrentlyLoaded; + } ThreadMotorIdToMotorId[FEEDER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_RDRIVING ; ThreadMotorIdToMotorId[DRYER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING; @@ -809,14 +815,14 @@ else //done enough cycles, go to the center point { MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,30000); - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles); + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0); Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); } } else //timeout or no movement { Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-(numberOfCycles-1)); + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles); TimeoutsCounter = 0; CallbackCounter = 0; /*if(PullerControlId != 0xFF) @@ -922,7 +928,12 @@ if (SecondTry == true) { - LoadArmRounds = 30; + MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&LoadArmRounds); + if (LoadArmRounds == 0) //prev trial stopped + { + LoadArmRounds = (int)dryerbufferlength; + } + //LoadArmRounds = 30; } else { @@ -1051,7 +1062,7 @@ } uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue) { - if (JobIsActive()) + if (JobIsActive()||(MachineReadyForHeating == false)) { Report("ThreadLoadButton called on job",__FILE__,__LINE__,LoadStages,RpMessage,ReadValue,0); return ERROR; |
