aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-04 12:25:18 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-04 12:25:18 +0200
commit6f3b655069d0adb709f4f9cdaf25eadcd353c06b (patch)
tree25beab198b398ce3eba2f6f97cddd1659369b9a2 /Software/Embedded_SW/Embedded/Modules/Thread
parent2e562cd2949b98a130b23772a0d6e8ba938c2cd9 (diff)
parent1d5c93a263a03b7f9af9490c1107a9eef4fe0438 (diff)
downloadTango-6f3b655069d0adb709f4f9cdaf25eadcd353c06b.tar.gz
Tango-6f3b655069d0adb709f4f9cdaf25eadcd353c06b.zip
MREGE
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c19
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c50
2 files changed, 12 insertions, 57 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 856812c12..852c19a1a 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -67,6 +67,7 @@
uint8_t CallbackCounter = 0;
uint8_t TimeoutsCounter = 0;
+ uint32_t UnloadingStart = 0;
uint8_t NumberOfDrierLoaderCycles = 0;
uint32_t status = OK;
uint32_t LoadingControlId = 0xFF,PullerControlId = 0xFF,WinderControlId = 0xFF;
@@ -184,8 +185,6 @@
{
Report("Thread_Load_Set_Load_Arm_To_Start_Position_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
//storeLoadArmParameters();
- MotorMove(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,LoadArmInfo.LoadArmBackLash );
-
SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); //set this point as the spool home
LoadStages++;
ThreadLoadStateMachine(LoadStages);
@@ -215,6 +214,8 @@
//move to exact location?
// Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
CallbackCounter = 0;
+ Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0);
+
Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
NumberOfDrierLoaderCycles=0;
//storeLoadArmParameters();
@@ -614,7 +615,7 @@
LoadArmInfo.LoadArmRounds = 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);
+ SetOriginMotorSpeed(30);
// OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000;
// CurrentControlledSpeed[FEEDER_MOTOR] = 1000;
@@ -670,14 +671,14 @@
CallbackCounter++;
//MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,
// numberOfSteps, Thread_Load_Dryer_Loading_Callback, 100000);
- Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
+ UnloadingStart = msec_millisecondCounter;
+ Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,UnloadingStart,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
LoadArmInfo.LoadArmBackLash = 5;
-
status |= MotorMoveToStopper(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize),
- MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4, Thread_Load_Set_Load_Arm_To_Stopper_Callback,LoadArmInfo.LoadArmBackLash,1000);
+ MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/2, Thread_Load_Set_Load_Arm_To_Stopper_Callback,LoadArmInfo.LoadArmBackLash,1000);
//Keep Notation How Many Rotations In The Dryer
- LoadArmInfo.LoadArmBackLash = 5;
+ //LoadArmInfo.LoadArmBackLash = 0;
LoadArmInfo.LoadArmRounds = (int)dryerbufferlength;
load.color = BLINK;
return OK;
@@ -840,7 +841,7 @@ uint32_t ThreadLoadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
CurrentControlledSpeed[index] = calculated_speed;
MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed);
}
- if (index == POOLER_MOTOR)
+ /* if (index == POOLER_MOTOR)
{
if ((TranslatedReadValue)<(-1200))
{
@@ -868,7 +869,7 @@ uint32_t ThreadLoadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}
- }
+ }*/
/* LoadCounter++;
if ((LoadCounter % 5001) == 0)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 741fed7af..4de702e14 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -107,6 +107,8 @@ uint32_t InternalWindingConfigMessage(JobSpool* request)
InternalWinderCfg.startoffsetpulses = request->startoffsetpulses;
InternalWinderCfg.SpoolBottomBackingRate = request->bottombackingrate;
InternalWinderCfg.NumberOfRotationPerPassage = 3.1415926*2;//request->rotationsperpassage;
+ if (request->rotationsperpassage > 6.1)
+ InternalWinderCfg.NumberOfRotationPerPassage = request->rotationsperpassage;
InternalWinderCfg.diameter = request->diameter;
usnprintf(ScrewStr, 150, "WindingConfig start,offset,head,tail {, %d, %d, %d, %d, %d}",InternalWinderCfg.startoffsetpulses,(int)InternalWinderCfg.segmentoffsetpulses,
(int)InternalWinderCfg.spoolbackingrate,(int)InternalWinderCfg.SpoolBottomBackingRate);
@@ -279,7 +281,6 @@ numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__
double WinderReferenceSpeed=0;
double TotalWinderSpeed=0;
bool Add100 = false;
-double Rotations = 6.0;
int flipflop = 0;
uint32_t motspeed;
float speedf;
@@ -290,12 +291,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
double temp,tempScrewSpeed;
double screw_horizontal_speed = 0;
double RotationsPerSecond;
- //double Averagewinderspeed = 0;
-
-// {
-// TotalWinderSpeed-=WinderMotorSpeed[WinderMotorSpeedCounter];
-// WinderMotorSpeed[WinderMotorSpeedCounter] = CurrentControlledSpeed[WINDER_MOTOR];
-// TotalWinderSpeed+=WinderMotorSpeed[WinderMotorSpeedCounter];
if (WinderMotorSpeedCounter++>=MAX_WINDER_SPEED_CALCULATION)
{
if (WinderMotorSpeedRollOver == false)
@@ -305,17 +300,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
}
// WinderMotorSpeedCounter=0;
}
-// }
- /*if (flipflop == 0)
- {
- MotorGetSpeedFromFPGA1(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
- }
- else if (flipflop == 1)
- {
- speedf = MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
- }
- flipflop ++;
- */
if (ScrewDirectionChangeCounter == CalculationDirectionChangeCounter)
return OK;
//deley TODO
@@ -353,16 +337,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
Report("Winder difference",__FILE__,CalculationDirectionChangeCounter,ScrewLocationPrev[0],RpWarning,ScrewLocationRun[0], 0);
}
ScrewLocationPrev[0] = ScrewLocationRun[0];
- //else
- // Report("winder run error value" ,__FILE__,WinderRun,ScrewLocationRun[0],RpWarning,ScrewLocationRun[1], 0);
-
- //Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
- //REPORT_MSG(abs(ScrewLocationRun[1] - ScrewLocationRun[0]), "Screw Run NumberOfSteps");
- //usnprintf(ScrewStr, 100, "Winder Encoder: 0 0x%x 1 0x%x diff %d intent %d rot %d",ScrewLocationRun[0],ScrewLocationRun[1],abs(ScrewLocationRun[1] - ScrewLocationRun[0]),ScrewNumberOfSteps,Rotations*10);
- //usnprintf(ScrewStr, 150, "Winder Encoder:id, diff, intended, winderspeed, rotation, speed, time, mot speed {, %d, %d, %d, %d, %d, %d, %d, %d, }",CalculationDirectionChangeCounter,
- // abs(ScrewLocationRun[1] - ScrewLocationRun[0]),ScrewNumberOfSteps,(int)(WinderReferenceSpeed),(int)(Rotations*10),(int)ScrewSpeed,(int)ScrewRunningTime,(int)speedf);
- //usnprintf(ScrewStr, 100, "Winder Encoder: 0 %d 1 %d diff %d ",ScrewLocationRun[0],ScrewLocationRun[1],ScrewLocationRun[1] - ScrewLocationRun[0]);
- //Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0);
#endif
if (ScrewCurrentDirection == 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize) //next time going out
{
@@ -388,24 +362,6 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
// Report("Bottom Backing ",__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewNumberOfSteps, 0);
}
}
- /* if (WinderMotorSpeedRollOver)
- {
- if (WinderCalculation%60000 == 0)//100 minutes
- {
- Averagewinderspeed = TotalWinderSpeed/MAX_WINDER_SPEED_CALCULATION;
- //Report("WinderSpeedUpdated",__FILE__,__LINE__,(int)TotalWinderSpeed,RpWarning,(int)Averagewinderspeed,0);
- WinderReferenceSpeed = Averagewinderspeed;
- }
- WinderCalculation++;
- }*/
- //WinderReferenceSpeed = 1000;
- //ScrewNumberOfSteps = 1000;
- screw_horizontal_speed = ScrewNumberOfSteps / Rotations;//InternalWinderCfg.NumberOfRotationPerPassage;
- // if (Rotations > 6.6)//7.0)
- // Rotations = 6.0;
- RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround;
- tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond;
- //ROM_IntMasterDisable();
tempScrewSpeed = ScrewSpeed;
CurrentControlledSpeed[SCREW_MOTOR] = ScrewSpeed;
@@ -468,7 +424,6 @@ uint32_t Winder_Presegment(void *SegmentDetails, uint32_t SegmentId)
InternalWinderCfg.SpoolBottomBackingRate = 2000; //no cone shape for samples
InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw
JobSegment* Segment = SegmentDetails;
- InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw
ScrewSpeed = InternalWinderCfg.segmentoffsetpulses/(((Segment->length *100)/dyeingspeed)/3);
ScrewNumberOfSteps = InternalWinderCfg.segmentoffsetpulses;//*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep;
@@ -481,7 +436,6 @@ uint32_t Winder_Presegment(void *SegmentDetails, uint32_t SegmentId)
InternalWinderCfg.SpoolBottomBackingRate = 2000; //no cone shape for samples
InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw
JobSegment* Segment = SegmentDetails;
- InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw
ScrewSpeed = InternalWinderCfg.segmentoffsetpulses/(((Segment->length *100)/dyeingspeed)/20);
ScrewNumberOfSteps = InternalWinderCfg.segmentoffsetpulses;//*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep;
}