aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-02-19 20:37:44 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-02-19 20:37:44 +0200
commitd6e2772dd98e6880de14ea12be0ef53bae24f763 (patch)
tree4d3385fc155c5bc5cb080da5318dc7dfeb4d0d75 /Software
parentb41a0cfe17a485abd077b7f059bb9620cf6e474c (diff)
parent7577588797cea9bd827df9170180370b739a5a8d (diff)
downloadTango-d6e2772dd98e6880de14ea12be0ef53bae24f763.tar.gz
Tango-d6e2772dd98e6880de14ea12be0ef53bae24f763.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c2
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c2
-rw-r--r--Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c26
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c8
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c54
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h7
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c12
-rw-r--r--Software/Embedded_SW/Embedded/Embedded.cfg4
-rw-r--r--Software/Embedded_SW/Embedded/Main.c3
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c29
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c3
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c30
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/process.c6
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c66
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c63
-rw-r--r--Software/Embedded_SW/Embedded/Software Release Notes.txt88
20 files changed, 326 insertions, 85 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index e8d7f6f58..1ba656657 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -100,7 +100,7 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer)
if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
CommRxTaskHandle = Task_self();
- Task_setPri(CommRxTaskHandle, 3);
+ Task_setPri(CommRxTaskHandle, 2);
// Report("Task_setPri", __FILE__, __LINE__, 4, RpWarning, (int)CommRxTaskHandle, 0);
//Report("FileUploadRequestFunc 2", __FILE__, __LINE__, msec_millisecondCounter, RpWarning, (int)0, 0);
Fresult = f_open(UploadFileHandle,request->path,FA_READ | FA_WRITE | FA_OPEN_ALWAYS | FA_CREATE_ALWAYS);
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
index 24f02f60c..4bbe44aea 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
@@ -165,6 +165,7 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer)
usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename);
Fresult = f_unlink("//SYSINFO//PROCESSP.CFG");
Fresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG");
+ LoadProcessParamsFromFile();
CurrentRunningFile++;
break;
case VERSION_FILE_DESTINATION__AlarmParams:
@@ -180,6 +181,7 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer)
usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename);
Fresult = f_unlink("//SYSINFO//GENHWCFG.CFG");
Fresult |= f_rename (FullPath, "//SYSINFO//GENHWCFG.CFG");
+ HWConfigurationLoadFile();
CurrentRunningFile++;
break;
default:
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 6885ee3d8..201b896ff 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,11};
+TangoVersion_t _gTangoVersion = {1,4,6,12};
#define BUILD_DATE __DATE__
char Dat[50] = BUILD_DATE;
char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d
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 d31d0479a..cc4b34857 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
@@ -324,28 +324,33 @@ uint32_t HeadCard_Valve_Control(bool Direction)
}
*/
uint32_t ActControlId = 0xFF;
-ACTUATORS Global_Act_ID;
-uint32_t HeadCard_ActuatorsCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
+char Global_Act_Cmd_flag = 0; //Sync - prevent reset from previous command
+
+
+uint32_t HeadCard_ActuatorsCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) // use IfIndex for Act_ID
{
uint32_t status = OK;
static uint8_t Counter = 0;
+ static char Act_Cmd_flag = 0;
+
+ Act_Cmd_flag++;//prevent reset from previous command
+
uint32_t Motion_Status = STOPPED;
- ACTUATORS Act_ID = Global_Act_ID;
+ ACTUATORS Act_ID = (ACTUATORS) IfIndex;
if (SafeRemoveControlCallback(ActControlId, HeadCard_ActuatorsCallBackFunction )==OK)
ActControlId = 0xFF;
else
Report("Remove control callback failed",__FILE__,__LINE__,(int)ActControlId,RpWarning,(int)HeadCard_ActuatorsCallBackFunction,0);
- ///************** do your stuff
//Read movement status
Motion_Status = HeadCard_Actuators_Status(Act_ID);
- if(Motion_Status == MOVING)
+ if((Motion_Status == MOVING) && (Global_Act_Cmd_flag == Act_Cmd_flag))
{
//RST
Head_I2C_EXP2_0x42.bits.OUTPUT_ACTLOW_ACT_RST = 0x00;//Disable movement
@@ -374,8 +379,6 @@ uint32_t HeadCard_Actuators_Control(ACTUATORS Act_ID, bool Direction)
{
uint32_t status = OK;
- Global_Act_ID = Act_ID;
-
if(Act_ID == ACTIN)//0
{
Head_I2C_EXP4_0x46.bits.OUTPUT_ACTLOW_ACTIN_ON = LOW;
@@ -389,8 +392,7 @@ uint32_t HeadCard_Actuators_Control(ACTUATORS Act_ID, bool Direction)
status |= Head_Write_IO_Reg(0x46,LOW_AND_HIGH);
- //Task_sleep(500);
- delayms(750);
+ Task_sleep(500);
if(Act_ID == ACTIN)//0
{
@@ -402,8 +404,10 @@ uint32_t HeadCard_Actuators_Control(ACTUATORS Act_ID, bool Direction)
}
status |= Head_Write_IO_Reg(0x46,HIGH);
- //5sec delay - Timeout
- ActControlId = AddControlCallback("ActuatorControl", HeadCard_ActuatorsCallBackFunction, (2* eOneSecond), TemplateDataReadCBFunction,0,0, 0 );
+ Global_Act_Cmd_flag++;//Sync the callback to the command
+
+ //3sec delay - Timeout
+ ActControlId = AddControlCallback("ActuatorControl", HeadCard_ActuatorsCallBackFunction, (3* eOneSecond), TemplateDataReadCBFunction,Act_ID,0, 0 );
return status;
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
index c6b8dbf39..40f6fce5e 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
@@ -396,9 +396,17 @@ void Trigger_WHS_I2C_EEprom_Read(uint32_t address, uint16_t size, uint8_t *p_dat
Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT);
return;
}
+void I2C_ReadingTask(UArg arg0, UArg arg1);
void I2C_ReadingTask_Init(void)
{
+ Task_Params taskParams;
+
I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,NULL);
+ Task_Params_init(&taskParams);
+ taskParams.instance->name = "I2C_Reading";
+ taskParams.priority = 8;
+ taskParams.stackSize = 2048;
+ I2C_Task_Handle = Task_create((Task_FuncPtr)I2C_ReadingTask, &taskParams, NULL);
}
void I2C_ReadingTask(UArg arg0, UArg arg1)
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 384e3cd59..728b7d3d1 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
@@ -17,6 +17,8 @@
#include <Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h>
+#include "StateMachines/Initialization/InitSequence.h"
+
bool Read_Max5805_device_ID();
uint8_t Read_Buf[2] = {0};
@@ -28,6 +30,8 @@ double average_Q_orifice1;
double average_Q_orifice3;
bool ORF1_flageNewBlowerValue;
bool ORF3_flageNewBlowerValue;
+double SetPoint_Q = 0.0;
+bool CofigurationFlow = 1;
int32_t i2c_smbus_write_word_data(int i2cFileDescriptor, uint8_t command_regAddress, uint16_t regValue)
{
@@ -220,7 +224,7 @@ double WHS_Blower_Avarege_ORF1()
i += 1;
}
sum_orifice_Q -= average_orf1_Q_buff[i];
- get_orf_1(&orifice_hex_value );
+ //get_orf_1(&orifice_hex_value );
average_orf1_Q_buff[i] = get_Q(orifice_hex_value);
sum_orifice_Q += average_orf1_Q_buff[i];
average_Q_orifice1 = sum_orifice_Q / ORF_BUFF_SIZE;
@@ -269,6 +273,20 @@ double WHS_Blower_Avarege_ORF3()
return average_Q_orifice3;
}
+double get_ORF1_Q()
+{
+ uint16_t tempu16 = 0;
+ get_orf_1(&tempu16);
+ return get_Q(tempu16);
+}
+
+double get_ORF3_Q()
+{
+ uint16_t tempu16 = 0;
+ get_orf_3(&tempu16);
+ return get_Q(tempu16);
+}
+
double get_average_ORF1_Q()
{
return average_Q_orifice1;
@@ -298,8 +316,8 @@ bool Test_WHS_blower()
return status;
}
#define SET_DYEING_HEAD_ORRIFFICE_SENSOR headairflow //todo
-#define LARGE_STEP 10 //todo define the correct number
-#define SMALL_STEP 1 //todo define the correct number
+#define LARGE_STEP 100 //todo define the correct number
+#define SMALL_STEP 10 //todo define the correct number
bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint_Q)
{
@@ -307,13 +325,15 @@ bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint_Q)
double current_dying_head_flow_Q = 0;
uint16_t volt;
-
+double tmp = 0.0;
current_dying_head_flow_Q = get_average_ORF3_Q();
ReportWithPackageFilter(WasteFilter,"------------ current_dying_head_flow_Q =-----------------", __FILE__,__LINE__, current_dying_head_flow_Q, RpMessage, 0, 0);
ReportWithPackageFilter(WasteFilter,"------------ SET_DYEING_HEAD_ORRIFFICE_SENSOR =-----------------", __FILE__,__LINE__, SET_DYEING_HEAD_ORRIFFICE_SENSOR, RpMessage, current_dying_head_flow_Q, 0);
- while (abs(current_dying_head_flow_Q - SetPoint_Q) > 0.2)
+ tmp = fabs((current_dying_head_flow_Q*10) - (SetPoint_Q*10));
+
+ if (tmp > (0.2 * 10))
{
- volt = getBlowerState();
+ volt = g_MAX5805_device.CODE;//getBlowerState();
if (current_dying_head_flow_Q < SetPoint_Q)
{
if (( SetPoint_Q - current_dying_head_flow_Q) > 0.5)
@@ -352,18 +372,23 @@ bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint_Q)
return OK;
}
-void WHS_Start_Blower_Control_Closed_Loop (double SetPoint_Q)
+void WHS_Set_SetPoint_Q_value(double value)
{
- // use 0 to STOP
-// uint16_t mVSetpoint = 0;
+ SetPoint_Q = value;
+ CofigurationFlow = 0;
+}
- if(SetPoint_Q)
+void WHS_Start_Blower_Control_Closed_Loop ()
+{
+ if (GetMachineState()<MACHINE_STATE_HEATING_STARTED)
+ return; //do not start before controller is initialized and running
+ if(CofigurationFlow)
{
- WHS_Set_Blower_Control_Closed_Loop(SetPoint_Q);
+ WHS_Set_Blower_Control_Closed_Loop(headairflow);
}
else
{
- // blower off?
+ WHS_Set_Blower_Control_Closed_Loop(SetPoint_Q);
}
@@ -383,5 +408,8 @@ return value;
}
*/
-
+uint16_t WHS_Get_Volt_Blower_Control()
+{
+ return g_MAX5805_device.CODE;
+}
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h
index 9f79034bb..344932033 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h
@@ -16,16 +16,19 @@ int16_t Write_Max5805_LDACn(bool value);
bool WHS_init_Blower(void);
bool WHS_Set_Volt_Blower_Control(uint16_t volt);
+uint16_t WHS_Get_Volt_Blower_Control(void);
bool Write_MAX5805_REF(void);
bool Test_WHS_blower(void);
double WHS_Blower_Avarege_ORF1(void);
double WHS_Blower_Avarege_ORF3(void);
double get_average_ORF1_Q(void);
double get_average_ORF3_Q(void);
+double get_ORF1_Q();
+double get_ORF3_Q();
bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint);
-void WHS_Start_Blower_Control_Closed_Loop (double SetPoint);
+void WHS_Start_Blower_Control_Closed_Loop ();
double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void);
-
+void WHS_Set_SetPoint_Q_value(double value);
extern double headairflow;
/* from Blower.h
diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
index 6515f14bc..4fe623e5a 100644
--- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
+++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
@@ -466,9 +466,9 @@ DFUDetachCallback(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgData,
return(0);
}
#define MAX_USB_LOG 100
-uint16_t UsbEventId[MAX_USB_LOG+1] = {0};
-uint32_t UsbTime[MAX_USB_LOG+1] = {0};
-uint16_t Usbindex = 0;
+//uint16_t UsbEventId[MAX_USB_LOG+1] = {0};
+//uint32_t UsbTime[MAX_USB_LOG+1] = {0};
+//uint16_t Usbindex = 0;
//*****************************************************************************
//
@@ -491,11 +491,11 @@ uint32_t USBConn = 0, USBDisc = 0;
uint32_t ControlHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData)
{
- UsbEventId[Usbindex] = ui32Event;
+ /*UsbEventId[Usbindex] = ui32Event;
UsbTime[Usbindex] = msec_millisecondCounter;
if (Usbindex++ >= MAX_USB_LOG)
- Usbindex = 0;
- //
+ Usbindex = 0;*/
+ //
// Which event are we being asked to process?
//
switch(ui32Event)
diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg
index 734902ce7..a9a958a55 100644
--- a/Software/Embedded_SW/Embedded/Embedded.cfg
+++ b/Software/Embedded_SW/Embedded/Embedded.cfg
@@ -132,12 +132,12 @@ ProcessTaskParams.stackSize = 4096;
ProcessTaskParams.priority = 9;
Program.global.process = Task.create("&jobTask", ProcessTaskParams);
-var I2C_Reading = new Task.Params();
+/*var I2C_Reading = new Task.Params();
I2C_Reading.instance.name = "I2C_Reading";
I2C_Reading.stackSize = 2048;
I2C_Reading.priority = 8;
Program.global.I2C_Reading = Task.create("&I2C_ReadingTask", I2C_Reading);
-
+*/
var HeaterControlTaskParams = new Task.Params();
HeaterControlTaskParams.instance.name = "HeatersControl";
HeaterControlTaskParams.priority = 7;
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index 803a22cc4..604fc73fb 100644
--- a/Software/Embedded_SW/Embedded/Main.c
+++ b/Software/Embedded_SW/Embedded/Main.c
@@ -300,7 +300,8 @@ int main(void)
//ActivateHeadMagnet();
Set_Speed_Sensor_TypeII_Registers(10,5);//set default values
#endif
- I2C_ReadingTask_Init();
+ if ((Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD)||(WHS_Type == WHS_TYPE_NEW))
+ I2C_ReadingTask_Init();
//EMAC_initEMAC();
ControlInit();
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
index e06e908bd..22cc33822 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -1566,7 +1566,7 @@ void SendEventNotifications(void)
}
EventsResponse.n_events = 0;
- UInt Key = Task_disable();
+ //UInt Key = Task_disable();
for (i = 0;i<NumOfSystemAlarms;i++)
{
if (AlarmState[i].Status == true)
@@ -1594,14 +1594,24 @@ void SendEventNotifications(void)
{
EventsResponse.events[e]=AlarmState[i].EventPtr;
e++;
+ if (e > EventsResponse.n_events)
+ {
+ ReportWithPackageFilter(AlarmFilter,"Error in alarm numbers - large ", __FILE__,__LINE__,EventsResponse.n_events, RpFatalError, e, 0);
+ break;
+ }
}
}
}
+ if (e!=EventsResponse.n_events)
+ {
+ ReportWithPackageFilter(AlarmFilter,"Error in alarm numbers - small ", __FILE__,__LINE__,EventsResponse.n_events, RpFatalError, e, 0);
+ EventsResponse.n_events = e;
+ }
}
else
{
LOG_ERROR(EventsResponse.n_events,"events malloc error");
- Task_restore(Key);
+ //Task_restore(Key);
return;
}
}
@@ -1609,7 +1619,7 @@ void SendEventNotifications(void)
{
EventsResponse.events = NULL;
}
- Task_restore(Key);
+ //Task_restore(Key);
responseContainer = createAllocatedContainer(MESSAGE_TYPE__StartEventsNotificationResponse, AlarmHandlingToken, false, &EventsResponse, &start_events_notification_response__pack, &start_events_notification_response__get_packed_size,&alarm_response_buffer);
responseContainer.has_continuous = true;
responseContainer.continuous = true;
@@ -1670,11 +1680,22 @@ uint32_t StartEventsNotificationRequestFunc(MessageContainer* requestContainer)
// ReportInitParams InitParams;
//ControlStart();
EventsNotificationRequestAccepted = true;
- //AlarmHandlingStart();
+ AlarmHandlingStart();
+ MessageContainer responseContainer;
+
+ StartEventsNotificationResponse response = START_EVENTS_NOTIFICATION_RESPONSE__INIT;
StartEventsNotificationRequest* request = start_events_notification_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
ustrncpy (AlarmHandlingToken, requestContainer->token,36);
start_events_notification_request__free_unpacked(request,NULL);
+
+ responseContainer = createContainer(MESSAGE_TYPE__StartEventsNotificationResponse, AlarmHandlingToken, false, &response, &start_events_notification_response__pack, &start_events_notification_response__get_packed_size);
+ responseContainer.has_continuous = true;
+ responseContainer.continuous = true;
+ uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
+ size_t container_size = message_container__pack(&responseContainer, container_buffer);
+ my_free(responseContainer.data.data);
+ SendChars(container_buffer, container_size);
return status;
}
uint32_t StopEventsNotificationRequestFunc(MessageContainer* requestContainer)
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 2c7512129..fe350d78d 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -569,6 +569,7 @@ void setRapidPressureRead(bool value)
}
uint16_t PumpCounter = 0;
+uint16_t realtimetest[101];
uint32_t MillisecLowLoop(uint32_t tick)
{
uint8_t Motor_i,Disp_i,temp;
@@ -598,6 +599,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
Onesecond_Tick = (tick%eOneSecond == 0) ?true:false;
OneMinute_Tick = (tick%eOneMinute == 0) ?true:false;
OneHourTick = (tick%eOneHour == 0) ?true:false;
+ realtimetest[(tick%1000)/10]++;
//gather Motor data from FPGA
//ROM_IntMasterDisable();
int StartPT100 = 0;
@@ -723,6 +725,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
WHS_Blower_Avarege_ORF1(); //drier
WHS_Blower_Avarege_ORF3(); //head
Trigger_WHSReadAllFanTacho ();
+ WHS_Start_Blower_Control_Closed_Loop ();
}
if (OneMinute_Tick)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index ba11ff58c..bea68e314 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -585,7 +585,7 @@ uint32_t ControlLowLoop(uint32_t tick)
{
if (ControlArray[ControlLowDevice_i].ControlActive)
{
- if (tick == ControlArray[ControlLowDevice_i].StartTick)
+ if (tick - ControlArray[ControlLowDevice_i].StartTick<=skipped_ticks)
continue;
if (ControlArray[ControlLowDevice_i].ControlTiming == eOneMillisecond)
continue;
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
index 63fe510c4..0764b2028 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
@@ -446,7 +446,7 @@ 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))*10 + (int)(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;
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
index 4f6a40c90..ec59385ab 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
@@ -129,6 +129,7 @@ uint32_t HWConfigurationInit(void)
status = HWConfiguration(UploadRequest);
if (status !=OK)
{
+ AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_NO_CFG_FILE,ON);
SetMachineState(MACHINE_STATE_HW_CONFIG_FAILED);
STATUS_GREEN_LED_OFF;
}
@@ -494,12 +495,18 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest)
}
BlowerCfg.enabled = true;
- BlowerCfg.voltage = 2650;
- BlowerCfg.heatingvoltage = 3000;
if (WHS_Type == WHS_TYPE_UNKNOWN)
- blowerType = HARDWARE_BLOWER_TYPE__WHSBlower2;
- else
+ {
blowerType = HARDWARE_BLOWER_TYPE__DefaultBlower;
+ BlowerCfg.voltage = 3000;
+ BlowerCfg.heatingvoltage = 2650;
+ }
+ else
+ {
+ blowerType = HARDWARE_BLOWER_TYPE__WHSBlower2;
+ BlowerCfg.voltage = 2200;
+ BlowerCfg.heatingvoltage = 2000;
+ }
if (request->n_blowers)
{
for (Dispenser_i = 0; Dispenser_i < request->n_blowers ; Dispenser_i++)
@@ -717,6 +724,21 @@ uint32_t LoadConfigurationParamsFromFile(bool Initialize)
}
return Fresult;
}
+void HWConfigurationLoadFile(void)
+{
+ FRESULT Fresult = FR_OK;
+ uint8_t* buffer = NULL;
+ uint32_t Bytes = 0;
+ buffer = HWConfigurationLoadFromFile(&Bytes); //load hardware config
+ if (buffer)
+ {
+ ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH, 4,&Bytes);
+ ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH+4, Bytes, buffer);
+ free (buffer);
+ FlashInitResults[0] = true;
+ }
+ Report("Hardware Initialized", __FILE__,__LINE__,Bytes, RpMessage, GENHWCFG_MAP_IN_FLASH, 0);
+}
void FlashInitAndLoad(void)
{
FRESULT Fresult = FR_OK;
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h
index 76e4d4414..55490a140 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h
@@ -17,6 +17,8 @@ extern void HWSystemResetRequest(MessageContainer* requestContainer);
uint32_t HWConfigurationInit(void);
void FlashInitAndLoad(void);
uint32_t LoadConfigurationParamsFromFile(bool);
+void HWConfigurationLoadFile(void);
+
extern HardwareBlower BlowerCfg;
extern bool DataUpdated;
diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c
index 6b87db616..815a26385 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/process.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/process.c
@@ -22,6 +22,7 @@
#include "modules/ids/ids_ex.h"
#include "Common/SWUpdate/FileSystem.h"
#include "StateMachines/Initialization/PowerIdle.h"
+#include "StateMachines/Initialization/InitSequence.h"
#include "drivers/Flash_ram/FlashProgram.h"
@@ -94,6 +95,11 @@ uint32_t HandleProcessParameters(ProcessParameters* ProcessParams,bool saveData)
if (ProcessParams->headzone6temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__INVALID_PARAMETER;
if (status != 0)
return status;
+ if (GetMachineState()<MACHINE_STATE_HEATING_STARTED)
+ {
+ status = ERROR_CODE__GENERAL_ERROR;
+ return status;
+ }
if (ProcessParams)
{
memcpy (&ProcessParametersKeep,ProcessParams,sizeof(ProcessParameters));
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
index 290e65fa9..06da53823 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
@@ -40,6 +40,8 @@
#include "StateMachines/Printing/PrintingSTM.h"
#include "StateMachines/Initialization/PowerIdle.h"
+#include "StateMachines/Initialization/PowerOffSequence.h"
+#include "StateMachines/Initialization/InitSequence.h"
/******************** Data Structures ********************************************/
@@ -1485,19 +1487,75 @@ uint32_t HeatersDisasterControl(uint32_t x,uint32_t y)
return OK;
}
bool UseSecondaryDrierHeater = true;
-uint32_t DrierHeaterVlotageSetup(double voltage)
+double TotalCurrentLimit(double VAC)
+{
+ if (VAC<=210)
+ {
+ return 5.8;
+ }
+ else if (VAC>222)
+ {
+ return 5.15;
+ }
+ else
+ {
+ return 5.5;
+ }
+
+}
+uint32_t DrierHeaterVoltageSetup(double voltage)
{
- uint32_t status = OK;
double DrierAcVoltage = 0.0;
+ char str[100];
+ bool tempDrier2 = UseSecondaryDrierHeater;
+
if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) //rapid/pp machines
{
DrierAcVoltage = ReadVAC();
-
+ if (DrierAcVoltage<=180)
+ {
+ AlarmHandlingSetAlarm(EVENT_TYPE__POWER_UP_BIT_FAILURE, true);
+ ReportWithPackageFilter(HeatersFilter,"Power too low!!!!!", __FILE__,__LINE__,DrierAcVoltage, RpMessage, 0, 0);
+ }
+ else if (DrierAcVoltage>264)
+ {
+ AlarmHandlingSetAlarm(EVENT_TYPE__POWER_UP_BIT_FAILURE, true);
+ ReportWithPackageFilter(HeatersFilter,"Power too high!!!!!", __FILE__,__LINE__,DrierAcVoltage, RpMessage, 0, 0);
+ ReportWithPackageFilter(HeatersFilter,"Power too high!!!!!", __FILE__,__LINE__,DrierAcVoltage, RpMessage, 0, 0);
+ ReportWithPackageFilter(HeatersFilter,"Power too high!!!!!", __FILE__,__LINE__,DrierAcVoltage, RpMessage, 0, 0);
+ HeatersEnd();
+ //PowerOffPowerOff();
+ }
+ else if (DrierAcVoltage<205)
+ {
+ UseSecondaryDrierHeater = true;
+ }
+ else if (DrierAcVoltage>224)
+ {
+ UseSecondaryDrierHeater = false;
+ }
+ else
+ {
+ if ((GetZone2RMSCurrent(DrierAcVoltage)+Get_Heaters_Current(HEATER_DRYER_CURRENT_1))>TotalCurrentLimit(DrierAcVoltage))
+ {
+ UseSecondaryDrierHeater = false;
+ }
+ else
+ {
+ UseSecondaryDrierHeater = true;
+ }
+ }
}
else
{
UseSecondaryDrierHeater = true;
}
+ if (tempDrier2 != UseSecondaryDrierHeater)
+ {
+ usnprintf(str, 100, "\r\n Changing Drier 2 setting VAC %d D1 Current %d D2 assumed current %d limit %d"
+ ,DrierAcVoltage,(int)(GetZone2RMSCurrent(DrierAcVoltage)*100),(int)(Get_Heaters_Current(HEATER_DRYER_CURRENT_1)*100),(int)(TotalCurrentLimit(DrierAcVoltage)*100));
+ ReportWithPackageFilter(HeatersFilter,str, __FILE__,__LINE__,DrierAcVoltage, RpMessage, UseSecondaryDrierHeater, 0);
+ }
return OK;
}
uint32_t HeatersControlLoop(uint32_t tick)
@@ -1541,7 +1599,7 @@ uint32_t HeatersControlLoop(uint32_t tick)
}
if ((HeaterMaxTempFlag[HEATER_TYPE__DryerSecondaryHeater] == false)&&(UseSecondaryDrierHeater == true))
{
-#warning trial use both heaters in drier
+//#warning trial use both heaters in drier
ActivateHeater (HEATER_TYPE__DryerSecondaryHeater);
//DeActivate HEATER_TYPE__DryerSecondaryHeater
//DeActivateHeater (HEATER_TYPE__DryerSecondaryHeater);
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index 88b8cb0c9..ccd051c71 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -14,10 +14,12 @@
#include "drivers/Flash_Memory/FATFS/ff.h"
#include "drivers/Flash_Memory/FATFS/Control_File_System.h"
+#include "drivers/Flash_ram/FlashProgram.h"
#include "drivers/adc_sampling/adc.h"
#include "drivers/Heater/TemperatureSensor.h"
#include "drivers/ADC_Sampling/adc.h"
#include "drivers/Flash_ram/MCU_E2Prom.h"
+#include "Drivers/SSI_Comm/Dancer/Dancer.h"
#include "Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.h"
#include "Drivers/I2C_Communication/Head_Card/Fan/fan_click.h"
@@ -121,18 +123,30 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
{
if (WHS_Type == WHS_TYPE_NEW)
{
- WHS_Set_Blower_Control_Closed_Loop (request->delay);
+ WHS_Set_SetPoint_Q_value((double) request->delay);
response.progress = 0;
response.has_progress = false;
}
}
else
+ if (request->amount == 0x3E6) // get WHS Blower speed by Q value
+ {
+ if (WHS_Type == WHS_TYPE_NEW)
+ {
+ response.progress = WHS_Get_Volt_Blower_Control();
+ //response.progress = 0;
+ response.has_progress = true;
+ }
+ }
+ // WHS_Get_Volt_Blower_Control
+ else
if(request->amount == 0x3EA)
{
uint16_t tempu16 = 0;
+ double temp_double = 0.0;
if (WHS_Type == WHS_TYPE_NEW)
{
- switch(request->delay )// set WHS Blower speed 0x00-0xfff
+ switch(request->delay )// get A2D
{
case 0:
get_orf_1(&tempu16);
@@ -161,12 +175,53 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
case 8:
tempu16 = 0; //get_cur_vlv2(&tempu16);
break;
+ case 10:
+ temp_double = get_ORF1_Q();
+ break;
+ case 12:
+ temp_double = get_ORF3_Q();
+ break;
+ case 20:
+ temp_double = get_average_ORF1_Q();
+ break;
+ case 22:
+ temp_double = get_average_ORF3_Q();
+ break;
+
+ case 11:
+ //get_orf_2(&tempu16);
+ break;
+ case 13:
+ //get_vlev1(&tempu16);
+ break;
+ case 14:
+ //get_vlev2(&tempu16);
+ break;
+ case 15:
+ //get_gas_out(&tempu16);
+ break;
+ case 16:
+ //get_cur_fan(&tempu16);
+ break;
+ case 17:
+ //get_cur_vlv1(&tempu16);
+ break;
+ case 18:
+ //tempu16 = 0; //get_cur_vlv2(&tempu16);
+ break;
default :
tempu16 = 0x500; //get_cur_vlv2(&tempu16);
break;
}
}
- response.progress = (double)tempu16;
+ if ((request->delay)<10)
+ {
+ response.progress = (double)tempu16;
+ }
+ else
+ {
+ response.progress = temp_double;
+ }
response.has_progress = true;
}
else //
@@ -511,7 +566,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
else
if((request->amount == 0x0CE) && (request->delay == 0x0CE)) //Get Gas Sensor
{
- LOG_ERROR(request->delay,"FlashInitAndLoad");
+ LOG_ERROR(request->delay,"FlashInit");
FlashInit();
response.progress = (double)OK;
response.has_progress = true;
diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt
index 6a00adf48..4ce158426 100644
--- a/Software/Embedded_SW/Embedded/Software Release Notes.txt
+++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt
@@ -1,39 +1,67 @@
-Embedded SW Release note - Version 1.4.6.0
+Embedded SW Release note - Version 1.4.6.12 - Pack 1 Urgent
=============================================================
+Main features: support new head and new WHS, support Powerstep01 motor drivers
+options bypass: auto shutdown, auto idle, pressure checking, rockers bypass
Common:
-logs: better control (filter messages and priorities)
-
+ logs: better control (filter messages and priorities)
+ files: improved handling of files and upgrades
Drivers:
-I2C reading task for better handling of slow I2C interactions (head etc)
-observe and handle FPGA watchdog reset (report, reinitialize motors)
-
+ Support new flat head (12 zones) and Arc head (3+2 zones and blowers. partial support)
+ I2C reading task for better handling of slow I2C interactions (head etc)
+ observe and handle FPGA watchdog reset (report, reinitialize motors)
+ AC voltage reating
+ additional data stored in EEPROM
+ RFID preparations
+ motor timeout alarms
+ USB reinitialized
+ Valve validation for the midtank air valves
+ new speed sensor
Modules:
-textual names for control calls to help debuggng
-add midtank and dispenser ink content to diagnostics
-alarm handling:
- 7midtamk overflow,
- *fix current alarms,
- *consequent actions and job verification,
- *critical alarms,
- *use alarms file (remote update)
-IDS:
- *dispenser data,
- *improve autofill on job start,
- *puller_tension from RML as cleaner speed,
- *handle inactive dispenser pressure,
- *dispensers PID preparation,
- *bring dispensers to first segment pressures before job
-Thread:
- *real dryer rampup.
- *dancers from EEPROM only.
- *insure rockers motors voltage value;
-
+ Control:
+ textual names for control calls to help debuging
+ fix control on real time challenges
+ head and whs
+ Diagnostics:
+ add midtank and dispenser ink content to diagnostics
+ add new heating zoneshandle actuators and buzzer
+ handle BlowerState widget
+ improve overall data quality
+ General:
+ Buttons: loading starts on a LONG (5 seconds) press
+ improve init handlling and alarm reporting
+ support new WHS
+ alarm handling:
+ *midtamk overflow,
+ *fix current alarms,
+ *consequent actions and job verification,
+ *critical alarms,
+ *use alarms file (remote update) ONLY!
+ Heaters:
+ support new head (12*2 zones)
+ fix internal machine temperature
+ voltage measurement and handling
+ IDS:
+ *dispenser data,
+ *improve auto-fill on job start,
+ *puller_tension from RML as cleaner speed,
+ *handle inactive dispenser pressure,
+ *dispensers PID preparation,
+ *bring dispensers to first segment pressures before job
+ support better dispensers (need compilattion)
+ WCF on first segment
+ Thread:
+ *real dryer ramp-up.
+ *dancers from EEPROM only.
+ *insure rockers motors voltage value;
+ support moving the feeder dancer to the dryer
+ loading - fix bug (dancer), actuators
+ WHS:
+ new WHS
State machines:
-print: *prevent job on open covers (dryer, head) (suspended until new head)
+ Init: current measurements, wait for the cooler,
+ print: *prevent job on open covers (dryer, head) (suspended until new head)
-preparation for new head:
-I2C scheduling (control, task)
-larger number of heaters (heaters module, control, diagnostics, alarms.
+tasks priorities reorganized,
Embedded SW Release note - Version 1.4.5.104 (alpha 1 ++)
=============================================================