From aeacbdabd448b2e7455e16460b996c8090731d9d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 15 Nov 2018 14:54:51 +0200 Subject: many logs. improve job handling and IDS. NEW WINDER ALGORITHM (Interrupts) --- .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 3b17cd5dd..e189e2639 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -42,7 +42,7 @@ uint32_t CurrentControlledSpeed[MAX_THREAD_MOTORS_NUM] = {0}; TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,HARDWARE_MOTOR_TYPE__MOTO_WINDER,HARDWARE_MOTOR_TYPE__MOTO_SCREW}; HardwareDancerType ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {FEEDER_DANCER,NUM_OF_DANCERS,POOLER_DANCER,WINDER_DANCER,NUM_OF_DANCERS}; -uint32_t ControlIdtoMotorId [MAX_THREAD_MOTORS_NUM] = {0xFF}; +uint32_t ControlIdtoMotorId [MAX_THREAD_MOTORS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF}; uint32_t SpeedControlId=0xFF; uint32_t PoolerSpeedControlId=0xFF; @@ -706,16 +706,20 @@ uint32_t ThreadPreSegmentState(void *JobDetails) return OK; } +int REPSegmentId = 0; void ThreadInterSegmentEnded(void) { + LOG_ERROR (REPSegmentId,"ThreadInterSegmentEnded"); PreSegmentReady(Module_Thread,ModuleDone); } void ThreadSegmentEnded(void) { + LOG_ERROR (REPSegmentId," ThreadSegmentState"); SegmentReady(Module_Thread,ModuleDone); } void ThreadDistanceToSpoolEnded(void) { + LOG_ERROR (REPSegmentId," ThreadDistanceToSpoolEnded"); DistanceToSpoolReady(Module_Thread,ModuleDone); } double seglength = 0.0; @@ -723,8 +727,10 @@ double seglength = 0.0; uint32_t ThreadSegmentState(void *JobDetails, int SegmentId) { JobTicket* JobTicket = JobDetails; + REPSegmentId = SegmentId; seglength = JobTicket->segments[SegmentId]->length; CurrentSegmentId = SegmentId; + LOG_ERROR (seglength," ThreadSegmentState"); ThreadUpdateProcessLength (seglength,(void *)ThreadSegmentEnded); return OK; } @@ -733,6 +739,7 @@ uint32_t ThreadSegmentState(void *JobDetails, int SegmentId) uint32_t ThreadDistanceToSpoolState(void ) { seglength = dryerbufferlength; + LOG_ERROR (seglength,"ThreadDistanceToSpoolState"); ThreadUpdateProcessLength (seglength,(void *)ThreadDistanceToSpoolEnded); return OK; } @@ -766,7 +773,10 @@ char Endstr[150]; { if (ControlIdtoMotorId[Motor_i] != 0xFF) { - RemoveControlCallback(ControlIdtoMotorId[Motor_i],ThreadControlCBFunction); + if(RemoveControlCallback(ControlIdtoMotorId[Motor_i],ThreadControlCBFunction) == OK) + ControlIdtoMotorId[Motor_i] == 0xFF; + else + LOG_ERROR (ControlIdtoMotorId[Motor_i],"Remove Control failed"); } MotorStop(ThreadMotorIdToMotorId[Motor_i],Hard_Hiz); } -- cgit v1.3.1 From 18999a12b60a4d1713c77f353bd662e3a8743ab5 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 18 Nov 2018 14:37:45 +0200 Subject: improved winder algorithm. some logs for heaters PID and for control debug --- .../Embedded_SW/Embedded/Drivers/Valves/Valve.c | 4 +- .../Embedded_SW/Embedded/Modules/General/process.c | 2 +- .../Embedded/Modules/Heaters/Heaters_print.c | 47 ++++--- .../Embedded/Modules/Thread/Thread_Winder.c | 139 ++++++++++----------- .../Embedded/Modules/Thread/Thread_print.c | 20 +-- 5 files changed, 107 insertions(+), 105 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c') diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 5ae8a5ad3..6c9255466 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -340,8 +340,8 @@ uint32_t Valve3WayCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //stop this control loop if (RemoveControlCallback(Valve3WayControlId[ValveId], Valve3WayCallBackFunction )==OK) Valve3WayControlId[ValveId] == 0xFF; - - //LOG_ERROR(Valve3WayControlId[ValveId], "Remove control callback"); + else + LOG_ERROR(ValveId, "Remove control callback"); //call the module callback if (Valve3WayModuleCallback[ValveId]) diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index 919a93148..1ab1365d0 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -158,7 +158,7 @@ void ProcessRequestFunc(MessageContainer* requestContainer) container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - REPORT_MSG (ProcessParams->dryerzone1temp,"Process Params Dryer"); + //REPORT_MSG (ProcessParams->dryerzone1temp,"Process Params Dryer"); if (status == 0) status = HandleProcessParameters(ProcessParams); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 0e4466d81..aa3d695de 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -341,21 +341,19 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) HeaterPIDConfig[HeaterId].m_SetParam = SetTemperatue*100;//need to update SetParams on presegment stage if (HeaterId >= MAX_AC_HEATERS) //DC Heaters { - ControlIdtoHeaterId [HeaterId] = AddControlCallback( DCHeaterControlCBFunction, /*eOneSecond*/eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),HeaterId2PT100Id[HeaterId],0); + if (ControlIdtoHeaterId [HeaterId] == 0xFF) + ControlIdtoHeaterId [HeaterId] = AddControlCallback( DCHeaterControlCBFunction, /*eOneSecond*/eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),HeaterId2PT100Id[HeaterId],0); DCInitialHeating[HeaterId] = true; HeaterReady[HeaterId] = false; } else if (HeaterId == HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature) //AC Heaters { -#ifdef DEMO_TEMPERATURE - ControlIdtoHeaterId [HeaterId] = AddControlCallback( HeaterControlCBFunction, eHundredMillisecond,DemoTemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature,0); - MainDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,DemoTemperatureSensorRead,(IfTypeHeaters*0x100+HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain),HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain,0); - SecondDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,DemoTemperatureSensorRead,(IfTypeHeaters*0x100+HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary),HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary,0); -#else - ControlIdtoHeaterId [HeaterId] = AddControlCallback( HeaterControlCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),DryerInternalPT100Id,0); - MainDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain),HeaterId2PT100Id[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain],0); - SecondDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary),HeaterId2PT100Id[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary],0); -#endif + if (ControlIdtoHeaterId [HeaterId] == 0xFF) + ControlIdtoHeaterId [HeaterId] = AddControlCallback( HeaterControlCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),DryerInternalPT100Id,0); + if (MainDryerHeaterMaxTempControl == 0xFF) + MainDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain),HeaterId2PT100Id[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain],0); + if (SecondDryerHeaterMaxTempControl == 0xFF) + SecondDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary),HeaterId2PT100Id[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary],0); InitialHeating = true; HeaterReady[HeaterId] = false; if (BlowerCfg.enabled == true) @@ -366,16 +364,6 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) } } -/* if (HeaterId == HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain) //Dryer Heaters - { - MainDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),HeaterId2PT100Id[HeaterId],0); - } - if (HeaterId == HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary) //Dryer Heaters - { - SecondDryerHeaterMaxTempControl = AddControlCallback( HeaterMaxTempCBFunction, eHundredMillisecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),HeaterId2PT100Id[HeaterId],0); - } -*/ - return OK; } bool HeaterCheckReady(void) @@ -481,11 +469,12 @@ uint32_t HeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) } return ERROR; } +char ACheatstr[100]; +int printindex=0; uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) { int index=MAX_HEATERS_NUM; - /*char str[100]; - uint8_t len = 0;*/ + uint8_t len = 0; if (IfIndex>>8 != IfTypeHeaters) { LOG_ERROR (IfIndex, "Wrong Interface type"); @@ -497,6 +486,7 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) LOG_ERROR (IfIndex, "Wrong Interface "); return 0xFFFFFFFF; } + if (printindex++>MAX_HEATERS_NUM)printindex=0; if (HeaterCmd[index].targettemperatue == 0) { DeActivateHeater(index); @@ -557,6 +547,11 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) //check only for the proportional band limits HeaterPIDConfig[index].m_calculatedError = PIDAlgorithmCalculation(HeaterPIDConfig[index].m_SetParam , HeaterPIDConfig[index].m_mesuredParam, &HeaterPIDConfig[index].m_params, &HeaterPIDConfig[index].m_preError, &HeaterPIDConfig[index].m_integral); + len = usnprintf(ACheatstr, 254, "ACD%d: Temp %d Integral %d Output %d ",index,(int)HeaterPIDConfig[index].m_mesuredParam ,(int)HeaterPIDConfig[index].m_integral,(int)HeaterPIDConfig[index].m_calculatedError); + // Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]); + // #warning PID is now only proportional (above) + if (printindex==index) + Report(ACheatstr,__FILE__,__LINE__,index,RpWarning,readValue, HeaterPIDConfig[index].m_calculatedError); HeaterRecalculateSharedHeatersParams(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } } @@ -574,13 +569,13 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) //float output[HARDWARE_PID_CONTROL_TYPE__MixerHeater][100]; //int Counter[HARDWARE_PID_CONTROL_TYPE__MixerHeater] = {0,0,0,0,0,0,0}; //char logmsg[HARDWARE_PID_CONTROL_TYPE__MixerHeater][254]; +char heatstr[100]; uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) { int index=MAX_HEATERS_NUM; int len; - /*char str[100]; - uint8_t len = 0;*/ + //uint8_t len = 0; if (IfIndex>>8 != IfTypeHeaters) { LOG_ERROR (IfIndex, "Wrong Interface type"); @@ -654,9 +649,11 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) // output[index][Counter[index]] = HeaterPIDConfig[index].m_calculatedError; // if (Counter[index]++ >=100) // Counter[index] = 0; - // len = usnprintf(logmsg[index], 254, "PID%d: Temp %d Integral %d Output %d ",index,(int)HeaterPIDConfig[index].m_mesuredParam ,(int)HeaterPIDConfig[index].m_integral,(int)HeaterPIDConfig[index].m_calculatedError); + len = usnprintf(heatstr, 254, "PID%d: Temp %d Integral %d Output %d ",index,(int)HeaterPIDConfig[index].m_mesuredParam ,(int)HeaterPIDConfig[index].m_integral,(int)HeaterPIDConfig[index].m_calculatedError); // Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]); // #warning PID is now only proportional (above) + if (printindex==index) + Report(heatstr,__FILE__,__LINE__,index,RpWarning,readValue, HeaterPIDConfig[index].m_calculatedError); HeaterRecalculateHeaterParams(index, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 305c0e767..0c4a3b80a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -28,19 +28,22 @@ bool Winder_ScrewHoming = false; +#define MAX_WINDER_SPEED_CALCULATION 100 uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag); uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue); bool ScrewCurrentDirection = false; //holds current screw direction -bool BusyfirstCall = true; //Ignores first call after activating the screw - too early +uint32_t ScrewDirectionChangeCounter = 1; //holds the current number of runs of the screw - will be used to build the cone +uint32_t CalculationDirectionChangeCounter = 1; //holds the current number of runs of the screw - will be used to build the cone +uint32_t WinderMotorSpeed[MAX_WINDER_SPEED_CALCULATION]; +uint8_t WinderMotorSpeedCounter=0; +uint32_t WinderMotorSpeedRollOver=0; double ScrewSpeed = 0; double ScrewRunningTime = 0; -bool ScrewDirection = false; +uint32_t ScrewNumberOfSteps = 0; //holds the current number of steps for the next screw run - will be used to build the cone bool SCREW_TimerActivated = false; //ScrewSpeed uint32_t ScrewControlId = 0xFF; -uint32_t ScrewNumberOfSteps = 0; //holds the current number of steps for the next screw run - will be used to build the cone -uint32_t DirectionChangeCounter = 0; //holds the current number of runs of the screw - will be used to build the cone InternalWinderConfigStruc InternalWinderCfg = {0}; void ScrewTimerInterruptInit(void); @@ -138,7 +141,6 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag) ScrewSpeed = 0; ScrewControlId = 0xFF; ScrewNumberOfSteps = 0; - DirectionChangeCounter = 0; REPORT_MSG(BusyFlag, "Winder_ScrewAtOffsetCallback"); PrepareReady(Module_Winder, ModuleDone); return OK; @@ -171,81 +173,68 @@ InternalWinderCfg.segmentoffsetpulses numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; */ -uint32_t CalculateNumberOfSteps (uint32_t Counter, bool direction) +uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { - uint32_t NumberOfSteps = InternalWinderCfg.segmentoffsetpulses;//*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; + uint32_t Steps,i,winderspeed=0; + double temp; + uint32_t WinderReferenceSpeed = OriginalMotorSpd_2PPS[WINDER_MOTOR]; float screw_horizontal_speed = 0; float RotationsPerSecond; - if (Counter%InternalWinderCfg.spoolbackingrate == 0) - { - NumberOfSteps -= (Counter/InternalWinderCfg.spoolbackingrate); - REPORT_MSG(ScrewNumberOfSteps, "Head Backing ScrewNumberOfSteps"); - ScrewNumberOfSteps--; - screw_horizontal_speed = ScrewNumberOfSteps / InternalWinderCfg.NumberOfRotationPerPassage; - // calculation input#2: number of rotations per second - (basically: speed/winder perimeter. later - according to winder actual speed - calculate according to winder position accumulation in the last second. - RotationsPerSecond = OriginalMotorSpd_2PPS[WINDER_MOTOR] / MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; - // calculation input#3: speed = rotation per second * traverse per rotation = traverse per second. speed set: traverse per second (mm) * pulses per mm. - ScrewSpeed = screw_horizontal_speed*RotationsPerSecond; + WinderMotorSpeed[WinderMotorSpeedCounter] = CurrentControlledSpeed[WINDER_MOTOR]; + if (WinderMotorSpeedCounter++>=MAX_WINDER_SPEED_CALCULATION) + { + WinderMotorSpeedCounter=0; + WinderMotorSpeedRollOver++; + } + + if (ScrewDirectionChangeCounter == CalculationDirectionChangeCounter) + return OK; - //MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed); - //REPORT_MSG(ScrewSpeed, "CalculateNumberOfSteps ScrewSpeed"); - //REPORT_MSG(CurrentControlledSpeed[WINDER_MOTOR], "CalculateNumberOfSteps Winder speed"); - CurrentControlledSpeed[SCREW_MOTOR] = ScrewSpeed; + ScrewCurrentDirection = 1-ScrewCurrentDirection; + CalculationDirectionChangeCounter++; - } - if ((Counter%InternalWinderCfg.SpoolBottomBackingRate == 0)||(Counter%InternalWinderCfg.SpoolBottomBackingRate == 1)) + if (ScrewCurrentDirection == 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize) //next time going out + { + if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.spoolbackingrate == 0) { - if (direction == MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize)//because the direction is already reversed at the interrupt - { - NumberOfSteps += (Counter/InternalWinderCfg.SpoolBottomBackingRate); - ScrewNumberOfSteps++; - REPORT_MSG(ScrewNumberOfSteps, "Bottom Backing ScrewNumberOfSteps"); - } + ScrewNumberOfSteps--; + REPORT_MSG(ScrewNumberOfSteps, "Head Backing ScrewNumberOfSteps"); } - return NumberOfSteps; - -} -uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag) -{ - uint32_t Steps; - double temp; - if (BusyfirstCall) - { - BusyfirstCall = false; - DirectionChangeCounter++; - return OK; } - //ScrewCurrentDirection: false moves out, true moves home - if (BusyFlag == NOTBUSY) + else //next time going back { - CalculateNumberOfSteps (DirectionChangeCounter++, ScrewCurrentDirection); - Steps = ScrewNumberOfSteps; -/* if (FPGA_Read_limit_Switches(GPI_LS_SCREW_RIGHT)==LIMIT) + if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.SpoolBottomBackingRate == 0) { - ScrewCurrentDirection = (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize); - Steps += InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; - REPORT_MSG(LIMIT, "Winder at right limit"); + ScrewNumberOfSteps++; + REPORT_MSG(ScrewNumberOfSteps, "Bottom Backing ScrewNumberOfSteps"); } - else if (FPGA_Read_limit_Switches(GPI_LS_SCREW_LEFT)==LIMIT) + } + if (WinderMotorSpeedRollOver) + { + for (i=0;i Date: Mon, 19 Nov 2018 10:59:09 +0200 Subject: Version 1.1.4.3: Cart goes to the edge at job end to enable spool change --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 22 +++++++++++----------- .../Embedded/Modules/Thread/Thread_Winder.c | 5 +++-- .../Embedded/Modules/Thread/Thread_print.c | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c') 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 6dd23d8b9..5faf7fbe4 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 = {001,001,004,002}; +TangoVersion_t _gTangoVersion = {001,001,004,003}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index eb371a4de..53f850352 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -116,22 +116,22 @@ AlarmHandlingItem AlarmItem[MAX_SYSTEM_ALARMS]={ {eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmLow_6,false,true,DEBUG_LOG_CATEGORY__Warning,5,0,0,false,EVENT_TYPE__Dispenser6LowLevel,NULL,"Dispenser6LowLevel"}, {eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmLow_7,false,true,DEBUG_LOG_CATEGORY__Warning,6,0,0,false,EVENT_TYPE__Dispenser7LowLevel,NULL,"Dispenser7LowLevel"}, {eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmLow_8,false,true,DEBUG_LOG_CATEGORY__Warning,7,0,0,false,EVENT_TYPE__Dispenser8LowLevel,NULL,"Dispenser8LowLevel"},*/ -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP3,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"Mixer Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP3,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"Mixer Over Temperature"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"GeneralInternal Over Temperature"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP2,80,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"GeneralInternal Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead1OverTemperature,NULL,"DyeingHead1 Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead2OverTemperature,NULL,"DyeingHead2 Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead3OverTemperature,NULL,"DyeingHead3 Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead4OverTemperature,NULL,"DyeingHead4 Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead5OverTemperature,NULL,"DyeingHead5 Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead6OverTemperature,NULL,"DyeingHead6 Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead1OverTemperature,NULL,"DyeingHead1 Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead2OverTemperature,NULL,"DyeingHead2 Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead3OverTemperature,NULL,"DyeingHead3 Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead4OverTemperature,NULL,"DyeingHead4 Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead5OverTemperature,NULL,"DyeingHead5 Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead6OverTemperature,NULL,"DyeingHead6 Over Temperature"}, {eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP2,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP3,300,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, -/*{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP3,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"Mixer PT100 Not Working"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, +{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,300,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, +//{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP3,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"Mixer PT100 Not Working"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalPT100 Not Working,NULL,"GeneralInternalPT100 Not Working"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP2,80,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalPT100 Not Working,NULL,"GeneralInternalPT100 Not Working"}, -{eOneSecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead1OverTemperature,NULL,"DyeingHead 1 PT100 Not Working"}, +/*{eOneSecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead1OverTemperature,NULL,"DyeingHead 1 PT100 Not Working"}, {eOneSecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead2OverTemperature,NULL,"DyeingHead 2 PT100 Not Working"}, {eOneSecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead3OverTemperature,NULL,"DyeingHead 3 PT100 Not Working"}, {eOneSecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead4OverTemperature,NULL,"DyeingHead 4 PT100 Not Working"}, diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 0c4a3b80a..fd577311e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -309,7 +309,6 @@ uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId) } uint32_t Winder_End(void) { - int pend; //stop screw ScrewNumberOfSteps = 0; if (ScrewControlId != 0xFF) @@ -319,8 +318,10 @@ uint32_t Winder_End(void) } CurrentControlledSpeed[SCREW_MOTOR] = 0; ScrewsStopControlTimer(); + //move the cart to the edge so the spool can be easily replaced + MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, 1000, GPI_LS_SCREW_RIGHT, NULL); - return MotorStop (HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); + return OK; } void Winder_ScrewHomeLimitSwitchInterrupt(void) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index ea86c2892..5390ed0a7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -775,7 +775,7 @@ char Endstr[150]; PoolerSpeedControlId = 0xFF; } - for ( Motor_i = 0;Motor_i < MAX_THREAD_MOTORS_NUM;Motor_i++) + for ( Motor_i = 0;Motor_i <= WINDER_MOTOR;Motor_i++) { if (ControlIdtoMotorId[Motor_i] != 0xFF) { -- cgit v1.3.1