aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-05-19 19:28:56 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-05-19 19:28:56 +0300
commit5f6a459aab9a781dc143d8a6eb214408ead6906d (patch)
tree1f1c53c59790f2f8d5602666e6926f0b500eba63 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
parentd3a01259a456926ec6a0b05ba897c89230149774 (diff)
downloadTango-5f6a459aab9a781dc143d8a6eb214408ead6906d.tar.gz
Tango-5f6a459aab9a781dc143d8a6eb214408ead6906d.zip
PID - fabs() enabled small integral values. empty waste indication.
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index 4454565c1..265c751c6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -106,18 +106,18 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request)
#ifdef TEST_LONGER_PID_THREAD
MotorsControl[Motor_i].pvinputfilterfactormode = 10; //test longer control
#endif
- for (i = 0;i < MotorsControl[Motor_i].pvinputfilterfactormode; i++)
+ for (i = 0;i < (int)MotorsControl[Motor_i].pvinputfilterfactormode; i++)
{
MotorSamples[Motor_i][i] = 0; //reset the samples value for control beginning
MotorSpeedSamples[Motor_i][i] = 0;
}
NormalizedErrorCoEfficient[Motor_i] = (2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength);
temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits);
- temp=(10*(temp-1)*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm);
+ temp=(NORMAL_COEF_DIVIDER*(temp-1)*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm);
NormalizedErrorCoEfficient[Motor_i] = NormalizedErrorCoEfficient[Motor_i] / temp;
// uint32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES];
temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits);
- temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm*2);
+ temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm*3/2);
DancerStopActivityLimit[Motor_i] = temp/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength);
return OK;
}