From e9665e376174a23c361cebb57fa94da67c4e9ec0 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 11 Jul 2018 18:31:23 +0000 Subject: Updated Thread_Winder.c - preparation for cone --- .../Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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 } -- cgit v1.3.1