aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
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
parent49ddda1cc22d6cbb72f499b37e5db32c95252dfa (diff)
downloadTango-338edba081dba2a2aefb634811be1cc84ec93d64.tar.gz
Tango-338edba081dba2a2aefb634811be1cc84ec93d64.zip
merge
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c9
-rw-r--r--Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c2
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/delay.c (renamed from Software/Embedded_SW/Embedded/delay.c)0
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/delay.h (renamed from Software/Embedded_SW/Embedded/delay.h)6
-rw-r--r--Software/Embedded_SW/Embedded/Common/report/reportInit.c45
-rw-r--r--Software/Embedded_SW/Embedded/Communication/CommunicationTask.c15
-rw-r--r--Software/Embedded_SW/Embedded/DataDef.h2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c15
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h5
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/ispvme/hardware.c3
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c4
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c4
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c10
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c53
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h4
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c1
-rw-r--r--Software/Embedded_SW/Embedded/Embedded.cfg6
-rw-r--r--Software/Embedded_SW/Embedded/Include.h2
-rw-r--r--Software/Embedded_SW/Embedded/Main.c117
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c33
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c30
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c2
-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
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IFS/ifs.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread.h10
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c53
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c75
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c95
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c2
-rw-r--r--Software/Embedded_SW/Embedded/Software Release Notes.txt25
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c2
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c2
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c4
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c5
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c5
-rw-r--r--Software/Embedded_SW/Embedded/src/makefile.libs4
-rw-r--r--Software/Embedded_SW/Embedded/src/sysbios/makefile24
-rw-r--r--Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4fbin1998810 -> 1998354 bytes
47 files changed, 532 insertions, 226 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
index 013a06e22..3a1a4ab83 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
@@ -56,14 +56,15 @@ uint32_t ActivateVersionCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
MessageContainer responseContainer;
bool last = true;
- usnprintf(activateString, 1000, "file %d of %d bytes %d of %d",CurrentRunningFile+1,NumberOfFiles,vme_index,CurrentFileSize);
-
- Report(activateString,__FILE__,__LINE__,(int)CurrentRunningFile,RpWarning,CurrentFileSize,0);
-
if (CurrentRunningFile<NumberOfFiles)
{
last = false;
}
+
+ usnprintf(activateString, 1000, "file %d of %d bytes %d of %d last %d",CurrentRunningFile+1,NumberOfFiles,vme_index,CurrentFileSize,last);
+
+ Report(activateString,__FILE__,__LINE__,(int)CurrentRunningFile,RpWarning,CurrentFileSize,0);
+
responseContainer = createContainer(MESSAGE_TYPE__ActivateVersionResponse, ActivateToken, last, &response, &activate_version_response__pack, &activate_version_response__get_packed_size);
responseContainer.has_continuous = true;
responseContainer.continuous = true;
diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
index 06a4ed090..64002276c 100644
--- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
+++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
@@ -20,7 +20,7 @@ typedef struct
} TangoVersion_t;
-TangoVersion_t _gTangoVersion = {1,4,6,40};
+TangoVersion_t _gTangoVersion = {1,4,6,43};
#define BUILD_DATE __DATE__
char Dat[50] = BUILD_DATE;
char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//e
diff --git a/Software/Embedded_SW/Embedded/delay.c b/Software/Embedded_SW/Embedded/Common/Utilities/delay.c
index ef095fe5b..ef095fe5b 100644
--- a/Software/Embedded_SW/Embedded/delay.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/delay.c
diff --git a/Software/Embedded_SW/Embedded/delay.h b/Software/Embedded_SW/Embedded/Common/Utilities/delay.h
index d35c904fd..a070cae1d 100644
--- a/Software/Embedded_SW/Embedded/delay.h
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/delay.h
@@ -5,8 +5,8 @@
* Author: avi
*/
-#ifndef DELAY_H_
-#define DELAY_H_
+#ifndef COMMON_UTILITIES_DELAY_H_
+#define COMMON_UTILITIES_DELAY_H_
void delayms(uint32_t ui32ms);
@@ -14,4 +14,4 @@ void delayUs(uint32_t ui32Us);
-#endif /* DELAY_H_ */
+#endif /* COMMON_UTILITIES_DELAY_H_ */
diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c
index 5c8646bf1..7ffbe5b6d 100644
--- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c
+++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c
@@ -68,7 +68,7 @@ PackageHandle MaintFilter;
char LogPath[50] = "0://ErrFile.txt";
char protobufToken[36+1] = {0};
-char message[300];
+char RepMessage[300];
FRESULT LogFresult = FR_OK;
FIL *LogFileHandle = 0; //the system supports a single active file
bool isReportActive(void)
@@ -81,23 +81,32 @@ bool isReportActive(void)
}
uint32_t OpenLogFile(void)
{
- /*int len;
- uint32_t Bytes = 0;
- LogFresult = f_open(LogFileHandle,LogPath,FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
- if (LogFresult == FR_OK)
+ int len;
+ uint32_t Bytes = 0;
+ LogFileHandle = my_malloc(sizeof(FIL));
+ if (LogFileHandle)
{
- if (LogFileHandle->fsize < 100000)
- f_lseek(LogFileHandle, LogFileHandle->fsize);
- len = usnprintf(message, 80, "Log File %s %s",__DATE__, __TIME__);
- LogFresult = f_write(LogFileHandle,message,len,&Bytes );
- }*/
+ LogFresult = f_open(LogFileHandle,LogPath,FA_READ | FA_WRITE | FA_OPEN_ALWAYS);
+ if (LogFresult == FR_OK)
+ {
+ if (LogFileHandle->fsize < 50000)
+ f_lseek(LogFileHandle, LogFileHandle->fsize);
+ else
+ f_lseek(LogFileHandle, 0);
+ len = usnprintf(RepMessage, 80, "Log File %s %s",__DATE__, __TIME__);
+ LogFresult = f_write(LogFileHandle,RepMessage,len,&Bytes );
+ }
+ }
+ else
+ LogFresult = FR_INT_ERR;
+
return LogFresult;
}
uint32_t CloseLogFile(void)
{
/* perform default error output */
- //LogFresult = f_close(LogFileHandle);
-
+ LogFresult = f_close(LogFileHandle);
+ LogFileHandle = NULL;
return LogFresult;
}
uint32_t LogToFile(char *message, /* The formatted message */
@@ -109,13 +118,15 @@ uint32_t LogToFile(char *message, /* The formatted message
{
/* print user supplied error code */
- /* uint32_t Bytes = 0;
+ uint32_t Bytes = 0;
int len;
+ if (LogFileHandle == NULL)
+ return OK;
- len = usnprintf(message, 300, "%s, file %s line %d code %d sev %d,param %d",message,FileName, LineNumber,errorCode, Severity, parameter);
- LogFresult = f_write(LogFileHandle,message,len,&Bytes );*/
+ len = usnprintf(RepMessage, 300, "\r\n%s, file %s line %d code %d sev %d,param %d",message,FileName, LineNumber,errorCode, Severity, parameter);
+ LogFresult = f_write(LogFileHandle,RepMessage,len,&Bytes );
- return LogFresult;
+ return LogFresult;
}
int ReportResponseFunc(char *message, /* The formatted message */
char *FileName,
@@ -315,6 +326,8 @@ uint32_t ReportInitMessage(MessageContainer* requestContainer)
StartDebugLogRequest* request = start_debug_log_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
ustrncpy (protobufToken, requestContainer->token,36);
+ if (LogFileHandle != NULL)
+ f_sync(LogFileHandle);
DistributorHandle ReportHandle = ReportAddDistributor("ProtoBuf");
//CloseLogFile();
if (ReportHandle == NULL) status |= 0x8;
diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
index c846ae0a3..4874e82c3 100644
--- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
+++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
@@ -9,7 +9,7 @@
#include "drivers/Uart_Comm/uart.h"
#include "communicationTask.h"
#include <Container.h>
-#include "delay.h"
+#include <Utilities/delay.h>
#include "modules/Diagnostics/Diagnostics.h"
#include "drivers/Uart_Comm/uart.h"
@@ -37,15 +37,16 @@ struct serialBuffer {
} typedef SerialBuffer;
#define SHORT_BUFFER_SIZE 100
char CommShortRxBuffer[10][SHORT_BUFFER_SIZE];
-char CommRxBuffer[2][COMM_MAX_BUFFER_SIZE];
-SerialBuffer inBuffer[12];
-bool SerialBufferUsed[12] = {false,false,false,false,false,false,false,false,false,false,false,false};
+char CommRxBuffer[COMM_MAX_BUFFER_SIZE];
+SerialBuffer inBuffer[11];
+bool SerialBufferUsed[11] = {false,false,false,false,false,false,false,false,false,false,false};
uint32_t initArray(size_t initialSize)
{
if (initialSize >= COMM_MAX_BUFFER_SIZE) return 0xFF;
if (initialSize > SHORT_BUFFER_SIZE)
{
- if ((SerialBufferUsed[10] == true)&&(SerialBufferUsed[11] == true))
+ //if ((SerialBufferUsed[10] == true)&&(SerialBufferUsed[11] == true))
+ if (SerialBufferUsed[10] == true)
{
return 0xFF;
}
@@ -60,7 +61,7 @@ uint32_t initArray(size_t initialSize)
//Report("initArray", __FILE__, 10, inBuffer[10].size, RpWarning, (int)0, 0);
return 10;
}
- else if (SerialBufferUsed[11] == false)
+ /*else if (SerialBufferUsed[11] == false)
{
SerialBufferUsed[11] = true;
inBuffer[11].buffer = CommRxBuffer;
@@ -68,7 +69,7 @@ uint32_t initArray(size_t initialSize)
inBuffer[11].size = initialSize;
//Report("initArray", __FILE__, 10, inBuffer[10].size, RpWarning, (int)0, 0);
return 11;
- }
+ }*/
else return 0xFF;
}
}
diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h
index 310af654e..2b104a521 100644
--- a/Software/Embedded_SW/Embedded/DataDef.h
+++ b/Software/Embedded_SW/Embedded/DataDef.h
@@ -23,7 +23,7 @@
#define WATCHDOG
//#define DISPESER_TEST
//#define FPGA_WATCHDOG_DISABLE
-
+//#define FOUR_WINDERS
//#define USE_POWERSTEP01 -NA
//#define EMC_FORCE_MOT_CLOCK_INTERNAL
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c
index 1528473a1..f8e8d7b9e 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c
@@ -11,7 +11,6 @@
#include <DataDef.h>
#include "modules/control/millisecTask.h"
#include "modules/thread/thread.h"
-#include "delay.h"
#include "FPGA_GPIO.h"
#include "drivers/FPGA/FPGA.h"
#include "StateMachines/Printing/PrintingSTM.h"
@@ -19,6 +18,7 @@
#include "Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.h"
#include <Drivers/I2C_Communication/I2C_Task.h>
+#include <Utilities/delay.h>
FPGA_GPI FPGA_Gpi;
@@ -434,6 +434,12 @@ bool FPGA_Read_limit_Switches(FPGA_GPI_ENUM Limit_Switch)
case GPI_LS_LSPARE2:
LM_Status = LS_Left.bits.F1_LS_LSPARE2;
break;
+ case GPI_LS_SPARE2_2:
+ LM_Status = LS_Spare.bits.F3_LS_SPARE2_2;
+ break;
+ case GPI_LS_SPARE1_2:
+ LM_Status = LS_Spare.bits.F3_LS_SPARE1_2;
+ break;
case I2C_HEADCARD_COVER_LS_FRONT:
case I2C_HEADCARD_ARC_LS_ACTUATOR:
LM_Status = !(Head_I2C_EXP4_0x46.bits.INPUT_LS_FRONT_ARC_ACT);
@@ -537,9 +543,10 @@ uint32_t MagnetCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
if(Head_Type == HEAD_TYPE_FLAT)
Trigger_Head_Magnet(DISABLE_MAGNET);
//HeadCard_HeadMagnet_Disable();
+#ifndef FOUR_WINDERS
else
MotorStop(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,Hard_Hiz );
-
+#endif
if (SafeRemoveControlCallback(MagnetControlId, MagnetCallBackFunction )==OK)
MagnetControlId = 0xFF;
else
@@ -563,6 +570,7 @@ uint32_t ActivateHeadMagnet()
F2_CTRL = F2_CTRL_Reg.ushort;
#endif
}
+#ifndef FOUR_WINDERS
if (isMotorConfigured(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM))
{
if (MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM].DriverType == CombinrdMotDriver)
@@ -570,6 +578,7 @@ uint32_t ActivateHeadMagnet()
else
MotorGoTo(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,DH_LID_CLOSE );
}
+#endif
MagnetControlId = AddControlCallback(NULL, MagnetCallBackFunction, 2* eOneSecond, TemplateDataReadCBFunction,0,0, 0 );
return OK;
}
@@ -597,6 +606,7 @@ uint32_t DeActivateHeadMagnet()
#endif
}
Report("DeActivateHeadMagnet - open the lid magnet",__FILE__,__LINE__,(int)HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,RpWarning,(int)DH_LID_CLOSE,0);
+#ifndef FOUR_WINDERS
if (isMotorConfigured(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM))
{
if (MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM].DriverType == CombinrdMotDriver)
@@ -605,6 +615,7 @@ uint32_t DeActivateHeadMagnet()
MotorGoTo(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,DH_LID_OPEN );
//MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM, DH_LID_OPEN, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM], NULL,1000);
}
+#endif
//MagnetControlId = AddControlCallback(NULL, MagnetCallBackFunction, 2* eOneSecond, TemplateDataReadCBFunction,0,0, 0 );
Task_sleep(500);
return OK;
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h
index a7999ea2e..e707a9b39 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h
@@ -158,6 +158,11 @@ typedef enum
GPI_EXTWINDER_Direct_BIT13, //125
GPI_EXTWINDER_Direct_BIT14, //126
GPI_EXTWINDER_Direct_BIT15, //127
+
+ //LS_Spare
+ GPI_LS_SPARE2_2, //128
+ GPI_LS_SPARE1_2, //129
+
//-------------------------------
I2C_HEADCARD_COVER_LS_FRONT,
I2C_HEADCARD_COVER_LS_REAR,
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/ispvme/hardware.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/ispvme/hardware.c
index 2e3b3c3ff..549a41477 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/ispvme/hardware.c
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/ispvme/hardware.c
@@ -29,13 +29,12 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
+#include <Utilities/delay.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "Drivers/FPGA/Full_Vme/FPGA_Programming_Up.h"
-#include "delay.h"
-
#include "vmopcode.h"
#include "Drivers/FPGA/Full_vme/FPGA_Programming_Up.h"
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
index 2d2de930b..5bac56231 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
@@ -291,7 +291,7 @@ double Calc_Calibration_MidTank_Liquid(uint32_t VsampleInBits, MidTank_t MidTan
}
//LOG_ERROR (MidTank_ID,"Wrong MidTank Calibration parameters");
#ifndef DISPESER_TEST
- Report("Wrong MidTank Calibration parameters",__FILE__,MidTank_ID,(int)(Initial_Offset_A[MidTank_ID]*100),RpMessage,(int)(Slope_B[MidTank_ID]*100),0);
+ //Report("Wrong MidTank Calibration parameters",__FILE__,MidTank_ID,(int)(Initial_Offset_A[MidTank_ID]*100),RpMessage,(int)(Slope_B[MidTank_ID]*100),0);
#endif
}
else
@@ -483,7 +483,7 @@ uint32_t Read_Head_MixChip_Heaters_Current(HEATERS_CURRENT Heater_ID) //0-5
if (Heater_ID>=NUM_OF_CURRENT_HEATERS)
return ERROR;
- #warning need to change the hardware://there is overflow in Dyer Head zone 4 with resistor 0.05
+ //#warning need to change the hardware://there is overflow in Dyer Head zone 4 with resistor 0.05
const double Resistor[NUM_OF_CURRENT_HEATERS] = {0.025, 0.025, 0.025, 0.025, 0.020, 0.025};
if (Heaters_Current_Read_Enable[Heater_ID] == false)
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c
index d9f5385f6..9023f8250 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c
@@ -106,8 +106,8 @@ uint32_t Dispenser_EEPROM_Read_Data(uint8_t Dispenser_ID)//0..7
uint32_t test_disp_eeprom(uint8_t Dispenser_ID , uint8_t EEprom_Add)//0..7
{
uint32_t status= OK;
- uint32_t i;
-/*
+/* uint32_t i;
+
Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Dispebser_Data.SN = 0x12345678;
Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Nl_Pulse_Value = 0xAB;
Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Flow_Pass_Fail = 0xCD;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c
index 45da809af..445d835c5 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c
@@ -9,11 +9,11 @@
#include <stdbool.h>
#include <stdint.h>
-#include <delay.h>
#include <DataDef.h>
#include <Drivers/I2C_Communication/Dispenser_Card/I2C_Dispenser_Card_Mux.h>
#include <Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h>
#include <Drivers/I2C_Communication/I2C.h>
+#include <Utilities/delay.h>
//TCA9534Regs* Disp_IO_Reg;
TCA9534Regs Regs;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c
index 6d34f391d..33d888b14 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c
@@ -770,7 +770,7 @@ bool isActuatorOnLowestLocation(void) // Give indication if the actuator stopped
uint32_t HeadCard_Actuators_Relocate_callback(uint32_t IfIndex, uint32_t BusyFlag) // use IfIndex for Act_ID
{
count_time++;
- ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0);
+ //ReportWithPackageFilter(ThreadFilter,"actuators relocation",__FILE__,msec_millisecondCounter,ActuatorLocating,RpMessage,count_time,0);
switch (ActuatorLocating)
{
case ActuatorIdle:
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c
index 9be6a90b9..4057b4912 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c
@@ -10,12 +10,12 @@
#include <stdbool.h>
#include <string.h> //memset
#include <DataDef.h>
-#include "delay.h"
#include "driverlib/sysctl.h"
#include "driverlib/i2c.h"
#include <Drivers/I2C_Communication/I2C.h>
#include "drivers/FPGA/FPGA_Comm.h"
#include <Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.h>
+#include <Utilities/delay.h>
#include "I2C_IFS_Mux.h"
#include "NFC_MainBaord.h"
#include "Modules/Control/Control.h"
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c
index 8da522961..a1139591d 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c
@@ -10,12 +10,12 @@
#include <string.h> //memset
#include <DataDef.h>
#include "datadef.h"
-#include "delay.h"
#include "drivers/I2C_Communication/I2C.h"
#include "drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.h"
#include "drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.h"
#include <Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.h>
#include <Drivers/I2C_Communication/RFID_NFC/NFC.h>
+#include <Utilities/delay.h>
RFID_TAG_State_Machine TagStage = Tag_Idle;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.c
index bc8ef08e0..74b00f4ad 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.c
@@ -14,7 +14,6 @@
#include "driverlib/sysctl.h"
#include <Drivers/I2C_Communication/I2C.h>
#include "drivers/FPGA/FPGA_Comm.h"
-#include "delay.h"
#include <Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.h>
#include <Drivers/I2C_Communication/RFID_NFC/Test_RFID.h>
#include "drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.h"
@@ -22,6 +21,7 @@
#include "Drivers/I2C_Communication/RFID_NFC/NFC.h"
#include "driverlib/i2c.h"
#include <Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_NFC.h>
+#include <Utilities/delay.h>
//#include <Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_NFC.h>
//#include <Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_NFC_Settings.h>
//#include <Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.h>
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c
index 3e5ed6ab5..6c2d54111 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c
@@ -267,8 +267,6 @@ bool WHS_PT100_Read(TEMPERATURE_SENSOR_ID_ENUM SensorId)
break;
}
- #warning what to do with the data ??????? //- see TempSensorResponse[SensorId].Temperature_C_mult_by_100
-
return Status;
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
index b974e4c5b..764ef0d44 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
@@ -465,7 +465,7 @@ bool WHS_Set_Blower_Control_Closed_Loop(double Q_value)
close_loop_time = 15;
if (midtank_cleared < NUM_OF_MIDTANKS)
{
-#warning open waiting midtank both valves for 15 seconds
+//#warning open waiting midtank both valves for 15 seconds
Valve_Set(IDS_Id_to_AirValve[midtank_cleared], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON
Valve_Set(IDS_Id_to_CartrideValve[midtank_cleared], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON
}
@@ -475,7 +475,7 @@ bool WHS_Set_Blower_Control_Closed_Loop(double Q_value)
{
if (midtank_cleared < NUM_OF_MIDTANKS)
{
-#warning close waiting midtank both valves for 15 seconds
+//#warning close waiting midtank both valves for 15 seconds
Valve_Set(IDS_Id_to_AirValve[midtank_cleared], Atm_MidTank_OFF ); //Atm_MidTank_OFF/ON
Valve_Set(IDS_Id_to_CartrideValve[midtank_cleared], Atm_MidTank_OFF ); //Atm_MidTank_OFF/ON
midtank_cleared = NUM_OF_MIDTANKS;
@@ -613,7 +613,7 @@ char whs_str[150];
uint32_t WHS_Pid_Testing_Func(double setParam,double measuredParam)
{
float calculated_speed;
- float avreageSampleValue = 0;
+ //float avreageSampleValue = 0;
int i;
/*WhsBlowerSamples[WhsBlowerSamplesPointer] = measuredParam;//(-1 * TranslatedReadValue);
@@ -634,9 +634,9 @@ uint32_t WHS_Pid_Testing_Func(double setParam,double measuredParam)
calculated_speed = volt + 100;
if (calculated_speed < (volt - 100))
calculated_speed = volt - 100;*/
- usnprintf(whs_str, 150, "WHS_Pid_Testing_Func meas %d avg %d set %d error %d integral %d blower %d",
+/* usnprintf(whs_str, 150, "WHS_Pid_Testing_Func meas %d avg %d set %d error %d integral %d blower %d",
(int)(measuredParam*100),(int)(avreageSampleValue*100),(int)(setParam*100),(int)(WHS_ControlData.m_calculatedError*100),(int)(WHS_ControlData.m_integral*100),(int)(calculated_speed));
- Report(whs_str, __FILE__,__LINE__, (int)(calculated_speed), RpMessage, (int)(volt), 0);
+ Report(whs_str, __FILE__,__LINE__, (int)(calculated_speed), RpMessage, (int)(volt), 0);*/
/*if (fabs(WHS_ControlData.m_calculatedError)>(WHS_ControlData.m_params.MAX/2))
{
close_loop_time = 1;
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
index 419c34985..f500104f4 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
@@ -52,6 +52,39 @@ uint32_t MotorTimeLag[NUM_OF_MOTORS];
uint32_t MotorTimeLimit[NUM_OF_MOTORS];
uint32_t MotorControlId[NUM_OF_MOTORS];
uint32_t StoredMotorPosition[NUM_OF_MOTORS];
+#ifdef FOUR_WINDERS
+FPGA_GPI_ENUM Motor_Id_to_LS_IdDown[NUM_OF_MOTORS] = { // limit switch for normal homing into working mode
+ GPI_LS_DH_CLEAN_LEFT , //MOTO_DH_CLEANHEAD = 0, Shlomo Correct setting for machine 7 25/3
+ GPI_LS_DH_CLEAN_RIGHT, //MOTO_DH_CLEANMECH = 1, Shlomo Correct setting for machine 7 25/3
+ GPI_LS_DH_LID_CLOSED, //MOTO_DH_LID = 2,
+ MAX_GPI, //MOTO_DRYER_DRIVING = 3,
+ GPI_LS_DRYER_LID_CLOSED, //MOTO_DRYER_LID = 4,
+ MAX_GPI, //MOTO_DRYER_LOADARM = 5,
+ GPI_LS_DISPENSER_DOWN_1, //MOTO_DISPENSER_1 = 6,
+ GPI_LS_DISPENSER_DOWN_2, //MOTO_DISPENSER_2 = 7,
+ GPI_LS_DISPENSER_DOWN_3, //MOTO_DISPENSER_3 = 8,
+ GPI_LS_DISPENSER_DOWN_4, //MOTO_DISPENSER_4 = 9,
+ GPI_LS_DISPENSER_DOWN_5, //MOTO_DISPENSER_5 = 10,
+ GPI_LS_DISPENSER_DOWN_6, //MOTO_DISPENSER_6 = 11,
+ GPI_LS_DISPENSER_DOWN_7, //MOTO_DISPENSER_7 = 12,
+ GPI_LS_DISPENSER_DOWN_8, //MOTO_DISPENSER_8 = 13,
+ GPI_LS_SCREW_RIGHT, //MOTO_SCREW = 14,
+ MAX_GPI, //MOTO_WINDER = 15,
+ GPI_LS_LDANCER1_DOWN, //MOTO_LDANCER1 = 16,
+ GPI_LS_LSPARE1, //MOTO_LDANCER2 = 17,
+ MAX_GPI, //MOTO_LDRIVING = 18,
+ GPI_LS_LLOADMOTOR_DOWN, //MOTO_LLOADING = 19,
+ GPI_LS_LPIVOT_DOWN, //MOTO_LPIVOT1 = 20,
+ GPI_LS_RDANCER_UP, //MOTO_RDANCER = 21,
+ MAX_GPI, //MOTO_RDRIVING = 22,
+ GPI_LS_RDANCER_LONG, //MOTO_RLOADARM = 23,
+ GPI_LS_RLOADMOTOR_DOWN, //MOTO_RLOADING = 24,
+ GPI_LS_SPARE1_2, //HARDWARE_MOTOR_TYPE__MOTO_SPARE1_1 = 25,
+ MAX_GPI, //HARDWARE_MOTOR_TYPE__MOTO_SPARE1_2 = 26,
+ GPI_LS_SPARE2_2, //HARDWARE_MOTOR_TYPE__MOTO_SPARE2_1 = 27,
+ MAX_GPI, //HARDWARE_MOTOR_TYPE__MOTO_SPARE2_2 = 28,
+};
+#else
FPGA_GPI_ENUM Motor_Id_to_LS_IdDown[NUM_OF_MOTORS] = { // limit switch for normal homing into working mode
GPI_LS_DH_CLEAN_LEFT , //MOTO_DH_CLEANHEAD = 0, Shlomo Correct setting for machine 7 25/3
GPI_LS_DH_CLEAN_RIGHT, //MOTO_DH_CLEANMECH = 1, Shlomo Correct setting for machine 7 25/3
@@ -79,6 +112,7 @@ FPGA_GPI_ENUM Motor_Id_to_LS_IdDown[NUM_OF_MOTORS] = { // limit switch for n
GPI_LS_RDANCER_LONG, //MOTO_RLOADARM = 23,
GPI_LS_RLOADMOTOR_DOWN, //MOTO_RLOADING = 24,
};
+#endif
FPGA_GPI_ENUM Motor_Id_to_LS_IdUp[NUM_OF_MOTORS] = { // limit switch for normal homing out of working mode
GPI_LS_DH_CLEAN_LEFT , //MOTO_DH_CLEANHEAD = 0, Shlomo Correct setting for machine 7 25/3
GPI_LS_DH_CLEAN_RIGHT, //MOTO_DH_CLEANMECH = 1, Shlomo Correct setting for machine 7 25/3
@@ -190,7 +224,7 @@ uint32_t MotorMoveWithCallback (TimerMotors_t MotorId,bool direction, uint32_t S
//MotorStop(MotorId,Hard_Hiz );
MotorMove(MotorId,direction,Steps );
- MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,MotorId, MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
MotorControlCallback[MotorId] = MotorMoveCallBackFunction;
return MotorControlId[MotorId];
}
@@ -437,15 +471,15 @@ uint32_t MotorSetSpeedWithCallback (TimerMotors_t MotorId, uint32_t _freq, callb
}
uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
{
- uint32_t MotorId;
+ uint32_t MotorId,encoder;
uint32_t Busy = BusyFlag;
- /*if (IfIndex>>8 != IfTypeMotors)
+ if (IfIndex>>8 != IfTypeMotors)
{
LOG_ERROR (IfIndex, "Wrong Interface type");
return 0xFFFFFFFF;
- }*/
+ }
+ MotorId = IfIndex&0xFF;
- MotorId = IfIndex;
CallbackCalls++;
if (MotorId ==HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM)
{
@@ -455,7 +489,7 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
}
if (CallbackCalls%200 == 1)
{
- MotorId = Read_Dryer_ENC_Position(0,0);
+ encoder = Read_Dryer_ENC_Position(0,0);
Report("MotorMoveCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,MotorId,0);
}
}
@@ -475,7 +509,7 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
printBusy = false;
}*/
//stop this control loop
- Report("MotorControlGetnBusyState stop",__FILE__,__LINE__,BusyFlag,RpMessage,MotorTimeout[MotorId],0);
+ Report("MotorControlGetnBusyState stop",__FILE__,MotorId,BusyFlag,RpMessage,MotorTimeout[MotorId],0);
SafeRemoveControlCallback(MotorControlId[MotorId], MotorMoveCallBackFunction );
MotorControlCallback[MotorId] = 0;
MotorControlId[MotorId] = 0xFF;
@@ -688,8 +722,7 @@ uint32_t MotorMovetoLimitSwitch (TimerMotors_t MotorId,bool direction, uint32_t
/*if (Head_Type == HEAD_TYPE_FLAT)
{
Report("Close_actuators",__FILE__,__LINE__,LOW,RpMessage,true,0);
- Trigger_Head_Actuators_Control(ACTOT, LOW,false);
- //Trigger_Head_Actuators_Control(ACTIN, LOW,false);
+ Trigger_Head_Actuators_Stub(ACTOT, ENABLE, DOWN);
HeadCard_Actuators_Relocate();
}*/
}
@@ -901,7 +934,7 @@ void MotorActionsInit(void)
MotorDriverResponse[i].Status = 0xFFFFFFFF;
StoredMotorPosition[i] = 0;
}
- if (Head_Type == HEAD_TYPE_FLAT)//adjust the limit switches
+ if ((Head_Type == HEAD_TYPE_FLAT)||(Head_Type == HEAD_TYPE_ARC))//adjust the limit switches
{
Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID] = I2C_HEADCARD_COVER_LS_FRONT;
Motor_Id_to_LS_IdUp [HARDWARE_MOTOR_TYPE__MOTO_DH_LID] = I2C_HEADCARD_COVER_LS_REAR ;
diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h
index 6598b88c2..4f864eaca 100644
--- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h
+++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h
@@ -17,8 +17,8 @@ uint32_t Read_Dryer_Status(HardwareDancerType DancerId);
void Loop_SSI();
-void test_dancer_responce_RTFU(bool motor_direction);
-void test_dancer_responce_RTFU();
+//void test_dancer_responce_RTFU(bool motor_direction);
+void test_dancer_responce_RTFU(void);
extern bool test_dancer_direction, test_dancer_flag;
diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c
index e2d0443b4..3389d941c 100644
--- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c
+++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c
@@ -245,7 +245,6 @@ void MainCardEEpromReadRequestFunc(MessageContainer* requestContainer)
uint32_t status = PASSED;
MessageContainer responseContainer;
- int32_t EEdata = 0;
StubMainCardEEpromReadRequest* request = stub_main_card_eeprom_read_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg
index 10f94e08c..f41e56966 100644
--- a/Software/Embedded_SW/Embedded/Embedded.cfg
+++ b/Software/Embedded_SW/Embedded/Embedded.cfg
@@ -97,12 +97,12 @@ semaphore7Params.instance.name = "ReconnectSem";
semaphore7Params.mode = Semaphore.Mode_BINARY;
Program.global.ReconnectSem = Semaphore.create(null, semaphore7Params);
-/*Task.addHookSet({
+Task.addHookSet({
// registerFxn: '&myRegisterFxn',
// createFxn: '&myCreateFxn',
// deleteFxn: '&myDeleteFxn',
- switchFxn: '&mySwitchFxn'
-});*/
+ switchFxn: '&MyswitchFxn'
+});
var MillisecTaskParams = new Task.Params();
MillisecTaskParams.instance.name = "MilliSecond";
diff --git a/Software/Embedded_SW/Embedded/Include.h b/Software/Embedded_SW/Embedded/Include.h
index bc0bb6bce..34410bd29 100644
--- a/Software/Embedded_SW/Embedded/Include.h
+++ b/Software/Embedded_SW/Embedded/Include.h
@@ -50,8 +50,8 @@
#include "Common/Utilities/Utils.h"
#include "Common/report/report.h"
+#include "Common/Utilities/delay.h"
#include "DataDef.h"
-#include "delay.h"
#define SYS_CLK_FREQ 120000000
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index d22ee2006..d6f74dd48 100644
--- a/Software/Embedded_SW/Embedded/Main.c
+++ b/Software/Embedded_SW/Embedded/Main.c
@@ -81,7 +81,6 @@
#include "Modules/Waste/Waste.h"
#include <Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h>
#include "Drivers/I2C_Communication/Main_Board_EEPROM/Main_EEPROM.h"
-#include "delay.h"
#include "Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.h"
#include "Drivers/I2C_Communication/Head_Card/EEPROM/Head_EEPROM.h"
#include "modules/AlarmHandling/AlarmHandling.h"
@@ -94,6 +93,7 @@
#include <Drivers/I2C_Communication/RFID_NFC/NFC.h>
#include <Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.h>
+#include <Utilities/delay.h>
//*****************************************************************************
//
// The system tick rate expressed both as ticks per second and a millisecond
@@ -122,71 +122,69 @@ Error_Id eid;
int eCode;
char ErrorPath[50] = "0://ErrFile.txt";
bool UpdateFlag = false;
+bool FirstErrorFlag = true;
+Task_Handle PrevTask,NextTask;
+extern FIL *LogFileHandle;
+/* ======== Function switchHook ======== */
+Void MyswitchFxn(Task_Handle prev, Task_Handle next)
+{
+ PrevTask = prev;
+ NextTask = next;
+}
+
/* ======== errHook ======== */
Void errHook(Error_Block *eb)
{
- /*FRESULT Fresult = FR_OK;
- FIL *FileHandle = 0; //the system supports a single active file
+ FRESULT Fresult = FR_OK;
+
uint32_t Bytes = 0;
- char File[50] = "";
+ //char File[50] = "";*/
char message[300];
- int len;*/
+ int len;
STATUS_GREEN_LED_OFF;
ACTIVITY_GREEN_LED_OFF;
COMM_GREEN_LED_OFF;
STATUS_RED_LED_ON;
- MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,InitFailures+1);
-
ACTIVITY_RED_LED_ON;
COMM_RED_LED_ON;
-
- site = Error_getSite(eb);
- eid = Error_getId(eb);
- eCode = Error_getCode(eb);
- //CloseLogFile();
+ ReportStopReporting();
if (UpdateFlag == true)
return;
- /*FileHandle = my_malloc(sizeof(FIL));
- if (FileHandle == 0)
- Fresult = FR_DENIED;
- else
+ if (FirstErrorFlag == true)
{
- Fresult = f_open(FileHandle,ErrorPath,FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
- if (Fresult == FR_OK)
- {
- f_lseek(FileHandle, FileHandle->fsize);
- strncpy(File,site->file,49);
- len = usnprintf(message, 80, "\r\n%s %s",__DATE__, __TIME__);
- Fresult = f_write(FileHandle,message,len,&Bytes );
- // print user supplied error code
- len = usnprintf(message, 300, "\r\nerror %d, eid %d mod %d file %s line %d",
- eCode, eid,site->mod,
- site->file,site->line);
- Fresult = f_write(FileHandle,message,len,&Bytes );
-
- //LOG_ERROR (eCode, "error # ");
- // check originator's mod id against known mods
- if (site->mod == Main_Module_id()) {
- Fresult = f_write(FileHandle,"\r\napp error: ",12,&Bytes );
- }
+ FirstErrorFlag = false;
+ MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,InitFailures+1);
+ len = usnprintf(message, 300, "\r\nerror task 0x%x %s context prev task 0x%x,%s", PrevTask,Task_Handle_name(PrevTask),NextTask,Task_Handle_name(NextTask));
+ Fresult = f_write(LogFileHandle,message,len,&Bytes );
+ site = Error_getSite(eb);
+ eid = Error_getId(eb);
+ eCode = Error_getCode(eb);
+ // print user supplied error code
+ len = usnprintf(message, 300, "\r\nerror %d, eid %d mod %d file %s line %d",
+ eCode, eid,site->mod,
+ site->file,site->line);
+ Fresult = f_write(LogFileHandle,message,len,&Bytes );
- // check error id against known errors
- if (eid == Error_E_generic) {
- Fresult = f_write(FileHandle,"generic: ",10,&Bytes );
- }
- else if (eid == Assert_E_assertFailed) {
- System_printf("assertion violation: ");
- Fresult = f_write(FileHandle,"\r\nassertion violation: ",22,&Bytes );
- }
+ //LOG_ERROR (eCode, "error # ");
+ // check originator's mod id against known mods
+ if (site->mod == Main_Module_id()) {
+ Fresult = f_write(LogFileHandle,"\r\napp error: ",12,&Bytes );
+ }
- // perform default error output
- f_close(FileHandle);
+ // check error id against known errors
+ if (eid == Error_E_generic) {
+ Fresult = f_write(LogFileHandle,"generic: ",10,&Bytes );
+ }
+ else if (eid == Assert_E_assertFailed) {
+ System_printf("assertion violation: ");
+ Fresult = f_write(LogFileHandle,"\r\nassertion violation: ",22,&Bytes );
}
- Task_sleep (200);
- my_free(FileHandle);
- }*/
+ }
+ CloseLogFile();
+
+
#ifdef WATCHDOG
//Power_Reset();
SysCtlReset();
@@ -245,17 +243,6 @@ int main(void)
uint32_t Data,i;
MCU_E2PromInit();
- Data = MCU_E2PromEmbeddedVersionRead();
- memcpy (&Version,&Data,4);
- i = memcmp(&Version,&_gTangoVersion,4);
- if (i)
- {
- LOG_ERROR(Version.m_minor,"Version change, do stuff");
- FlashInit();
- MCU_E2PromEmbeddedVersionProgram();
- MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,0);
- }
- MCU_E2PromRead(EEPROM_INIT_FAILURE_COUNTER,&InitFailures);
#endif
#ifdef EVALUATION_BOARD
@@ -268,7 +255,18 @@ int main(void)
LOG_ERROR (iFResult, "Error during init Flash File System");
assert(iFResult);
}
- //OpenLogFile();
+ OpenLogFile();
+ Data = MCU_E2PromEmbeddedVersionRead();
+ memcpy (&Version,&Data,4);
+ i = memcmp(&Version,&_gTangoVersion,4);
+ if (i)
+ {
+ LOG_ERROR(Version.m_minor,"Version change, do stuff");
+ FlashInit();
+ MCU_E2PromEmbeddedVersionProgram();
+ MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,0);
+ }
+ MCU_E2PromRead(EEPROM_INIT_FAILURE_COUNTER,&InitFailures);
Init_All_I2C();
#ifndef EVALUATION_BOARD
@@ -295,7 +293,6 @@ int main(void)
FPGA_Init();
Check_IFS_Availability();//Init_IFS();//must be done after FPGA_Init
-
#endif
MAP_FPULazyStackingEnable();
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
index 7963a9290..a76142b00 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
@@ -332,26 +332,26 @@ uint32_t DiagnosticsLoadDigitalValues(void)
DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPI_WCONTAINER_WARN;
DigitalOutputState[index++].value = WHS_IsContainerEmpty();
- DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_SPARE1_1; /*waste lower cartridge presence*/
- DigitalOutputState[index++].value = WHS_WasteCartridgeLowerPresent();
-
- DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_SPARE1_2; /*waste middle cartridge presence*/
- DigitalOutputState[index++].value = WHS_WasteCartridgeMiddlePresent();
-
DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_SPARE_SSR12_CTRL; /*lubricant valve*/
DigitalOutputState[index++].value = GetLubricantState();
- DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_TFEED_BREAK_1; /*Secondary Pump Active*/
- DigitalOutputState[index++].value = SecondaryPumpActive;
-
DigitalOutputState[index].interfaceio = INTERFACE_IOS__CART1; /*Secondary Pump Active*/
- DigitalOutputState[index++].value = IFS_CartridgeLowerPresent();
+ DigitalOutputState[index++].value = Is_Cartridge_Present(CART_1);
DigitalOutputState[index].interfaceio = INTERFACE_IOS__CART2; /*Secondary Pump Active*/
- DigitalOutputState[index++].value = WHS_WasteCartridgeMiddlePresent();
+ DigitalOutputState[index++].value = Is_Cartridge_Present(CART_2);
DigitalOutputState[index].interfaceio = INTERFACE_IOS__CART3; /*Secondary Pump Active*/
- DigitalOutputState[index++].value = WHS_WasteCartridgeLowerPresent();
+ DigitalOutputState[index++].value = Is_Cartridge_Present(CART_3);
+
+ DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_SPARE1_1; /*Waste filling middle cartridge*/
+ DigitalOutputState[index++].value = (cartGetState(WasteCartridge_middle)==CartridgeStateACTIVE)?1:0;
+
+ DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_SPARE1_2; /*Waste filling lower cartridge*/
+ DigitalOutputState[index++].value = (cartGetState(WasteCartridge_lower)==CartridgeStateACTIVE)?1:0;
+
+ DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_TFEED_BREAK_1; /*IFS MidTank Filling*/
+ DigitalOutputState[index++].value = IFS_MidTankFilling();
return index;
}
@@ -593,8 +593,8 @@ void DiagnosticOneMinuteCollection(void)
}
DiagnosticsMonitor.n_overalltemperature = 1;
- OverallTemperature = max(MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP1),MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP2));
- OverallTemperature = ((int)(MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP1)/100)*1000 + (int)(MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP2)/100));
+ OverallTemperature = (max(MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP1),MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP2)))/100;
+ //OverallTemperature = ((int)(MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP1)/100)*1000 + (int)(MillisecGetTemperatures(TEMP_SENSE_AN_ENCLOSURETEMP2)/100));
DiagnosticsMonitor.overalltemperature = &OverallTemperature;
DiagnosticsMonitor.n_midtank1level = 1;
@@ -856,8 +856,8 @@ void DiagnosticOneSecCollection(void)
if (Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD) //rapid/pp machines
{
AcVoltage = ReadVAC();
- DiagnosticsMonitor.whsblower2voltage = &AcVoltage;
- DiagnosticsMonitor.n_whsblower2voltage = 1;
+ //DiagnosticsMonitor.whsblower2voltage = &AcVoltage;
+ //DiagnosticsMonitor.n_whsblower2voltage = 1;
DiagnosticsMonitor.incomingvoltage = &AcVoltage;
DiagnosticsMonitor.n_incomingvoltage = 1;
}
@@ -880,6 +880,7 @@ void DiagnosticOneSecCollection(void)
if ((GetMachineState()<MACHINE_STATE_NO_PROCESS_PARAMS) &&(GetMachineState()>=MACHINE_STATE_WAIT_FOR_COOLER))
{
InitCounter-=1.0;
+ if(InitCounter<0)InitCounter = 0;
DiagnosticsMonitor.chillertemperature = &InitCounter;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
index 047293ea9..d9f8d30fd 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
@@ -43,11 +43,12 @@ uint32_t HomingControlId[NUM_OF_MOTORS];
uint32_t Diagnostics_Dryer_UnLoading(void);
uint32_t Diagnostics_Dryer_Loading(void);
+int kval_upper_value;
/********************************************************************************
* Motor Homing
********************************************************************************/
-//int32_t keepkvalright,keepkvalleft;
+int32_t keepkvalright,keepkvalleft;
uint32_t MotorHomingProgressReport(uint32_t deviceID, uint32_t ReadValue)
{
if (HomingToken[deviceID][0] == 0)
@@ -88,11 +89,11 @@ uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue)
if(deviceID == HARDWARE_MOTOR_TYPE__MOTO_RLOADING)
{
- MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 24);
+ MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, keepkvalright);
}
if(deviceID == HARDWARE_MOTOR_TYPE__MOTO_LLOADING)
{
- MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 24);
+ MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, keepkvalleft);
}
if (resetPullerDancer == true)
{
@@ -101,7 +102,7 @@ uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue)
}
if (resetWinderDancer == true)
{
- resetPullerDancer = false;
+ resetWinderDancer = false;
MCU_E2PromProgram(EEPROM_WINDER_TENSION_POSITION,1);
}
if (HomingControlId[deviceID] != 0xff)
@@ -146,9 +147,8 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer)
LoadArmRounds = (int)dryerbufferlength;
- int kval_upper_value;
if (Is_PP_Machine())
- kval_upper_value = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
+ kval_upper_value = 28;
else
kval_upper_value = 70;
@@ -200,12 +200,12 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer)
}
if(MotorId == HARDWARE_MOTOR_TYPE__MOTO_RLOADING)
{
- //keepkvalright = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
+ keepkvalright = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, kval_upper_value);
}
if(MotorId == HARDWARE_MOTOR_TYPE__MOTO_LLOADING)
{
- //keepkvalleft = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].kvalrun;
+ keepkvalleft = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].kvalrun;
MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, kval_upper_value);
}
MotorMovetoLimitSwitch (MotorId,1-MotorsCfg[MotorId].directionthreadwize, speed, Motor_Id_to_LS_IdUp[MotorId], MotorHomingRequestCallback,30000);
@@ -241,12 +241,12 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer)
{
if(MotorId == HARDWARE_MOTOR_TYPE__MOTO_RLOADING)
{
- //keepkvalright = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
+ keepkvalright = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, kval_upper_value);
}
if(MotorId == HARDWARE_MOTOR_TYPE__MOTO_LLOADING)
{
- //keepkvalleft = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].kvalrun;
+ keepkvalleft = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].kvalrun;
MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, kval_upper_value);
}
MotorMovetoLimitSwitch (MotorId,MotorsCfg[MotorId].directionthreadwize, speed, Motor_Id_to_LS_IdDown[MotorId], MotorHomingRequestCallback,30000);
@@ -298,6 +298,16 @@ uint32_t MotorAbortHomingRequestFunc(MessageContainer* requestContainer)
{
resetWinderDancer = false;
}
+ if(MotorId == HARDWARE_MOTOR_TYPE__MOTO_RLOADING)
+ {
+ if (keepkvalright)
+ MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, keepkvalright);
+ }
+ if(MotorId == HARDWARE_MOTOR_TYPE__MOTO_LLOADING)
+ {
+ if (keepkvalleft)
+ MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, keepkvalleft);
+ }
responseContainer = createContainer(MESSAGE_TYPE__MotorAbortHomingResponse, requestContainer->token, false, &response, &motor_abort_homing_response__pack, &motor_abort_homing_response__get_packed_size);
responseContainer.continuous = false;
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
index 52e9a6e85..ce3ced6ef 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
@@ -724,7 +724,7 @@ void PrepareACHeater(int HeaterId,uint32_t Frequency, uint32_t SetTemperatue)
{
if(Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD)
{
- WHS_Set_SetPoint_Q_value(headairflow*2/3);
+ WHS_Set_SetPoint_Q_value(headairflow);
}
else
{
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);
}
diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
index e0a2f79d5..f822c869c 100644
--- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
+++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
@@ -286,6 +286,7 @@ void midTankStateMachine(void)
}
if (doorState != prevDoorState) {
prevDoorState = doorState;
+ Report("Door state change", __FILE__, __LINE__, doorState, RpMessage, prevDoorState, 0);
}
break;
case MidTankStateWait:
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
index c912bca21..aea0dd93a 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
@@ -42,6 +42,15 @@ typedef struct
PID_Config_Params m_params;
}MotorControlConfig_t;
+#ifdef FOUR_WINDERS
+#define SCREW_2_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE2_1
+#define SCREW_3_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE1_1
+#define SCREW_4_Motor HARDWARE_MOTOR_TYPE__MOTO_RDANCER
+#define Winder_2_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE2_2
+#define Winder_3_Motor HARDWARE_MOTOR_TYPE__MOTO_SPARE1_2
+#define Winder_4_Motor HARDWARE_MOTOR_TYPE__MOTO_RLOADARM
+#endif
+
#define MAX_THREAD_FEED_MOTORS (WINDER_MOTOR+1)
#define MAX_SYSTEM_DANCERS (HARDWARE_DANCER_TYPE__RightDancer+1)
@@ -84,6 +93,7 @@ uint32_t DancerConfigMessage(HardwareDancer * request);
uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Read);
void SetOriginMotorSpeed(float process_speed);
+uint32_t UpdatePidDuringRun(HardwarePidControl *hardwarepidcontrol);
uint32_t ThreadPrepare_Tension (int DancerId, double tension);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index c7ec8a58c..c478b82de 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -164,7 +164,7 @@
{
if (Is_PP_Machine())
- kval_upperValue = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
+ kval_upperValue = 28;
else
kval_upperValue = 70;
@@ -208,7 +208,7 @@
{
if(Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD)
{
- WHS_Set_SetPoint_Q_value(headairflow*2/3);
+ WHS_Set_SetPoint_Q_value(headairflow);
}
else
{
@@ -349,7 +349,10 @@
if (Head_Type != HEAD_TYPE_ARC)
{
CallbackCounter++;
- 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);
+ if (MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 300, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,20000)==ERROR)
+ {
+ Thread_Load_HomingCallback(HARDWARE_MOTOR_TYPE__MOTO_DH_LID,NO_LIMIT);
+ }
}
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);
@@ -366,8 +369,8 @@
if (Head_Type == HEAD_TYPE_FLAT)
{
Report("Thread_Load_Lift_actuators",__FILE__,__LINE__,LOW,RpMessage,false,0);
- Trigger_Head_Actuators_Control(ACT_IN_AND_OUT, LOW,true);
- //Trigger_Head_Actuators_Control(ACTIN, LOW,true);
+ Trigger_Head_Actuators_Stub(ACTOT, ENABLE, UP);
+ Trigger_Head_Actuators_Stub(ACTIN, ENABLE, UP);
}
return OK;
}
@@ -395,8 +398,8 @@
{
keepmicrostep = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].microstep;
keepkvalrun = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
- if (keepkvalrun>=25)
- keepkvalrun = 25;
+ /*if (keepkvalrun>=25)
+ keepkvalrun = 25;*/
Report("Read_Dryer_ENC_Position()",__FILE__,__LINE__,0,RpWarning,Read_Dryer_ENC_Position(),0);
@@ -428,6 +431,7 @@
if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT)
{
REPORT_MSG(LIMIT, "No cone in winder");
+ Thread_Load_HomingCallback(HARDWARE_MOTOR_TYPE__MOTO_WINDER,NO_LIMIT);
//return ERROR;
}
CallbackCounter++;
@@ -440,8 +444,8 @@
{
keepmicrostep = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].microstep;
keepkvalrun = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].kvalrun;
- if (keepkvalrun>=25)
- keepkvalrun = 25;
+ /*if (keepkvalrun>=25)
+ keepkvalrun = 25;*/
Report("Thread_Load_Close_Rockers",__FILE__,__LINE__,keepkvalrun,RpMessage,keepmicrostep,0);
MotorSetMicroStep(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 8);
@@ -460,7 +464,7 @@
uint32_t Thread_Load_Close_Dancers(void)
//Send Dancer Motors To Preset Location, Check That The Dancers Are On The Thread
{
- uint32_t current = 0;
+ uint32_t current = 1;
REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Close_Dancers");
CallbackCounter++;
MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RDANCER], Thread_Load_HomingCallback,10000);
@@ -500,14 +504,14 @@
if (Head_Type == HEAD_TYPE_FLAT)
{
Report("Thread_Load_Close_actuators",__FILE__,__LINE__,LOW,RpMessage,true,0);
- Trigger_Head_Actuators_Control(ACTOT, LOW,false);
- //Trigger_Head_Actuators_Control(ACTIN, LOW,false);
+ Trigger_Head_Actuators_Stub(ACTOT, ENABLE, DOWN);
+ //Trigger_Head_Actuators_Stub(ACTIN, ENABLE, DOWN);
HeadCard_Actuators_Relocate();
}
if (Head_Type != HEAD_TYPE_ARC)
{
CallbackCounter++;
- 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);
+ MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 300, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,20000);
}
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);
@@ -1227,11 +1231,11 @@ uint32_t ThreadLoadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
index = IfIndex&0xFF;
DancerId = ThreadMotorIdToDancerId[index];
- if (ReadValue < 10)
+ /*if (ReadValue < 10)
{
Report("Dancer value read too small.",__FILE__,__LINE__,DancerId,RpError,ReadValue,0);
return OK;
- }
+ }*/
if (ReadValue == 0x3FFF)
{
return OK;
@@ -1242,6 +1246,11 @@ uint32_t ThreadLoadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
//pooler dancer is right sided: data is opposite
TranslatedReadValue = (-1*TranslatedReadValue);
}
+ if (abs(TranslatedReadValue) > 0x2000)
+ {
+ TranslatedReadValue = 0x3FFF- TranslatedReadValue; //overcome zero environment
+ }
+
//TranslatedReadValue = 0;//test
MotorSamples[index][MotorSamplePointer[index]] = TranslatedReadValue;//(-1 * TranslatedReadValue);
MotorSamplePointer[index]++;
@@ -1344,10 +1353,16 @@ void ThreadLoadRequest(MessageContainer* requestContainer)
responseContainer = createContainer(MESSAGE_TYPE__StubHeatingTestResponse, requestContainer->token, false, &response, &stub_heating_test_response__pack, &stub_heating_test_response__get_packed_size);
container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
-
int LoadStage = (int)request->dryerzone1temp;
- LoadStages = LoadStage;
- ThreadLoadStateMachine(LoadStage);
+ if (request->hardwarepidcontrol1!=NULL)
+ {
+ UpdatePidDuringRun(request->hardwarepidcontrol1);
+ }
+ else
+ {
+ LoadStages = LoadStage;
+ ThreadLoadStateMachine(LoadStage);
+ }
/*if (status)
{
@@ -1463,7 +1478,7 @@ uint32_t ThreadLoadingReport(void)
uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer)
{
- TryThreadLoadingRequest *request = continue_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
+ TryThreadLoadingRequest *request = try_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
TryThreadLoadingResponse Cresponse = TRY_THREAD_LOADING_RESPONSE__INIT;
MessageContainer responseContainer;
MessageState = 2;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 420141d5b..1ce27115d 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -133,6 +133,7 @@ uint32_t InternalWindingConfigMessage(JobSpool* request)
* 1. move home to the limit switch (check that the cart is clear from the limit switch, start moving, with acceleration to maximal speed. enable interrupt on the limit switch, upon interrupt stop.
* report ready to the job STM
*/
+int Screw_wait_counter;
uint32_t Winder_Prepare(void *JobDetails)
{
JobTicket* JobTicket = JobDetails;
@@ -199,7 +200,16 @@ uint32_t Winder_Prepare(void *JobDetails)
//REPORT_MSG(ScrewSpeed, "Winder_Prepare");
Winder_ScrewHoming = true;
//REPORT_MSG(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, "Winder_Prepare move to limit");
+ Screw_wait_counter=1;
status = MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, ScrewSpeed, GPI_LS_SCREW_RIGHT, Winder_PrepareStage2,2000);
+#ifdef FOUR_WINDERS
+ Screw_wait_counter++;
+ status = MotorMovetoLimitSwitch (SCREW_2_Motor,MotorsCfg[SCREW_2_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE2_2, Winder_PrepareStage2,2000);
+ Screw_wait_counter++;
+ status = MotorMovetoLimitSwitch (SCREW_3_Motor,MotorsCfg[SCREW_3_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE1_2, Winder_PrepareStage2,2000);
+ Screw_wait_counter++;
+ status = MotorMovetoLimitSwitch (SCREW_4_Motor,MotorsCfg[SCREW_4_Motor].directionthreadwize, ScrewSpeed, GPI_LS_RDANCER_UP, Winder_PrepareStage2,2000);
+#endif
}
return status;
}
@@ -214,7 +224,7 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue)
uint32_t status=OK;
uint32_t numOfSteps = WindingConeLocation*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep;
- //MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses);
+ //MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses);
//REPORT_MSG(numOfSteps, "Winder_PrepareStage2");
#ifdef READ_SCREW_ENCODER
Read_Screw_Encoder();
@@ -223,11 +233,12 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue)
#endif
REPORT_MSG(millisecondCounter/*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].maxfrequency*/, "Winder_PrepareStage2");
+ Screw_wait_counter--;
if (ReadValue != LIMIT)
{
if (JobIsActive()==true)
{
- LOG_ERROR(ReadValue,"Screw failed to reach the limit switch!!");
+ LOG_ERROR(deviceID,"Screw failed to reach the limit switch!!");
//returned with a timeout
Winder_ScrewAtOffsetCallback(0,0);
}
@@ -238,18 +249,38 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue)
}
else
{
+ if (Screw_wait_counter!=0)
+ {
+ ReportWithPackageFilter(ThreadFilter,"waiting for winders",__FILE__,__LINE__,Screw_wait_counter,RpWarning,deviceID, 0);
+ return status;
+ }
+ Screw_wait_counter++;
status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_SCREW, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize),numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+#ifdef FOUR_WINDERS
+ Screw_wait_counter++;
+ status |= MotorMoveWithCallback (SCREW_2_Motor,(1-MotorsCfg[SCREW_2_Motor].directionthreadwize), numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+ Screw_wait_counter++;
+ status |= MotorMoveWithCallback (SCREW_3_Motor,(1-MotorsCfg[SCREW_3_Motor].directionthreadwize), numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+ Screw_wait_counter++;
+ status |= MotorMoveWithCallback (SCREW_4_Motor,(1-MotorsCfg[SCREW_4_Motor].directionthreadwize), numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+#endif
}
//set motor location 0 here
return status;
}
-uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag)
+uint32_t Winder_ScrewAtOffsetCallback(uint32_t MotorId, uint32_t BusyFlag)
{
//MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,temp_MaxFrequency);
+ Screw_wait_counter--;
- MotorStop (HARDWARE_MOTOR_TYPE__MOTO_SCREW,Soft_Hiz); //per L6470 errata between mov and run commands
+ MotorStop (MotorId,Soft_Hiz); //per L6470 errata between mov and run commands
+/*#ifdef FOUR_WINDERS
+ MotorStop(SCREW_2_Motor, Hard_Hiz);
+ MotorStop(SCREW_3_Motor, Hard_Hiz);
+ MotorStop(SCREW_4_Motor, Hard_Hiz);
+#endif*/
Task_sleep(5);
#ifdef READ_SCREW_ENCODER
Reset_Screw_Encoder();
@@ -260,7 +291,12 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag)
REPORT_MSG(ScrewLocationStart, "Winder_ScrewAtOffsetCallback Encoder Location");
#endif
- SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_SCREW); //set this point as the spool home
+ SetMotHome(MotorId); //set this point as the spool home
+/*#ifdef FOUR_WINDERS
+ SetMotHome(SCREW_2_Motor);
+ SetMotHome(SCREW_3_Motor);
+ SetMotHome(SCREW_4_Motor);
+#endif*/
ScrewCurrentDirection = false;
#ifdef READ_SCREW_ENCODER
@@ -269,8 +305,9 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag)
ScrewSpeed = 0;
ScrewControlId = 0xFF;
ScrewNumberOfSteps = 0;
- REPORT_MSG(millisecondCounter, "Winder_ScrewAtOffsetCallback");
- PrepareReady(Module_Winder, ModuleDone);
+ ReportWithPackageFilter(ThreadFilter,"Winder_ScrewAtOffsetCallback",__FILE__,millisecondCounter,Screw_wait_counter,RpWarning,MotorId, 0);
+ if (Screw_wait_counter == 0)
+ PrepareReady(Module_Winder, ModuleDone);
return OK;
}
@@ -565,6 +602,11 @@ uint32_t ScrewDTSCallback(uint32_t deviceID, uint32_t BusyFlag)
//MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, 1000, GPI_LS_SCREW_RIGHT, NULL,0);
//MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz);
MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, ScrewSpeed, GPI_LS_SCREW_RIGHT, WinderDistanceToSpoolEnded,2000);
+#ifdef FOUR_WINDERS
+ MotorMovetoLimitSwitch (SCREW_2_Motor,MotorsCfg[SCREW_2_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE2_2, NULL,2000);
+ MotorMovetoLimitSwitch (SCREW_3_Motor,MotorsCfg[SCREW_3_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE1_2, NULL,2000);
+ MotorMovetoLimitSwitch (SCREW_4_Motor,MotorsCfg[SCREW_4_Motor].directionthreadwize, ScrewSpeed, GPI_LS_RDANCER_UP, NULL,2000);
+#endif
return OK;
}
@@ -594,9 +636,14 @@ uint32_t Winder_End(void)
//MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, 1000, GPI_LS_SCREW_RIGHT, NULL,0);
//MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz);
MotorAbortMovetoLimitSwitch(HARDWARE_MOTOR_TYPE__MOTO_SCREW); //bug #2709
+#ifdef FOUR_WINDERS
+ MotorAbortMovetoLimitSwitch (SCREW_2_Motor);
+ MotorAbortMovetoLimitSwitch (SCREW_3_Motor);
+ MotorAbortMovetoLimitSwitch (SCREW_4_Motor);
+#endif
return OK;
}
-void Winder_ScrewHomeLimitSwitchInterrupt(void)
+/*void Winder_ScrewHomeLimitSwitchInterrupt(void)
{
//uint32_t status;
//handle glitch - send information to the next time that the motor stops
@@ -611,7 +658,7 @@ void Winder_ScrewOutLimitSwitchInterrupt(void)
//handle glitch - send information to the next time that the motor stops
//uint32_t status;
MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out
-}
+}*/
uint32_t Screw_timerBase = TIMER3_BASE; //Timer handle
@@ -655,7 +702,17 @@ void ScrewTimerInterrupt(int ARG0)
{
ROM_TimerLoadSet(Screw_timerBase, TIMER_A,(int)ScrewRunningTime);
MotorSetDirection (HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewCurrentDirection);
+#ifdef FOUR_WINDERS
+ MotorSetDirection (SCREW_2_Motor, ScrewCurrentDirection);
+ MotorSetDirection (SCREW_3_Motor, ScrewCurrentDirection);
+ MotorSetDirection (SCREW_4_Motor, ScrewCurrentDirection);
+#endif
MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
+#ifdef FOUR_WINDERS
+ MotorSetSpeedDirect (SCREW_2_Motor, ScrewSpeed);
+ MotorSetSpeedDirect (SCREW_3_Motor, ScrewSpeed);
+ MotorSetSpeedDirect (SCREW_4_Motor, ScrewSpeed);
+#endif
#ifdef READ_SCREW_ENCODER
Read_Screw_Encoder();
ScrewLocationRun[ScrewCurrentDirection] = Screw_RotEnc.Position;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 2bdf1b17f..98147f6b2 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -696,7 +696,8 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}*`/
}*/
calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index];
- calculated_speed = calculated_speed*InitialDryerSpeed/OriginalMotorSpd_2PPS[DRYER_MOTOR];
+ if (index != WINDER_MOTOR)
+ calculated_speed = calculated_speed*InitialDryerSpeed/OriginalMotorSpd_2PPS[DRYER_MOTOR];
//calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*CurrentControlledSpeed[index];
if (0)//(JobCounter % 1000 == 0)
//if (JobCounter < 100)//(FirstCalcInJob == true)
@@ -728,6 +729,14 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}*/
CurrentControlledSpeed[index] = calculated_speed;
MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed);
+#ifdef FOUR_WINDERS
+ if (index == WINDER_MOTOR)
+ {
+ MotorSetSpeed(Winder_2_Motor, calculated_speed);
+ MotorSetSpeed(Winder_3_Motor, calculated_speed);
+ MotorSetSpeed(Winder_4_Motor, calculated_speed);
+ }
+#endif
}
else
{
@@ -841,19 +850,21 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag)
uint32_t Release_Right_TFU_Tension()
{
uint32_t status = OK;
+#ifndef FOUR_WINDERS
if (RTFU_Up == true)
{
Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0);
RTFU_Up = false;
status = MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Release_Right_TFU_TensionCallback,1000);
}
-
+#endif
return status;
}
int SecondFeederCorrection = 4;
int PrepareWaitCount = 0;
uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadValue)
{
+#ifndef FOUR_WINDERS
MotorStop (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,Soft_Stop); //per L6470 errata between mov and run commands
Report("Adjust_Right_TFU_Tension_2ndCallback x more steps",__FILE__,__LINE__,MotorId,RpMessage,SecondFeederCorrection,0);
if (JobIsActive()==false)
@@ -872,20 +883,23 @@ uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadVa
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback Prepare Ready",__FILE__,__LINE__,2,RpWarning,PrepareWaitCount,0);
PrepareReady(Module_Thread,ModuleDone);
}
-
+#endif
return OK;
}
uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue)
{
+#ifndef FOUR_WINDERS
Report("Adjust_Right_TFU_Tension_Callback",__FILE__,__LINE__,MotorId,RpMessage,0,0);
MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,SecondFeederCorrection* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Adjust_Right_TFU_Tension_2nd_Callback,1000);
RTFU_Up = true;
+#endif
return OK;
}
uint32_t Adjust_Right_TFU_Tension(double tension)
{
uint32_t status = OK;
+#ifndef FOUR_WINDERS
if (tension > 0.5) //0 = lower position, 1 = high position
{
if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT)
@@ -895,7 +909,7 @@ uint32_t Adjust_Right_TFU_Tension(double tension)
Report("Adjust_Right_TFU_Tension",__FILE__,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,PrepareWaitCount,0);
}
}
-
+#endif
return status;
}
uint32_t ThreadPrepare_TensionCallback (int MotorId, double tension)
@@ -1013,11 +1027,11 @@ uint32_t ThreadPrepareState(void *JobDetails)
PrepareWaitCount = 0;
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension);
- ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpFatalError,(int)windertension,0);
+ ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0);
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension);
- ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpFatalError,(int)pullertension,0);
+ ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpWarning,(int)pullertension,0);
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension);
- ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpFatalError,(int)feedertension,0);
+ ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpWarning,(int)feedertension,0);
FirstCalcInJob = true;
if(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].speedmaster == false)
@@ -1034,14 +1048,14 @@ uint32_t ThreadPrepareState(void *JobDetails)
/*if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID]) != LIMIT)
{
- ReportWithPackageFilter(ThreadFilter,"Dyeing head is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpFatalError,LIMIT,0);
+ ReportWithPackageFilter(ThreadFilter,"Dyeing head is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpWarning,LIMIT,0);
//JobEndReason = JOB_LIDS_OPEN;
//PrepareReady(Module_Thread,ModuleFail);
//return ERROR;
}
if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID]) != LIMIT)
{
- ReportWithPackageFilter(ThreadFilter,"Dryer lid is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpFatalError,LIMIT,0);
+ ReportWithPackageFilter(ThreadFilter,"Dryer lid is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpWarning,LIMIT,0);
//JobEndReason = JOB_LIDS_OPEN;
//PrepareReady(Module_Thread,ModuleFail);
//return ERROR;
@@ -1120,6 +1134,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
/////////////////////////////////////////////////////
MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize);
+#ifndef FOUR_WINDERS
if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0);
@@ -1132,6 +1147,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
LengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep);
SpeedControlId = AddControlCallback(NULL,ThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
}
+#endif
if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0);
@@ -1145,6 +1161,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep);
PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
}
+#ifndef FOUR_WINDERS
if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
if (ControlIdtoMotorId[Motor_i] != 0xFF)
@@ -1159,6 +1176,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
//AddControlCallback(NULL,ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
#endif
}
+#endif
if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled
{
if (ControlIdtoMotorId[Motor_i] != 0xFF)
@@ -1196,7 +1214,57 @@ uint32_t ThreadPrepareState(void *JobDetails)
//set 3 dancers to the profile positions
return OK;
}
+uint32_t UpdatePidDuringRun(HardwarePidControl *request)
+{
+ int Motor_i = MAX_THREAD_MOTORS_NUM,i;
+ double temp_dt;
+ for (i=0;i<MAX_THREAD_MOTORS_NUM;i++)
+ {
+ if (ThreadMotorIdToControlId[i] == request->hardwarepidcontroltype)
+ {
+ Motor_i = i;
+ break;
+ }
+ }
+ if (Motor_i == MAX_THREAD_MOTORS_NUM)
+ return ERROR;
+
+
+ if (request->derivativetime == true)
+ {
+ MotorControlConfig[Motor_i].m_params.Kd = request->derivativetime;
+ ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Kd",__FILE__,Motor_i,(int)(request->derivativetime),RpWarning,0,0);
+ }
+ if (request->proportionalgain == true)
+ {
+ MotorControlConfig[Motor_i].m_params.Kp = request->proportionalgain;
+ ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Kp",__FILE__,Motor_i,(int)(request->proportionalgain),RpWarning,0,0);
+ }
+ if (request->integraltime == true)
+ {
+ MotorControlConfig[Motor_i].m_params.Ki = request->integraltime;
+ ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Ki",__FILE__,Motor_i,(int)(request->integraltime),RpWarning,0,0);
+ }
+ if (request->epsilon == true)
+ {
+ MotorControlConfig[Motor_i].m_params.epsilon = request->epsilon;
+ ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun epsilon",__FILE__,Motor_i,(int)(request->epsilon*10000),RpWarning,0,0);
+ }
+ if (request->has_controloutputtype == true)
+ {
+ MotorControlConfig[Motor_i].m_params.dt = request->controloutputtype;
+ temp_dt = MotorControlConfig[Motor_i].m_params.dt/0.001;
+ MotorTiming[Motor_i] = (int)temp_dt;
+ if (MotorTiming[Motor_i])
+ {
+ MotorTimer[Motor_i] = MotorTiming[Motor_i]-1;
+ }
+ ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun dt",__FILE__,Motor_i,(int)(request->controloutputtype*1000),RpWarning,temp_dt,0);
+ }
+//////////////////////////////////////////////////
+ return OK;
+}
void SetOriginMotorSpeed(float process_speed)
{
int Motor_i, HW_Motor_Id;
@@ -1451,6 +1519,15 @@ char Endstr[150];
for ( Motor_i = 0;Motor_i <= WINDER_MOTOR;Motor_i++)
{
MotorStop(ThreadMotorIdToMotorId[Motor_i],Hard_Hiz);
+#ifdef FOUR_WINDERS
+ if (Motor_i == WINDER_MOTOR)
+ {
+ MotorStop(Winder_2_Motor, Hard_Hiz);
+ MotorStop(Winder_3_Motor, Hard_Hiz);
+ MotorStop(Winder_4_Motor, Hard_Hiz);
+ }
+#endif
+
}
MotorStop(HARDWARE_MOTOR_TYPE__MOTO_RLOADING,Hard_Hiz);
MotorStop(HARDWARE_MOTOR_TYPE__MOTO_LLOADING,Hard_Hiz);
diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c
index c0e51a143..222b618d2 100644
--- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c
+++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c
@@ -526,6 +526,4 @@ uint32_t Waste_Prepare(void)
//PrepareReady(Module_Waste,ModuleFail);
return JOB_OTHER_ALARM;
}
- return;
-
}
diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt
index d38f03d0e..7d39689d4 100644
--- a/Software/Embedded_SW/Embedded/Software Release Notes.txt
+++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt
@@ -1,3 +1,28 @@
+Embedded SW Release note - Version 1.4.6.42 - Pack Mid alpha
+=============================================================
+log events before report starts and after afailure to a file (errorfile.txt)
+save space in the usb communication
+4 winders support (under a flag)
+ARC head -read tacho fan correctly
+fix actuator handling in loading and jogging
+diagnostics - cartridges state, ambient temp (max of cabinet/machine)
+initial heating headflow - full
+pressure relief in inactive dispensers - pull down 2000 steps, issue an alarm in 5 bars and open valve
+update PID during run stub (not tested)
+transfer RML PID params on cleaning/ jogging jobs (from the previous job)
+raise motor voltage on loading wheels movement to 0.8 (kval 28)
+IDS job prepare - run at least 120000 steps in each active dispenser before the job. pressure buildup up to 4 bars
+fix IDS bug - when the thread runs fast and need to cancel the last brushstops (delta job)
+fix winder thread movement on start
+fix stuck in power down right after restart
+
+
+Embedded SW Release note - Version 1.4.6.41 - Pack Mid alpha
+=============================================================
+fix a bug that crashed the SW on arm movement (motorMovewithcallback)
+remove some logs
+fix gradient finishing when job runs too fast
+
Embedded SW Release note - Version 1.4.6.40 - Pack Mid alpha
=============================================================
change head type names (internal) FLAT/ARC
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
index 815b153d1..f20b1aa94 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
@@ -242,7 +242,7 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
Control_Voltage_To_Blower(3000);
WHS_enable_control_loop(true);
- WHS_Set_SetPoint_Q_value(headairflow*2/3);
+ WHS_Set_SetPoint_Q_value(headairflow);
AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation
waste_seq_step1();// include 1Sec delay <- to open !!!!
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c
index 3a60a761b..5d512cb9b 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c
@@ -120,7 +120,7 @@ void PowerIdleSetIdle(void)
Control_Voltage_To_Blower(BlowerCfg.heatingvoltage);
else
Control_Voltage_To_Blower(BlowerCfg.voltage-500);
- WHS_Set_SetPoint_Q_value(headairflow/2);
+ WHS_Set_SetPoint_Q_value(headairflow);
}
SetMachineStatus(MACHINE_STATE__Sleep);
if (Auto_Shutdown_Bypass == false)
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c
index 776d55080..73d93a7b2 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c
@@ -256,7 +256,7 @@ uint32_t PowerOffHeatersOff(void)
if (HandleProcessParameters(&ProcessParametersClear,false)!= OK)
{
LOG_ERROR (PowerOffMachineState, "Turn Off Heaters failed");
- return ERROR;
+ //return ERROR;
}
PowerOffMachineState++;
@@ -501,6 +501,8 @@ uint32_t PowerOffPowerOff(void)
REPORT_MSG (10-i, "Power off in x seconds");
Task_sleep (1000);
}
+ CloseLogFile();
+
ControlStop();
MillisecStop();
HeatersEnd();
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index 33face713..8bce76ccf 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
@@ -151,6 +151,7 @@ bool JobResumed = false;
char JobToken[36+1]={0};
bool JobAbortedByUser = false;
+ThreadParameters SavedThreadParameters;
////////////////////////////////////////////////////////////////////////////
void StartJob(void *JobDetails);
@@ -425,6 +426,7 @@ uint32_t ThreadJoggingFunc(int speed)
Tspool->rotationsperpassage = 3.1415926*2;
Tspool->has_limitswitchstartpointoffset = false;
Ticket.spool = Tspool;
+ Ticket.threadparameters = &SavedThreadParameters;
CurrentJob = &Ticket;
InternalWindingConfigMessage(Tspool);
JoggingJobActive = true;
@@ -608,6 +610,7 @@ uint32_t ThreadCleaningJob(int speed)
Tspool->rotationsperpassage = 3.1415926*2;
Tspool->has_limitswitchstartpointoffset = false;
Ticket.spool = Tspool;
+ Ticket.threadparameters = &SavedThreadParameters;
CurrentJob = &Ticket;
job_length = CurrentJob->length + dryerbufferMeters;
@@ -958,6 +961,7 @@ void JobRequestFunc(MessageContainer* requestContainer)
{
Report("Job Request ",__FILE__,__LINE__,Ticket->processparameters->dyeingspeed,RpWarning,n_segments, Ticket->intersegmentlength);
memcpy(&Configured,&JobConfigured,sizeof(JobConfigured));
+ memcpy(&SavedThreadParameters,&Ticket->threadparameters,sizeof(SavedThreadParameters));
StartJob(CurrentJob);
}
}
@@ -1352,6 +1356,7 @@ Void jobTask(UArg arg0, UArg arg1)
//uint16_t length;
//Clock_setTimeout(HostKAClock, 1000);
//Clock_start(HostKAClock);
+ memset(&SavedThreadParameters,0,sizeof(SavedThreadParameters));
JobmsgQ = Mailbox_create(MAX_MSG_LEN, 20, NULL,NULL);
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c
index b874e5eaf..52aac94f5 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c
@@ -142,7 +142,6 @@ FRESULT RewindJobFile()
FRESULT CloseJobFile()
{
Fresult = f_close(JobRequestFileHandle);
-#warning trying not to hold the semaphore and enable the PPC/MS to work on several files simultaneously
readbBytes = 0;
ImmediateRead = 0;
@@ -254,6 +253,8 @@ JobDescriptionFileBrushStop *GetNextBrushStopFromJobFile()
{
readbBytes += ImmediateRead;
BrushStop = job_description_file_brush_stop__unpack(NULL, BrushStopSize, BrushStopPtr);
+ if (BrushStop == NULL)
+ Report("brush_stop__unpack error!",__FILE__,BrushStopSize,(int)readbBytes,RpWarning,(int)ImmediateRead,0);
}//brushstop malloc ok
else
{
@@ -310,7 +311,7 @@ uint32_t PrintingHWConfiguration(void *Configuration)
if ((IFS_Availability[1] == IFS_RECOGNIZED_INIT_PASSED)&&(IFS_Availability[2] == IFS_RECOGNIZED_INIT_PASSED)) //ifs installed -check cartridges
Configured[Module_Waste] = true;
- if (request->n_motors < HARDWARE_MOTOR_TYPE__MOTO_SPARE1_1)
+ if (request->n_motors)
{
for (i = 0; i < request->n_motors ; i++)
{
diff --git a/Software/Embedded_SW/Embedded/src/makefile.libs b/Software/Embedded_SW/Embedded/src/makefile.libs
index f262762ef..ae6999352 100644
--- a/Software/Embedded_SW/Embedded/src/makefile.libs
+++ b/Software/Embedded_SW/Embedded/src/makefile.libs
@@ -1,6 +1,6 @@
#
# This file was generated based on the configuration script:
-# C:\Tango\Software\Embedded_SW\Embedded\Embedded.cfg
+# C:\tango\Software\Embedded_SW\Embedded\Embedded.cfg
#
# This makefile may be included in other makefiles that need to build
# the libraries containing the compiled source files generated as
@@ -14,7 +14,7 @@
#
# The absolute path to the generated source directory (at the time the
# sources were generated) is:
-# C:\Tango\Software\Embedded_SW\Embedded\src
+# C:\tango\Software\Embedded_SW\Embedded\src
#
GEN_SRC_DIR ?= ../src
diff --git a/Software/Embedded_SW/Embedded/src/sysbios/makefile b/Software/Embedded_SW/Embedded/src/sysbios/makefile
index 0f63ec463..a8280a913 100644
--- a/Software/Embedded_SW/Embedded/src/sysbios/makefile
+++ b/Software/Embedded_SW/Embedded/src/sysbios/makefile
@@ -1,29 +1,29 @@
-XOPTS = -I"C:/TI/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M4F
+XOPTS = -I"C:/ti/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M4F
-vpath % C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
-vpath %.c C:/TI/xdctools_3_32_00_06_core/packages/
+vpath % C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
+vpath %.c C:/ti/xdctools_3_32_00_06_core/packages/
CCOPTS = --endian=little -mv7M4 --abi=eabi --float_support=fpv4spd16 -q -ms --program_level_compile -g -Dxdc_FILE=__FILE__ -Dti_sysbios_knl_Task_minimizeLatency__D=FALSE -Dti_sysbios_knl_Clock_stopCheckNext__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_enableException__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_disablePriority__D=32U -Dti_sysbios_family_arm_m3_Hwi_numSparseInterrupts__D=0U -Dti_sysbios_hal_Core_numCores__D=1
-XDC_ROOT = C:/TI/xdctools_3_32_00_06_core/packages/
+XDC_ROOT = C:/ti/xdctools_3_32_00_06_core/packages/
-BIOS_ROOT = C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
+BIOS_ROOT = C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
BIOS_DEFS = -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=16 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=16 -Dti_sysbios_knl_Task_checkStackFlag__D=TRUE -Dti_sysbios_knl_Task_initStackFlag__D=TRUE -Dti_sysbios_knl_Task_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_PERIODIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=TRUE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_utils_Load_hwiEnabled__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=TRUE
-BIOS_INC = -I"C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
+BIOS_INC = -I"C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
-TARGET_INC = -I"C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
+TARGET_INC = -I"C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
INCS = $(BIOS_INC) $(TARGET_INC)
-CC = C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl -c $(CCOPTS) -I C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include
-ASM = C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl -c $(CCOPTS) -I C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include
-AR = C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armar rq
+CC = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/include
+ASM = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/include
+AR = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.2.LTS/bin/armar rq
-DEL = C:/TI/xdctools_3_32_00_06_core/packages/../bin/rm -f
-CP = C:/TI/xdctools_3_32_00_06_core/packages/../bin/cp -f
+DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f
+CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f
define RM
$(if $(wildcard $1),$(DEL) $1,:)
diff --git a/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f b/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f
index b658da29a..5708939be 100644
--- a/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f
+++ b/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f
Binary files differ