aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-03 04:38:53 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-03 04:38:53 +0200
commit907aa0cd6c29c182d4647f8d2dab89750fd23bc9 (patch)
tree1f29f2df3ed45d42676008c63aba19e29c246f7e /Software/Embedded_SW/Embedded/Modules
parent8e24bbb500924ddf9e75d7873f92de618d8757ad (diff)
parent61b72c2bcb2798f7b0d96f1b4ccb5e176b2051dc (diff)
downloadTango-907aa0cd6c29c182d4647f8d2dab89750fd23bc9.tar.gz
Tango-907aa0cd6c29c182d4647f8d2dab89750fd23bc9.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c6
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c12
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Procedure.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c21
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h4
11 files changed, 46 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index d366e8832..eb72de61b 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -821,6 +821,10 @@ uint32_t MillisecLowLoop(uint32_t tick)
if (Head_Type == HEAD_TYPE_ARC) {
HeadBlowersControlLoop();
}
+ else
+ {
+ FlatHeadAlarms();
+ }
//call waste state machine
Waste_StateMachine_OneSecond_Call();
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
index 9f7994629..d880b1381 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
@@ -325,7 +325,7 @@ uint32_t DiagnosticsLoadDigitalValues(void)
if(Head_Type == HEAD_TYPE_ARC)
DigitalOutputState[index++].value = FPGA_Read_limit_Switches(I2C_HEADCARD_COVER_LS_ARC);
else
- DigitalOutputState[index++].value = FPGA_Read_limit_Switches(GPI_LS_DH_LID_OPEN);
+ DigitalOutputState[index++].value = FPGA_Read_limit_Switches(Motor_Id_to_LS_IdUp [HARDWARE_MOTOR_TYPE__MOTO_DH_LID]);
#ifdef USE_VOC_BUZZER_ALARM
if (WHS_Type == WHS_TYPE_NEW)
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
index 7e1424b8a..d20cd65d5 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
@@ -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 20efd6e8e..3fbb4e70c 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
@@ -44,6 +44,7 @@
#include "drivers/Flash_ram/MCU_E2Prom.h"
#include <Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h>
#include "drivers/FPGA/Full_Vme/FPGA_Programming_Up.h"
+#include <Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.h>
#include "StateMachines/Printing/PrintingSTM.h"
#include "StateMachines/Initialization/InitSequence.h"
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
index 63118221b..2f8de1643 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
@@ -258,7 +258,19 @@ 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 (++count9 == ARC_ALARM_LIMIT)
+ setArcHeadAlarms(EVENT_TYPE__DYEING_HEAD_COVER_IS_OPEN, true);
+ count9 = (count9 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count9);
+ } else {
+ if (--count9 == 0)
+ setArcHeadAlarms(EVENT_TYPE__DYEING_HEAD_COVER_IS_OPEN, false);
+ count9 = (count9 < 0)?(0):(count9);
+ }
+}
void ArcHeadAlarms(void)
{
double currentFlow = 0.0;
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
index cac543647..a172532c2 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
@@ -52,6 +52,7 @@ void HeadBlowersInit();
uint32_t HeadBlowerPidRequestMessage(void* request, int BlowerId);
void HeadBlowersCfg();
void HeadBlowersControlLoop ();
+void FlatHeadAlarms(void);
uint32_t HeadBlowerCommandRequestMessage(int blowerId, float flow);
void HeadBlowersOff(int off);
uint32_t HeadBlowersOffGet();
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c
index d26b3d814..3f1ceeabb 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c
@@ -47,7 +47,7 @@ uint32_t CalculateRpeat(uint32_t IfIndex, uint32_t BusyFlag)
void Stub_CalculateRequest(MessageContainer* requestContainer)
{
- MessageContainer responseContainer;
+ //MessageContainer responseContainer;
CalculateRequest* request = calculate_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
ustrncpy (CalculateToken, requestContainer->token,36);
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Procedure.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Procedure.c
index c2871869d..c84dc5fb5 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Procedure.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Procedure.c
@@ -93,7 +93,7 @@ void Stub_ProcedureRequest(MessageContainer* requestContainer)
response.replymessage = request->testname;
if (n_param)
{
- response.replyvalue = (float**)my_malloc(sizeof(float *)*(request->n_param));
+ response.replyvalue = (float*)my_malloc(sizeof(float *)*(request->n_param));
response.n_replyvalue = request->n_param;
for(i=0;i<n_param;i++)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index 3fef1f48b..750dc81af 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -39,6 +39,7 @@
#include <Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h>
#include "drivers/Heater/TemperatureSensor.h"
#include "Drivers/I2C_Communication/Head_Card/PT100/ADS122X04.h"
+#include "drivers/I2C_Communication/DAC/Blower.h"
#include "Modules/IFS/ifs.h"
#include "Modules/IDS/ids_ex.h"
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index f2ca4e8d7..f327ef3b2 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -258,12 +258,14 @@
{
CallbackCounter--;
}
- if ((abs(angle)>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round
+ if ((abs(angle)<200 )&&(BusyFlag == NOTBUSY)) // 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 +274,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 +319,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 +689,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 +731,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 +941,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 +1498,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;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
index 11a92ab63..4ce48a639 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
@@ -9,6 +9,10 @@
#define WINDER_DANCER HARDWARE_DANCER_TYPE__LeftDancer
#define POOLER_DANCER HARDWARE_DANCER_TYPE__MiddleDancer
#define FEEDER_DANCER HARDWARE_DANCER_TYPE__RightDancer
+#define WINDER_2_DANCER HARDWARE_DANCER_TYPE__FourthDancer
+#define WINDER_3_DANCER HARDWARE_DANCER_TYPE__ThirdDancer
+#define WINDER_4_DANCER HARDWARE_DANCER_TYPE__RightDancer
+
#define NUM_OF_DANCERS NUM_OF_ROTENC
//} DANCER_ENUM;
typedef enum threadMotorsEnum