aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-05-25 11:18:24 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-05-25 11:18:24 +0300
commit99c414b62fff1e60bcd2110c7ca0736648b36cd5 (patch)
tree60d25951160545287e7d804387d5dbee7ab9b116 /Software/Embedded_SW
parent2a0905a1f57519b0cd33594a3a7fcb3f5f860d74 (diff)
downloadTango-99c414b62fff1e60bcd2110c7ca0736648b36cd5.tar.gz
Tango-99c414b62fff1e60bcd2110c7ca0736648b36cd5.zip
fixes for thread loading, VOC and waste handling
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c18
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c6
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c9
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c8
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IFS/ifs.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c57
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c14
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c22
10 files changed, 97 insertions, 44 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c b/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c
index 86c030dc0..54e186b28 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c
@@ -51,7 +51,7 @@ static uint32_t idle_counter;
static long next_interval; /*by ticks*/
static bool first_time_after_init;
static int system_load;
-static int load;
+static int Load;
static int max_system_load;
static int max_load;
static uint32_t idle_load_table[101];
@@ -188,14 +188,14 @@ uint32_t unload_max_count=0;
calculate_system_load(current_load);
old_idle_counter = idle_counter;
time_interval = next_interval;
- load=current_load;
+ Load=current_load;
prev_load = current_load / 10;
- idle_load_table[load]++;
- if(load > max_load) max_load = load;
- //REPORT_MSG(load,"Real time load");
+ idle_load_table[Load]++;
+ if(Load > max_load) max_load = Load;
+ //REPORT_MSG(Load,"Real time load");
#ifdef DEBUG
- printf("c_ld=%d\n",load);
+ printf("c_ld=%d\n",Load);
#endif
}
}
@@ -239,7 +239,7 @@ static uint32_t number_of_load_samples;
first_time_after_init = FALSE;
system_load = current_load;
max_system_load = system_load;
- max_load = load;
+ max_load = Load;
number_of_load_samples = 1;
sum_of_previous_load = current_load;
}
@@ -299,7 +299,7 @@ extern int IDLE_TASK_get_load(void)
/***********************************************************/
extern int IDLE_TASK_get_current_load(void)
{
- return load;
+ return Load;
}
/***********************************************************/
@@ -320,7 +320,7 @@ extern int IDLE_TASK_get_load(void)
/***********************************************************/
/*export MN_uint32_t mn_get_curent_load(char *pParams)
{
- MN_printf("\n\rload=%d,max load=%d", load, max_load);
+ MN_printf("\n\rload=%d,max Load=%d", Load, max_load);
return(RET_OK);
}
*/
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c
index 78dc866da..27e2dd038 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c
@@ -682,8 +682,10 @@ bool waste_seq_cont_stop(void)
Report("------------ stop waste_seq_step1_cont -----------------", __FILE__, __LINE__, WasteControlId, RpMessage, 0, 0);
Trigger_SetWHS_VOC_Valve(CLOSE);
- RemoveControlCallback(WasteControlId, Trigger_ReadWHS_WasteContinouos );
- WasteControlId = 0xFF;
+ if (RemoveControlCallback(WasteControlId, Trigger_ReadWHS_WasteContinouos )==OK)
+ WasteControlId = 0xFF;
+ //else
+ // Report("Remove control callback failed",__FILE__,__LINE__,(int)WasteControlId,RpWarning,(int)waste_seq_step2,0);
return OK;
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
index 4fe623e5a..8b4445146 100644
--- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
+++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
@@ -990,13 +990,20 @@ unsigned int USBCDCD_sendData(const unsigned char *_pBuff,
unsigned int _length,
unsigned int _timeout)
{
+ int len = 0;
uint8_t size[4];
size[3] = (_length>>24) & 0xFF;
size[2] = (_length>>16) & 0xFF;
size[1] = (_length>>8) & 0xFF;
size[0] = _length & 0xFF;
- USBBufferWrite((tUSBBuffer *)&txBuffer, size, 4);
+ len = USBBufferWrite((tUSBBuffer *)&txBuffer, size, 4);
+ /*if (len == 0)
+ {
+ USBRingBufFlush(&(txBuffer.sPrivateData.sRingBuf));
+ len = USBBufferWrite((tUSBBuffer *)&txBuffer, size, 4);
+ }*/
+
return USBBufferWrite((tUSBBuffer *)&txBuffer, (uint8_t*)_pBuff, _length);
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h
index d0505e650..3ad399159 100644
--- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h
+++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h
@@ -41,6 +41,7 @@ typedef enum {
EEPROM_WASTE_TANK_ZERO_VALUE,
EEPROM_PULLER_TENSION_POSITION,
EEPROM_WINDER_TENSION_POSITION,
+ EEPROM_INIT_FAILURE_COUNTER,
MAX_EEPROM_STORAGE
}EEPROM_STORAGE_USAGE_ENUM;
#define MAX_SERIAL_NUM_LEN 5 //5*4 bytes
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index dfd01cef5..67a532e78 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -773,10 +773,6 @@ uint32_t MillisecLowLoop(uint32_t tick)
midtankDisplay = 1-midtankDisplay;
/*if (WHS_Type == WHS_TYPE_UNKNOWN)
Gas_PPM_Info = Calculate_Gas_Power_Consumption();*/
- if (WHS_Type == WHS_TYPE_NEW)
- {
- waste_seq_step1();// include 1Sec delay <- to open !!!!
- }
// ReportWithPackageFilter(ThreadFilter,"waste tank calculate level",__FILE__,__LINE__,(int)(GetWHSWasteTankLevelMiliLiter()*1000),RpWarning,(int) msec_millisecondCounter,0);
//Trigger_WHS_MAX11614_Read_allADC();
#ifdef CONTROL_DEBUG
@@ -793,6 +789,10 @@ uint32_t MillisecLowLoop(uint32_t tick)
PumpCounter = 0;
}
MidTankReading();
+ if (WHS_Type == WHS_TYPE_NEW)
+ {
+ waste_seq_step1();// include 1Sec delay <- to open !!!!
+ }
}
//ROM_IntMasterEnable();
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
index 6782a8ecb..49058c359 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
@@ -150,7 +150,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer)
direction = DRIER_LID_OPEN;
}
Report("MotorHomingRequestFunc Dryer lid open",__FILE__,MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].DriverType,DRIER_LID_OPEN,RpMessage,GPI_LS_DRYER_LID_OPEN,0);
- MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, GPI_LS_DRYER_LID_OPEN, MotorHomingRequestCallback,4000);
+ MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, GPI_LS_DRYER_LID_OPEN, MotorHomingRequestCallback,10000);
status = OK;
}
else
@@ -198,7 +198,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer)
direction = DRIER_LID_CLOSE;
}
Report("MotorHomingRequestFunc Dryer lid close",__FILE__,MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].DriverType,DRIER_LID_CLOSE,RpMessage,GPI_LS_DRYER_LID_CLOSED,0);
- MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, GPI_LS_DRYER_LID_CLOSED, MotorHomingRequestCallback,4000);
+ MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, GPI_LS_DRYER_LID_CLOSED, MotorHomingRequestCallback,10000);
status = OK;
}
else
diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
index 6c7bb087f..77c177fce 100644
--- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
+++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
@@ -60,7 +60,7 @@ void IFS_Init(void)
* @return bool ret OK = 0 , CartridgeFinished = 1
*/
#define CARTRIDGE_EMPTY_QUANTITY_LIMIT 10
-#define CARTRIDGE_EMPTY_CALCULATION_TIME 6
+#define CARTRIDGE_EMPTY_CALCULATION_TIME 12
bool DetectIfCartridgeFinished(int int_MidTank_Pressure_1000)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 19392c754..2ad58ea0a 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -108,7 +108,7 @@
float numberOfSteps = 0;
float numberOfCycles = 0;
double DrierPrevLocation = 0;
- FPGA_GPI_ENUM screw[2] = {GPI_LS_SCREW_LEFT,GPI_LS_SCREW_RIGHT};
+ FPGA_GPI_ENUM screw[2] = {GPI_LS_SCREW_RIGHT,GPI_LS_SCREW_LEFT};
int Screw_Dir = false;
bool InitCalled = false;
uint32_t LoadArmRounds;
@@ -326,10 +326,19 @@
MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,10000);
CallbackCounter++;
//MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000);
- MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, 0, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000);
+ int direction;
+ if (MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].DriverType == CombinrdMotDriver)//reverse direction for powerstep
+ {
+ direction = DRIER_LID_CLOSE;
+ }
+ else
+ {
+ direction = DRIER_LID_OPEN;
+ }
+ MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000);
Report("Thread_Load_Lift_actuators",__FILE__,__LINE__,LOW,RpMessage,false,0);
- Trigger_Head_Actuators_Control(ACTOT, LOW,false);
- Trigger_Head_Actuators_Control(ACTIN, LOW,false);
+ Trigger_Head_Actuators_Control(ACTOT, LOW,true);
+ Trigger_Head_Actuators_Control(ACTIN, LOW,true);
return OK;
}
uint32_t Thread_Load_Lift_Dancers(void)
@@ -450,10 +459,19 @@
MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 200, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,10000);
CallbackCounter++;
// MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].directionthreadwize, 200, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000);
- MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, 2, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000);
+ int direction;
+ if (MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].DriverType == CombinrdMotDriver)//reverse direction for powerstep
+ {
+ direction = DRIER_LID_OPEN;
+ }
+ else
+ {
+ direction = DRIER_LID_CLOSE;
+ }
+ MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000);
Report("Thread_Load_Close_actuators",__FILE__,__LINE__,LOW,RpMessage,true,0);
- Trigger_Head_Actuators_Control(ACTOT, LOW,true);
- Trigger_Head_Actuators_Control(ACTIN, LOW,true);
+ Trigger_Head_Actuators_Control(ACTOT, LOW,false);
+ Trigger_Head_Actuators_Control(ACTIN, LOW,false);
return OK;
}
uint32_t Thread_Load_Resume_Heating(void)
@@ -575,7 +593,7 @@
}
else
{
- MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Dryer_MovetoEncoderPosition_Callback,10000);
+ MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Dryer_MovetoEncoderPosition_Callback,30000);
MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles);
Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0);
}
@@ -652,7 +670,8 @@
MotorControlConfig[FEEDER_MOTOR].m_SetParam = 0;//need to update SetParams on presegment stage
MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize);
- MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius);
+ MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/6*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius);
+ //6 seconds per round
LoadingControlId = AddControlCallback(NULL,ThreadLoadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+FEEDER_MOTOR),FEEDER_DANCER,FEEDER_MOTOR);
Report("AddControlCallback feeder",__FILE__,__LINE__,LoadingControlId,RpMessage,IfTypeThread*0x100+FEEDER_MOTOR,0);
@@ -670,7 +689,7 @@
CallbackCounter++;
Report("Thread_Load_Dryer_Loading",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,
- numberOfSteps-400, Thread_Load_Dryer_Loading_Callback, 10000);
+ numberOfSteps-800, Thread_Load_Dryer_Loading_Callback, 10000);
return OK;
}
uint32_t Thread_Load_Jog_ThreadStop(uint32_t index, uint32_t ReadValue)
@@ -767,11 +786,11 @@
if (numberOfCycles<LoadArmRounds)
{
MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,
- numberOfSteps, Thread_Load_Dryer_UnLoading_Callback, 30000);
+ numberOfSteps, Thread_Load_Dryer_UnLoading_Callback, 10000);
}
else //done enough cycles, go to the center point
{
- MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,10000);
+ MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,30000);
MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles);
Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0);
}
@@ -890,15 +909,19 @@
else
{
MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&LoadArmRounds);
+ if (LoadArmRounds == 0) //prev trial stopped
+ {
+ LoadArmRounds = (int)dryerbufferlength;
+ }
}
MCU_E2PromRead(EEPROM_STORAGE_DRYER_CENTER,&temp);
DrierPrevLocation = temp;
Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,UnloadingStart,DrierPrevLocation,RpMessage, LoadArmRounds,0);
- MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius);
+ MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/6*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius);
// status |= MotorMoveToStopper(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize),
// MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4, Thread_Load_Set_Load_Arm_To_Stopper_Callback,0,1000);
MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,
- numberOfSteps-400, Thread_Load_Dryer_UnLoading_Callback, 30000);
+ numberOfSteps-800, Thread_Load_Dryer_UnLoading_Callback, 10000);
Screw_Dir = 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize;
@@ -1204,15 +1227,15 @@ bool ThreadLoaded(void)
ReadValue = Control_Read_Dancer_Position(FEEDER_DANCER,0);
FeederValue = ReadValue - DancersCfg[FEEDER_DANCER].zeropoint;
- Report("Feeder out",__FILE__,FeederValue,ReadValue,RpWarning,(int)DancersCfg[FEEDER_DANCER].zeropoint,0);
+ Report("Feeder out",__FILE__,abs(FeederValue),ReadValue,RpWarning,(int)DancersCfg[FEEDER_DANCER].zeropoint,0);
ReadValue = Control_Read_Dancer_Position(WINDER_DANCER,0);
WinderValue = ReadValue - DancersCfg[WINDER_DANCER].zeropoint;
- Report("Winder out",__FILE__,WinderValue,ReadValue,RpWarning,(int)DancersCfg[WINDER_DANCER].zeropoint,0);
+ Report("Winder out",__FILE__,abs(WinderValue),ReadValue,RpWarning,(int)DancersCfg[WINDER_DANCER].zeropoint,0);
ReadValue = Control_Read_Dancer_Position(POOLER_DANCER,0);
PoolerValue = ReadValue - DancersCfg[POOLER_DANCER].zeropoint;
//pooler dancer is right sided: data is opposite
PoolerValue = (-1*PoolerValue);
- Report("Puller out",__FILE__,PoolerValue,ReadValue,RpWarning,(int)DancersCfg[POOLER_DANCER].zeropoint,0);
+ Report("Puller out",__FILE__,abs(PoolerValue),ReadValue,RpWarning,(int)DancersCfg[POOLER_DANCER].zeropoint,0);
if (((PoolerValue)<(-1200))&&((WinderValue)<(-1200))&&((FeederValue)<(-1200)))
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c
index f011e8a1f..906a0d458 100644
--- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c
@@ -458,10 +458,10 @@ U8 CartridgeWasteFilling(bool status)
}
/* ------read waste tank sensors ----------- */
-#define WASTE_CARTRIDGE_SIZE 1.5
-#define WASTE_LEVEL_OVERFLOW 4.0
-#define WASTE_LEVEL_FULL 3.5
-#define WASTE_LEVEL_EMPTY 2.10
+#define WASTE_CARTRIDGE_SIZE 1500
+#define WASTE_LEVEL_OVERFLOW 4000
+#define WASTE_LEVEL_FULL 3500
+#define WASTE_LEVEL_EMPTY 2100
double WasteLevelOverflow = WASTE_LEVEL_OVERFLOW;
double WasteLevelFull = WASTE_LEVEL_FULL;
double WasteLevelEmpty = WASTE_LEVEL_EMPTY;
@@ -493,7 +493,7 @@ bool RdWasteTankEmptySensor()
bool RdWasteTankFullSensor()
{
double WasteLevel = 0.0;
- bool ret = notOK;
+ bool ret = SENSORnotFULL;
//WHS_Read_GPI_Registers();
//WHS_info.WHS_sensors.waste_tank_full_sensor = WHS_GPI_WCONTAINER_FULL();
//ret = WHS_info.WHS_sensors.waste_tank_full_sensor;
@@ -504,8 +504,8 @@ bool RdWasteTankFullSensor()
else //new WHS
{
WasteLevel = GetWHSWasteTankLevelMiliLiter();
- if (WasteLevel < WasteLevelFull)
- ret = OK;
+ if (WasteLevel >= WasteLevelFull)
+ ret = SENSORFULL;
}
return ret;
}
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
index 3511338e4..0891b1156 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
@@ -100,14 +100,24 @@ void StopInitSequence(void)
uint32_t InitSequenceCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
{
MACHINE_STATE_STAGES_ENUM status;
+ int InitFailures = 0;
if (SafeRemoveControlCallback(HWControlId, InitSequenceCallBackFunction )==OK)
HWControlId = 0xFF;
else
Report("Remove control callback failed",__FILE__,__LINE__,(int)HWControlId,RpWarning,(int)InitSequenceCallBackFunction,0);
+ MCU_E2PromRead(EEPROM_INIT_FAILURE_COUNTER,&InitFailures);
+ if (InitFailures > 3)
+ {
+ Report("HWConfigurationInit repeated failure",__FILE__,__LINE__,(int)InitFailures,RpWarning,(int)EEPROM_INIT_FAILURE_COUNTER,0);
+ SetMachineState(status);
+ AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_HW_CONFIG_FAILED,ON);
+ SetMachineStatus(MACHINE_STATE__Error);
+ return ERROR;
+ }
status = (MACHINE_STATE_STAGES_ENUM)HWConfigurationInit();
if (status == OK)
{
- ActivateHeadMagnet();
+ //ActivateHeadMagnet();
InitStages++;
//InitSequenceStateMachine(InitStages);
}
@@ -158,6 +168,7 @@ void InitSequenceBuiltInTestCallBack(uint32_t IfIndex, uint32_t BusyFlag)
InitStages++;
//InitSequenceStateMachine(InitStages);
AlarmHandlingSetAlarm(EVENT_TYPE__POWER_UP_BIT_FAILURE,false);
+ MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,0);
}
else
{
@@ -227,6 +238,8 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
WHS_Set_SetPoint_Q_value(headairflow/2);
AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation
+ waste_seq_step1();// include 1Sec delay <- to open !!!!
+
Safety_Init();
InitStages++;
//InitSequenceStateMachine(InitStages);
@@ -422,6 +435,13 @@ uint32_t InitSequenceInitialBlowerActivation(void)
ReportWithPackageFilter(InitFilter,"store initial orifice 3 value", __FILE__,EEPROM_ORIFICE3_ZERO_VALUE,total3, RpMessage, ZeroValue, 0);
WHS_MAX11614_Load_OrificeZeroValue(total1,total3);
}
+ else
+ {
+ MCU_E2PromRead(EEPROM_ORIFICE1_ZERO_VALUE,&total1);
+ MCU_E2PromRead(EEPROM_ORIFICE3_ZERO_VALUE,&total3);
+ ReportWithPackageFilter(InitFilter,"load initial values from EEPROM", __FILE__,__LINE__,total3, RpMessage, total1, 0);
+ WHS_MAX11614_Load_OrificeZeroValue(total1,total3);
+ }
}
Voc_Sensor_Zero_Calibration();