From fd2e751df27157deff79c753ad00c4180be22703 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 10 Aug 2020 00:06:13 +0300 Subject: logs --- .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 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 9c29cf14d..64425256f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -962,10 +962,20 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension) MotorMoveWithCallback (HW_Motor_Id, direction, (movement*MotorsCfg[HW_Motor_Id].microstep), ThreadPrepare_TensionCallback,20000); status |= MCU_E2PromProgram(address,request); } - usnprintf(Lenstr, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d", - DancerId,request,current,movement,direction,HW_Motor_Id,address); - ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,address,current,RpWarning,request,0); + if (DancerId == HARDWARE_DANCER_TYPE__LeftDancer) + { + usnprintf(Lenstr, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d", + DancerId,request,current,movement,direction,HW_Motor_Id,address); + ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,address,current,RpWarning,request,0); + + } + else + { + usnprintf(TMessage, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d", + DancerId,request,current,movement,direction,HW_Motor_Id,address); + ReportWithPackageFilter(ThreadFilter,TMessage,__FILE__,address,current,RpWarning,request,0); + } return status; } //******************************************************************************************************************** -- cgit v1.3.1 From ee2c20c777478b178de879ff6c827fc90ed86e27 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 10 Aug 2020 00:25:19 +0300 Subject: logs, handle prepare counter --- Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c | 10 +++++----- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 03138399c..6e0deec97 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -190,7 +190,7 @@ uint32_t MotorMoveWithCallback (TimerMotors_t MotorId,bool direction, uint32_t S //MotorStop(MotorId,Hard_Hiz ); MotorMove(MotorId,direction,Steps ); - MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 ); + MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,MotorId, MotorId, 0 ); MotorControlCallback[MotorId] = MotorMoveCallBackFunction; return MotorControlId[MotorId]; } @@ -439,12 +439,13 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO { uint32_t MotorId; uint32_t Busy = BusyFlag; - if (IfIndex>>8 != IfTypeMotors) + /*if (IfIndex>>8 != IfTypeMotors) { LOG_ERROR (IfIndex, "Wrong Interface type"); return 0xFFFFFFFF; - } + }*/ + MotorId = IfIndex; CallbackCalls++; if (CallbackCalls%200 == 0) { @@ -455,7 +456,6 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO MotorId = Read_Dryer_ENC_Position(0,0); Report("MotorMoveCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,MotorId,0); } - MotorId = IfIndex&0xFF; MotorTimeout[MotorId]+=MotorTimeLag[MotorId]; if ((BusyFlag == NOTBUSY)||((MotorTimeout[MotorId]>=MotorTimeLimit[MotorId])&&(MotorTimeLimit[MotorId]>0))) @@ -463,9 +463,9 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO /*if (MotorId == HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM) { printBusy = false; - Report("MotorControlGetnBusyState stop",__FILE__,__LINE__,MotorDriverResponse[MotorId].Busy,RpMessage,0,0); }*/ //stop this control loop + Report("MotorControlGetnBusyState stop",__FILE__,__LINE__,BusyFlag,RpMessage,MotorTimeout[MotorId],0); SafeRemoveControlCallback(MotorControlId[MotorId], MotorMoveCallBackFunction ); MotorControlCallback[MotorId] = 0; MotorControlId[MotorId] = 0xFF; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 64425256f..b6a4a455f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -888,9 +888,9 @@ uint32_t Adjust_Right_TFU_Tension(double tension) uint32_t status = OK; if (tension > 0.5) //0 = lower position, 1 = high position { - //PrepareWaitCount++; if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT) { + PrepareWaitCount++; MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, GPI_LS_RDANCER_UP, Adjust_Right_TFU_Tension_Callback,15000); Report("Adjust_Right_TFU_Tension",__FILE__,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,GPI_LS_RDANCER_UP,0); } @@ -901,9 +901,9 @@ uint32_t Adjust_Right_TFU_Tension(double tension) uint32_t ThreadPrepare_TensionCallback (int MotorId, double tension) { //MotorStop(MotorId,Hard_Hiz); + ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback",__FILE__,__LINE__,MotorId,RpWarning,PrepareWaitCount,0); if (PrepareWaitCount) { - ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback",__FILE__,__LINE__,MotorId,RpWarning,PrepareWaitCount,0); PrepareWaitCount--; } if ((PrepareWaitCount == 0)&&(PrepareState == true)) -- cgit v1.3.1 From 046d701f0b56c3cf0316ea92160cf34ccbf90412 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 10 Aug 2020 08:33:14 +0300 Subject: bugs --- Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c | 2 +- Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 3 ++- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 4 ++-- Software/PMR/Messages/Common/ErrorCode.proto | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 93bf916b2..047293ea9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -148,7 +148,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) int kval_upper_value; if (Is_PP_Machine()) - kval_upper_value = 40; + kval_upper_value = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun; else kval_upper_value = 70; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index d68c1c783..3f30e755a 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1228,7 +1228,8 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId) { Report("Unhandled brushstops remained",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)PrevSegment->brushstopscount,0); //REPORT_MSG (Segment->brushstopscount, "Segment->brushstopscount"); - for (Brush_i=JobBrushStopId;Brush_ibrushstopscount;Brush_i++) + //for (Brush_i=JobBrushStopId;Brush_ibrushstopscount;Brush_i++) #bug 3348 - unhandled jobstops stops too soon + for (Brush_i=JobBrushStopId;Brush_i<=PrevSegment->brushstopscount;Brush_i++) { if (status == ERROR) break; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 9c29cf14d..f040a9a8d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -721,11 +721,11 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { if (calculated_speed>5.0) { - if (calculated_speed>(CurrentControlledSpeed[index]+100)) + /*if (calculated_speed>(CurrentControlledSpeed[index]+100)) { ReportWithPackageFilter(ThreadFilter,"limit acceleration",__FILE__,calculated_speed,CurrentControlledSpeed[index],RpError,index,0); calculated_speed=CurrentControlledSpeed[index]+100; - } + }*/ CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); } diff --git a/Software/PMR/Messages/Common/ErrorCode.proto b/Software/PMR/Messages/Common/ErrorCode.proto index 71d15a602..9b360f6e3 100644 --- a/Software/PMR/Messages/Common/ErrorCode.proto +++ b/Software/PMR/Messages/Common/ErrorCode.proto @@ -58,6 +58,8 @@ enum ErrorCode JOB_ABORTED_BY_USER = 2014; JOB_SAFETY_ALARM = 2015; JOB_NO_ALARM_FILE = 2016; + JOB_FILE_PROBLEM = 2017; + JOB_WASTE_HANDLING_PROBLEM = 2018; //power up POWER_UP_NO_CFG_FILE = 3000; -- cgit v1.3.1 From 71b6596e53b93e9c55195b3edcf2d35e80bb7242 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 10 Aug 2020 12:30:50 +0300 Subject: fix TFU tension handling. small fix in waste handling --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Drivers/Motors/MotorActions.c | 20 +++++++++++++++----- .../Embedded/Modules/Control/MillisecTask.c | 8 ++++---- .../Embedded_SW/Embedded/Modules/General/Safety.c | 4 ++-- .../Embedded/Modules/Thread/Thread_print.c | 22 ++++++++++++---------- .../StateMachines/Initialization/InitSequence.c | 2 +- 6 files changed, 35 insertions(+), 23 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index 1045fe792..06a4ed090 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,4,6,39}; +TangoVersion_t _gTangoVersion = {1,4,6,40}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//e diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 6e0deec97..419c34985 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -447,14 +447,24 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO MotorId = IfIndex; CallbackCalls++; - if (CallbackCalls%200 == 0) + if (MotorId ==HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM) { - Read_Dryer_ENC_Position(); + if (CallbackCalls%200 == 0) + { + Read_Dryer_ENC_Position(); + } + if (CallbackCalls%200 == 1) + { + MotorId = Read_Dryer_ENC_Position(0,0); + Report("MotorMoveCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,MotorId,0); + } } - if (CallbackCalls%200 == 1) + else { - MotorId = Read_Dryer_ENC_Position(0,0); - Report("MotorMoveCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,MotorId,0); + if (CallbackCalls%100 == 1) + { + Report("MotorMoveCallBackFunction",__FILE__,MotorId,MotorTimeout[MotorId],RpWarning,MotorTimeLimit[MotorId],0); + } } MotorTimeout[MotorId]+=MotorTimeLag[MotorId]; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 242bdc3ce..327b5d19b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -804,10 +804,10 @@ uint32_t MillisecLowLoop(uint32_t tick) } if (TenMinutes_Tick) { - if (WHS_Type == WHS_TYPE_NEW) + /*if (WHS_Type == WHS_TYPE_NEW) { waste_seq_step1();// include 1Sec delay <- to open !!!! - } + }*/ } if (OneHourTick) { @@ -819,10 +819,10 @@ uint32_t MillisecLowLoop(uint32_t tick) PumpCounter = 0; } MidTankReading(); - /*if (WHS_Type == WHS_TYPE_NEW) + if (WHS_Type == WHS_TYPE_NEW) { waste_seq_step1();// include 1Sec delay <- to open !!!! - }*/ + } //Trigger_WHS_MAX11614_Read_Gas_Sensor(); } //ROM_IntMasterEnable(); diff --git a/Software/Embedded_SW/Embedded/Modules/General/Safety.c b/Software/Embedded_SW/Embedded/Modules/General/Safety.c index 099ac1769..422b4745f 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/Safety.c +++ b/Software/Embedded_SW/Embedded/Modules/General/Safety.c @@ -234,12 +234,12 @@ uint32_t Safety_Main_State(uint32_t IfIndex, uint32_t BusyFlag) AlarmHandlingSetAlarm(EVENT_TYPE__AIR_FILTER_NOT_INSTALLED, false); AirFilterAlarmState = mAirFilterAlarmState; } - if ((mWasteOverflowAlarmState != WasteOverflowAlarmState)|| (mWasteOverflowAlarmState == false)) + /*if ((mWasteOverflowAlarmState != WasteOverflowAlarmState)|| (mWasteOverflowAlarmState == false)) { //alarm went off AlarmHandlingSetAlarm(EVENT_TYPE__WASTE_CONTAINER_OVERFLOW, false); WasteOverflowAlarmState = mWasteOverflowAlarmState; - } + }*/ #ifdef CONTROL_DEBUG tempq = HibernateRTCSSGet(); if (tempq < tempp) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index e489f78ff..2bdf1b17f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -892,7 +892,7 @@ uint32_t Adjust_Right_TFU_Tension(double tension) { PrepareWaitCount++; MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, GPI_LS_RDANCER_UP, Adjust_Right_TFU_Tension_Callback,15000); - Report("Adjust_Right_TFU_Tension",__FILE__,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,GPI_LS_RDANCER_UP,0); + Report("Adjust_Right_TFU_Tension",__FILE__,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,PrepareWaitCount,0); } } @@ -947,7 +947,6 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension) return status; else { - PrepareWaitCount++; if (current < request) //go down { direction = MotorsCfg[HW_Motor_Id].directionthreadwize; @@ -958,21 +957,23 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension) direction = 1-MotorsCfg[HW_Motor_Id].directionthreadwize; movement = current - request; } - MotorSetMaxSpeed (HW_Motor_Id, 500); + MotorSetMaxSpeed (HW_Motor_Id, 800); MotorMoveWithCallback (HW_Motor_Id, direction, (movement*MotorsCfg[HW_Motor_Id].microstep), ThreadPrepare_TensionCallback,20000); + PrepareWaitCount++; + ReportWithPackageFilter(ThreadFilter,"PrepareWaitCount",__FILE__,PrepareWaitCount,current,RpWarning,request,0); status |= MCU_E2PromProgram(address,request); } if (DancerId == HARDWARE_DANCER_TYPE__LeftDancer) { - usnprintf(Lenstr, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d", - DancerId,request,current,movement,direction,HW_Motor_Id,address); + usnprintf(Lenstr, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d call %d", + DancerId,request,current,movement,direction,HW_Motor_Id,address,PrepareWaitCount); ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,address,current,RpWarning,request,0); } else { - usnprintf(TMessage, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d", - DancerId,request,current,movement,direction,HW_Motor_Id,address); + usnprintf(TMessage, 100, "ThreadPrepare_Tension Dancer %d Request: %d Current %d movement %d dir %d motor %d address %d call %d", + DancerId,request,current,movement,direction,HW_Motor_Id,address,PrepareWaitCount); ReportWithPackageFilter(ThreadFilter,TMessage,__FILE__,address,current,RpWarning,request,0); } @@ -1010,12 +1011,13 @@ uint32_t ThreadPrepareState(void *JobDetails) EnableIntersegment = JobTicket->enableintersegment; IntersegmentLength = JobTicket->intersegmentlength; + PrepareWaitCount = 0; status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension); - ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,status,RpFatalError,(int)windertension,0); + ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpFatalError,(int)windertension,0); status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension); - ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,status,RpFatalError,(int)pullertension,0); + ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpFatalError,(int)pullertension,0); status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension); - ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,status,RpFatalError,(int)feedertension,0); + ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpFatalError,(int)feedertension,0); FirstCalcInJob = true; if(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].speedmaster == false) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 30e43fe99..815b153d1 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -592,7 +592,7 @@ uint32_t InitSequenceStartHeating(void) SetMachineReadyForHeating(true); HeadCard_Actuators_Relocate(); //SetMachineStatus(MACHINE_STATE__Ready); //prevent job while waiting for the cooler - + waste_seq_step1(); if (InitialHeating) { if (ProcessParamsInit() ==OK) -- cgit v1.3.1