aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index a119b0b16..c651c57a6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -1,7 +1,7 @@
/*
* Thread_Winder.c
*
- * Created on: 25 áîøõ 2018
+ * Created on: 25 áîøõ 2018
* Author: shlomo
*/
#include"include.h"
@@ -108,6 +108,18 @@ uint32_t ScrewNumberOfSteps = 0;
uint32_t DirectionChangeCounter = 0;
*/
+Calculate the number of steps.
+Initial home position = ...
+Initial out movement = ScrewNumberOfSteps
+if DirectionChangeCounter %= external cone : reduce one from the ScrewNumberOfSteps
+if DirectionChangeCounter %= internal cone && direction was out: ADD one to the ScrewNumberOfSteps, (raise a flag???)
+// WRONG? if the flag is raised - lower it and reduce one from the ScrewNumberOfSteps
+30:100 - 70
+30:99 - 69
+30:98 - 68
+29:98 - 69
+29:97 -68
+*/
uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
{
if (BusyfirstCall)
@@ -197,6 +209,7 @@ uint32_t Winder_End(void)
void Winder_ScrewHomeLimitSwitchInterrupt(void)
{
uint32_t status;
+ //handle glitch - send information to the next time that the motor stops
if (Winder_ScrewHoming)
{
MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); //stop ASAP
@@ -205,6 +218,7 @@ void Winder_ScrewHomeLimitSwitchInterrupt(void)
}
void Winder_ScrewOutLimitSwitchInterrupt(void)
{
+ //handle glitch - send information to the next time that the motor stops
uint32_t status;
status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out
}