aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-02-17 14:46:41 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-02-17 14:46:41 +0200
commit5d5a592d9af5f971767216dcd7e3a0027970d691 (patch)
treec1ee079fde2da54297cfd49f385dbabdcdc1ccf9 /Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
parent7d7d28fdeab29f74d064e50f19a4985c763ee813 (diff)
downloadTango-5d5a592d9af5f971767216dcd7e3a0027970d691.tar.gz
Tango-5d5a592d9af5f971767216dcd7e3a0027970d691.zip
thread load testing
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index d5cf08ccb..edfa3b0b9 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -85,7 +85,7 @@
FRESULT Fresult = FR_OK;
REPORT_MSG(LoadStages, "Thread Load State Machine step");
- LoadArmInfo.LoadArmBackLash = 0;
+ LoadArmInfo.LoadArmBackLash = 40;
LoadArmInfo.LoadArmRounds = 0xFF;
Fresult = f_mkdir(SW_INFO_DIR);
if ((Fresult == FR_OK)||(Fresult == FR_EXIST))
@@ -103,7 +103,7 @@
memcpy (&ProcessParametersRecover,&ProcessParametersKeep,sizeof(ProcessParameters));
//NumberOfDrierLoaderCycles = loadLoadArmParameters();
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
return OK;
}
@@ -137,35 +137,38 @@
Control_Voltage_To_Blower(BlowerCfg.voltage-500);
Control_Dryer_Fan(STOP,75);//use START or STOP, 0 - 100%
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
}
return OK;
}
uint32_t Thread_Load_Set_Load_Arm_To_Start_Position_Callback(uint32_t deviceID, uint32_t BusyFlag)
{
- Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
+ // Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
NumberOfDrierLoaderCycles--;
if (NumberOfDrierLoaderCycles)
{
+ Report("Thread_Load_Set_Load_Arm_To_Start_Position_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize),
MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround, Thread_Load_Set_Load_Arm_To_Start_Position_Callback,1000);
}
else
{
+ Report("Thread_Load_Set_Load_Arm_To_Start_Position_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
//storeLoadArmParameters();
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
}
return OK;
}
uint32_t Thread_Load_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_t BusyFlag)
{
- Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
+// Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
+ Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
NumberOfDrierLoaderCycles=0;
//storeLoadArmParameters();
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
return OK;
}
uint32_t Thread_Load_Set_Load_Arm_To_Start_Position(void)
@@ -173,14 +176,16 @@
REPORT_MSG(LoadStages, "Thread Load State Machine step");
if (LoadArmInfo.LoadArmRounds != 0xFF)
{
+ Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
NumberOfDrierLoaderCycles = LoadArmInfo.LoadArmRounds;
- status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize),
+ status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize),
MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround*LoadArmInfo.LoadArmRounds, Thread_Load_Set_Load_Arm_To_Start_Position_Callback,1000);
}
else //number of circles is not known - compare to position of the motor to verify location at the stopper
{
- status |= MotorMoveToStopper(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize),
- MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/10, Thread_Load_Set_Load_Arm_To_Start_Position_Callback,LoadArmInfo.LoadArmBackLash,1000);
+ Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
+ 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/2, Thread_Load_Set_Load_Arm_To_Stopper_Callback,LoadArmInfo.LoadArmBackLash,1000);
}
//Use Notation How Many Rotations In The Drier, Or Check Against Stopper. Move Slowly
@@ -202,7 +207,7 @@
if (CallbackCounter == 0)
{
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
}
}
else
@@ -316,7 +321,7 @@
{
Control_Dryer_Fan(START,75);//use START or STOP, 0 - 100%
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
}
return OK;
}
@@ -335,7 +340,7 @@
//Start Feeder Pid, Rotate Loading Arm Counter Thread Direction X Circles According To Rml. Feeder Speed Is 40
OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000;
ControlId = AddControlCallback(ThreadLoadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+FEEDER_MOTOR),FEEDER_DANCER,FEEDER_MOTOR);
- MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,
+ MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,
MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround*LoadArmInfo.LoadArmRounds, Thread_Load_HomingCallback, 100000);
//Keep Notation How Many Rotations In The Dryer
@@ -351,7 +356,7 @@
ControlId = 0xFF;
ThreadAbortJoggingFunc();
LoadStages++;
- ThreadLoadStateMachine(LoadStages);
+ //ThreadLoadStateMachine(LoadStages);
return OK;
}
uint32_t Thread_Load_Jog_Thread(void)
@@ -510,14 +515,15 @@ void ThreadLoadRequest(MessageContainer* requestContainer)
container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
- int LoadStages = (int)request->dryerzone1temp;
- ThreadLoadStateMachine(LoadStages);
+ int LoadStage = (int)request->dryerzone1temp;
+ LoadStages = LoadStage;
+ ThreadLoadStateMachine(LoadStage);
- //if (status)
+ /*if (status)
{
responseContainer.has_error = true;
responseContainer.error = ERROR_CODE__JOB_UNSPECIFIED_ERROR;
- }
+ }*/
size_t container_size = message_container__pack(&responseContainer, container_buffer);
my_free(responseContainer.data.data);
//USBCDCD_sendData(container_buffer, container_size,10);
@@ -544,11 +550,11 @@ void ThreadLoadPollRequest(MessageContainer* requestContainer)
container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
-
+/*
{
responseContainer.has_error = true;
responseContainer.error = ERROR_CODE__JOB_UNSPECIFIED_ERROR;
- }
+ }*/
size_t container_size = message_container__pack(&responseContainer, container_buffer);
my_free(responseContainer.data.data);
SendChars(container_buffer, container_size);