From ffbe0df145c04bc9e39d5db162a49928ae205da3 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 23 Feb 2020 15:41:29 +0200 Subject: switch ADC line 16 and 17 (drier 1, drier 2). pt100 error is a BIT failure. dancer status, and use low dancer values and 0x3FFF (for dancer rollover) --- .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 1dd101f82..9e0a2ac7f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -442,7 +442,6 @@ void testDancersControl() ThreadControlActive = false; } #endif -bool dancerinvalid = false; int MotorFailedSample[MAX_THREAD_MOTORS_NUM] = {0,0,0,0,0}; char TMessage[150]; //char time[150]; @@ -481,21 +480,20 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //if (MotorDriverResponse[ThreadMotorIdToMotorId[index]].Busy == true) // return OK; DancerId = ThreadMotorIdToDancerId[index]; - if (ReadValue < 10) +/* if (ReadValue < 10) { MotorFailedSample[index]++; ReportWithPackageFilter(ThreadFilter,"Dancer value read too small.",__FILE__,__LINE__,DancerId,RpError,ReadValue,0); return OK; - } + }*/ if (ReadValue == 0x3FFF) { - MotorFailedSample[index]++; - if (dancerinvalid == false) + if (Read_Dryer_Status(DancerId) != OK) { - dancerinvalid = true; - ReportWithPackageFilter(ThreadFilter,"Dancer value invalid.",__FILE__,__LINE__,(int)IfIndex,RpError,(int)ReadValue,0); + ReportWithPackageFilter(ThreadFilter,"Dancer value invalid.",__FILE__,ReadValue,(int)DancerId,RpError,(int)Read_Dryer_Status(DancerId),0); + MotorFailedSample[index]++; + return OK; } - return OK; } KeepReadValue = ReadValue; TranslatedReadValue = ReadValue - DancersCfg[DancerId].zeropoint; -- cgit v1.3.1 From e4b6aae111fefea65835cf2a40089fb8528fe588 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 24 Feb 2020 10:02:36 +0200 Subject: EC PT100 upper limit lowered. fix short jog screw alarm, improve current measurement --- .../Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 2 +- .../Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 13 ++++++++++--- .../Embedded/StateMachines/Initialization/InitSequence.c | 6 +++++- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 5434765e1..bc0d1002b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -320,7 +320,7 @@ uint32_t HeatersTestInternalAlarmsCBFunction(uint32_t IfIndex, uint32_t readValu } readValue = MillisecGetTemperatures(InternalId2PT100Id[index]); - if((MINIMUM_HEATER_READ*100>=readValue)||(270.00*100 < readValue)) + if((MINIMUM_HEATER_READ*100>=readValue)||(200.00*100 < readValue)) { //ReportWithPackageFilter(HeatersFilter,"PT100 not working properly",__FILE__,__LINE__,HeaterId,RpError, 0,0); return ERROR; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 78092ae2b..78150e9f9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -213,9 +213,16 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue) REPORT_MSG(millisecondCounter/*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].maxfrequency*/, "Winder_PrepareStage2"); if (ReadValue != LIMIT) { - LOG_ERROR(ReadValue,"Screw failed to reach the limit switch!!"); - //returned with a timeout - Winder_ScrewAtOffsetCallback(0,0); + if (JobIsActive()==true) + { + LOG_ERROR(ReadValue,"Screw failed to reach the limit switch!!"); + //returned with a timeout + Winder_ScrewAtOffsetCallback(0,0); + } + else //short jog, etc + { + AlarmHandlingSetAlarm (EVENT_TYPE__SCREW_MOTOR_LIMIT_TIMEOUT,OFF); //on a short jog, this callback will be called without need + } } else { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 20780b8c1..92f22b0ac 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -222,6 +222,7 @@ double MainCurrent,SecondaryCurrent,StableCurrent; double InitDrierAcVoltage = 0.0; int InitDrierAcVoltageCount = 0; double Zone2Resistance = 0.0; +int WaitForCurrentRaise = 0;//let the heater current raise void InitCurrentReadingStable(void) { memset(Heater_Current,0,sizeof(Heater_Current)); @@ -229,8 +230,9 @@ void InitCurrentReadingStable(void) count_Heater_Current = 0; Maxcount_Heater_Current = 0; StableCurrent = 0.0; + WaitForCurrentRaise = 0; } - +#define MaxStabilization 10 bool DetectIfCurrentReadingStable(double HeaterCurrent) { bool ret = false; @@ -268,6 +270,8 @@ uint32_t PowerManagementCallBack(uint32_t IfIndex, uint32_t BusyFlag) { ReportWithPackageFilter(InitFilter,"PowerManagementCallBack", __FILE__,MainHeaterStable,(int)(SecondaryHeaterStable), RpMessage, Maxcount_Heater_Current, 0); ReportWithPackageFilter(InitFilter,"PowerManagementCallBack", __FILE__,GetHeaterState(HEATER_TYPE__DryerMainHeater),(int)(GetHeaterState(HEATER_TYPE__DryerSecondaryHeater)), RpMessage, Maxcount_Heater_Current, 0); + if (WaitForCurrentRaise++ < MaxStabilization) + return OK; if ((MainHeaterStable == false)&&(Maxcount_Heater_Current