diff options
15 files changed, 110 insertions, 71 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/report/report.h b/Software/Embedded_SW/Embedded/Common/report/report.h index 2d7e93ca5..a267bfc6b 100644 --- a/Software/Embedded_SW/Embedded/Common/report/report.h +++ b/Software/Embedded_SW/Embedded/Common/report/report.h @@ -126,7 +126,7 @@ extern uint32_t StopReportInitMessage(MessageContainer* requestContainer); uint32_t SetDebugLogCategoryFunc(MessageContainer* requestContainer); void SetupDebugDisributorsRequestFunc(MessageContainer* requestContainer); -void ReportResetReason(void); +uint32_t ReportResetReason(void); uint32_t OpenLogFile(void); uint32_t CloseLogFile(void); bool isReportActive(void); diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index 6ed149039..8f3cde15f 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -255,7 +255,7 @@ void SetupDebugDisributorsRequestFunc(MessageContainer* requestContainer) } -void ReportResetReason(void) +uint32_t ReportResetReason(void) { /* #define SYSCTL_CAUSE_HSRVREQ 0x00001000 // Hardware System Service Request @@ -300,6 +300,8 @@ void ReportResetReason(void) if ((RESC & SYSCTL_CAUSE_WDOG1)||(RESC & SYSCTL_CAUSE_WDOG0)||(RESC & SYSCTL_CAUSE_BOR)) AlarmHandlingSetAlarm (EVENT_TYPE__UNINTENDED_RESET,ON); //handle alarm detection and operation + return RESC; + } uint32_t ReportInitMessage(MessageContainer* requestContainer) 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 c620cebdb..f182ec09c 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 @@ -525,10 +525,11 @@ uint32_t MagnetCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) Report("MagnetCallBackFunction",__FILE__,__LINE__,(int)MagnetControlId,RpWarning,(int)MagnetCallBackFunction,0); return OK; } - +//double BlowerSetPoint; uint32_t ActivateHeadMagnet() { Report("ActivateHeadMagnet - Close the lid magnet",__FILE__,__LINE__,(int)HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,RpWarning,(int)DH_LID_OPEN,0); + //WHS_Start_Blower_Control_Closed_Loop(BlowerSetPoint); //Task_sleep(500); if(Head_Type == HEAD_TYPE_SYLKO) HeadCard_ActivateHeadMagnet(); @@ -551,6 +552,9 @@ uint32_t HeadCard_HeadMagnet_Disable(); */ uint32_t DeActivateHeadMagnet() { + //BlowerSetPoint = WHS_Get_Blower_Control_Closed_Loop_SetPoint(); + + //WHS_Start_Blower_Control_Closed_Loop(0.0); if(Head_Type == HEAD_TYPE_SYLKO) { 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 4308a7913..cc876a45a 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -41,7 +41,6 @@ typedef enum Actuators_Control, /* enum for WHS :*/ - DetectNewWHS, WHS_start, WHS_init_I2C_IO, WHS_init_fan, @@ -161,16 +160,6 @@ void Trigger_InputsReading(void) } -void Trigger_Check_WHS_Type_Via_EEPROM() -{ - I2C_ReadingMessageStruc I2C_ReadingMessage; - - I2C_ReadingMessage.messageId = DetectNewWHS; - if (I2C_ReadingMsgQ != NULL) - Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); - return; -} - void Trigger_WHS_init_IO(void) { I2C_ReadingMessageStruc I2C_ReadingMessage; @@ -461,10 +450,6 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) } break; - case DetectNewWHS: - Check_WHS_Type_Via_EEPROM(); - break; - case WHS_init_I2C_IO: WHS_IO_Init(); break; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h index 4f5712442..bc58e2450 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h @@ -10,7 +10,7 @@ #define DRIVERS_I2C_COMMUNICATION_I2C_TASK_H_ -void Trigger_Check_WHS_Type_Via_EEPROM(void); + void Trigger_WHS_init_IO(void); void Trigger_WHS_init_fan(void); void Trigger_WHS_init_PT100(void); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 03135c0d5..d1fd48b32 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -636,7 +636,8 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever { if (AlarmItem == NULL) return ERROR; - //DebugLogCategory reprocessedSeverity = Severity; + + DebugLogCategory reprocessedSeverity = Severity; //ProcessParameters ProcessParameterZero; switch (AlarmItem[AlarmId].AlarmSource) { @@ -691,14 +692,19 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever Valve_Set(IDS_Id_to_AirValve[AlarmItem[AlarmId].DeviceId], AlarmItem[AlarmId].DeviceId ); //AlarmItem[AlarmId].DeviceId/ON Valve_Set(IDS_Id_to_CartrideValve[AlarmItem[AlarmId].DeviceId], AlarmItem[AlarmId].DeviceId ); //Atm_MidTank_OFF/ON } + if ((JobIsActive())&&(DispenserUsedInJob[AlarmItem[AlarmId].DeviceId] == false)) + { + reprocessedSeverity = DEBUG_LOG_CATEGORY__Warning; + } + } break; default: break; } - /*switch (reprocessedSeverity)*/ - switch (Severity) + switch (reprocessedSeverity) + /*switch (Severity)*/ { case DEBUG_LOG_CATEGORY__Warning: //raise flag fr next job diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index b24970ea0..48c7c3f5e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -720,8 +720,8 @@ uint32_t MillisecLowLoop(uint32_t tick) } Trigger_WHS_PT100_Read_All(); Trigger_WHS_MAX11614_Read_allADC(); - WHS_Blower_Avarege_ORF1(); - WHS_Blower_Avarege_ORF3(); +// WHS_Blower_Avarege_ORF1(); //drier + WHS_Blower_Avarege_ORF3(); //head Trigger_WHSReadAllFanTacho (); } if (OneMinute_Tick) diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index ec7650f3d..2c6040bab 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -518,25 +518,6 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) } } } - //from now on starting blower on INIT, so that the chiller does not freeze - /*if (BlowerCfg.enabled == true) - { - Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.heatingvoltage) - Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); - else - Control_Voltage_To_Blower(BlowerCfg.voltage-500); - - }*/ - -/* - for (Dispenser_i = 0;Dispenser_i < MAX_SYSTEM_DISPENSERS;Dispenser_i++) - { - Enable_MidTank_Pressure_Reading(Dispenser_i); - Valve_Set(IDS_Id_to_AirValve[Dispenser_i], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON - } - GenHWControlId = AddControlCallback(NULL, GenHWInitCallBackFunction, 2* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); -*/ ControlStart(); AlarmHandlingStart(); //ThreadInitialTestStub(request); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index d84098469..079903a1c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -694,6 +694,7 @@ void PrepareACHeater(int HeaterId,uint32_t Frequency, uint32_t SetTemperatue) HeaterAtTemp[HeaterId] = false; if (BlowerCfg.enabled == true) { + //WHS_Start_Blower_Control_Closed_Loop(2.5); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); @@ -1161,6 +1162,7 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) AlarmHandlingSetAlarm(HeaterUnderEventType[index], false); if (BlowerCfg.enabled == true) { + //WHS_Start_Blower_Control_Closed_Loop(5.0); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.voltage) //Gradual_Increase_Blower(BlowerCfg.heatingvoltage,BlowerCfg.voltage); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 56e314967..f87aa2eda 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -506,7 +506,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } else - if(request->amount == 0x0CC) //Cùøàøïâò÷ Vùêïâùàïíî ø÷ãôíîã÷ + if(request->amount == 0x0CC) //Cartridge Validation Response Demo { LOG_ERROR(request->delay,"ResponseDemo"); ResponseDemo(request->delay); @@ -550,7 +550,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else - if(request->amount == 0xB2) //fast refresh for pressure + if(request->amount == 0xB2) //Set loading arm cycles { LOG_ERROR(request->delay,"Set loading arm cycles"); @@ -567,7 +567,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } else - if(request->amount == 0xB4) //fast refresh for pressure + if(request->amount == 0xB4) //IDS_Dispenser_Content_Init { LOG_ERROR(request->amount,"IDS_Dispenser_Content_Init"); IDS_Dispenser_Content_Init(); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 2a83f8425..aa090625c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -191,6 +191,7 @@ } else { + //WHS_Start_Blower_Control_Closed_Loop(2.5); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 937e348b0..d1f667405 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -39,6 +39,7 @@ INIT_SEQUENCE_BUILT_IN_TEST, INIT_SEQUENCE_INITIAL_BLOWER_ACTIVATION, //INIT_SEQUENCE_DISPENSER_PRESSURE_BUILDUP_TEST, + INIT_SEQUENCE_WAIT_FOR_COOLER, INIT_SEQUENCE_THREAD_DETECTION, INIT_SEQUENCE_START_HEATING, INIT_SEQUENCE_MACHINE_READY_TO_DYE, @@ -120,9 +121,10 @@ uint32_t Start_InitSequence(void) InitSchedulerControlId = AddControlCallback("InitScheduler", InitScheduler, eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); return OK; } +uint32_t ResetReason = 0; void InitSequenceResetReason(void) { - ReportResetReason(); + ResetReason = ReportResetReason(); InitStages++; //InitSequenceStateMachine(InitStages); @@ -198,7 +200,7 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); else Control_Voltage_To_Blower(3000); - + //WHS_Start_Blower_Control_Closed_Loop(2.5); AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation Safety_Init(); @@ -209,11 +211,12 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) uint32_t InitSequenceInitialBlowerActivation(void) { MachineStateDetail = MACHINE_STATE_INITIAL_BLOWER_ACTIVATION; + //WHS_Start_Blower_Control_Closed_Loop(0.0); Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.voltage) - Control_Voltage_To_Blower(BlowerCfg.voltage); - else - Control_Voltage_To_Blower(3000); +// if (BlowerCfg.voltage) +// Control_Voltage_To_Blower(BlowerCfg.voltage); +// else + Control_Voltage_To_Blower(4200); HWControlId = AddControlCallback("Init Blower", InitSequenceBlowerCallBackFunction, 10* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); /*if (RdInkCartridgeSensor()) //if there is a cartridge in the ink slot skip the valves procedure { @@ -255,6 +258,39 @@ uint32_t InitSequenceDispenserPressureBuildUpTest(void) return OK; } +uint32_t InitSequenceWaitForCoolerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) +{ + InitStages++; + MachineStateDetail = INIT_SEQUENCE_WAIT_FOR_COOLER; + + if (SafeRemoveControlCallback(HWControlId, InitSequenceWaitForCoolerCallBackFunction )==OK) + HWControlId = 0xFF; + else + Report("Remove control callback failed",__FILE__,__LINE__,(int)HWControlId,RpWarning,(int)InitSequenceWaitForCoolerCallBackFunction,0); + return OK; +} +uint32_t InitSequenceWaitForCooler(void) +{ + if (WHS_Type == WHS_TYPE_UNKNOWN) + { + InitStages++; + MachineStateDetail = INIT_SEQUENCE_WAIT_FOR_COOLER; + return OK; + } + if ((ResetReason & SYSCTL_CAUSE_SW)||(ResetReason & SYSCTL_CAUSE_WDOG1)||(ResetReason & SYSCTL_CAUSE_WDOG0)) + { + //soft-warm reset + InitStages++; + MachineStateDetail = INIT_SEQUENCE_WAIT_FOR_COOLER; + } + else + { + //cold reset, wait 2 minutes for cooler start + HWControlId = AddControlCallback("Init Cooler", InitSequenceWaitForCoolerCallBackFunction, 2*eOneMinute, TemplateDataReadCBFunction,0,0, 0 ); + } + //InitSequenceStateMachine(InitStages); + return OK; +} uint32_t InitSequenceThreadDetection(void) { InitStages++; @@ -352,6 +388,8 @@ uint32_t InitSequenceStateMachine( INIT_SEQUENCE_STAGES_ENUM ReadValue) /*case INIT_SEQUENCE_DISPENSER_PRESSURE_BUILDUP_TEST: InitSequenceDispenserPressureBuildUpTest(); break;*/ + case INIT_SEQUENCE_WAIT_FOR_COOLER: + InitSequenceWaitForCooler(); case INIT_SEQUENCE_THREAD_DETECTION: InitSequenceThreadDetection(); break; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c index 051d6c9cd..70e713420 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c @@ -100,6 +100,7 @@ void PowerIdleSetIdle(void) } if (BlowerCfg.enabled == true) { + //WHS_Start_Blower_Control_Closed_Loop(2.5); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 4218c64a1..0d45b8477 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -442,6 +442,7 @@ uint32_t PowerOffTurnOffCooler(void) /*******************************************************************************************************/ uint32_t PowerOffTurnOffBlower(void) { + //WHS_Start_Blower_Control_Closed_Loop(0.0); Turn_the_Blower_Off();//Turn off PowerOffMachineState++; return OK; @@ -455,6 +456,10 @@ uint32_t PowerOffPowerOff(void) REPORT_MSG (10-i, "Power off in x seconds"); Task_sleep (1000); } + ControlStop(); + MillisecStop(); + HeatersEnd(); + ROM_IntMasterDisable(); Power_Off(); return OK; } diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs index 4934a9013..f5fed3fe4 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs @@ -219,30 +219,46 @@ namespace RealTimeGraphX { try { - var pending_list = _pending_series_collection.BlockDequeue(); + List<List<PendingSeries>> pending_lists = new List<List<PendingSeries>>(); - foreach (var pending_series in pending_list) + if (_pending_series_collection.Count == 0) { - if (pending_series.IsClearSeries) - { - _pending_series_collection = new GraphDataQueue<List<PendingSeries>>(); - _to_render.Clear(); - break; - } + Thread.Sleep(TimeSpan.FromSeconds(1)); + continue; + } - if (_to_render.ContainsKey(pending_series.Series)) - { - var s = _to_render[pending_series.Series]; - s.XX.AddRange(pending_series.XX); - s.YY.AddRange(pending_series.YY); - } - else + while (_pending_series_collection.Count > 0) + { + var pending_list = _pending_series_collection.BlockDequeue(); + pending_lists.Add(pending_list); + } + + foreach (var pending_list in pending_lists) + { + foreach (var pending_series in pending_list) { - _to_render[pending_series.Series] = pending_series; + if (pending_series.IsClearSeries) + { + _pending_series_collection = new GraphDataQueue<List<PendingSeries>>(); + _to_render.Clear(); + break; + } + + if (_to_render.ContainsKey(pending_series.Series)) + { + var s = _to_render[pending_series.Series]; + s.XX.AddRange(pending_series.XX); + s.YY.AddRange(pending_series.YY); + } + else + { + _to_render[pending_series.Series] = pending_series; + } } } - if (DateTime.Now > _last_render_time.AddMilliseconds(RefreshRate.TotalMilliseconds) && _to_render.Count > 0) + if (_to_render.Count > 0) + //if (DateTime.Now > _last_render_time.AddMilliseconds(RefreshRate.TotalMilliseconds) && _to_render.Count > 0) { GraphDataPoint min_x = _range.MaximumX - _range.MaximumX; GraphDataPoint max_x = _range.MaximumX; @@ -256,7 +272,6 @@ namespace RealTimeGraphX } else { - Thread.Sleep(RefreshRate); continue; } @@ -350,7 +365,6 @@ namespace RealTimeGraphX catch (Exception ex) { Debug.WriteLine($"Error in RealTimeGraphX:\n{ex.ToString()}"); - Thread.Sleep(RefreshRate); } } else |
