diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-26 14:13:51 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-26 14:13:51 +0300 |
| commit | 3006b6a690a9e07140ea4e3240a52978ebe1e96d (patch) | |
| tree | c1d381ad99c64bfa2779770d10b788ef4ad95d89 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | |
| parent | 189f45f48fbf1181cc9af20c93901fa9cedb9fb1 (diff) | |
| download | Tango-3006b6a690a9e07140ea4e3240a52978ebe1e96d.tar.gz Tango-3006b6a690a9e07140ea4e3240a52978ebe1e96d.zip | |
fix winder prints
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 14 |
1 files changed, 9 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 60bf8123f..4789c7a17 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -54,6 +54,8 @@ uint32_t ScrewNumberOfSteps = 0; //holds the current number of steps for the bool SCREW_TimerActivated = false; uint32_t ScrewControlId = 0xFF; + + static bool KeepWindingCone = false; static uint32_t WindingConeLocation; static uint32_t WinderBackToBaseTime = 800; @@ -63,6 +65,8 @@ InternalWinderConfigStruc InternalWinderCfg = {0}; #ifdef READ_SCREW_ENCODER uint32_t ScrewLocationLimitSwitch = 0,ScrewLocationStart = 0; uint32_t ScrewLocationRun[3]; +float WinderRunAverage = 0.0,WinderRunSum = 0.0; +int WinderRunSamples = 0; #endif bool SampleWinding = false; uint32_t Winder_Init(void) @@ -141,6 +145,10 @@ uint32_t Winder_Prepare(void *JobDetails) #ifdef READ_SCREW_ENCODER ScrewLocationRun[0] = 0; ScrewLocationRun[1] = 0; + WinderRunAverage = 0.0; + WinderRunSum = 0.0; + WinderRunSamples = 0; + #endif if (( KeepWindingCone == false)||(WindingConeLocation == 0)) { @@ -272,10 +280,6 @@ 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; @@ -322,7 +326,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) #ifdef READ_SCREW_ENCODER int WinderRun; WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]); - if ((WinderRun < 20000)&&(Add100 == false)) + if ((WinderRun < 30000)&&(WinderMotorSpeedRollOver == true)) { WinderRunSamples++; if (WinderRunSamples>10) |
