diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-20 15:07:17 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-20 15:07:17 +0200 |
| commit | 4554080793bd46fcb8f55578d2f67917584dc332 (patch) | |
| tree | 080d2f35589a41703dbc79518568b5aaa7a500fd /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | |
| parent | 0b638c292d3d8e95fdad56eed1b5b38523c6dc33 (diff) | |
| download | Tango-4554080793bd46fcb8f55578d2f67917584dc332.tar.gz Tango-4554080793bd46fcb8f55578d2f67917584dc332.zip | |
Version 1.3.0.5: break sensor debounce (10 msec default). temperature spikes ignored in heating control. thread winding improved.
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 9 |
1 files changed, 6 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 2b6d3aaea..6915cc657 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -180,7 +180,7 @@ double WinderReferenceSpeed=0; int32_t TotalWinderSpeed=0; uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { - uint32_t Steps,i; + uint32_t Steps; double temp; double screw_horizontal_speed = 0; double RotationsPerSecond; @@ -232,6 +232,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) } screw_horizontal_speed = ScrewNumberOfSteps / InternalWinderCfg.NumberOfRotationPerPassage; RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; + ROM_IntMasterDisable(); ScrewSpeed = screw_horizontal_speed*RotationsPerSecond; CurrentControlledSpeed[SCREW_MOTOR] = ScrewSpeed; temp = SYS_CLK_FREQ; @@ -239,6 +240,8 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) temp /= ScrewSpeed; if (ScrewRunningTime != temp) { + ScrewRunningTime = temp;//(SYS_CLK_FREQ*Steps)/ScrewSpeed; + ROM_IntMasterEnable(); //usnprintf(TempScrewStr, 100, "Winder: Horizon,Rotation, PPR, RPP{ %d, %d ,%d, %d} ",(int)screw_horizontal_speed,(int)RotationsPerSecond,(int)InternalWinderCfg.NumberOfRotationPerPassage,(int)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround); usnprintf(ScrewStr, 100, "Winder: Steps,Speed, Time, WinderSpeed{ %d, %d ,%d, %d} ",(int)ScrewNumberOfSteps,(int)ScrewSpeed,(int)temp,(int)WinderReferenceSpeed); // Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]); @@ -248,9 +251,9 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) //REPORT_MSG(temp , "new winder speed"); //Report("new winder speed",__FILE__,__LINE__,temp,RpWarning,ScrewSpeed,0); } - ScrewRunningTime = temp;//(SYS_CLK_FREQ*Steps)/ScrewSpeed; /********************************************************************************/ + ROM_IntMasterEnable(); return OK; } @@ -409,7 +412,7 @@ void ScrewTimerInterrupt(int ARG0) { TimerDisable(Screw_timerBase, TIMER_A); } - //Report("ScrewTimerInterrupt dir, duration, speed", __FILE__,ScrewCurrentDirection,ScrewRunningTime, RpMessage, ScrewSpeed, 0); + Report("ScrewTimerInterrupt dir, duration, speed", __FILE__,ScrewCurrentDirection,ScrewRunningTime, RpMessage, ScrewSpeed, 0); // // Enable all interrupts. // |
