aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-28 18:07:39 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-28 18:07:39 +0200
commitf63af5c5755ba9adf91c9612c5629f008da84838 (patch)
tree4196e72e6bc9e4082f2991dd4a1e5562201eb7c0 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
parenta706aefd3dbf0552205dc0c850e2eba06bbf6e34 (diff)
parent652ba187110a48e5a7887ece87d12b04e4eb8105 (diff)
downloadTango-f63af5c5755ba9adf91c9612c5629f008da84838.tar.gz
Tango-f63af5c5755ba9adf91c9612c5629f008da84838.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index c277dd5df..4454565c1 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -22,6 +22,9 @@
MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]={0};
HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM] = {0};
+int32_t MotorSpeedSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES] = {0};
+int MotorSpeedSamplePointer[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};
@@ -104,7 +107,10 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request)
MotorsControl[Motor_i].pvinputfilterfactormode = 10; //test longer control
#endif
for (i = 0;i < 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);