diff options
| author | Avi Levkovich <avi@twine-s.com> | 2019-08-15 14:49:01 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2019-08-15 14:49:01 +0300 |
| commit | b1b2f343dc25c1c052a0af360ebd512d575e6de9 (patch) | |
| tree | 613e9b8e68b9d1e3c215f92b43fb0714e23475bd /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | e3d2cb0e82a5a1c75577285077dc7c281f952705 (diff) | |
| parent | 68f0b285920d9c17189522916c6f0e783629bc9a (diff) | |
| download | Tango-b1b2f343dc25c1c052a0af360ebd512d575e6de9.tar.gz Tango-b1b2f343dc25c1c052a0af360ebd512d575e6de9.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 | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 0ed0f5318..0ac23baf5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -90,8 +90,6 @@ uint32_t InternalWinderConfigMessage(HardwareWinder* request) return status; } -char ScrewStr[150]; - uint32_t InternalWindingConfigMessage(JobSpool* request) { uint32_t status = PASSED; @@ -102,9 +100,6 @@ 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; } @@ -262,7 +257,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; @@ -272,8 +267,6 @@ int flipflop = 0; uint32_t motspeed; float speedf; int WinderCalculation = 0; -float WinderRunAverage = 0.0,WinderRunSum = 0.0; -int WinderRunSamples = 0; uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { //uint32_t Steps; @@ -281,8 +274,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) double screw_horizontal_speed = 0; double RotationsPerSecond; double Averagewinderspeed = 0; - int WinderRun; - // { // TotalWinderSpeed-=WinderMotorSpeed[WinderMotorSpeedCounter]; @@ -321,15 +312,14 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) //double calcsteps = (ScrewRunningTime/SYS_CLK_FREQ)*ScrewSpeed; #ifdef READ_SCREW_ENCODER WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]); - if ((WinderRun < 50000)&&(Add100 == false)) + if (WinderRun < 50000) { WinderRunSum+=WinderRun; WinderRunSamples++; WinderRunAverage = WinderRunSum/WinderRunSamples; - if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0)) + if ((fabs(WinderRun-WinderRunAverage)>=50)||(WinderRunSamples%50 == 0)) { - 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)); + usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d }",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples); Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); } } @@ -353,7 +343,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { ScrewNumberOfSteps--; WindingConeLocation--; - ReportWithPackageFilter(ThreadFilter,"Head Backing",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0); + // ReportWithPackageFilter(ThreadFilter,"Head Backing",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0); } } else //next time going back @@ -361,7 +351,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.SpoolBottomBackingRate == 0) { ScrewNumberOfSteps++; - Report("Bottom Backing ",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0); + // Report("Bottom Backing ",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0); } } /* if (WinderMotorSpeedRollOver) |
