diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-15 17:30:18 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-15 17:30:18 +0300 |
| commit | beca75b89f9c227ce987abdd01e01fa911dfa91d (patch) | |
| tree | 1d9b894df0299c004b608daee34cbd5c5a854668 /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | ca9a080e283819b40c424d17332a18423ff6dcb1 (diff) | |
| parent | f22625f8edf038ffa01d561969dc14b849b6a866 (diff) | |
| download | Tango-beca75b89f9c227ce987abdd01e01fa911dfa91d.tar.gz Tango-beca75b89f9c227ce987abdd01e01fa911dfa91d.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 19 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 1 |
2 files changed, 15 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 0ac23baf5..c5e124ad3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -90,6 +90,8 @@ uint32_t InternalWinderConfigMessage(HardwareWinder* request) return status; } +char ScrewStr[150]; + uint32_t InternalWindingConfigMessage(JobSpool* request) { uint32_t status = PASSED; @@ -100,6 +102,9 @@ uint32_t InternalWindingConfigMessage(JobSpool* request) InternalWinderCfg.SpoolBottomBackingRate = request->bottombackingrate; InternalWinderCfg.NumberOfRotationPerPassage = 3.1415926*2;//request->rotationsperpassage; InternalWinderCfg.diameter = request->diameter; + usnprintf(ScrewStr, 150, "WindingConfig start,offset,head,tail {, %d, %d, %d, %d, %d}",InternalWinderCfg.startoffsetpulses,(int)InternalWinderCfg.segmentoffsetpulses, + (int)InternalWinderCfg.spoolbackingrate,(int)InternalWinderCfg.SpoolBottomBackingRate); + Report(ScrewStr,__FILE__,__LINE__,(int)InternalWinderCfg.diameter,RpWarning,(int)(InternalWinderCfg.NumberOfRotationPerPassage*1000), 0); return status; } @@ -257,7 +262,7 @@ InternalWinderCfg.segmentoffsetpulses numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; */ -char ScrewStr[150]; + //char TempScrewStr[100]; double WinderReferenceSpeed=0; double TotalWinderSpeed=0; @@ -267,6 +272,10 @@ int flipflop = 0; uint32_t motspeed; float speedf; int WinderCalculation = 0; +#ifdef READ_SCREW_ENCODER +float WinderRunAverage = 0.0,WinderRunSum = 0.0; +int WinderRunSamples = 0; +#endif uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { //uint32_t Steps; @@ -311,15 +320,17 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) return OK; //double calcsteps = (ScrewRunningTime/SYS_CLK_FREQ)*ScrewSpeed; #ifdef READ_SCREW_ENCODER + int WinderRun; WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]); - if (WinderRun < 50000) + if ((WinderRun < 50000)&&(Add100 == false)) { WinderRunSum+=WinderRun; WinderRunSamples++; WinderRunAverage = WinderRunSum/WinderRunSamples; - if ((fabs(WinderRun-WinderRunAverage)>=50)||(WinderRunSamples%50 == 0)) + if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0)) { - usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d }",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples); + usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples, + (int)(100*WinderRun/ScrewNumberOfSteps)); Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); } } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index a88ce61a5..9e77f2de8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -288,7 +288,6 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) //} - length = (double)(positionDiff)*PoolerLengthCalculationMultiplier; PoolerTotalProcessedLength+= (length/100); TempPoolerTotalProcessedLength = PoolerTotalProcessedLength; #ifndef FEEDER_LENGTH_CALCULATION |
