From a259d2e0ee5e28237f967f1683cc0b9c2a295c27 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Sun, 12 May 2019 14:35:16 +0300 Subject: Add stub to read dispenser type + LS status --- Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index c6f2526db..c3b94c01f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -25,6 +25,12 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) ProgressResponse response = PROGRESS_RESPONSE__INIT; + if((request->amount == 0xDE) && (request->delay < 8) && (request->delay >= 0)) // read dispenser type + LS status + { + response.progress = ((Dispenser_struct[request->delay].Type) << 8) + Dispenser_struct[request->delay].Status; + response.has_progress = true; + } + else if((request->amount == 0xCF) && (request->delay == 0xCF)) //Create File System on the Drive { FRESULT iFResult = Init_Flash_File_System(true); -- cgit v1.3.1 From 092660c6bb1a30856ae03241ceb63faac8f59a57 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 12 May 2019 18:17:09 +0300 Subject: Version 1.3.9.12 keep alive related changes, + faster dispenser init --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Common/report/distributor.c | 5 ++++ .../Embedded/Communication/Connection.c | 9 ++++-- .../Embedded/Modules/Control/MillisecTask.c | 34 +++++++++++++++++----- .../Embedded/Modules/Control/MillisecTask.h | 1 + .../Embedded/Modules/General/GeneralHardware.c | 1 + .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 9 ++++-- .../Embedded/Modules/Thread/Thread_Winder.c | 4 +-- .../StateMachines/Initialization/InitSequence.c | 2 +- .../Embedded/StateMachines/Printing/JobSTM.c | 6 ++-- 10 files changed, 53 insertions(+), 20 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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 81a34b7ac..bb9972f9b 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,3,9,10}; +TangoVersion_t _gTangoVersion = {1,3,9,12}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Common/report/distributor.c b/Software/Embedded_SW/Embedded/Common/report/distributor.c index f011653ec..84a49fde3 100644 --- a/Software/Embedded_SW/Embedded/Common/report/distributor.c +++ b/Software/Embedded_SW/Embedded/Common/report/distributor.c @@ -618,6 +618,11 @@ STATUS ReportFunc(ReportFunction func, uint32_t SwitchAddRemove, DistributorHand } if (SwitchAddRemove == REPORT_ADD) { + if ((ReportFunc1 == func)||(ReportFunc2 == func)) + { + return OK; + } + if (ReportFunc1 == NULL) { ReportFunc1 = func; diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index 1d9f43cd1..3063e1ebe 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -146,11 +146,12 @@ void KeepAliveOneSecondCall(void) if (KeepAliveActive == false) return; KeepAliveOneSecondCounter++; - if (KeepAliveOneSecondCounter > KEEPALIVE_COMMUNICATION_ABORT_LIMIT) + if (KeepAliveOneSecondCounter > 5) { - LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed"); + Report("keepalive ",__FILE__,__LINE__,KeepAliveOneSecondCounter,RpWarning,msec_millisecondCounter, 0); + //LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed"); KeepAliveOneSecondCounter = 0; - KeepAliveActive = false; + /*KeepAliveActive = false; ReportStopReporting(); DiagnosticsStop(); JobStopReporting(); @@ -158,5 +159,7 @@ void KeepAliveOneSecondCall(void) //CommunicationMailboxFlush(); USBCDCD_Reinit(); //UART_ResetBuffers(); + * + */ } } diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 916d33772..cb1be7fa5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -477,6 +477,11 @@ int MillisecGetTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId) { return TemperatureCalc[SensorId]; } +bool RapidPressureRead = false; +void setRapidPressureRead(bool value) +{ + RapidPressureRead = value; +} uint32_t MillisecLowLoop(uint32_t tick) { uint8_t Motor_i,Disp_i,Heater_i,temp; @@ -528,24 +533,36 @@ uint32_t MillisecLowLoop(uint32_t tick) //LOG_ERROR (1111, "Control_WD"); } } + if (RapidPressureRead == true) + { + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + CalculateDispenserPressure(Disp_i); + //Read_MidTank_Pressure_Sensor(Disp_i); + } + ADC_TriggerCollection(); + } } - if (O900Millisecond_Tick) + if ((O900Millisecond_Tick)&&(RapidPressureRead == false)) { ADC_TriggerCollection(); } if (Onesecond_Tick) { - for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + if (RapidPressureRead == false) { - CalculateDispenserPressure(Disp_i); - //Read_MidTank_Pressure_Sensor(Disp_i); + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + CalculateDispenserPressure(Disp_i); + //Read_MidTank_Pressure_Sensor(Disp_i); + } } FPGA_GetAllDispensersValveBusyOCD(); temp = Read_Fans_Tacho(); DrawerFansStatus = temp & 0x1F; SystemFansStatus = temp & 0xE0; - KeepAliveOneSecondCall(); + //KeepAliveOneSecondCall(); for (Motor_i = 0;Motor_i < NUM_OF_MOTORS;Motor_i++) { if (Motor_i == HARDWARE_MOTOR_TYPE__MOTO_SCREW) @@ -553,9 +570,12 @@ uint32_t MillisecLowLoop(uint32_t tick) if (isMotorConfigured(Motor_i)) MotorGetStatusFromFPGA(Motor_i); } - for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++) + if (!(OneMinute_Tick)) { - Read_Heaters_Current(Heater_i); + for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++) + { + Read_Heaters_Current(Heater_i); + } } Gas_PPM = Calculate_Gas_Power_Consumption(); for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h index be82d9e98..4edc1a8ed 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h @@ -34,6 +34,7 @@ uint32_t getDrawerFansStatus(void); uint32_t getSystemFansStatus(void); uint8_t getGasReading(void); int MillisecGetTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId); +void setRapidPressureRead(bool value); void MillisecInit(void); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index f0edc56ab..781a48692 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -273,6 +273,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) if (JobIsActive()) { + LOG_ERROR(1,"JobIsActive"); return ERROR; } if (watchdogCriticalAlarm == true) diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index cd748fd5c..40591a76d 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -553,6 +553,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. double PrepeareSpeed = 0; int NumOfActiveDispensers = 0; int DispenserBuildTimeCounter = 0; +#define PRESSURE_READ_TIME_GAP 100 //******************************************************************************************************************** uint32_t IDS_Prepare_Callback(uint32_t DispenserId, uint32_t ReadValue) { @@ -561,7 +562,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. int NumofReadyDispensers = 0; //REPORT_MSG((int)DispenserPrepareControlId, "Prepare Callback"); - DispenserBuildTimeCounter+=500; + DispenserBuildTimeCounter+=PRESSURE_READ_TIME_GAP; if (DispenserBuildTimeCounter<(2*eOneSecond)) { @@ -578,7 +579,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. } } - if (NumofReadyDispensers) + if ((NumofReadyDispensers)&&(DispenserBuildTimeCounter%10 == 0)) Report("IDS_Prepare_Callback",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); if (NumofReadyDispensers>=NumOfActiveDispensers) @@ -587,6 +588,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. if ((DispenserBuildTimeCounter >= DispenserPrepareTimeout)||(pressureReady == true)) { SafeRemoveControlCallback(DispenserPrepareControlId, IDS_Prepare_Callback ); + setRapidPressureRead(false); //DispenserPrepareReady(); PrepareReady(Module_IDS,ModuleDone); } @@ -679,7 +681,8 @@ c. Go to step 2.a x Segment.BrushStopsCount. } } DispenserBuildTimeCounter = 0; - DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, 500,TemplateDataReadCBFunction ,0, 0, 0 ); + DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, PRESSURE_READ_TIME_GAP,TemplateDataReadCBFunction ,0, 0, 0 ); + setRapidPressureRead(true); } //******************************************************************************************************************** diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index df88db3f9..06597ee84 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -289,7 +289,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) WinderReferenceSpeed = Averagewinderspeed; } screw_horizontal_speed = ScrewNumberOfSteps / Rotations;//InternalWinderCfg.NumberOfRotationPerPassage; - if (Rotations > 7.0) + if (Rotations > 6.4)//7.0) Rotations = 6.0; RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond; @@ -479,7 +479,7 @@ void ScrewTimerInterrupt(int ARG0) TimerDisable(Screw_timerBase, TIMER_A); } ROM_IntMasterEnable(); - Rotations+=0.03; + Rotations+=0.005; return ; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index eb36dae1a..05606faff 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -118,7 +118,7 @@ void InitSequenceResetReason(void) */ RESET_Cause = SysCtlResetCauseGet (); LOG_ERROR(RESET_Cause,"Reset Reason Register"); - SysCtlResetCauseClear(RESET_Cause); + //SysCtlResetCauseClear(RESET_Cause); InitStages++; //InitSequenceStateMachine(InitStages); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 66473a3f8..3da59e412 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -183,7 +183,7 @@ static ReturnCode PrepareState(void *JobDetails) if (Configured[Module_IDS]) { PrepareWaiting[Module_IDS] = ModuleWaiting; - REPORT_MSG(Module_IDS,"Dispenser prepare waiting"); +// REPORT_MSG(Module_IDS,"Dispenser prepare waiting"); } if (Configured[Module_Thread]) { @@ -203,7 +203,7 @@ static ReturnCode PrepareState(void *JobDetails) //check thread type if (Configured[Module_IDS]) { - REPORT_MSG(Module_IDS,"Dispenser prepare called"); + //REPORT_MSG(Module_IDS,"Dispenser prepare called"); IDSPrepareState(JobDetails); } /* if (Configured[Module_Heaters]) @@ -647,7 +647,7 @@ void JobRequestFunc(MessageContainer* requestContainer) usnprintf(ErrorMsg, 100, "Hardware Parameters Not Set"); } } - REPORT_MSG(0,"Process parameters in job request are not handled. push separately for now"); + //REPORT_MSG(0,"Process parameters in job request are not handled. push separately for now"); if (Ticket->spool) { if (InternalWindingConfigMessage(Ticket->spool)!= OK) -- cgit v1.3.1 From b4eded222b78d19ea2e1606ee1a7f457c0aa1738 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Tue, 14 May 2019 11:19:35 +0300 Subject: move the dispensers init functions to hardware init + update the eeprom struct acording to "DISPENSER AUTOMATIC TEST STATION FUNCTIONAL REQUIREMENTS" Version: 0.2 --- Software/Embedded_SW/Embedded/DataDef.h | 52 +++++++++++++++++++++- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 2 +- .../Dispenser_Card/EEPROM/Dispenser_EEPROM.c | 14 +++--- Software/Embedded_SW/Embedded/Main.c | 2 - .../Embedded/Modules/General/GeneralHardware.c | 6 +++ 5 files changed, 65 insertions(+), 11 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 1b5f000f2..0cf75637c 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -325,7 +325,7 @@ typedef enum }LS_STATUS; - +/* typedef union { struct @@ -340,7 +340,57 @@ typedef union }bytes; uint8_t Buf[16]; }DISP_EEPROM; +*/ +//////////////////////////////////////////// +typedef struct +{ + uint32_t SN; + uint32_t Batch_Productions_data; + uint32_t Production_date; + uint32_t Dispenser_Part_Number; + uint32_t PCB_Serial; + uint32_t PCB_Version; +}DISPENSER_DATA; + +typedef struct +{ + float Humidity; + float Temperature; +}DISPENSER_TEST_AMBIENT; + +typedef struct +{ + uint16_t Current; + uint16_t Batch; +}DISPENSER_COLOR; + +typedef struct +{ + float Calibration0; + float Calibration1; +}DISPENSER_CALIBRATION_TABLE; + +typedef struct +{ + DISPENSER_DATA Dispebser_Data; + uint32_t Calibration_Test_Date ; + uint32_t ATS_location_Slot ; + uint32_t Nl_Pulse_Value ; + uint32_t Flow_Pass_Fail ; + DISPENSER_CALIBRATION_TABLE Calibration_table; + uint32_t Test_TI_Batch; + DISPENSER_COLOR Color; + DISPENSER_TEST_AMBIENT Test_Ambient; + uint32_t Total_Cycles_Working_Time; + uint32_t Spare[5]; +}DISP_EEPROM_BYTES; +typedef union +{ + DISP_EEPROM_BYTES bytes; + uint8_t Buf[sizeof(DISP_EEPROM_BYTES)]; +}DISP_EEPROM; +//////////////////////////////////////////// typedef struct { DISP_TYPE Type; 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 0ba34deb6..4686f4b58 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 @@ -119,7 +119,7 @@ LS_DRYER_DH Ls_Dryer_Dh; void FPGA_Read_LS_Safty_Ind_Reg() { - uint8_t temp[8],i; + uint8_t temp[8] = {0,0,0,0,0,0,0,0},i; LS_Left.ushort = F1_GPI_LS2_D; Ls_Right_Screw_Spool.ushort = F1_GPI_LS3_D; 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 a75ef5e40..9aeb5b20a 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 @@ -96,13 +96,13 @@ uint32_t test_disp_eeprom(uint8_t Dispenser_ID , uint8_t EEprom_Add)//0..7 uint32_t status= OK; uint32_t i; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.SN = 0x12345678; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Version = 0xAB; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Content = 0xCD; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Location = 0xEF; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Life_Time = 0x55; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Calibration = 0xA1B2C3D4; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Spare = 0xE5F60102; + 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; + Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Test_Ambient.Humidity = 0xEF; + Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Color.Batch = 0x55; + Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Calibration_table.Calibration0 = 0xA1B2C3D4; + Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Spare[0] = 0xE5F60102; status |= I2C_EEprom_Write_Ch(Dispenser_ID, EEprom_Add); SysCtlDelay(5000000);//Must delay for at least 5 milli. !!! (See data sheet ) diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 46a173672..168676d06 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -243,8 +243,6 @@ int main(void) Control_Dryer_Fan(STOP,0);//Preventing unwanted movement at power up, since the default from FPGA is "0" (= START) #endif - Check_Dispenser_Type(); - Init_Dispensers_IO_Registers(&Disp_IO_Reg); #ifdef WATCHDOG InitWatchdog(ui32SysClock*10); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index f0edc56ab..2c64055e9 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -42,6 +42,8 @@ #include "StateMachines/Initialization/InitSequence.h" #include "StateMachines/Initialization/PowerIdle.h" #include "StateMachines/Initialization/PowerOffSequence.h" +#include "Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h" +#include uint32_t EmbeddedParametersInit(void); uint32_t EmbeddedParametersWrite(void * buffer, uint16_t size); @@ -285,6 +287,10 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) PrintingHWConfiguration(request); if (request->n_winders == 1) status += InternalWinderConfigMessage(request->winders); + + Check_Dispenser_Type(); + Init_Dispensers_IO_Registers(&Disp_IO_Reg); + status += MotorsInit(); if (request->n_motors < NUM_OF_MOTORS) -- cgit v1.3.1 From d31ad49fdc654352322da85da921e6e0423d98bd Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 14 May 2019 11:33:54 +0300 Subject: Version 1.3.10.1 Support for lubricant valve in tech board. double reporting bug, winding - small change. keepalive failure restarts usb driver. some traces. --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Communication/Connection.c | 10 ++-- .../PMR/Diagnostics/InterfaceIOs.pb-c.c | 70 +++++++++++----------- .../PMR/Diagnostics/InterfaceIOs.pb-c.h | 1 + .../Embedded_SW/Embedded/Drivers/Valves/Valve.c | 8 ++- .../Embedded_SW/Embedded/Drivers/Valves/Valve.h | 2 + .../Embedded/Modules/Control/MillisecTask.c | 2 +- .../Modules/Diagnostics/DiagnosticActions.c | 6 ++ .../Embedded/Modules/Diagnostics/Diagnostics.c | 7 ++- .../Embedded/Modules/General/GeneralHardware.c | 2 +- .../Embedded/Modules/Heaters/Heaters_print.c | 4 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 4 +- .../Embedded/Modules/Thread/Thread_Winder.c | 2 + .../Embedded/StateMachines/Printing/JobSTM.c | 37 ++++++++---- 14 files changed, 97 insertions(+), 60 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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 bb9972f9b..46e648d92 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,3,9,12}; +TangoVersion_t _gTangoVersion = {1,3,10,1}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index 3063e1ebe..50f23d26e 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -146,20 +146,20 @@ void KeepAliveOneSecondCall(void) if (KeepAliveActive == false) return; KeepAliveOneSecondCounter++; - if (KeepAliveOneSecondCounter > 5) + if (KeepAliveOneSecondCounter > KEEPALIVE_COMMUNICATION_ABORT_LIMIT) { Report("keepalive ",__FILE__,__LINE__,KeepAliveOneSecondCounter,RpWarning,msec_millisecondCounter, 0); //LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed"); KeepAliveOneSecondCounter = 0; - /*KeepAliveActive = false; + KeepAliveActive = false; ReportStopReporting(); DiagnosticsStop(); JobStopReporting(); AlarmHandlingStop(); //CommunicationMailboxFlush(); - USBCDCD_Reinit(); + + USBCDCD_init(); + //USBCDCD_Reinit(); //UART_ResetBuffers(); - * - */ } } diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.c index c5c19ee52..ec93b525c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.c @@ -7,7 +7,7 @@ #endif #include "InterfaceIOs.pb-c.h" -static const ProtobufCEnumValue interface_ios__enum_values_by_number[38] = +static const ProtobufCEnumValue interface_ios__enum_values_by_number[39] = { { "ANALOG_MIXCHIP_TEMP", "INTERFACE_IOS__ANALOG_MIXCHIP_TEMP", 0 }, { "GPO_MIXCHIP_SSR4_CTRL", "INTERFACE_IOS__GPO_MIXCHIP_SSR4_CTRL", 19 }, @@ -18,6 +18,7 @@ static const ProtobufCEnumValue interface_ios__enum_values_by_number[38] = { "GPO_DRYER_SSR1_CTRL", "INTERFACE_IOS__GPO_DRYER_SSR1_CTRL", 43 }, { "GPO_DRYER_SSR2_CTRL", "INTERFACE_IOS__GPO_DRYER_SSR2_CTRL", 44 }, { "GPO_DRYER_SSR3_CTRL", "INTERFACE_IOS__GPO_DRYER_SSR3_CTRL", 45 }, + { "GPO_SPARE_SSR12_CTRL", "INTERFACE_IOS__GPO_SPARE_SSR12_CTRL", 54 }, { "GPO_SPARE_SSR13_CTRL", "INTERFACE_IOS__GPO_SPARE_SSR13_CTRL", 55 }, { "GPO_EXTWINDER_SSR11_CTRL", "INTERFACE_IOS__GPO_EXTWINDER_SSR11_CTRL", 64 }, { "GPO_DILUTORPUMP_SSR10_CTRL", "INTERFACE_IOS__GPO_DILUTORPUMP_SSR10_CTRL", 163 }, @@ -49,16 +50,16 @@ static const ProtobufCEnumValue interface_ios__enum_values_by_number[38] = { "VALVE_WASTE_TANK", "INTERFACE_IOS__VALVE_WASTE_TANK", 346 }, }; static const ProtobufCIntRange interface_ios__value_ranges[] = { -{0, 0},{19, 1},{43, 6},{55, 9},{64, 10},{163, 11},{274, 29},{318, 30},{341, 32},{0, 38} +{0, 0},{19, 1},{43, 6},{54, 9},{64, 11},{163, 12},{274, 30},{318, 31},{341, 33},{0, 39} }; -static const ProtobufCEnumValueIndex interface_ios__enum_values_by_name[38] = +static const ProtobufCEnumValueIndex interface_ios__enum_values_by_name[39] = { { "ANALOG_MIXCHIP_TEMP", 0 }, - { "GPI_WCONTAINER_FULL", 32 }, - { "GPI_WCONTAINER_WARN", 33 }, - { "GPO_BLOWER_PWM", 34 }, - { "GPO_CHILLER_SSR9_CTRL", 35 }, - { "GPO_DILUTORPUMP_SSR10_CTRL", 11 }, + { "GPI_WCONTAINER_FULL", 33 }, + { "GPI_WCONTAINER_WARN", 34 }, + { "GPO_BLOWER_PWM", 35 }, + { "GPO_CHILLER_SSR9_CTRL", 36 }, + { "GPO_DILUTORPUMP_SSR10_CTRL", 12 }, { "GPO_DRYER_SSR1_CTRL", 6 }, { "GPO_DRYER_SSR2_CTRL", 7 }, { "GPO_DRYER_SSR3_CTRL", 8 }, @@ -66,31 +67,32 @@ static const ProtobufCEnumValueIndex interface_ios__enum_values_by_name[38] = { "GPO_DYEINGH_SSR6_CTRL", 3 }, { "GPO_DYEINGH_SSR7_CTRL", 4 }, { "GPO_DYEINGH_SSR8_CTRL", 5 }, - { "GPO_EXTWINDER_SSR11_CTRL", 10 }, - { "GPO_LED4", 29 }, + { "GPO_EXTWINDER_SSR11_CTRL", 11 }, + { "GPO_LED4", 30 }, { "GPO_MIXCHIP_SSR4_CTRL", 1 }, - { "GPO_SPARE1_1", 30 }, - { "GPO_SPARE1_2", 31 }, - { "GPO_SPARE_SSR13_CTRL", 9 }, - { "GPO_WASTECH_PUMP2", 12 }, - { "GPO_WHS_WTANKPUMP2", 36 }, - { "Midtank1Air", 13 }, - { "Midtank1Cartridge", 21 }, - { "Midtank2Air", 14 }, - { "Midtank2Cartridge", 22 }, - { "Midtank3Air", 15 }, - { "Midtank3Cartridge", 23 }, - { "Midtank4Air", 16 }, - { "Midtank4Cartridge", 24 }, - { "Midtank5Air", 17 }, - { "Midtank5Cartridge", 25 }, - { "Midtank6Air", 18 }, - { "Midtank6Cartridge", 26 }, - { "Midtank7Air", 19 }, - { "Midtank7Cartridge", 27 }, - { "Midtank8Air", 20 }, - { "Midtank8Cartridge", 28 }, - { "VALVE_WASTE_TANK", 37 }, + { "GPO_SPARE1_1", 31 }, + { "GPO_SPARE1_2", 32 }, + { "GPO_SPARE_SSR12_CTRL", 9 }, + { "GPO_SPARE_SSR13_CTRL", 10 }, + { "GPO_WASTECH_PUMP2", 13 }, + { "GPO_WHS_WTANKPUMP2", 37 }, + { "Midtank1Air", 14 }, + { "Midtank1Cartridge", 22 }, + { "Midtank2Air", 15 }, + { "Midtank2Cartridge", 23 }, + { "Midtank3Air", 16 }, + { "Midtank3Cartridge", 24 }, + { "Midtank4Air", 17 }, + { "Midtank4Cartridge", 25 }, + { "Midtank5Air", 18 }, + { "Midtank5Cartridge", 26 }, + { "Midtank6Air", 19 }, + { "Midtank6Cartridge", 27 }, + { "Midtank7Air", 20 }, + { "Midtank7Cartridge", 28 }, + { "Midtank8Air", 21 }, + { "Midtank8Cartridge", 29 }, + { "VALVE_WASTE_TANK", 38 }, }; const ProtobufCEnumDescriptor interface_ios__descriptor = { @@ -99,9 +101,9 @@ const ProtobufCEnumDescriptor interface_ios__descriptor = "InterfaceIOs", "InterfaceIOs", "", - 38, + 39, interface_ios__enum_values_by_number, - 38, + 39, interface_ios__enum_values_by_name, 9, interface_ios__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.h index c3608b155..341997ea0 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/InterfaceIOs.pb-c.h @@ -29,6 +29,7 @@ typedef enum _InterfaceIOs { INTERFACE_IOS__GPO_DRYER_SSR1_CTRL = 43, INTERFACE_IOS__GPO_DRYER_SSR2_CTRL = 44, INTERFACE_IOS__GPO_DRYER_SSR3_CTRL = 45, + INTERFACE_IOS__GPO_SPARE_SSR12_CTRL = 54, INTERFACE_IOS__GPO_SPARE_SSR13_CTRL = 55, INTERFACE_IOS__GPO_EXTWINDER_SSR11_CTRL = 64, INTERFACE_IOS__GPO_DILUTORPUMP_SSR10_CTRL = 163, diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 85bbb7838..ec9ea17db 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -380,7 +380,7 @@ uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callb return Valve3WayControlId[_ValveId]; } - +bool LubricantState = false; uint8_t Lubricant_2Way_Valve(bool Direction) { uint8_t Status = OK; @@ -392,11 +392,13 @@ uint8_t Lubricant_2Way_Valve(bool Direction) { //F3_GPO_01_Reg.bits.F3_LUBRICANT_VALVE = OPEN; Low_Reg = 0; + LubricantState = true; } else //Direction = STOP { //F3_GPO_01_Reg.bits.F3_LUBRICANT_VALVE = CLOSE; Low_Reg = 100; + LubricantState = false; } F3_low_var_LED4 = Low_Reg + 1 ; @@ -406,5 +408,9 @@ uint8_t Lubricant_2Way_Valve(bool Direction) return Status; } +bool GetLubricantState(void) +{ + return LubricantState; +} diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h index 0ac65cb34..33d4d34e7 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h @@ -63,4 +63,6 @@ void FPGA_GetAllDispensersValveBusyOCD(); // MillisecLoop // OCD - Over Current uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callback_fptr callback); //direction: MidTank_Dispenser or Dispenser_Mixer uint8_t Lubricant_2Way_Valve(bool Direction); +bool GetLubricantState(void); + #endif /* DRIVERS_VALVES_VALVE_H_ */ diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index cb1be7fa5..4cd56df56 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -562,7 +562,7 @@ uint32_t MillisecLowLoop(uint32_t tick) temp = Read_Fans_Tacho(); DrawerFansStatus = temp & 0x1F; SystemFansStatus = temp & 0xE0; - //KeepAliveOneSecondCall(); + KeepAliveOneSecondCall(); for (Motor_i = 0;Motor_i < NUM_OF_MOTORS;Motor_i++) { if (Motor_i == HARDWARE_MOTOR_TYPE__MOTO_SCREW) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c index 2b24f9832..f8a57362a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c @@ -262,6 +262,12 @@ uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer) case INTERFACE_IOS__GPO_WHS_WTANKPUMP2: SetWastePump( request->value); break; + case INTERFACE_IOS__GPO_SPARE_SSR12_CTRL: + if (request->value == true) + Lubricant_2Way_Valve(START);//use START or STOP, 0 - 100%(); + else + Lubricant_2Way_Valve(STOP);//use START or STOP, 0 - 100%(); + break; default: responseContainer.has_error = true; responseContainer.error = ERROR_CODE__GENERAL_ERROR; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index db13f5e15..2fa4c9fe4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -114,7 +114,7 @@ DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS]; HeaterState **heatersstates; HeaterState HeaterInfo[HEATER_TYPE__MixerHeater+1]; DigitalInterfaceState **digitalinterfacestates; -DigitalInterfaceState DigitalOutputState[MAX_HEATERS_NUM+8]; +DigitalInterfaceState DigitalOutputState[MAX_HEATERS_NUM+9]; /*double dispenser1motorfrequency[DIAGNOSTICS_LIMIT+1]; double dispenser2motorfrequency[DIAGNOSTICS_LIMIT+1]; double dispenser3motorfrequency[DIAGNOSTICS_LIMIT+1]; @@ -179,7 +179,7 @@ void DiagnosticsInit(void) heatersstates[i] = &HeaterInfo[i]; } digitalinterfacestates = (DigitalInterfaceState**)my_malloc(sizeof(DigitalInterfaceState *)*(MAX_HEATERS_NUM+8)); - for (i = 0;i<(MAX_HEATERS_NUM+8);i++ ) + for (i = 0;i<(MAX_HEATERS_NUM+9);i++ ) { digital_interface_state__init(&DigitalOutputState[i]); DigitalOutputState[i].has_interfaceio = true; @@ -276,6 +276,9 @@ void DiagnosticsLoadDigitalValues(void) DigitalOutputState[15].interfaceio = INTERFACE_IOS__GPO_SPARE1_2; /*waste middle cartridge presence*/ DigitalOutputState[15].value = WHS_WasteCartridgeMiddlePresent(); + DigitalOutputState[16].interfaceio = INTERFACE_IOS__GPO_SPARE_SSR12_CTRL; /*lubricant valve*/ + DigitalOutputState[16].value = GetLubricantState(); + } void DiagnosticLoadTemperature(int HeaterId, int temperature) { diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 781a48692..409737a9e 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -155,7 +155,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters.has_dispenserpresegmentwfcf = true; EmbeddedParameters.dispenserpresegmentwfcf = 80; EmbeddedParameters.has_startheatingoninitsequence = true; - EmbeddedParameters.startheatingoninitsequence = false; + EmbeddedParameters.startheatingoninitsequence = true; //set to true shlomo 14/5/2019 //size_t n_generalparameters; // EmbeddedParameters.*generalparameters; EmbeddedParameters.has_currentalarmlowlimit = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index e10990f85..db23ab588 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -391,6 +391,7 @@ uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature) if ((HeaterState == HEATER_OFF)&& (OnOff == HEATER_ON)) //start heating { + Report("HeaterCommandRequest OFF-> ON",__FILE__,HeaterId,Temperature*100,RpWarning,HeaterState, 0); //set the heater control parameters //set the target operation temperature //start the control @@ -404,6 +405,7 @@ uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature) } else if ((HeaterState == HEATER_ON)&& (OnOff == HEATER_ON)) //set temperature { + Report("HeaterCommandRequest ON-> ON",__FILE__,HeaterId,Temperature*100,RpWarning,HeaterState, 0); //HeaterPIDConfig[HeaterId].m_SetParam = HeaterCmd[HeaterId].targettemperatue; if (abs(HeaterPIDConfig[HeaterId].m_SetParam - HeaterCmd[HeaterId].targettemperatue)>0.5) //#bug 221 { @@ -565,7 +567,7 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) temp = SetTemperatue*(100-band); //temp = SetTemperatue*90.0; HeaterControl[HeaterId].sensorminvalue = (int)temp; - Report("Temperature limits",__FILE__,HeaterId,HeaterControl[HeaterId].sensormaxvalue,RpWarning,HeaterControl[HeaterId].sensorminvalue, 0); + //Report("Temperature limits",__FILE__,HeaterId,HeaterControl[HeaterId].sensormaxvalue,RpWarning,HeaterControl[HeaterId].sensorminvalue, 0); if (HeaterPIDConfig[HeaterId].m_params.IntegralErrorMultiplier) { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 40591a76d..4e965350a 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -566,7 +566,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. if (DispenserBuildTimeCounter<(2*eOneSecond)) { - REPORT_MSG(DispenserBuildTimeCounter,"waiting 2 seconds for pressure changes"); + //REPORT_MSG(DispenserBuildTimeCounter,"waiting 2 seconds for pressure changes"); return OK; } for (i = 0; i < MAX_DYE_DISPENSERS; i++) @@ -579,7 +579,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. } } - if ((NumofReadyDispensers)&&(DispenserBuildTimeCounter%10 == 0)) + if ((NumofReadyDispensers)&&(DispenserBuildTimeCounter%1000 == 0)) Report("IDS_Prepare_Callback",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); if (NumofReadyDispensers>=NumOfActiveDispensers) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 06597ee84..e0350935a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -237,6 +237,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) if (WinderMotorSpeedRollOver == false) { Add100 = true; + LOG_ERROR(Add100, "Add100 = true"); } WinderMotorSpeedCounter=0; WinderMotorSpeedRollOver=true; @@ -387,6 +388,7 @@ uint32_t Winder_Presegment(void *SegmentDetails, uint32_t SegmentId) TotalWinderSpeed = 0; WinderMotorSpeedRollOver=false; Add100 = false; + LOG_ERROR(Add100, "Add100 = false"); } PreSegmentReady(Module_Winder,ModuleDone); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index a198afac3..dc0ce3116 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -903,16 +903,32 @@ uint32_t ResumeCurrentJobRequestFunc(MessageContainer* requestContainer) ResumeCurrentJobResponse response = RESUME_CURRENT_JOB_RESPONSE__INIT; JobStatus jobStatus = JOB_STATUS__INIT; - ustrncpy (JobToken, requestContainer->token,36); - JobResumed = true; - usnprintf(ErrorMsg, 100, "Job Resumed"); + if (JobActive == true) + { + ustrncpy (JobToken, requestContainer->token,36); + JobResumed = true; + usnprintf(ErrorMsg, 100, "Job Resumed"); + + jobStatus.message =ErrorMsg; + jobStatus.has_progress = true; + jobStatus.progress = 0.0; + jobStatus.has_currentsegmentindex = false; + response.status = &jobStatus; + response.has_canceled = false; + } + else + { + usnprintf(ErrorMsg, 100, "Job not Resumed"); + + jobStatus.message =ErrorMsg; + jobStatus.has_progress = true; + jobStatus.progress = 0.0; + jobStatus.has_currentsegmentindex = false; + response.status = &jobStatus; + response.has_canceled = true; + response.canceled = true; + } - jobStatus.message =ErrorMsg; - jobStatus.has_progress = true; - jobStatus.progress = 0.0; - jobStatus.has_currentsegmentindex = false; - response.status = &jobStatus; - response.has_canceled = false; responseContainer = createContainer(MESSAGE_TYPE__ResumeCurrentJobResponse, JobToken, false, &response, &resume_current_job_response__pack, &resume_current_job_response__get_packed_size); if (status!= OK) @@ -968,9 +984,6 @@ Void jobTask(UArg arg0, UArg arg1) JobEndReason = JOB_OK; JobActive = true; setmachineActive(true); - /*ValidateState (CurrentJob); - break; - case ValidationResultsOk:*/ PrepareState (CurrentJob); break; case ValidationResultsFail: -- cgit v1.3.1 From a870370b6034c62c6aeb15c1b29c55b22d935364 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 14 May 2019 19:22:33 +0300 Subject: Version 1.3.10.1 fix winding, kee alive, messages. --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 2 +- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 4 ++-- Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 4cd56df56..cb1be7fa5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -562,7 +562,7 @@ uint32_t MillisecLowLoop(uint32_t tick) temp = Read_Fans_Tacho(); DrawerFansStatus = temp & 0x1F; SystemFansStatus = temp & 0xE0; - KeepAliveOneSecondCall(); + //KeepAliveOneSecondCall(); for (Motor_i = 0;Motor_i < NUM_OF_MOTORS;Motor_i++) { if (Motor_i == HARDWARE_MOTOR_TYPE__MOTO_SCREW) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index e0350935a..f8b0efb17 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -290,7 +290,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) WinderReferenceSpeed = Averagewinderspeed; } screw_horizontal_speed = ScrewNumberOfSteps / Rotations;//InternalWinderCfg.NumberOfRotationPerPassage; - if (Rotations > 6.4)//7.0) + if (Rotations > 6.6)//7.0) Rotations = 6.0; RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond; @@ -481,7 +481,7 @@ void ScrewTimerInterrupt(int ARG0) TimerDisable(Screw_timerBase, TIMER_A); } ROM_IntMasterEnable(); - Rotations+=0.005; + Rotations+=0.01; return ; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index dc0ce3116..416be7edc 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -739,6 +739,7 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes strcpy (infomsg,Message); Report(infomsg,__FILE__,__LINE__,55,RpWarning,33, 44); }*/ + UInt Key = Task_disable(); if (JobToken[0] != 0) { @@ -831,6 +832,8 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes } // if (responseContainer.data.data) // my_free(responseContainer.data.data); + Task_restore(Key); + } void JobStopReporting(void) { -- cgit v1.3.1 From 5fc9cec8173d92e365b2a1febe48abd718e51044 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 15 May 2019 12:23:44 +0300 Subject: Version 1.3.10.2 - blower init fix --- Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Modules/General/GeneralHardware.c | 4 +++- .../Embedded_SW/Embedded/Software Release Notes.txt | 17 ++++++++++++++--- .../StateMachines/Initialization/InitSequence.c | 17 +++++++++-------- .../Embedded/StateMachines/Printing/JobSTM.c | 7 +------ 5 files changed, 28 insertions(+), 19 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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 46e648d92..6705148e3 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,3,10,1}; +TangoVersion_t _gTangoVersion = {1,3,10,2}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 15060ab8b..800d40db6 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -365,7 +365,9 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) } else { - BlowerCfg.enabled = false; + BlowerCfg.enabled = true; + BlowerCfg.voltage = 3000; + BlowerCfg.heatingvoltage = 3000; } //from now on starting blower on INIT, so that the chiller does not freeze /*if (BlowerCfg.enabled == true) diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 7b7666b5f..c02824117 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -1,19 +1,30 @@ -Embedded SW Release note - Version 1.3.9.9 - Itma Candidate 3 +Embedded SW Release note - Version 1.3.10.2 - Itma Candidate 3 ============================================================= Machine: Watchdog restart time is now 20 seconds, to avoid unintended restarts Modules: - IDS - Build pressure on job prepare. currently hard coded: building on 130%, for at least 1 bar, or 1 minute. + IDS - Build pressure on job prepare. currently hard coded: building on 480, for at least bar, or 1 minute. Heaters: do not restart the heating controlled process if the setpoint does not changes + blower activated even if cfg not found - at 3000mV Connection: Embedded does not reconnect until HW is initialized Alarm handling: many unusful alarm removed: motors, heating process, midtank empty Diagnostic data reduced significantly in frequency + Waste state machine disabled for ITMA Drivers: VOC Gas sensor fixes. Lubricant valve workaround until FPGA will be fixed Encoder screw reading prepared (FPGA needs to be changed) + improve dispenser type identification + tech board support handling of lubricant valve + disable watchdog on DFU detection + prevent reading of current and midtank pressure at the same time, in millisec task +Other: + fix double report bug + improve file system handling + keepalive cosequences REMOVED (itma) + progress stub: 0xCF - init flash; 0xDF - power off sequence; 0xDE - read dispenser info; 0xC - gas sensor; Procedures: - Initializing - Dispensers Pressure buildup removed + Initializing - Dispensers Pressure buildup removed. AUTOMATIC HEATING ENABLED; Power down waits up to 1 hour (instead of 30 minutes) for cooling down Embedded SW Release note - Version 1.3.9.5 - Itma Candidate 2 diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 05606faff..8ee3c8181 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -187,8 +187,10 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) HWControlId = 0xFF; else Report("Remove control callback failed",__FILE__,__LINE__,(int)HWControlId,RpWarning,(int)InitSequenceBlowerCallBackFunction,0); - if (BlowerCfg.voltage) + if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); + else + Control_Voltage_To_Blower(2700); Safety_Init(); InitStages++; //InitSequenceStateMachine(InitStages); @@ -197,13 +199,12 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) uint32_t InitSequenceInitialBlowerActivation(void) { MachineState = MACHINE_STATE_INITIAL_BLOWER_ACTIVATION; - if (BlowerCfg.enabled == true) - { - Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.voltage) - Control_Voltage_To_Blower(BlowerCfg.voltage); - HWControlId = AddControlCallback( InitSequenceBlowerCallBackFunction, 10* eOneSecond/*eHundredMillisecond*/, TemplateDataReadCBFunction,0,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); + HWControlId = AddControlCallback( InitSequenceBlowerCallBackFunction, 10* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); MidTankControlId = AddControlCallback( InitSequenceMidTankCallBackFunction, 300/*eHundredMillisecond*/, TemplateDataReadCBFunction,0,0, 0 ); return OK; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 416be7edc..6d60ce05c 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -583,7 +583,6 @@ void Stub_AbortJobRequest(MessageContainer* requestContainer) return ; } -int jobCatch = 0; //******************************************************************************************************************** void JobRequestFunc(MessageContainer* requestContainer) @@ -619,7 +618,6 @@ void JobRequestFunc(MessageContainer* requestContainer) // if (CurrentRequest!= NULL) // job_request__free_unpacked(CurrentRequest,NULL); CurrentRequest = request; - jobCatch = 0; n_segments = 0; if (CurrentJob->uploadstrategy == JOB_UPLOAD_STRATEGY__JobDescriptionFile) { @@ -722,6 +720,7 @@ uint8_t JobStatusBuffer[400]; ResumeCurrentJobResponse resumeresponse = RESUME_CURRENT_JOB_RESPONSE__INIT; JobResponse JobResponseMsg = JOB_RESPONSE__INIT; JobStatus jobStatus = JOB_STATUS__INIT; + void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Message) { MessageContainer responseContainer; @@ -813,14 +812,10 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes if (done == true) { - jobCatch++; if (CurrentRequest!= NULL) { - jobCatch++; - // ROM_IntMasterDisable(); // job_request__free_unpacked(CurrentRequest,NULL); CurrentRequest = NULL; - // ROM_IntMasterEnable(); } JobStopReporting(); JobMessageStruc JobMessage; -- cgit v1.3.1 From 20fc9c6e153e409ddb92be2bdd1e49dd2b40473b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 15 May 2019 16:19:42 +0300 Subject: heater trace --- .../Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index db23ab588..b401af289 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -353,6 +353,7 @@ int GetFilteredHeaterRead(int HeaterId) * called by: Communication from host * initialized all global data *************************************************************************************/ +bool HeaterRestarted[MAX_HEATERS_NUM] = {false,false,false,false,false,false,false,false,false,false}; uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature) { //uint32_t status = NOT_SUPPORTED; @@ -414,7 +415,8 @@ uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature) else { //HeaterPreviousRead[HeaterId] = MillisecGetTemperatures(HeaterId);// - LOG_ERROR(HeaterId,"Restarting same temperature Heater Temp"); + Report("Restarting same temperature Heater Temp",__FILE__,HeaterId,ControlIdtoHeaterId [HeaterId],RpWarning,HeaterPreviousRead[HeaterId], 0); + HeaterRestarted[HeaterId] = true; } //PrepareHeater(HeaterId,Temperature); //prepare the heaters control info // if the heater is not on return (?). @@ -958,6 +960,11 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) // #warning PID is now only proportional (above) // Report(ACheatstr,__FILE__,__LINE__,index,RpWarning,readValue, HeaterPIDConfig[index].m_calculatedError); //Report("AC PID",__FILE__,__LINE__,HeaterPIDConfig[index].m_calculatedError/100,RpWarning,readValue, index); + if (HeaterRestarted[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain] == true) + { + Report("Restarting same temperature Heater Temp",__FILE__,HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain,HeaterPIDConfig[index].m_calculatedError,RpWarning,readValue, 0); + HeaterRestarted[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain] = false; + } HeaterRecalculateSharedHeatersParams(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } } @@ -1104,6 +1111,11 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) // Counter[index] = 0; // Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]); // #warning PID is now only proportional (above) + if (HeaterRestarted[index] == true) + { + Report("Restarting same temperature Heater Temp",__FILE__,index,HeaterPIDConfig[index].m_calculatedError,RpWarning,readValue, 0); + HeaterRestarted[index] = false; + } HeaterRecalculateHeaterParams(index, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } -- cgit v1.3.1