diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-10-16 16:52:25 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-10-16 16:52:25 +0300 |
| commit | 657bfe0fa9204f593ffe7c0c37f4027a6b7c1af5 (patch) | |
| tree | 3a1b7c8654a7862648db31288795fdc562f0cdb4 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | |
| parent | d27432fbfa2707bbe77704ad8eab80ccb68673d5 (diff) | |
| download | Tango-657bfe0fa9204f593ffe7c0c37f4027a6b7c1af5.tar.gz Tango-657bfe0fa9204f593ffe7c0c37f4027a6b7c1af5.zip | |
minor fixes
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index ac76e4dd1..3b5d2a3e9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -302,7 +302,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) LOG_ERROR(Add100, "Add100 = true"); } // WinderMotorSpeedCounter=0; - WinderMotorSpeedRollOver=true; } // } if (flipflop == 0) @@ -328,11 +327,11 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) #ifdef READ_SCREW_ENCODER int WinderRun; WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]); - if ((WinderRun < 30000)&&(WinderMotorSpeedRollOver == true)) + if ((WinderRun < 30000)&&(ScrewDirectionChangeCounter >= 30)) { WinderRunSamples++; WinderRunSum+=WinderRun; - WinderRunAverage = WinderRunSum/(WinderRunSamples); + WinderRunAverage = WinderRunSum/WinderRunSamples; if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0)) { usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples, @@ -357,6 +356,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { ScrewNumberOfSteps += 100; Add100 = false; + WinderMotorSpeedRollOver=true; } if ((CalculationDirectionChangeCounter/2)%InternalWinderCfg.spoolbackingrate == 0) |
