aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-03-28 10:55:56 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-03-28 10:55:56 +0200
commit36f19301ac0cc27d74b73eb4b31fdecfd86f5060 (patch)
treee4f4a636f4a2dc03376e6eff2077ced4079429ed /Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
parent1ea2a13900697e203658ff8c9489b70866792a49 (diff)
parentb62c4b8b67b3103c691564df80f65423a9c315a0 (diff)
downloadTango-36f19301ac0cc27d74b73eb4b31fdecfd86f5060.tar.gz
Tango-36f19301ac0cc27d74b73eb4b31fdecfd86f5060.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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index a1e91f6fc..4454565c1 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -2,6 +2,7 @@
**************************************************************************************************************************/
#include <DataDef.h>
+#include <Drivers/FPGA/Motors_Driver/PowerSTEP01.h>
#include "include.h"
#include "PMR/Hardware/UploadHardWareConfigurationRequest.pb-c.h"
@@ -17,12 +18,13 @@
#include "drivers/Flash_Memory/fatfs/ff.h"
#include "drivers/SSI_Comm/Dancer/Dancer.h"
-#include "drivers/FPGA/Moters_Driver/PowerSTEP01.h"
-
#include "thread.h"
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};
@@ -105,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);