aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/IDS
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-10-31 10:16:10 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-10-31 10:16:10 +0200
commitcd18fb27a2499072f18cb0320ddeb85a0500a93e (patch)
treeb1bf1984813bc70ea4784e0e956497fd4fd35805 /Software/Embedded_SW/Embedded/Modules/IDS
parent4aca8247565596d6c12ba73242d599dc42887625 (diff)
downloadTango-cd18fb27a2499072f18cb0320ddeb85a0500a93e.tar.gz
Tango-cd18fb27a2499072f18cb0320ddeb85a0500a93e.zip
version 1.4.6.0 - going forward
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/IDS')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c12
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c12
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c10
4 files changed, 23 insertions, 12 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h
index a919ce4e1..3e2cf6ecb 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h
@@ -15,6 +15,7 @@ extern uint32_t DispenserPrepareTimeLag ;
extern int32_t CurrentDispenserSpeed[MAX_SYSTEM_DISPENSERS];
extern uint32_t DispenserIdToMotorId[MAX_SYSTEM_DISPENSERS];
+extern bool JobStartStopBackLash[MAX_SYSTEM_DISPENSERS];
extern float DispenserPressure[MAX_SYSTEM_DISPENSERS];
uint32_t DispenserConfigMessage(HardwareDispenser * request);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c
index b9ab97714..9c15885fc 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c
@@ -111,7 +111,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
{
Report("Cannot Add control callback",__FILE__,(int)DispenserId,GetControlCallbackFuncPtr(DispenserControlId[DispenserId]),RpWarning,(int)DispenserControlId[DispenserId],0);
}
- DispenserControlId[DispenserId] = AddControlCallback( IDS_Dispenser_Build_Pressure_Callback, DispenserPrepareTimeLag,TemplateDataReadCBFunction ,DispenserId, DispenserId, 0 );
+ DispenserControlId[DispenserId] = AddControlCallback(NULL, IDS_Dispenser_Build_Pressure_Callback, DispenserPrepareTimeLag,TemplateDataReadCBFunction ,DispenserId, DispenserId, 0 );
if (DispenserControlId[DispenserId] == 0xFF)
Report("Add control callback failed",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)DispenserControlId[DispenserId],0);
else
@@ -156,7 +156,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
if (DispenserControlId[DispenserId] != 0xFF)
Report("Cannot Add control callback",__FILE__,(int)DispenserId,GetControlCallbackFuncPtr(DispenserControlId[DispenserId]),RpWarning,(int)DispenserControlId[DispenserId],0);
- DispenserControlId[DispenserId] = AddControlCallback( IDS_Dispenser_StopMotorCallback, CloseValveTimeout, TemplateDataReadCBFunction,DispenserId, DispenserId, 0 );
+ DispenserControlId[DispenserId] = AddControlCallback(NULL, IDS_Dispenser_StopMotorCallback, CloseValveTimeout, TemplateDataReadCBFunction,DispenserId, DispenserId, 0 );
if (DispenserControlId[DispenserId] == 0xFF)
Report("Add control callback failed",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)DispenserControlId[DispenserId],0);
else
@@ -207,7 +207,7 @@ uint32_t IDS_Dispenser_Start_Motor_and_Open_Valve(int DispenserId, int MotorSpee
Report("Cannot Add control callback",__FILE__,(int)DispenserId,GetControlCallbackFuncPtr(DispenserControlId[DispenserId]),RpWarning,(int)DispenserControlId[DispenserId],0);
//Report("IDS_Dispenser_Start_Motor_and_Open_Valve",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)msec_millisecondCounter,0);
- DispenserControlId[DispenserId] = AddControlCallback( IDS_Dispenser_OpenValveCallback, OpenValveTimeout, TemplateDataReadCBFunction,DispenserId, DispenserId, 0 );
+ DispenserControlId[DispenserId] = AddControlCallback(NULL, IDS_Dispenser_OpenValveCallback, OpenValveTimeout, TemplateDataReadCBFunction,DispenserId, DispenserId, 0 );
if (DispenserControlId[DispenserId] == 0xFF)
Report("Add control callback failed",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)DispenserControlId[DispenserId],0);
//else
@@ -235,6 +235,12 @@ void IDS_Dispenser_Content_Init (void)
HW_Motor_Id = DispenserIdToMotorId[i];
dispenser_running_data__init(&IDS_Dispenser_Data[i]);
dispenserdata[i] = &IDS_Dispenser_Data[i];
+ IDS_Dispenser_Data[i].has_consumedinnanolitter = true;
+ IDS_Dispenser_Data[i].has_direction = true;
+ IDS_Dispenser_Data[i].has_microsteps = true;
+ IDS_Dispenser_Data[i].has_nanolitterperpulse = true;
+ IDS_Dispenser_Data[i].has_numberofrefills = true;
+ IDS_Dispenser_Data[i].has_totalconsumedinnanolitter = true;
IDS_Dispenser_Data[i].nanolitterperpulse = DEFAULT_NANOLITER_PER_PULSE;
IDS_Dispenser_Data[i].microsteps = MotorsCfg[HW_Motor_Id].microstep;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
index 1302d262a..f3528d4c8 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
@@ -136,7 +136,7 @@ uint32_t IDS_HomeDispenserWaitForHomingEnd(uint32_t DispenserId, uint32_t timeo
DispenserBacklashControlId[DispenserId] = 0xFF;
//return ERROR;
}
- DispenserBacklashControlId[DispenserId] = AddControlCallback( IDS_HomeDispenserWaitForHomingEnd,eOneSecond , TemplateDataReadCBFunction,DispenserId,0, 0 );
+ DispenserBacklashControlId[DispenserId] = AddControlCallback(NULL, IDS_HomeDispenserWaitForHomingEnd,eOneSecond , TemplateDataReadCBFunction,DispenserId,0, 0 );
if ( DispenserBacklashControlId[DispenserId] == 0xFF)
return ERROR;
@@ -146,7 +146,7 @@ uint32_t IDS_HomeDispenserWaitForHomingEnd(uint32_t DispenserId, uint32_t timeo
uint32_t IDS_HomeDispenserBackMoveCallback(uint32_t motorId, uint32_t ReadValue)
{
uint8_t DispenserId = motorId-HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1;
- if ((GetDispenserPressure(DispenserId)>=InitialDispenserPressure)||(DispenserHomingTime[DispenserId]>InitialDispenserTimeout))
+ if ((GetDispenserPressure(DispenserId)>=InitialDispenserPressure)||(DispenserHomingTime[DispenserId]>InitialDispenserTimeout)||(JobStartStopBackLash[DispenserId] == true))
{
MotorStop(motorId,Hard_Hiz);
CurrentDispenserSpeed[DispenserId] = 0;
@@ -161,6 +161,8 @@ uint32_t IDS_HomeDispenserBackMoveCallback(uint32_t motorId, uint32_t ReadValue)
Valve_Set(IDS_Id_to_AirValve[DispenserId], Atm_MidTank_OFF);
Disable_MidTank_Pressure_Reading(DispenserId);
+ if (JobStartStopBackLash[DispenserId] == true)
+ JobStartStopBackLash[DispenserId] = false;
Report("End backlash",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0);
if (SafeRemoveControlCallback(DispenserHomingControlId[DispenserId], IDS_HomeDispenserBackMoveCallback )==OK)
DispenserHomingControlId[DispenserId] = 0xFF;
@@ -191,7 +193,7 @@ uint32_t IDS_HomeDispenserCallback(uint32_t motorId, uint32_t ReadValue)
// HomingActive[DispenserId]= false;
IDS_Dispenser_RefillEnded ( DispenserId, MotorsCfg[motorId].microstep);
Report("Start backlash",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0);
- DispenserHomingControlId[DispenserId] = AddControlCallback( IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 );
+ DispenserHomingControlId[DispenserId] = AddControlCallback(NULL, IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 );
MotorSetDirection(motorId,MotorsCfg[motorId].directionthreadwize);
Task_sleep(10);
MotorSetSpeed(motorId, InitialDispenserSpeed);
@@ -213,7 +215,7 @@ uint32_t IDS_HomeDispenser (uint32_t DispenserId, uint32_t speed , callback_fptr
}
if (Get_MidTank_Pressure_Sensor(DispenserId)<0.2)
{
- Report("IDS_HomeDispenser - Midtank is empty",__FILE__,Get_MidTank_Int100_Sensor(DispenserId),(int)DispenserId,RpWarning,LIMIT,0);
+ Report("IDS_HomeDispenser - Midtank is empty",__FILE__,Get_MidTank_Int1000_Sensor(DispenserId),(int)DispenserId,RpWarning,LIMIT,0);
return ERROR;
}
//if Safety is active
@@ -363,7 +365,7 @@ uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId)
}
// HomingActive[DispenserId]= false;
Report("Start backlash",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0);
- DispenserHomingControlId[DispenserId] = AddControlCallback( IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 );
+ DispenserHomingControlId[DispenserId] = AddControlCallback("DispenserBackLash", IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 );
Task_sleep(10);
MotorSetDirection(motorId,MotorsCfg[motorId].directionthreadwize);
Task_sleep(10);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index 791b3c47b..1bab2c65d 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -55,6 +55,7 @@ uint32_t IDS_Valve_DistanceToSpoolReady(uint32_t deviceID, uint32_t ReadValue);
uint32_t IDS_Valve_PresegmentReady(uint32_t deviceID, uint32_t ReadValue);
uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue);
//bool IDS_isDispenserUsedNextSegment(void *JobDetails,int DispenserId, int SegmentId);
+bool JobStartStopBackLash[MAX_SYSTEM_DISPENSERS] = {false,false,false,false,false,false,false,false};
/******************** GLOBAL PARAMETERS ********************************************/
DispenserControlConfig_t DispenserControlConfig[MAX_SYSTEM_DISPENSERS];
uint32_t ControlIdtoDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
@@ -549,6 +550,7 @@ c. Go to step 2.a x Segment.BrushStopsCount.
if (DispenserUsedInJob[i] == true) //we actually should check for all dispensers
{
IDS_StopHomeDispenser(i);
+ JobStartStopBackLash[i] = true;
NumOfActiveDispensers++;
}
else
@@ -585,7 +587,7 @@ c. Go to step 2.a x Segment.BrushStopsCount.
}
}
DispenserBuildTimeCounter = 0;
- DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, PRESSURE_READ_TIME_GAP,TemplateDataReadCBFunction ,0, 0, 0 );
+ DispenserPrepareControlId = AddControlCallback(NULL, IDS_Prepare_Callback, PRESSURE_READ_TIME_GAP,TemplateDataReadCBFunction ,0, 0, 0 );
setRapidPressureRead(true);
}
@@ -978,7 +980,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId)
lInterSegmentLength = ((IntersegmentLength*100)*1000/dyeingspeed);
lInterSegmentLength-=(lInterSegmentLength%100); //round to a 100 multiplication
InterSegmentStepsCount = 0;
- DispenserPreSegmentControlId = AddControlCallback( IDSPreSegmentStateCallbackRunner, 100,TemplateDataReadCBFunction ,0, 0, 0 );
+ DispenserPreSegmentControlId = AddControlCallback(NULL,IDSPreSegmentStateCallbackRunner, 100,TemplateDataReadCBFunction ,0, 0, 0 );
if (DispenserPreSegmentControlId == 0xFF)
{
Report("Add control callback failed",__FILE__,__LINE__,(int)100,RpWarning,(int)0,0);
@@ -1256,7 +1258,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId)
JobBrushStopId++;
if ((BrushStopTime)&&(SegmentNumOfBrushStops > 1))
{
- BrushStopControlId = AddControlCallback( IDSBrushStopRestartCallback, BrushStopTime,TemplateDataReadCBFunction ,SegmentDetails, 0, 0 );
+ BrushStopControlId = AddControlCallback(NULL, IDSBrushStopRestartCallback, BrushStopTime,TemplateDataReadCBFunction ,SegmentDetails, 0, 0 );
if (BrushStopControlId == 0xFF)
{
Report("Add control callback failed",__FILE__,__LINE__,(int)BrushStopTime,RpWarning,(int)0,0);
@@ -1327,7 +1329,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId)
lInterSegmentLength = (dryerbufferCentimeters*1000/dyeingspeed);
lInterSegmentLength-=(lInterSegmentLength%100); //round to a 100 multiplication
InterSegmentStepsCount = 0;
- DispenserPreSegmentControlId = AddControlCallback( IDSPreSegmentStateCallbackRunner, 100,TemplateDataReadCBFunction ,0, 0, 0 );
+ DispenserPreSegmentControlId = AddControlCallback(NULL, IDSPreSegmentStateCallbackRunner, 100,TemplateDataReadCBFunction ,0, 0, 0 );
if (DispenserPreSegmentControlId == 0xFF)
{
Report("Add control callback failed",__FILE__,__LINE__,(int)100,RpWarning,(int)0,0);