From e96d9f083aa58b24d2e64cbbec47e638d0ce84a0 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 18 Jul 2018 08:01:12 +0300 Subject: global progress counter, some minor corrections --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 12 ++++++------ Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h | 1 + 2 files changed, 7 insertions(+), 6 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 a8ca46574..0ec10a072 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -183,7 +183,7 @@ uint32_t CalculateNumberOfSteps (uint32_t Counter, bool direction) } } - return CalculateNumberOfSteps; + return NumberOfSteps; } uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag) @@ -225,7 +225,7 @@ uint32_t WinderPresegmentReady(uint32_t deviceID, uint32_t ReadValue) uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId) { - JobTicket* JobTicket = JobDetails; + //JobTicket* JobTicket = JobDetails; float screw_speed = 0; float RotationsPerSecond; @@ -280,18 +280,18 @@ uint32_t Winder_End(void) } void Winder_ScrewHomeLimitSwitchInterrupt(void) { - uint32_t status; + //uint32_t status; //handle glitch - send information to the next time that the motor stops if (Winder_ScrewHoming) { MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); //stop ASAP } - status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out + MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out } void Winder_ScrewOutLimitSwitchInterrupt(void) { //handle glitch - send information to the next time that the motor stops - uint32_t status; - status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out + //uint32_t status; + MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 56e88204f..df88da8c8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -11,6 +11,7 @@ #define FEEDER_DANCER HARDWARE_DANCER_TYPE__RightDancer #define NUM_OF_DANCERS HARDWARE_DANCER_TYPE__RightDancer+1 //} DANCER_ENUM; +extern double TotalProcessedLength; uint32_t InternalWindingConfigMessage(JobSpool* request); -- cgit v1.3.1 From cb839690af5ae6ea272a3cb303fcf97761f3d84d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 18 Jul 2018 12:11:20 +0300 Subject: IDS Distance to spool - stop dispensers sensor break in comment --- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 2 +- Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h | 1 + .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 39 +++++++++++++++++++++- .../Embedded/Modules/Thread/Thread_print.c | 8 +++-- 4 files changed, 45 insertions(+), 5 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') 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 6046df852..36ad0fe9a 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 @@ -239,7 +239,7 @@ uint32_t ReadBreakSensor() { uint32_t Status = ERROR; - uint32_t BearkSensorsMask = GPI_TFEED_BREAK_1 | GPI_TFEED_BREAK_2; // TODO: to update if only one is connected + uint32_t BearkSensorsMask = GPI_TFEED_BREAK_1 /*| GPI_TFEED_BREAK_2*/; if((F1_GPI_EXTWINDER_D & BearkSensorsMask) == BearkSensorsMask ) // (1 - Runing, 0 - Broken) TODO: Verify the polarity { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h index c96078771..a3134c303 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h @@ -14,6 +14,7 @@ uint32_t IDSPrepareState(void *JobDetails); uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId); uint32_t IDSSegmentState(void *JobDetails, int SegmentId); +uint32_t IDSDistanceToSpoolState(void); uint32_t IDSEndState(void *JobDetails); uint32_t IDS_DispenserPidRequestMessage(HardwarePidControl* request); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index ed9e37fcc..bfdb7b5d7 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -47,6 +47,7 @@ uint32_t ControlIdtoDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xF int OriginalDispenserSpd_2PPS[MAX_SYSTEM_DISPENSERS] = {0,0,0,0,0,0,0,0}; bool DispenserPreSegmentReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; bool DispenserSegmentReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; +bool DispenserDistanceToSpoolReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; int JobBrushStopId = 0; uint32_t IDS_DispenserPidRequestMessage(HardwarePidControl* request) @@ -165,7 +166,8 @@ void DispenserPrepareReady(void) PreSegmentReady(Module_IDS,ModuleDone); return OK; // all configured heaters are ready } - //******************************************************************************************************************** + +//******************************************************************************************************************** uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) { //set the speed only before the first segment, speed is constant accros job @@ -279,6 +281,41 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) return OK; } + //******************************************************************************************************************** + uint32_t IDS_Valve_DistanceToSpoolReady(uint32_t deviceID, uint32_t ReadValue) + { + int i; + DispenserDistanceToSpoolReady[deviceID] = true; + for (i=0;i eOneSecond) @@ -365,10 +365,12 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) } } } + */ + //Stop Execution if the dancer moves too much if ((abs(avreageSampleValue)> DancerStopActivityLimit[index])&&(JobCounter > eOneSecond)) { - usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); - + usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); + JobAbortedByUser = true; EndState(CurrentJob,Message ); } NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index]; -- cgit v1.3.1 From 27f843a93af1fdda7e79ad4e1579f7f2de3d2e8d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 18 Jul 2018 12:16:55 +0300 Subject: remove the "Progress" message text --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 2 +- Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 6 ++++-- .../Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 6822493cd..ad3c731cb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -196,7 +196,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) } else { - SendJobProgress(TotalProcessedLength,0,false, "Progress"); + SendJobProgress(TotalProcessedLength,0,false, NULL); } } diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index d33cb0265..aa616fee2 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -410,8 +410,10 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes JobResponse response = JOB_RESPONSE__INIT; JobStatus jobStatus = JOB_STATUS__INIT; - jobStatus.message = Message; - + if (Message) + { + jobStatus.message = Message; + } //previousJobLength = ProcessedLength; jobStatus.has_progress = true; jobStatus.progress = TotalProcessedLength; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index 10e865bdc..a3ffe0c66 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -345,11 +345,11 @@ uint32_t DistanceToSpoolReady(int ModuleId, ModuleStateEnum result) static uint32_t DistanceToSpoolState(void *JobDetails) { SendJobProgress(0.0, 0, false, "DistanceToSpool Start"); - /*if (Configured[Module_IDS]) + if (Configured[Module_IDS]) { - //DistanceToSpoolWaiting[Module_IDS] = ModuleWaiting; - IDSSegmentState(JobDetails,SegmentId); - }*/ + DistanceToSpoolWaiting[Module_IDS] = ModuleWaiting; + IDSDistanceToSpoolState(); + } if (Configured[Module_Thread]) { DistanceToSpoolWaiting[Module_Thread] = ModuleWaiting; -- cgit v1.3.1