From 90b5d8c2fdaba7abecae6676fa4a5f50efbefc9c Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 25 Oct 2020 00:28:40 +0300 Subject: improve sublimation handling (set length, cancel, prevent on jogging/cleaning) --- .../WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 16 ++++++++++++---- .../WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h | 1 + .../Embedded/Modules/General/GeneralHardware.c | 4 ++++ .../Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 2 -- .../Embedded/StateMachines/Printing/PrintingSTM.c | 4 ++++ .../stubs/embeddedparametersbuild_w_cleaning.cs | 7 ++++++- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index 4484f1932..73fe02180 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -406,11 +406,19 @@ void WHS_Set_IFS_Clearing_Suction (int midtank) } Report("------------ WHS_Set_IFS_Clearing_Suction :-----------------", __FILE__,__LINE__, (int) IFS_Clearing_Suction, RpMessage, (int)JobIsActive(), 0); } -#define JobEndSuctionTime 30 +#define JOB_END_SUCTION_TIME 30 +int SublimationBlowTime = JOB_END_SUCTION_TIME; +void setSublimationBlowTime(int Time) +{ + SublimationBlowTime = Time; +} void WHS_Set_JobEndSuction (void) { - JobEndSuction = true; - Report("------------ WHS_Set_JobEndSuction :-----------------", __FILE__,__LINE__, (int) JobEndSuction, RpMessage, (int)JobIsActive(), 0); + if (SublimationBlowTime) + { + JobEndSuction = true; + } + Report("------------ WHS_Set_JobEndSuction :-----------------", __FILE__,SublimationBlowTime, (int) JobEndSuction, RpMessage, (int)JobIsActive(), 0); } #define MAX_ALLOWED_BLOWER_VOLTAGE 4300 @@ -494,7 +502,7 @@ bool WHS_Set_Blower_Control_Closed_Loop(double Q_value) JobEndSuction = false; Report("------------ Job end Clearing Suction -----------------", __FILE__,__LINE__, (int)4000, RpMessage, (int)JobEndSuctionTime, 0); Control_Voltage_To_Blower(4000); - close_loop_time = JobEndSuctionTime; + close_loop_time = SublimationBlowTime; return OK; } volt = getBlowerState(); diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h index 3033d6d06..391aa6185 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h @@ -29,6 +29,7 @@ bool WHS_Set_Blower_Control_Closed_Loop(double Q_value); void WHS_Start_Blower_Control_Closed_Loop (void); void WHS_Set_IFS_Clearing_Suction (int midtank); void WHS_Set_JobEndSuction (void); +void setSublimationBlowTime(int Time); double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void); void WHS_Set_SetPoint_Q_value(double value); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 2073fbaf0..39c552d33 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -400,6 +400,10 @@ uint32_t EmbeddedParametersInit(void) if (EmbeddedParameters->generalparameters[9]< 0.5) setPowerOffDisableCleaning(false); else setPowerOffDisableCleaning(true); } + if (EmbeddedParameters->n_generalparameters >= 10) + { + setSublimationBlowTime(EmbeddedParameters->generalparameters[10]); + } PowerIdleSetParameters(EmbeddedParameters->switchtoidletimeinseconds,EmbeddedParameters->idledriertemperature,EmbeddedParameters->idleheadtemperature,EmbeddedParameters->idlemixertemperature); return Fresult; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 8d11b75a3..ca859f390 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -1413,7 +1413,6 @@ Void jobTask(UArg arg0, UArg arg1) CurrentJob = NULL; if (IFS_Clearing_SuctionWaiting == true) WHS_Set_IFS_Clearing_Suction(NUM_OF_MIDTANKS); - WHS_Set_JobEndSuction(); SuspendLargeMessages = false; Report("Job Ended PrintingResultsOk",__FILE__,__LINE__, 4,RpMessage,0,0); //DiagnosticsStart(); @@ -1430,7 +1429,6 @@ Void jobTask(UArg arg0, UArg arg1) SuspendLargeMessages = false; if (IFS_Clearing_SuctionWaiting == true) WHS_Set_IFS_Clearing_Suction(NUM_OF_MIDTANKS); - WHS_Set_JobEndSuction(); Report("Job Ended PrintingResultsFail",__FILE__,__LINE__, 4,RpError,JobEndReason,0); //send message data as a validation error message to host ExitState(Message.messageData); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index d65dbadd9..3b0844934 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -645,6 +645,10 @@ uint32_t EndState(void *JobDetails, char *Message) CloseJobFile(); //ROM_IntMasterEnable(); SendJobProgress(0.0,0,true,Message); + if ((JoggingJobActive==false)&&(CleaningJobActive == false)) + { + WHS_Set_JobEndSuction(); + } if (JoggingJobActive == true) { JoggingJobActive = false; diff --git a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs index d0d78f61e..7716a920c 100644 --- a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs +++ b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs @@ -24,7 +24,7 @@ ConfigurationParameters configurationParameters = new ConfigurationParameters(); configurationParameters.BreakSensorLimit = 10; //how many samples to collect in diagnostics before sending -configurationParameters.DiagnosticCollectionLimit = 3; +configurationParameters.DiagnosticCollectionLimit = 1; //how many consecutive readout before declaring DC over/underheat alarm configurationParameters.OverHeatCountLimit = 3; @@ -140,6 +140,11 @@ double PowerOffDisableCleaning = new Double(); PowerOffDisableCleaning = 0.0 configurationParameters.GeneralParameters.Add(PowerOffDisableCleaning); +double SublimationBlowTime = new Double(); +SublimationBlowTime = 30.0 +configurationParameters.GeneralParameters.Add(SublimationBlowTime); + + File.WriteAllBytes("C:/temp/EmbParam.cfg",configurationParameters.ToBytes()); -- cgit v1.3.1