aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-05-10 13:57:03 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-05-10 13:57:03 +0300
commitd60f78be71fd705cb6bbea8ecb5b5c49858c973e (patch)
tree2a9f89698e8247efc097dc0e5c344eda18af0d4c /Software/Embedded_SW/Embedded/Modules/Thread
parenta19812920469fdcf6305e22b1a435c7a3895fa17 (diff)
downloadTango-d60f78be71fd705cb6bbea8ecb5b5c49858c973e.tar.gz
Tango-d60f78be71fd705cb6bbea8ecb5b5c49858c973e.zip
change motors config, improve initialization and control, first control run
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h9
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c10
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c1
4 files changed, 12 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
index 7690b131f..0bda4964b 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
@@ -15,6 +15,7 @@
#include "drivers/Motors/Motor.h"
#include "drivers/Danser_SSI/ssi_comm.h"
+#include "thread_ex.h"
typedef struct
{
@@ -37,6 +38,7 @@ typedef enum threadMotorsEnum
SCREW_MOTOR,
MAX_THREAD_MOTORS_NUM
}threadMotorsEnum;
+
#define MAX_THREAD_FEED_MOTORS WINDER_MOTOR+1
#define MAX_SYSTEM_DANCERS HARDWARE_DANCER_TYPE__RightDancer+1
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
index 5f49c7d10..3fb78d2f0 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
@@ -1,6 +1,15 @@
#ifndef MODULES_THREAD_THREAD_EX_H_
#define MODULES_THREAD_THREAD_EX_H_
+
+typedef enum
+{
+ WINDER_DANCER,
+ POOLER_DANCER,
+ FEEDER_DANCER,
+ NUM_OF_DANCERS
+} DANCER_ENUM;
+
uint32_t ThreadPrepareState(void *JobDetails);
uint32_t ThreadPreSegmentState(void *JobDetails);
uint32_t ThreadSegmentState(void *JobDetails, int SegmentId);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index 5a8c3df76..0e276fe92 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -51,7 +51,6 @@ uint32_t MotorsConfigMessage(HardwareMotor * request)
{
uint32_t status = PASSED;
TimerMotors_t Motor_i;
- MotorDriverConfigStruc MotorDriverConfig;
Motor_i = request->hardwaremotortype;
/*for (i=0;i<MAX_THREAD_MOTORS_NUM;i++)
{
@@ -69,15 +68,8 @@ uint32_t MotorsConfigMessage(HardwareMotor * request)
//if (Motor_i< MAX_THREAD_MOTORS_NUM)
//{
memcpy (&MotorsCfg[Motor_i],request,sizeof(HardwareMotor));
- MotorDriverConfig.ACC = MotorsCfg[Motor_i].maxchangeslope;
- MotorDriverConfig.DEC = MotorsCfg[Motor_i].maxchangeslope;
- MotorDriverConfig.MaxSpeed = MotorsCfg[Motor_i].maxfrequency;
- MotorDriverConfig.HasMicroStep = MotorsCfg[Motor_i].has_microstep;
- MotorDriverConfig.Microstep = MotorsCfg[Motor_i].microstep;
- MotorDriverConfig.HasConfigWord = MotorsCfg[Motor_i].has_configword;
- MotorDriverConfig.ConfigWord = MotorsCfg[Motor_i].configword;
- status = MotorConfig( Motor_i, &MotorDriverConfig);
+ status = MotorConfig( Motor_i, &MotorsCfg[Motor_i]);
// if (Motor_i == MOTOR_RDRIVING)
// ThreadInitialTestStub(request);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 0e68a6406..434ac0f21 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -216,7 +216,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
avreageSampleValue += MotorSamples[index][i];
avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode;
NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index];
-if (index != 0) return OK;
MotorControlConfig[index].m_mesuredParam = NormalizedError;
MotorControlConfig[index].m_calculatedError = PIDAlgorithmCalculation((float)MotorControlConfig[index].m_SetParam , (float)MotorControlConfig[index].m_mesuredParam,
&MotorControlConfig[index].m_params, &MotorControlConfig[index].m_preError, &MotorControlConfig[index].m_integral);