diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-07 10:06:44 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-07 10:06:44 +0200 |
| commit | 804c34c8a18f4804f71ab7bda134a8efe854ad90 (patch) | |
| tree | b7911c18183d5ba11c06cb477ffe48a892c8d74b /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | |
| parent | f4aca2933f8ddced04a53367cf2aed3af61a311b (diff) | |
| download | Tango-804c34c8a18f4804f71ab7bda134a8efe854ad90.tar.gz Tango-804c34c8a18f4804f71ab7bda134a8efe854ad90.zip | |
Version 1.2.0.1 improve winder algo, trace job end traffic.
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index c7d303f9a..eafe9e5a0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -28,16 +28,16 @@ bool Winder_ScrewHoming = false; -#define MAX_WINDER_SPEED_CALCULATION 100 +#define MAX_WINDER_SPEED_CALCULATION 200 uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag); uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue); bool ScrewCurrentDirection = false; //holds current screw direction uint32_t ScrewDirectionChangeCounter = 1; //holds the current number of runs of the screw - will be used to build the cone uint32_t CalculationDirectionChangeCounter = 1; //holds the current number of runs of the screw - will be used to build the cone -uint32_t WinderMotorSpeed[MAX_WINDER_SPEED_CALCULATION]; -uint8_t WinderMotorSpeedCounter=0; -uint32_t WinderMotorSpeedRollOver=0; +uint16_t WinderMotorSpeed[MAX_WINDER_SPEED_CALCULATION]; +uint16_t WinderMotorSpeedCounter = 0; +bool WinderMotorSpeedRollOver = false; double ScrewSpeed = 0; double ScrewRunningTime = 0; uint32_t ScrewNumberOfSteps = 0; //holds the current number of steps for the next screw run - will be used to build the cone @@ -186,7 +186,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) if (WinderMotorSpeedCounter++>=MAX_WINDER_SPEED_CALCULATION) { WinderMotorSpeedCounter=0; - WinderMotorSpeedRollOver++; + WinderMotorSpeedRollOver=true; } if (ScrewDirectionChangeCounter == CalculationDirectionChangeCounter) @@ -305,7 +305,8 @@ uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId) ScrewDirectionChangeCounter = 1; CalculationDirectionChangeCounter = 1; memset (WinderMotorSpeed,0,sizeof(uint32_t) *MAX_WINDER_SPEED_CALCULATION); - WinderMotorSpeedCounter=0,WinderMotorSpeedRollOver=0; + WinderMotorSpeedCounter=0; + WinderMotorSpeedRollOver=false; } PreSegmentReady(Module_Winder,ModuleDone); |
