diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-02-17 16:07:38 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-02-17 16:07:38 +0200 |
| commit | ef657b4a3ae76e99ab077d6b4fc19691c2a0da4a (patch) | |
| tree | e60f97eee0076c674d27a1d2c0be8314c4e5de7e /Software/Embedded_SW/Embedded | |
| parent | dabfdff468c7065ceadaaf2fbe95e8eeaa3c2f9e (diff) | |
| download | Tango-ef657b4a3ae76e99ab077d6b4fc19691c2a0da4a.tar.gz Tango-ef657b4a3ae76e99ab077d6b4fc19691c2a0da4a.zip | |
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded')
15 files changed, 173 insertions, 69 deletions
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 e0dc92e1b..6885ee3d8 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,10}; +TangoVersion_t _gTangoVersion = {1,4,6,11}; #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/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index ce777f393..27ae72084 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -55,6 +55,7 @@ typedef enum WHS_READ_FAN_TACHO, WHS_READ_ALL_FAN_TACHO, WHS_SET_VOLT_BLOWER_CONTROL, + WHS_SETPOINT_Q_BLOWER, WHS_SET_VAlVE_CARTRIDGE, WHS_SET_PUMP, WHS_READ_ADC, @@ -301,6 +302,19 @@ void Trigger_SetWHSBlowerVoltage (uint16_t voltage) return; } +void Trigger_WHS_Set_Blower_Control_Closed_Loop (uint32_t setpoint_Q) +{ + I2C_ReadingMessageStruc I2C_ReadingMessage; + + I2C_ReadingMessage.messageId = WHS_SETPOINT_Q_BLOWER; + I2C_ReadingMessage.parameter = setpoint_Q; + + if (I2C_ReadingMsgQ != NULL) + Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); + return; +} + + //void Trigger_WHS_Set_Valve(uint8_t valve_number, bool status) void Trigger_SetWHSValveWatseCartridge(uint8_t Cart_Id) { @@ -389,12 +403,14 @@ void I2C_ReadingTask_Init(void) { I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,NULL); } + void I2C_ReadingTask(UArg arg0, UArg arg1) { I2C_ReadingMessageStruc I2C_ReadingMessage; Semaphore_post(I2C_Sem); TEMPERATURE_SENSOR_ID_ENUM Sensor_i; I2C_Task_Handle = Task_self(); + double dbl_setpoint_Q = 0.0; while(1) { @@ -498,6 +514,12 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) WHS_Set_Volt_Blower_Control(I2C_ReadingMessage.parameter); //(fan_number, 0x20) break; + case WHS_SETPOINT_Q_BLOWER: + + dbl_setpoint_Q = (double)(I2C_ReadingMessage.parameter / 100) ; + WHS_Set_Blower_Control_Closed_Loop(dbl_setpoint_Q); + break; + case WHS_SET_VAlVE_CARTRIDGE: // Set_WHS_valve(VALVE_0, I2C_ReadingMessage.parameter, 0); Write_WHS_Valve_reg(); 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 03edea5d9..b16e87766 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h @@ -27,7 +27,7 @@ void Trigger_WHS_PT100_Read_All(void); void Trigger_ReadWHSPT100(uint8_t PT100_Id); //void Trigger_WHS_Set_Volt_Blower_Control(uint16_t volt); void Trigger_SetWHSBlowerVoltage (uint16_t voltage); - +void Trigger_WHS_Set_Blower_Control_Closed_Loop (uint32_t setpoint_Q); //void Trigger_WHS_Set_Valve(uint8_t valve_number, bool status); void Trigger_SetWHSValveWatseCartridge(uint8_t Cart_Id); //void Trigger_WHS_Set_Pump(bool 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 310ad9163..28b4f8598 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 @@ -109,8 +109,15 @@ int16_t Write_Max5805_LDACn(bool value) bool WHS_Set_Volt_Blower_Control(uint16_t volt) { bool status = OK; - MAX5805_CODE_LOAD( volt); - ReportWithPackageFilter(WasteFilter,"------------ WHS_Set_Volt_Blower_Control (volt)-----------------", __FILE__,__LINE__, volt, RpMessage, 0, 0); + if (volt > 0xFFF ) //the max value is 0xFFF + { + ReportWithPackageFilter(WasteFilter,"------------ WHS_Set_Volt_Blower_Control (volt) high > 0xFFF-----------------", __FILE__,__LINE__, volt, RpMessage, 0, 0); + } + else + { + MAX5805_CODE_LOAD( volt); + ReportWithPackageFilter(WasteFilter,"------------ WHS_Set_Volt_Blower_Control (volt)-----------------", __FILE__,__LINE__, volt, RpMessage, 0, 0); + } return status; } @@ -221,6 +228,7 @@ double WHS_Blower_Avarege_ORF3() sum_orifice_Q += average_orf3_Q_buff[i]; average_Q_orifice3 = sum_orifice_Q /ORF_BUFF_SIZE; + ReportWithPackageFilter(WasteFilter,"------------ average_Q_orifice3 hex head -----------------", __FILE__,__LINE__,(int)orifice_hex_value, RpMessage, (average_Q_orifice3*1000), 0); return OK; } @@ -252,24 +260,26 @@ bool Test_WHS_blower() return status; } -#define SET_DYEING_HEAD_ORRIFFICE_SENSOR 0 //todo +#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 -bool WHS_Set_Blower_Control_Closed_Loop() +bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint_Q) { //double average_ORF1_Q = 0; - double current_dying_head_flow = 0; + double current_dying_head_flow_Q = 0; uint16_t volt; - //average_ORF1_Q = get_Q((int16_t) average_ORF1); - current_dying_head_flow = get_average_ORF1_Q(); - if (abs(current_dying_head_flow - SET_DYEING_HEAD_ORRIFFICE_SENSOR) > 0.2) + + 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); + if (abs(current_dying_head_flow_Q - SetPoint_Q) > 0.2) { volt = getBlowerState(); - if (current_dying_head_flow < SET_DYEING_HEAD_ORRIFFICE_SENSOR) + if (current_dying_head_flow_Q < SetPoint_Q) { - if (( SET_DYEING_HEAD_ORRIFFICE_SENSOR - current_dying_head_flow) > 0.5) + if (( SetPoint_Q - current_dying_head_flow_Q) > 0.5) { /* increase blower voltage by large step: */ ReportWithPackageFilter(WasteFilter,"------------ increase blower voltage by large step:-----------------", __FILE__,__LINE__, volt, RpMessage, LARGE_STEP, 0); @@ -284,7 +294,7 @@ bool WHS_Set_Blower_Control_Closed_Loop() } else { - if (( current_dying_head_flow -SET_DYEING_HEAD_ORRIFFICE_SENSOR) > 0.5) + if (( current_dying_head_flow_Q - SetPoint_Q) > 0.5) { /* decrease blower voltage by large step: */ ReportWithPackageFilter(WasteFilter,"------------ decrease blower voltage by large step:-----------------", __FILE__,__LINE__, volt, RpMessage, LARGE_STEP, 0); @@ -301,6 +311,36 @@ bool WHS_Set_Blower_Control_Closed_Loop() return OK; } +void WHS_Start_Blower_Control_Closed_Loop (double SetPoint_Q) +{ + // use 0 to STOP +// uint16_t mVSetpoint = 0; + + if(SetPoint_Q) + { + WHS_Set_Blower_Control_Closed_Loop(SetPoint_Q); + } + else + { + // blower off? + } + + +} +double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void) +{ + double SetPoint = 0; + // to do return the setpoint + return SetPoint; +} + +/* +uint16_t Convert_SetPoint_to_mV(double SetPoint) +{ + uint16_t value = (uint16_t)SetPoint; //todo convert function +return value; +} +*/ 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 2b776fbc9..9f79034bb 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 @@ -22,7 +22,12 @@ double WHS_Blower_Avarege_ORF1(void); double WHS_Blower_Avarege_ORF3(void); double get_average_ORF1_Q(void); double get_average_ORF3_Q(void); -bool WHS_Set_Blower_Control_Closed_Loop(); +bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint); +void WHS_Start_Blower_Control_Closed_Loop (double SetPoint); +double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void); + + +extern double headairflow; /* from Blower.h * uint32_t Turn_the_Blower_On(); diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index cf54019c5..dc92b6683 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -430,8 +430,8 @@ uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callb Valve3WayControlId[_ValveId] = AddControlCallback("Valve3WayControlId", Valve3WayCallBackFunction, eOneSecond/*eHundredMillisecond*/, FPGA_GetDispenserValveBusyOCD,(IfTypeDisopenser*0x100+_ValveId), _ValveId, 0 ); if (Valve3WayControlId[_ValveId] == 0xFF) Report("Add control callback failed",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); - //else - // Report("Add control callback",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); + else + Report("Add control callback",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); /*busy = */FPGA_GetDispenserValveBusyOCD(_ValveId,0); //Report("Set valve id, dir, busy",__FILE__,_ValveId,(int)direction,RpWarning,(int)busy,0); diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 393a366ac..6b5424d74 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -143,7 +143,7 @@ Void errHook(Error_Block *eb) CloseLogFile(); if (UpdateFlag == true) return; - FileHandle = my_malloc(sizeof(FIL)); + /*FileHandle = my_malloc(sizeof(FIL)); if (FileHandle == 0) Fresult = FR_DENIED; else @@ -155,19 +155,19 @@ Void errHook(Error_Block *eb) 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 */ + // 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 */ + // check originator's mod id against known mods if (site->mod == Main_Module_id()) { Fresult = f_write(FileHandle,"\r\napp error: ",12,&Bytes ); } - /* check error id against known errors */ + // check error id against known errors if (eid == Error_E_generic) { Fresult = f_write(FileHandle,"generic: ",10,&Bytes ); } @@ -176,12 +176,12 @@ Void errHook(Error_Block *eb) Fresult = f_write(FileHandle,"\r\nassertion violation: ",22,&Bytes ); } - /* perform default error output */ + // perform default error output f_close(FileHandle); } Task_sleep (200); my_free(FileHandle); - } + }*/ #ifdef WATCHDOG //Power_Reset(); SysCtlReset(); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 2c6040bab..4f6a40c90 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -187,7 +187,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_initialdispenserpressure = true; EmbeddedParameters->initialdispenserpressure = 0.25; EmbeddedParameters->has_initialdispensertimeout = true; - EmbeddedParameters->initialdispensertimeout = 60000; + EmbeddedParameters->initialdispensertimeout = 180000; EmbeddedParameters->has_initialdispensertimelag = true; EmbeddedParameters->initialdispensertimelag = 100; EmbeddedParameters->has_dispenserbuildpressurespeed = true; @@ -209,7 +209,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_midtankpressurecorrection = true; EmbeddedParameters->midtankpressurecorrection = 0.0; EmbeddedParameters->has_dispenserpresegmentwfcf = true; - EmbeddedParameters->dispenserpresegmentwfcf = 80; + EmbeddedParameters->dispenserpresegmentwfcf = 40; EmbeddedParameters->has_startheatingoninitsequence = true; EmbeddedParameters->startheatingoninitsequence = true; //set to true shlomo 14/5/2019 EmbeddedParameters->n_generalparameters = 8; @@ -252,7 +252,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_idlemixertemperature = true; EmbeddedParameters->idlemixertemperature = 0; EmbeddedParameters->has_powerofftemperaturelimit = true; - EmbeddedParameters->powerofftemperaturelimit = 50; + EmbeddedParameters->powerofftemperaturelimit = 90; EmbeddedParameters->has_ids_presegment_wfcf_timebeforesegment = true; EmbeddedParameters->ids_presegment_wfcf_timebeforesegment = 20000; uint8_t* response_buffer = my_malloc(configuration_parameters__get_packed_size(EmbeddedParameters)); @@ -494,7 +494,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) } BlowerCfg.enabled = true; - BlowerCfg.voltage = 3000; + BlowerCfg.voltage = 2650; BlowerCfg.heatingvoltage = 3000; if (WHS_Type == WHS_TYPE_UNKNOWN) blowerType = HARDWARE_BLOWER_TYPE__WHSBlower2; diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c index 50fd0ad16..7326dc039 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c @@ -280,36 +280,57 @@ uint32_t ButtonJogCBFunction(uint32_t IfIndex, uint32_t ReadValue) case sttDISABLE: if (JobIsActive() == false) { + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: jog.state=sttDISABLE , JobIsActive() == false-----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); jog.color = colorON; Pannel_Leds(THREAD_JOGGING, MODE_ON); jog.state = sttENABLE; } break; case sttENABLE: - if (jog.Action == COUNTPB) + if (JobIsActive() == true) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING; - jog.color = colorON; - jog.color = BLINK; - ThreadJoggingFunc(40); - jog.state = sttJOGGING; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is Disable -----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); + jog.Action = OFFPB; + jog.color = colorOFF; + Pannel_Leds(THREAD_JOGGING,MODE_OFF); + jog.state = sttDISABLE; } else { - if (JobIsActive() == true) + if (jog.Action == COUNTPB) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is Disable -----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); - jog.Action = OFFPB; - jog.color = colorOFF; - Pannel_Leds(THREAD_JOGGING,MODE_OFF); - jog.state = sttDISABLE; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); + jog.color = colorON; + jog.color = BLINK; + ThreadJoggingFunc(40); + jog.state = sttJOGGING; } } + +// if (jog.Action == COUNTPB) +// { +// ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); +// jog.color = colorON; +// jog.color = BLINK; +// ThreadJoggingFunc(40); +// jog.state = sttJOGGING; +// } +// else +// { +// if (JobIsActive() == true) +// { +// ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is Disable -----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); +// jog.Action = OFFPB; +// jog.color = colorOFF; +// Pannel_Leds(THREAD_JOGGING,MODE_OFF); +// jog.state = sttDISABLE; +// } +// } break; case sttJOGGING: if (jog.Action == SHORTPB) //PB is OFF { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action->SHORTPB-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action SHORTPB, sttJOGGING -> sttENABLE, stop JOGGING----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); ThreadAbortJoggingFunc(); jog.color = colorON; Pannel_Leds(THREAD_JOGGING, MODE_ON); @@ -317,26 +338,25 @@ uint32_t ButtonJogCBFunction(uint32_t IfIndex, uint32_t ReadValue) } else if (jog.Action == LONGPB) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action->LONGPB-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action LONGPB, sttJOGGING -> sttLONG_JOGGING-----------------", __FILE__,__LINE__, jog.state, RpMessage, jog.Action, 0); jog.state = sttLONG_JOGGING; - if (JobIsActive() == false) // added because sometimes the jog stops because of another reason and the button s stucked blinking - { - jog.color = colorON; - Pannel_Leds(THREAD_JOGGING, MODE_ON); - jog.state = sttENABLE; - } - } break; case sttLONG_JOGGING: if (jog.Action == COUNTPB) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttLONG_JOGGING action->COUNTPB-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING;ThreadAbortJoggingFunc(); // to do!!!! + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttLONG_JOGGING action COUNTPB, sttLONG_JOGGING -> sttENABLE, stop JOGGING-----------------", __FILE__,__LINE__, jog.state, RpMessage, jog.Action, 0); ThreadAbortJoggingFunc(); jog.color = colorON; Pannel_Leds(THREAD_JOGGING, MODE_ON); jog.state = sttENABLE; } + if (JobIsActive() == false) // added because sometimes the jog stops because of another reason and the button s stucked blinking + { + jog.color = colorON; + Pannel_Leds(THREAD_JOGGING, MODE_ON); + jog.state = sttENABLE; + } break; default: break; @@ -556,7 +576,7 @@ return OK; uint32_t LoadStatMachine( button *pBtn) { - ReportWithPackageFilter(GeneralFilter,"------------ start loading -----------------", __FILE__,__LINE__,pBtn->state, RpMessage, pBtn->color, 0); + ReportWithPackageFilter(GeneralFilter,"------------ (state) (color) -----------------", __FILE__,__LINE__,pBtn->state, RpMessage, pBtn->color, 0); switch (pBtn->state) { case sttRDY : diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 82f7e300f..290e65fa9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -1492,14 +1492,13 @@ uint32_t DrierHeaterVlotageSetup(double voltage) if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) //rapid/pp machines { DrierAcVoltage = ReadVAC(); - //if () } else { UseSecondaryDrierHeater = true; } - +return OK; } uint32_t HeatersControlLoop(uint32_t tick) { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 9ad8d485b..68da1317b 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -90,7 +90,11 @@ AutoHoming_Config_enum AutoHoming_Config = AutoHoming_off; void IDS_Dispenser_SetAutoHoming_Config(AutoHoming_Config_enum Config) { Report("IDS_Dispenser_SetAutoHoming_Config ",__FILE__,__LINE__,Config,RpWarning,AutoHoming_Config,0); +#ifdef SPECIAL_DISPENSERS + AutoHoming_Config = AutoHoming_off; +#else AutoHoming_Config = Config; +#endif } void IDS_Dispenser_SetBackLashValues(double initialdispenserpressure, uint32_t initialdispensertimeout, uint32_t initialdispensertimelag, uint32_t initialdispenserspeed) @@ -544,7 +548,8 @@ void IDS_Dispenser_Init(uint8_t DispenserId) PrimingActive[DispenserId]= false; Valve_Set(IDS_Id_to_AirValve[DispenserId], Atm_MidTank_OFF); Control3WayValvesWithCallback ((Valves_t)DispenserId, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer +#ifdef SPECIAL_DISPENSERS if (ControlIdtoInactiveDispenserId[DispenserId] == 0xFF) ControlIdtoInactiveDispenserId[DispenserId] = AddControlCallback("IDS_Check_Pressure", IDS_Check_Pressure_Callback, eOneMinute,TemplateDataReadCBFunction ,DispenserId, 0, 0 ); - +#endif } diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 04abb6870..14718ab0e 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1033,6 +1033,8 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0) IDS_Cleaning_Stop_Cleaning_Solution (NULL); setRapidPressureRead(false); + if (JobEndSequence == true) + DistanceToSpoolReady(Module_IDS,ModuleDone); } if (EnableCleaning == true) { @@ -1510,7 +1512,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) #else Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Head); #endif - //IDS_Cleaning_Stop_Cleaning_Solution(NULL); + IDS_Cleaning_Stop_Cleaning_Solution(NULL); SegmentNumOfBrushStops = Segment->n_brushstops; BrushStopTime = Segment->length*1000/(double)SegmentNumOfBrushStops; //brushstop in meters //brushstop in millisecond BrushStopTime = ((BrushStopTime*100)/dyeingspeed);//brushstop in seconds @@ -1537,7 +1539,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) if (DispenserPreSegmentControlId != 0xFF) { Report("IDS presegment not yet ended!!",__FILE__,__LINE__,(int)InterSegmentStepsCount,RpWarning,(int)lInterSegmentLength,0); - IDS_Cleaning_Stop_Cleaning_Solution (NULL); + //IDS_Cleaning_Stop_Cleaning_Solution (NULL); RemoveControlCallback(DispenserPreSegmentControlId, IDSPreSegmentStateCallbackRunner ); DispenserPreSegmentControlId = 0xFF; } @@ -1601,17 +1603,18 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) for (Dispenser_i = 0;Dispenser_i < MAX_DYE_DISPENSERS;Dispenser_i++) { DispenserDistanceToSpoolReady[Dispenser_i] = true; - if (DispenserUsedInJob[Dispenser_i]==false)//unconfigured dispenser - continue; - DispenserDistanceToSpoolReady[Dispenser_i] = false; -#ifdef SPECIAL_DISPENSERS - IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,NULL); -#else - MotorStop(DispenserIdToMotorId[Dispenser_i],Hard_Hiz); -#endif - Control3WayValvesWithCallback ((Valves_t)Dispenser_i, MidTank_Dispenser, IDS_Valve_DistanceToSpoolValveReady); //direction: MidTank_Dispenser or Dispenser_Mixer - CurrentDispenserSpeed[Dispenser_i] = 0; - //IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,IDS_Valve_DistanceToSpoolValveReady); + if (DispenserUsedInJob[Dispenser_i]==true)//unconfigured dispenser + { + DispenserDistanceToSpoolReady[Dispenser_i] = false; + #ifdef SPECIAL_DISPENSERS + IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,NULL); + #else + MotorStop(DispenserIdToMotorId[Dispenser_i],Hard_Hiz); + #endif + Control3WayValvesWithCallback ((Valves_t)Dispenser_i, MidTank_Dispenser, IDS_Valve_DistanceToSpoolValveReady); //direction: MidTank_Dispenser or Dispenser_Mixer + CurrentDispenserSpeed[Dispenser_i] = 0; + //IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,IDS_Valve_DistanceToSpoolValveReady); + } } //cleaning diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 76c6579da..677d3fa5f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -10,6 +10,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" #include "StateMachines/Initialization/PowerOffSequence.h" +#include "StateMachines/Initialization/PowerIdle.h" #include "drivers/Flash_Memory/FATFS/ff.h" #include "drivers/Flash_Memory/FATFS/Control_File_System.h" @@ -116,7 +117,16 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } //Trigger_WHS_Set_Volt_Blower_Control(request->delay); } else - if(request->amount == 0x3EA) + if (request->amount == 0x3E7) // set WHS Blower speed by Q value + { + if (WHS_Type == WHS_TYPE_NEW) + { + Trigger_WHS_Set_Blower_Control_Closed_Loop (request->delay); + response.progress = 0; + response.has_progress = true; + } //Trigger_WHS_Set_Volt_Blower_Control(request->delay); + } + else if(request->amount == 0x3EA) { uint16_t tempu16 = 0; if (WHS_Type == WHS_TYPE_NEW) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 4ab59ec19..128564586 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -1422,6 +1422,7 @@ uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer) MessageContainer responseContainer; MessageState = 2; Thread_Load_End(); + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles); Report("StopThreadLoadingFunc",__FILE__,__LINE__,0xFF,RpWarning,(int)LoadStages,0); responseContainer = createContainer(MESSAGE_TYPE__StopThreadLoadingResponse, requestContainer->token, true, &Cresponse, &stop_thread_loading_response__pack, &stop_thread_loading_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index ec705c2d2..fb3b78752 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -73,15 +73,14 @@ uint32_t MotorsConfigMessage(HardwareConfiguration * HWrequest) MotorsCfg[Motor_i].pulseperround = request->pulseperround; MotorsCfg[Motor_i].pulleyradius = request->pulleyradius; MotorsCfg[Motor_i].configword = request->configword; - MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize;//L6470 + L6472 -/* if(MotorDriverResponse[Motor_i].DriverType != CombinrdMotDriver) + if(MotorDriverResponse[Motor_i].DriverType == CombinrdMotDriver) { MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize ^ 1;//PowerSTEP01 } else { MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize;//L6470 + L6472 - }*/ + } MotorsCfg[Motor_i].kvalhold = request->kvalhold; MotorsCfg[Motor_i].kvalrun = request->kvalrun; MotorsCfg[Motor_i].kvalacc = request->kvalacc; |
