aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-12-05 10:27:18 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-12-05 10:27:18 +0200
commit82cf73a08ed9d590136746dc201c0226e41a49f3 (patch)
treedde0a5af480bbef281af1deb74b7222308c57dab /Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
parentad0b15583a2e7cf939c27cf1641c5de0ebefa3c2 (diff)
parent49abc5415f38bfd61a38d51b74a1594847bb49e7 (diff)
downloadTango-82cf73a08ed9d590136746dc201c0226e41a49f3.tar.gz
Tango-82cf73a08ed9d590136746dc201c0226e41a49f3.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index f66b1d9a4..dc9cfcd6d 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -58,6 +58,7 @@ typedef struct
float m_integral;
float m_calculatedError;
bool m_isReady;
+ uint32_t m_ingnoreValue;
PID_Config_Params m_params;
}MotorControlConfig_t;
@@ -387,7 +388,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
if (ReadValue < 10)
{
MotorFailedSample[index]++;
- REPORT_MSG(ReadValue, "Dancer value read too small.");
+ Report("Dancer value read too small.",__FILE__,__LINE__,DancerId,RpError,ReadValue,0);
return OK;
}
if (ReadValue == 0x3FFF)
@@ -469,7 +470,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
//KeepNormalizedError = NormalizedError;
}
calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index];
- if (abs(calculated_speed-CurrentControlledSpeed[index])>2)
+ if (abs(calculated_speed-CurrentControlledSpeed[index])> MotorControlConfig[index].m_ingnoreValue)
{
if (keepdata == true)
{
@@ -560,6 +561,7 @@ uint32_t ThreadEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue)
MotorControlConfig[Motor_i].m_params.ProportionalErrorMultiplier = MotorsControl[Pid_Id].outputonoffhysteresisvalue;
MotorControlConfig[Motor_i].m_params.epsilon = MotorsControl[Pid_Id].epsilon;
MotorControlConfig[Motor_i].m_params.dt = MotorsControl[Pid_Id].controloutputtype;
+ MotorControlConfig[Motor_i].m_ingnoreValue = MotorsControl[Pid_Id].sensorcorrectionadjustment; // the minimal change required to change the motor speed in pulses
MotorControlConfig[Motor_i].m_calculatedError = 0;
MotorControlConfig[Motor_i].m_integral = 0;
MotorControlConfig[Motor_i].m_isEnabled = true;
@@ -783,7 +785,7 @@ char Endstr[150];
if (ControlIdtoMotorId[Motor_i] != 0xFF)
{
if(RemoveControlCallback(ControlIdtoMotorId[Motor_i],ThreadControlCBFunction) == OK)
- ControlIdtoMotorId[Motor_i] == 0xFF;
+ ControlIdtoMotorId[Motor_i] = 0xFF;
else
LOG_ERROR (ControlIdtoMotorId[Motor_i],"Remove Control failed");
}