aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/IDS
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-08-25 10:08:01 +0300
committerAvi Levkovich <avi@twine-s.com>2020-08-25 10:08:01 +0300
commit338edba081dba2a2aefb634811be1cc84ec93d64 (patch)
tree0021538796c254a8eab8527e8461a2e831e68c1c /Software/Embedded_SW/Embedded/Modules/IDS
parent49ddda1cc22d6cbb72f499b37e5db32c95252dfa (diff)
downloadTango-338edba081dba2a2aefb634811be1cc84ec93d64.tar.gz
Tango-338edba081dba2a2aefb634811be1cc84ec93d64.zip
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/IDS')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c15
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c54
4 files changed, 59 insertions, 12 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c
index abfb5f229..09f5ae108 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c
@@ -123,6 +123,7 @@ uint32_t IDS_Cleaning_Spray_Cleaning_Solution (int dispenserSpeed,callback_fptr
Tdelay1 = LeftRockerSpeed%100;
Tdelay2 = RightRockerSpeed;
status = IDS_Dispenser_Start_Motor_and_Open_Valve(CLEANER_DISPENSER, dispenserSpeed, callback);
+ Init_CleaningStageCounter();
Report("IDS_Cleaning_Spray_Cleaning_Solution", __FILE__, __LINE__, CLEANER_DISPENSER, RpWarning, dispenserSpeed, 0);
Report("IDS_Cleaning parameters", __FILE__, Tup*100, Tdelay1*100, RpWarning, Tdelay2*100, 0);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h
index 831fa18cd..9973e4c7c 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h
@@ -49,6 +49,7 @@ extern bool ActuatorsCleaningSequence;
extern bool DispenserUsedInJob[MAX_SYSTEM_DISPENSERS];
extern int32_t CurrentDispenserSpeed[MAX_SYSTEM_DISPENSERS];
+extern bool DispenserLastMovementDown[MAX_SYSTEM_DISPENSERS];
bool IDS_MapDispenserUsedinJob(void *JobDetails);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
index 8dc12e615..14bb59661 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
@@ -296,6 +296,8 @@ uint32_t IDS_HomeDispenser (uint32_t DispenserId, uint32_t speed , callback_fptr
Report("IDS_HomeDispenser ",__FILE__,(int)(midTankContent*1000),(int)DispenserId,RpWarning,speed,0);
}
CurrentDispenserSpeed[DispenserId] = (-1*CurrentDispenserSpeed[DispenserId]);
+ DispenserLastMovementDown[DispenserId] = true;
+
return OK;
}
return ERROR;
@@ -531,15 +533,24 @@ uint32_t IDS_Check_Pressure_Callback(uint32_t DispenserId, uint32_t ReadValue)
if (GetDispenserPressure(DispenserId)>3.0)
{
- Report("Pulling dispenser down to reduce pressure",__FILE__,DispenserId,(int)(GetDispenserPressure(DispenserId)*100),RpWarning,200,0);
+ //10/8/2020 pulling down 2000 steps
+ Report("Pulling dispenser down to reduce pressure",__FILE__,DispenserId,(int)(GetDispenserPressure(DispenserId)*100),RpWarning,2000,0);
if ((HomingActive[DispenserId] == true)||(PrimingActive[DispenserId] == true))
{
Report("Dispenser in pressure but homing active",__FILE__,DispenserId,(int)HomingActive[DispenserId],RpWarning,PrimingActive[DispenserId],0);
LOG_ERROR(DispenserId,"IDS_Check_Pressure_Callback homing active");
return ERROR;
}
- MotorMove(HW_Motor_Id,1-MotorsCfg[HW_Motor_Id].directionthreadwize,200*MotorsCfg[HW_Motor_Id].microstep);
+ MotorMove(HW_Motor_Id,1-MotorsCfg[HW_Motor_Id].directionthreadwize,2000*MotorsCfg[HW_Motor_Id].microstep);
AddControlCallback("IDS_ReCheck_Pressure", IDS_ReCheck_Pressure_Callback, eOneSecond*4,TemplateDataReadCBFunction ,DispenserId, 0, 0 );
+ if (GetDispenserPressure(DispenserId)>5.5)
+ {
+ //stop job on pressure rise above 5.5 bar
+ IDS_Dispenser_Alarm_On(DispenserId);
+ //open valve toward mixer on pressure rise above 5.5 bar
+ Task_sleep(100);
+ Control3WayValvesWithCallback ((Valves_t)DispenserId, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer
+ }
}
return OK;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index 3f30e755a..9c82cb1bf 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -452,6 +452,9 @@ c. Go to step 2.a x Segment.BrushStopsCount.
uint32_t DispenserPrepareControlId = 0xFF;
int NumOfActiveDispensers = 0;
int DispenserBuildTimeCounter = 0;
+#define DISPENSER_UP_MOVEMENT
+ int DispenserTotalPrepareSteps[MAX_SYSTEM_DISPENSERS];
+ bool DispenserLastMovementDown[MAX_SYSTEM_DISPENSERS];
#define PRESSURE_READ_TIME_GAP 100
uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
{
@@ -508,6 +511,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
return OK; // all configured heaters are ready
}
char IdsMessage[100];
+ char IdMessage[100];
int SegmentPrepareWFCFCounter = 0;
bool pressureReady = false,endOfPrepareWCF = false;
//********************************************************************************************************************
@@ -532,6 +536,11 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
{
if (DispenserBuildTimeCounter<(2*eOneSecond))
{
+ for (i = 0; i < MAX_DYE_DISPENSERS; i++)
+ {
+ DispenserTotalPrepareSteps[i]+=(CurrentDispenserSpeed[i]*PRESSURE_READ_TIME_GAP/eOneSecond);
+ DispenserLastMovementDown[i] = false;
+ }
//REPORT_MSG(DispenserBuildTimeCounter,"waiting 2 seconds for pressure changes");
return OK;
}
@@ -541,10 +550,18 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
//IDS_StopHomeDispenser(i);
if (DispenserUsedInJob[i] == true) //we actually should check for all dispensers
{
+ DispenserTotalPrepareSteps[i]+=(CurrentDispenserSpeed[i]*PRESSURE_READ_TIME_GAP/eOneSecond);
+
HW_Motor_Id = DispenserIdToMotorId[i];
if (GetDispenserPressure(i) > DispenserPreparePressure*1.05)
{
- NumofReadyDispensers++;
+#ifdef DISPENSER_UP_MOVEMENT
+ if (DispenserTotalPrepareSteps[i]>120000)
+#endif
+ {
+ NumofReadyDispensers++;
+ Report("Dispenser total prepare steps ready",__FILE__,DispenserTotalPrepareSteps[i],(int)(DispenserPreparePressure*100),RpWarning,IDS_Dispenser_Data[i].consumedinnanolitter,0);
+ }
if (Special_Dispensers == true)
{
MotorStop(HW_Motor_Id, Hard_Hiz);
@@ -582,8 +599,9 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
{
HW_Motor_Id = DispenserIdToMotorId[CLEANER_DISPENSER];
MotorStop(HW_Motor_Id, Hard_Hiz);
+ if (CurrentDispenserSpeed[CLEANER_DISPENSER])
+ Report("IDS stop cleaner",__FILE__,CLEANER_DISPENSER,(int)(GetDispenserPressure(CLEANER_DISPENSER)*100),RpWarning,(int)CurrentDispenserSpeed[CLEANER_DISPENSER] ,0);
CurrentDispenserSpeed[CLEANER_DISPENSER] = 0;
- //Report("IDS stop cleaner",__FILE__,CLEANER_DISPENSER,(int)(GetDispenserPressure(CLEANER_DISPENSER)*100),RpWarning,(int)CurrentDispenserSpeed[CLEANER_DISPENSER] ,0);
}
if ((NumofReadyDispensers)&&(DispenserBuildTimeCounter%1000 == 0))
@@ -599,7 +617,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
{
DispenserBuildTimeCounter = 0;
pressureReady = true;
- Report("pressureReady = true or timeout;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0);
+ Report("pressureReady = true or timeout;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)(DispenserPreparePressure*100),0);
}
}
else if (endOfPrepareWCF == false)
@@ -641,7 +659,6 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
}
if (segmentfirst_speed > MINIMAL_MOTOR_SPEED)
{
- char IdMessage[100];
segmentfirst_speed *= (100+WFCF);
segmentfirst_speed /= 100;
DispenserSegmentReady[DispenserId] = false;
@@ -730,7 +747,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
JobTicket* JobTicket = JobDetails;
JobEndSequence = false;
- if ((pressurebuildup>0.1)&&(pressurebuildup<2.5))
+ if ((pressurebuildup>0.1)&&(pressurebuildup<4.0))
{
Report("Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0);
DispenserPreparePressure = pressurebuildup;
@@ -742,7 +759,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
}
if ((cleanerFlow>200)&&(cleanerFlow<1150))
{
- Report("Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(cleanerFlow),RpWarning,(int)CleaningDispenserSpeed,0);
+ Report("Setting cleanerFlow from RML cleanerFlow",__FILE__,__LINE__,(int)(cleanerFlow),RpWarning,(int)CleaningDispenserSpeed,0);
CleaningDispenserSpeed = cleanerFlow;
}
else if (cleanerFlow <= 10)
@@ -813,6 +830,8 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue)
Report("Stop active dispenser homing ",__FILE__,i,HomingActive[i],RpWarning,CurrentDispenserSpeed[i],0);
IDS_StopHomeDispenser(i);
}
+ DispenserTotalPrepareSteps[i] = 0;
+ Report("Dispenser total prepare steps zero",__FILE__,i,DispenserTotalPrepareSteps[i],RpWarning,IDS_Dispenser_Data[i].consumedinnanolitter,0);
}
else
{
@@ -1220,8 +1239,11 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId)
uint32_t status = OK;
JobDescriptionFileBrushStop * tFileBrushStop;
int Brush_i;
+ Task_Stat statbuf;
//check and close previous segment
+ RemoveControlCallback(BrushStopControlId,IDSBrushStopRestartCallback);
+ BrushStopControlId = 0xFF;
if (PrevSegment)
{
if (JobBrushStopId<PrevSegment->brushstopscount) //we did not finish reading the brushstops of the previous segment
@@ -1229,7 +1251,7 @@ 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_i<PrevSegment->brushstopscount;Brush_i++) #bug 3348 - unhandled jobstops stops too soon
- for (Brush_i=JobBrushStopId;Brush_i<=PrevSegment->brushstopscount;Brush_i++)
+ for (Brush_i=JobBrushStopId;Brush_i<PrevSegment->brushstopscount;Brush_i++)
{
if (status == ERROR)
break;
@@ -1241,13 +1263,19 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId)
}
else
{
+ Task_stat(Task_self(),&statbuf);
+ Report("Unhandled BrushStopRead Error",__FILE__,statbuf.used,(int)statbuf.stackSize,RpWarning,(int)statbuf.stackHeap,0);
+ //JobEndReason = JOB_OUT_OF_DYE;
+ //SegmentReady(Module_IDS,ModuleFail);
+ Report("Unhandled brushstops ERROR",__FILE__,__LINE__,(int)tFileBrushStop,RpWarning,(int)PrevSegment->brushstopscount,0);
status = ERROR;
break;
}
}//for brushstops
}
}
- return status;
+ Report("Unhandled brushstops result",__FILE__,__LINE__,(int)Brush_i,RpWarning,(int)PrevSegment->brushstopscount,0);
+ return OK;
}
uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId)
{
@@ -1525,7 +1553,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue)
Task_Stat statbuf;
if(BrushStopStartTime+BrushStopLength+100 < msec_millisecondCounter )
{
- Report("!!!!!!!!!!!!Overtime!",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0);
+ Report("!!!!!!!!!!!!Overtime!",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0);
}
if(++BrushStopCounter < BrushStopTime)
@@ -1535,6 +1563,11 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue)
BrushStopCounter = 0;
BrushStopStartTime = msec_millisecondCounter;
+ if (BrushStopControlId == 0xFF)
+ {
+ Report("!!!BrushStopControlId = 0xFF",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0);
+ return OK;
+ }
if (JobEndSequence == true)
{
@@ -1563,7 +1596,8 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue)
}
else
{
- LOG_ERROR(FileBrushStop,"BrushStopReadError");
+ Task_stat(Task_self(),&statbuf);
+ Report("BrushStopRead Error",__FILE__,statbuf.used,(int)statbuf.stackSize,RpWarning,(int)statbuf.stackHeap,0);
JobEndReason = JOB_OUT_OF_DYE;
SegmentReady(Module_IDS,ModuleFail);
}