aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c26
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c7
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c30
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c2
7 files changed, 52 insertions, 23 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
index 059b8fc4c..829261533 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -154,14 +154,14 @@ typedef enum
typedef struct
{
- uint16_t Frequency; //1/10/100/1000
+ //uint16_t Frequency; //1/10/100/1000
AlarmSourceType AlarmSource;
uint16_t DeviceId;
uint8_t ModuleDeviceId;
uint16_t AlarmValue;
bool AlarmDirection;
DebugLogCategory Severity;
- uint16_t Predecessor;
+ //uint16_t Predecessor;
uint8_t DebounceValue;
EventType EventType;
bool isPersistent;
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
index 7e1424b8a..0e235e043 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
@@ -481,17 +481,12 @@ uint32_t Diagnostics_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_
{
MessageContainer responseContainer;
MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT;
- uint32_t angle, temp = Read_Dryer_ENC_Position();
+ uint32_t temp = Read_Dryer_ENC_Position();
+ int angle;
- angle = Calculate_Arm_Distance(D_DrierPrevLocation,temp);
+ angle = Calculate_Arm_Distance(Drier_Center_read,temp);
- if ((abs (angle)<14000 )||(BusyFlag == BUSY)) // OK - take another round
- {
- responseContainer.has_error = true;
- responseContainer.error = ERROR_CODE__GENERAL_ERROR;
-
- }
- ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Set_Load_Arm_To_Stopper time",__FILE__,__LINE__,msec_millisecondCounter,RpMessage,0,0);
+ ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Set_Load_Arm_To_Stopper time",__FILE__,__LINE__,msec_millisecondCounter,RpMessage,angle,0);
if (HomingControlId[deviceID] != 0xff)
{
ReportWithPackageFilter(DiagnosticsFilter,"MotorHomingProgressReport stopped",__FILE__,__LINE__,deviceID,RpMessage,HomingCounter[deviceID],0);
@@ -506,6 +501,11 @@ uint32_t Diagnostics_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_
responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size);
responseContainer.has_continuous = true;
responseContainer.continuous = true;
+ if (abs (angle)>20) // arm not at center position
+ {
+ responseContainer.has_error = true;
+ responseContainer.error = ERROR_CODE__GENERAL_ERROR;
+ }
uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
size_t container_size = message_container__pack(&responseContainer, container_buffer);
my_free(responseContainer.data.data);
@@ -556,7 +556,7 @@ uint32_t Diagnostics_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_
uint32_t Diagnostics_Dryer_UnLoading(void)
{
D_DrierPrevLocation = Read_Dryer_ENC_Position();
-
+ MCU_E2PromRead(EEPROM_STORAGE_DRYER_CENTER,&Drier_Center_read);
LoadingArmReset(Diagnostics_Set_Load_Arm_To_Stopper_Callback,300000);
/*uint32_t temp;
@@ -615,13 +615,14 @@ uint32_t Diagnostics_Dryer_MovetoEncoderPosition_Callback(uint32_t MotorId, uint
uint32_t Diagnostics_Dryer_Loading_Callback(uint32_t MotorId, uint32_t ReadValue)
{
D_numberOfCycles++;
- uint32_t angle, temp = Read_Dryer_ENC_Position();
+ int angle;
+ uint32_t temp = Read_Dryer_ENC_Position();
angle = Calculate_Arm_Distance(D_DrierPrevLocation,temp);
ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading_Callback",__FILE__,(int)angle,(int)ReadValue,RpMessage,temp,0);
MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,D_numberOfCycles);
- if ((abs(angle)>14000 )&&(ReadValue == NOTBUSY)) // OK - take another round
+ if ((abs(angle)<400 )&&(ReadValue == NOTBUSY)) // OK - take another round
{
D_DrierPrevLocation = temp;
ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading_Callback",__FILE__,ReadValue,temp,RpMessage,angle,0);
@@ -653,6 +654,7 @@ uint32_t Diagnostics_Dryer_Loading(void)
if (dryerbufferlength)
LoadArmRounds = (int)dryerbufferlength;
MCU_E2PromRead(EEPROM_STORAGE_DRYER_CENTER,&D_DrierPrevLocation);
+
//MCU_E2PromProgram(EEPROM_DRIER_LOADING_ARM_ANGLE,Calc_angle);
ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading request: current ",__FILE__,D_DrierPrevLocation,D_numberOfCycles,RpMessage,LoadArmRounds,0);
Drier_Center_read = D_DrierPrevLocation;
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
index 3fbb4e70c..c572d29e6 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
@@ -217,6 +217,13 @@ void LoadConfigurationParameters(ConfigurationParameters *Params)
EmbeddedParameters->has_openvalvetimeout = true;
EmbeddedParameters->openvalvetimeout = 52;
+ EmbeddedParameters->has_initialdispenserpressure = true;
+ EmbeddedParameters->initialdispenserpressure=3.85;
+ EmbeddedParameters->has_initialdispensertimeout = true;
+ EmbeddedParameters->initialdispensertimeout=120000.0 ;
+ EmbeddedParameters->has_initialdispensertimelag = true;
+ EmbeddedParameters->initialdispensertimelag=100.0 ;
+
EmbeddedParameters->has_dispenserbuildpressurespeed = true;
EmbeddedParameters->dispenserbuildpressurespeed=500;
EmbeddedParameters->has_dispenserbuildpressurelimit = true;
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
index eefd42d75..2f8de1643 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
@@ -260,7 +260,7 @@ void setArcHeadAlarms(uint32_t AlarmId, bool value)
}
void FlatHeadAlarms(void)
{
- if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp [HARDWARE_MOTOR_TYPE__MOTO_DH_LID]) != LIMIT) {
+ if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp [HARDWARE_MOTOR_TYPE__MOTO_DH_LID]) == LIMIT) {
if (++count9 == ARC_ALARM_LIMIT)
setArcHeadAlarms(EVENT_TYPE__DYEING_HEAD_COVER_IS_OPEN, true);
count9 = (count9 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count9);
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index 750dc81af..73282fa97 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -1033,7 +1033,9 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
Read_Dryer_ENC_Position();
Task_sleep(500);
- response.progress = (double)MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CENTER,Read_Dryer_ENC_Position(0,0));
+ (double)MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CENTER,Read_Dryer_ENC_Position(0,0));
+
+ response.progress = (double)Read_Dryer_ENC_Position(0,0);
response.has_progress = true;
}
else
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index f2ca4e8d7..ffbb504db 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -247,7 +247,8 @@
}
uint32_t Thread_Load_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_t BusyFlag)
{
- uint32_t angle, temp = Read_Dryer_ENC_Position();
+ uint32_t temp = Read_Dryer_ENC_Position();
+ int angle;
ReportWithPackageFilter(DiagnosticsFilter,"Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,(int)numberOfCycles,(int)DrierPrevLocation,RpMessage,temp,0);
@@ -258,12 +259,14 @@
{
CallbackCounter--;
}
- if ((abs(angle)>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round
+ if (abs(angle)<10 ) // OK
{
Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0);
Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
NumberOfDrierLoaderCycles=0;
+ MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0);
+
//storeLoadArmParameters();
LoadStages++;
@@ -272,7 +275,7 @@
else
{
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM]);
+ usnprintf(LoadErrorMsg, 100, "^Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
@@ -317,7 +320,7 @@
{
TimeoutsCounter = 0;
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]);
+ usnprintf(LoadErrorMsg, 100, "/Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
@@ -687,7 +690,7 @@
TimeoutsCounter = 0;
CallbackCounter = 0;
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
+ usnprintf(LoadErrorMsg, 100, "$Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 200);
@@ -729,6 +732,13 @@
{
LoadArmRounds -= CurrentlyLoaded;
}
+ if (LoadArmRounds == CurrentlyLoaded)
+ {
+ Report("Thread_Load_Dryer_Loading no need for cycles",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
+ LoadStages++;
+ ThreadLoadStateMachine(LoadStages);
+ return OK;
+ }
ThreadMotorIdToMotorId[FEEDER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_RDRIVING ;
ThreadMotorIdToMotorId[DRYER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING;
@@ -932,7 +942,7 @@
MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,Hard_Hiz);
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
+ usnprintf(LoadErrorMsg, 100, "&Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
Report("Dryer unloading timeout(1) or no movement",__FILE__,temp,DrierPrevLocation,RpWarning,ReadValue,0);
LoadStatus = ERROR;
@@ -1489,6 +1499,8 @@ uint32_t ThreadLoadingRestartReport(void) //sending after a failure in the final
if (ThreadLoadingToken[0] == 0)
return OK;
+ if (LoadStages == THREAD_LOAD_INIT)
+ return OK;
ThreadLoadingRestartFlag = true;
response.has_state = true;
@@ -1520,6 +1532,12 @@ uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer)
{
responseContainer = createContainer(MESSAGE_TYPE__TryThreadLoadingResponse, requestContainer->token, true, &Cresponse, &try_thread_loading_response__pack, &try_thread_loading_response__get_packed_size);
responseContainer.continuous = false;
+ if (JobIsActive()||(MachineReadyForHeating == false)||(FPGABurningActive==true))
+ {
+ responseContainer.has_error = true;
+ responseContainer.error = ERROR_CODE__GENERAL_ERROR;
+ responseContainer.errormessage = "The machine is not ready for loading";
+ }
uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
size_t container_size = message_container__pack(&responseContainer, container_buffer);
my_free(responseContainer.data.data);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index ba505493d..c3fb17460 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -1061,7 +1061,7 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension)
return status;
}
//********************************************************************************************************************
-bool SkipOpenLids = true;
+bool SkipOpenLids = false;
uint32_t ThreadPrepareState(void *JobDetails)
{
int Motor_i,i, HW_Motor_Id, Pid_Id;