aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-09-26 12:35:08 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-09-26 12:35:08 +0300
commitabb10d023660d96414c614a77b5e687ca1aed4b2 (patch)
tree4f5eac37e9b88a0083fe2a1b5ba88a6f2c76c9a4 /Software/Embedded_SW/Embedded/Modules/Thread
parentd30fc59275a2d1a8091c2a4c02111275f2a19c3c (diff)
parent189f45f48fbf1181cc9af20c93901fa9cedb9fb1 (diff)
downloadTango-abb10d023660d96414c614a77b5e687ca1aed4b2.tar.gz
Tango-abb10d023660d96414c614a77b5e687ca1aed4b2.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c17
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c5
3 files changed, 17 insertions, 9 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 9ad42d739..c68156e68 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -567,13 +567,13 @@
{
REPORT_MSG(LoadStages, "Thread UnLoad State Machine step");
LoadArmInfo.LoadArmRounds = 0;
- uint32_t numberOfSteps = 0;
+ //uint32_t numberOfSteps = 0;
//Start Feeder Pid, Rotate Loading Arm Counter Thread Direction X Circles According To Rml. Feeder Speed Is 40
SetOriginMotorSpeed(19);
// OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000;
// CurrentControlledSpeed[FEEDER_MOTOR] = 1000;
- numberOfSteps = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround*LoadArmInfo.LoadArmRounds*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].microstep*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius;
+ //numberOfSteps = MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround*LoadArmInfo.LoadArmRounds*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].microstep*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulleyradius;
MotorControlConfig[POOLER_MOTOR].m_params.MAX = 1;
MotorControlConfig[POOLER_MOTOR].m_params.MIN = MotorsControl[POOLER_MOTOR].outputproportionalpowerlimit*-1;
MotorControlConfig[POOLER_MOTOR].m_params.Kd = MotorsControl[POOLER_MOTOR].derivativetime;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 4cbe1f70f..60bf8123f 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -322,16 +322,19 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
#ifdef READ_SCREW_ENCODER
int WinderRun;
WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]);
- if ((WinderRun < 50000)&&(Add100 == false))
+ if ((WinderRun < 20000)&&(Add100 == false))
{
- WinderRunSum+=WinderRun;
WinderRunSamples++;
- WinderRunAverage = WinderRunSum/WinderRunSamples;
- if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0))
+ if (WinderRunSamples>10)
{
- usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples,
- (int)(100*WinderRun/ScrewNumberOfSteps));
- Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
+ WinderRunSum+=WinderRun;
+ WinderRunAverage = WinderRunSum/(WinderRunSamples-10);
+ if ((fabs(WinderRun-WinderRunAverage)>=30)||(WinderRunSamples%100 == 0))
+ {
+ usnprintf(ScrewStr, 150, "curr,sum,avg,samples {Winder Encoder:, %d, %d, %d, %d, %d}",WinderRun,(int)WinderRunSum,(int)WinderRunAverage,(int)WinderRunSamples,
+ (int)(100*WinderRun/ScrewNumberOfSteps));
+ Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
+ }
}
}
else
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index 5d84bb5d0..88d62a495 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -11,6 +11,9 @@
#include "PMR/Hardware/HardwareDancer.pb-c.h"
#include "PMR/Hardware/HardwareWinder.pb-c.h"
#include "PMR/Hardware/HardwareBreakSensor.pb-c.h"
+#include <PMR/Diagnostics/EventType.pb-c.h>
+
+#include "Modules/AlarmHandling/AlarmHandling.h"
#include "PMR/Printing/JobSpool.pb-c.h"
#include "PMR/common/MessageContainer.pb-c.h"
@@ -49,6 +52,8 @@ uint32_t MotorsConfigMessage(HardwareConfiguration * HWrequest)
HardwareMotor *request;
if (HWrequest == NULL)
return ERROR;
+ AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_HW_CONFIG_FAILED,OFF);
+
for (MotorId = 0; MotorId < HWrequest->n_motors ; MotorId++)
{
request = HWrequest->motors[MotorId];