diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-10-16 10:19:53 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-10-16 10:19:53 +0300 |
| commit | 8e9c53625339326ef5477c4a9222ffbbf01b5d50 (patch) | |
| tree | 6804cec142e5ccff7b326d8b6a5a1de5abd1ae4b /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | e2bbf9ddb31303fab08ca10bd37cb7f469534b14 (diff) | |
| parent | 3ded2e3910c6829c51a87711d7d82a1993596944 (diff) | |
| download | Tango-8e9c53625339326ef5477c4a9222ffbbf01b5d50.tar.gz Tango-8e9c53625339326ef5477c4a9222ffbbf01b5d50.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 2 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 28 |
2 files changed, 6 insertions, 24 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index ccc9623a3..c7dd4f7ae 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -107,7 +107,7 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue) uint32_t status=OK; uint32_t numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; - MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].maxfrequency); + MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses); //REPORT_MSG(numOfSteps, "Winder_PrepareStage2"); REPORT_MSG(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].maxfrequency, "Winder_PrepareStage2"); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index b9a1f4e27..bbe537263 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -14,7 +14,6 @@ #include "PMR/Hardware/HardwareDancerType.pb-c.h" #include "PMR/Printing/JobSegment.pb-c.h" #include "PMR/Printing/JobTicket.pb-c.h" -#include "PMR/common/ErrorCode.pb-c.h" #include <PMR/Diagnostics/EventType.pb-c.h> #include <utils/ustdlib.h> @@ -311,14 +310,14 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue) } return OK; } -double calculatedError[1000]; //double eNormalizedError[100]; +//int TranslatedreadValue[100]; +/*double calculatedError[1000]; int MotorId[1000]; int readValue[1000]; -//int TranslatedreadValue[100]; int AveragereadValue[1000]; int calculatedspeed[1000]; -int timestamp[1000]; +int timestamp[1000];*/ int controlIndex = 0; bool keepdata = true; /*int32_t KeepReadValue = 0; @@ -462,36 +461,19 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //KeepNormalizedError = NormalizedError; } calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index]; - /*if (index == FEEDER_MOTOR) - { - if (KeepReadValue != TranslatedReadValue) - { - eNormalizedError[controlIndex] = NormalizedError; - calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; - readValue[controlIndex] = ReadValue; - TranslatedreadValue[controlIndex] = TranslatedReadValue; - AveragereadValue[controlIndex] = avreageSampleValue; - calculatedspeed[controlIndex] = calculated_speed; - controlIndex++; - if (controlIndex >= 99) controlIndex = 0; - KeepReadValue = TranslatedReadValue; - } - }*/ if (abs(calculated_speed-CurrentControlledSpeed[index])>2) { - if (keepdata == true) + /*if (keepdata == true) { calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; - //double eNormalizedError[100]; MotorId[controlIndex] = index; readValue[controlIndex] = ReadValue; - //int TranslatedreadValue[100]; AveragereadValue[controlIndex] = avreageSampleValue; calculatedspeed[controlIndex] = calculated_speed; timestamp[controlIndex] = HibernateRTCSSGet(); if (controlIndex++>=999) controlIndex = 0; - } + }*/ CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); } |
