aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-02 10:24:54 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-02 10:24:54 +0300
commit66aa9beeec79e5f828fc13ce7a5e41c15227ec9a (patch)
treea74f7e1b4da57063046177139a5e2db188b13f48 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
parentad93ce8b0f13540aafe55bc3ba9d7d72aa1fc7e2 (diff)
parent9e979a9b18727fdc9f128da5a7d2347dff2d0705 (diff)
downloadTango-66aa9beeec79e5f828fc13ce7a5e41c15227ec9a.tar.gz
Tango-66aa9beeec79e5f828fc13ce7a5e41c15227ec9a.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index b6c1fea57..8d1ea20fa 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -127,8 +127,8 @@ void ThreadUpdateProcessLength (double length, void *Funcptr)
ProcessedLengthFuncPtr = (ProcessedLengthFunc)Funcptr;
initialpos = 0xFFFF;
}
-double MotorSentData[100] = {0};
-uint32_t PosDif[100] = {0};
+double MotorSentData[102] = {0};
+uint32_t PosDif[102] = {0};
int MotorDataIndex = 0;
@@ -181,7 +181,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
//PosDif[MotorDataIndex] = positionDiff;
MotorSentData[MotorDataIndex] = length;
MotorDataIndex+=1;
- if (MotorDataIndex == 99) MotorDataIndex = 0;
+ if (MotorDataIndex >= 97) MotorDataIndex = 0;
static int pooler_counter = 0;
pooler_counter++;
TotalProcessedLength+= (length/100);
@@ -360,7 +360,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
if (ReadBreakSensor()==ERROR)
{
//LOG_ERROR(index, "ReadBreakSensor Error");
- JobEndReason = JOB_DANCER_FAIL;
+ JobEndReason = JOB_THREAD_BREAK;
//SendJobProgress(0.0,0,false, "ReadBreakSensor Error");
EndState(CurrentJob,"ReadBreakSensor Error" );
}
@@ -372,7 +372,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
{
usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint);
JobAbortedByUser = true;
- JobEndReason = JOB_THREAD_BREAK;
+ JobEndReason = JOB_DANCER_FAIL;
EndState(CurrentJob,Message );
}
NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index];
@@ -404,7 +404,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
KeepReadValue = TranslatedReadValue;
}
}*/
- if (abs(calculated_speed-CurrentControlledSpeed[index])>5)
+ if (abs(calculated_speed-CurrentControlledSpeed[index])>2)
{
CurrentControlledSpeed[index] = calculated_speed;
MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed);
@@ -533,6 +533,7 @@ void SetOriginMotorSpeed(float process_speed)
/ (2 * PI * MotorsCfg[HW_Motor_Id].pulleyradius);
//MotorControlConfig[Motor_i].m_SetParam = motor_speed;
OriginalMotorSpd_2PPS[Motor_i] = (int) motor_speed;
+ CurrentControlledSpeed[Motor_i] = (int) motor_speed;
}
}