aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-11-01 16:16:14 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-11-01 16:16:14 +0200
commit50c04072d0c59b8903136f7dd6599a9e0025a866 (patch)
treef832cdfedc8959eabb5cc27087ae8cd84297d99b /Software/Embedded_SW/Embedded/Modules/Thread
parent02f812394d5d4e614b6e93a22bd09a5e932db66a (diff)
parent8a28295329b996314caf21b8250bf3a14f375d8a (diff)
downloadTango-50c04072d0c59b8903136f7dd6599a9e0025a866.tar.gz
Tango-50c04072d0c59b8903136f7dd6599a9e0025a866.zip
MERGE!
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c3
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c27
2 files changed, 16 insertions, 14 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index eb04cadaf..fc87201c8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -182,6 +182,7 @@ uint32_t CalculateNumberOfSteps (uint32_t Counter, bool direction)
NumberOfSteps -= (Counter/InternalWinderCfg.spoolbackingrate);
REPORT_MSG(ScrewNumberOfSteps, "Head Backing");
ScrewNumberOfSteps--;
+ /*
screw_horizontal_speed = InternalWinderCfg.segmentoffsetpulses / InternalWinderCfg.NumberOfRotationPerPassage;
// calculation input#2: number of rotations per second - (basically: speed/winder perimeter. later - according to winder actual speed - calculate according to winder position accumulation in the last second.
RotationsPerSecond = dyeingspeed / (InternalWinderCfg.diameter * PI);
@@ -192,7 +193,7 @@ uint32_t CalculateNumberOfSteps (uint32_t Counter, bool direction)
MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
REPORT_MSG(ScrewSpeed, "CalculateNumberOfSteps");
CurrentControlledSpeed[SCREW_MOTOR] = ScrewSpeed;
-
+ */
}
if ((Counter%InternalWinderCfg.SpoolBottomBackingRate == 0)||(Counter%InternalWinderCfg.SpoolBottomBackingRate == 1))
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 6c58e1645..175cfcc7d 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -315,12 +315,13 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue)
}
//double eNormalizedError[100];
//int TranslatedreadValue[100];
-/*double calculatedError[1000];
-int MotorId[1000];
-int readValue[1000];
-int AveragereadValue[1000];
-int calculatedspeed[1000];
-int timestamp[1000];*/
+#define MAX_THREAD_CONTROL_LOG 500
+double calculatedError[MAX_THREAD_CONTROL_LOG];
+int MotorId[MAX_THREAD_CONTROL_LOG];
+int readValue[MAX_THREAD_CONTROL_LOG];
+int AveragereadValue[MAX_THREAD_CONTROL_LOG];
+int calculatedspeed[MAX_THREAD_CONTROL_LOG];
+int timestamp[MAX_THREAD_CONTROL_LOG];
int controlIndex = 0;
bool keepdata = true;
/*int32_t KeepReadValue = 0;
@@ -469,14 +470,14 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
{
if (keepdata == true)
{
- /* calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError;
+ calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError;
MotorId[controlIndex] = index;
readValue[controlIndex] = ReadValue;
AveragereadValue[controlIndex] = avreageSampleValue;
calculatedspeed[controlIndex] = calculated_speed;
timestamp[controlIndex] = HibernateRTCSSGet();
- if (controlIndex++>=999)
- controlIndex = 0;*/
+ if (controlIndex++>=MAX_THREAD_CONTROL_LOG)
+ controlIndex = 0;
}
CurrentControlledSpeed[index] = calculated_speed;
MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed);
@@ -667,8 +668,8 @@ uint32_t ThreadPreSegmentState(void *JobDetails)
//only for testing - when control works, these motors will take their speed from the dryer
//MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RDRIVING, OriginalMotorSpd_2PPS[FEEDER_MOTOR]);
-#warning rocker disabled
-/* if (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].maxfrequency > 0)
+//#warning rocker disabled
+ if (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].maxfrequency > 0)
{
MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_RLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].directionthreadwize);
MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 2);
@@ -677,8 +678,8 @@ uint32_t ThreadPreSegmentState(void *JobDetails)
{
MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_LLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].directionthreadwize);
MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 2);
- }*/
- #warning rocker disabled
+ }
+// #warning rocker disabled
// MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize, 0, GPI_LS_RLOADMOTOR_UP, EndState); //TODO