diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-14 15:57:56 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-14 15:57:56 +0300 |
| commit | c71bc6862bd3d3bcf8b10fd43cfe8bf52ee018c4 (patch) | |
| tree | 20b92806c4c7761aab738b85d7addf7bd13f00df /Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c | |
| parent | a775178c063082eb6a401b4254a046133840af03 (diff) | |
| parent | 9d4d0c084e084273ae62fd09863142aa2f6ef53d (diff) | |
| download | Tango-c71bc6862bd3d3bcf8b10fd43cfe8bf52ee018c4.tar.gz Tango-c71bc6862bd3d3bcf8b10fd43cfe8bf52ee018c4.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c | 7 |
1 files changed, 4 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 e2d492b47..3c9adbc31 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -17,7 +17,7 @@ HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM] = {0}; int32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES] = {0}; int MotorSamplePointer[MAX_THREAD_MOTORS_NUM] = {0}; double NormalizedErrorCoEfficient[MAX_THREAD_MOTORS_NUM] = {0}; -double DancerStopActivityLimit[MAX_THREAD_MOTORS_NUM] = {0}; +int DancerStopActivityLimit[MAX_THREAD_MOTORS_NUM] = {0}; InternalWinderConfigStruc InternalWinderCfg = {0}; HardwareDancer DancersCfg[MAX_SYSTEM_DANCERS] = {0}; @@ -101,8 +101,9 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request) temp=(10*(temp-1)*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm); NormalizedErrorCoEfficient[Motor_i] = NormalizedErrorCoEfficient[Motor_i] / temp; // uint32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES]; - DancerStopActivityLimit[Motor_i] = ((1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits)*(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm)*2)); - DancerStopActivityLimit[Motor_i] = DancerStopActivityLimit[Motor_i]/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); + temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits); + temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm*2); + DancerStopActivityLimit[Motor_i] = temp/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); return OK; } uint32_t DancerConfigMessage(HardwareDancer * request) |
