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 --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') 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 ; -- 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/Thread') 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/Thread') 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