aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c20
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IFS/ifs.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c8
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c46
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c22
6 files changed, 84 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index 5b6ad643d..fcd1c05a2 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -591,7 +591,10 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl
{
DispenserTotalPrepareSteps[i]+=(CurrentDispenserSpeed[i]*PRESSURE_READ_TIME_GAP/eOneSecond);
HW_Motor_Id = DispenserIdToMotorId[i];
-
+ if ((DispenserTotalPrepareSteps[i]>TargetNumberOfStepsPreRun)&&(DispenserTotalPrepareSteps[i]<(TargetNumberOfStepsPreRun+InitialDispenserSpeed)))
+ {
+ ReportWithPackageFilter(IDSFilter,"IDS dispenser pre-run ended",__FILE__,i,(int)DispenserTotalPrepareSteps[i],RpWarning,(int)(pressure*100),0);
+ }
if (DispenserTotalPrepareSteps[i]<TargetNumberOfStepsPreRun)
{
AdjustDispenserSpeedToPressure(i,MaximalPressurePreRun,pressure);
@@ -635,8 +638,11 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl
}
if (pressureReady == true)
{
+ usnprintf(IdMessage, 80,"pressureReady = true %d K %d,C %d,M %d,Y %d,TI %d",(int)(DispenserPreparePressure*100),(int)(GetDispenserPressure(0)*100),(int)(GetDispenserPressure(1)*100)
+ ,(int)(GetDispenserPressure(2)*100),(int)(GetDispenserPressure(3)*100),(int)(GetDispenserPressure(4)*100));
+ ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, DispenserBuildTimeCounter, RpWarning, NumofReadyDispensers, 0);
DispenserBuildTimeCounter = 0;
- ReportWithPackageFilter(IDSFilter,"pressureReady = true",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)(DispenserPreparePressure*100),0);
+ //ReportWithPackageFilter(IDSFilter,"pressureReady = true",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)(DispenserPreparePressure*100),0);
}
if (DispenserBuildTimeCounter >= DispenserPrepareTimeout)
{
@@ -730,7 +736,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl
}
}
}//for
- usnprintf(IdMessage, 80,"WFCF %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0],
+ usnprintf(IdMessage, 80,"WFCF %d K %d,C %d,M %d,Y %d,TI %d",WFCF,CurrentDispenserSpeed[0],
CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]);
ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, DispenserBuildTimeCounter, RpWarning, WFCF, 0);
@@ -788,7 +794,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl
JobEndSequence = false;
if ((pressurebuildup>0.1)&&(pressurebuildup<4.5))
{
- ReportWithPackageFilter(IDSFilter,"Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0);
+ ReportWithPackageFilter(IDSFilter,"Setting pressure from RML pressure buildup",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0);
DispenserPreparePressure = pressurebuildup;
}
if (JobTicket->headcleaningparameters)
@@ -1081,7 +1087,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl
}
}
}//for
- usnprintf(IdMessage, 80,"Presegment Prepare D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",CurrentDispenserSpeed[0],
+ usnprintf(IdMessage, 80,"Presegment Prepare K %d,C %d,M %d,Y %d,TI %d",CurrentDispenserSpeed[0],
CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]);
ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0);
@@ -1283,7 +1289,7 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback);
//SendJobProgress(0.0, 0, false, IdsMessage);*/
}
}//for
- usnprintf(IdMessage, 80,"Presegment WFCF %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0],
+ usnprintf(IdMessage, 80,"Presegment WFCF %d K %d,C %d,M %d,Y %d,TI %d",WFCF,CurrentDispenserSpeed[0],
CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]);
ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, FileBrushStop->index, RpWarning, lInterSegmentLength, 0);
}
@@ -1610,7 +1616,7 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers)
}
} //for
}
- usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0],
+ usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d K %d,C %d,M %d,Y %d,TI %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0],
CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]);
ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, SegmentNumOfBrushStops, FileBrushStop->index, RpWarning,(int)FileBrushStop->offsetmeters, 0);
diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
index b2498ee7f..329357ed4 100644
--- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
+++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
@@ -335,7 +335,7 @@ void midTankStateMachine(void)
if (midTankCartColor == MIDTANK_8)
{
- CartridgeInkTimeout = CARTRIDGE_INK_TIMEOUT*4;
+ CartridgeInkTimeout = CARTRIDGE_INK_TIMEOUT*10;
CartridgeCheckTime = FIVE_SECONDS*3;
}
// set valve selection
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index 5b216d25c..e694810d7 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -1246,6 +1246,14 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
response.has_progress = true;
}
else
+ if(request->amount == 0xB24) //Set loading arm cycles
+ {
+ REPORT_MSG(request->delay,"AttemptThreadJoggingFunc");
+ AttemptThreadJoggingFunc(1);
+ response.progress = 0xb24;
+ response.has_progress = true;
+ }
+ else
if(request->amount == 0xC3) //suspend I2C task
{
if (request->delay == 0)
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 63072e4d8..1d310cf01 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -49,6 +49,7 @@
#include "PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h"
#include "PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h"
#include "PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h"
+#include "PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h"
//#include <stdint.h>
//#include <stdbool.h>
@@ -1597,3 +1598,48 @@ uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer)
return OK;
}
+uint8_t attemptJogCounter = 0;
+#define ATTEMPT_JOG_TIMEOUT 18
+char AttemptJoggingToken[36+1] = {0};
+
+uint32_t AttemptThreadJoggingCallback(uint32_t index, uint32_t ReadValue)
+{
+ AttemptThreadJoggingResponse response = ATTEMPT_THREAD_JOGGING_RESPONSE__INIT;
+ MessageContainer responseContainer;
+
+ attemptJogCounter++;
+ Report("AttemptThreadJoggingCallback",__FILE__,attemptJogCounter,JobEndReason,RpWarning,(int)JobIsActive(),0);
+ if (attemptJogCounter<ATTEMPT_JOG_TIMEOUT)
+ {
+ if (JobIsActive() == true)//jog still preparing/running
+ return OK;
+ }
+ if (JobEndReason == JOB_OK)
+ ThreadAbortJoggingFunc();
+ else
+ {
+ responseContainer.has_error = true;
+ responseContainer.error = getJobError_to_ErrorCode(JobEndReason);
+ }
+ SafeRemoveControlCallback(LoadingControlId, Thread_Load_Jog_ThreadStop );
+ LoadingControlId = 0xFF;
+
+ responseContainer = createContainer(MESSAGE_TYPE__AttemptThreadJoggingResponse, AttemptJoggingToken, true, &response, &attempt_thread_jogging_response__pack, &attempt_thread_jogging_response__get_packed_size);
+ responseContainer.continuous = false;
+ uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
+ size_t container_size = message_container__pack(&responseContainer, container_buffer);
+ my_free(responseContainer.data.data);
+ SendChars((char*)container_buffer, container_size);
+ return OK;
+
+}
+uint32_t AttemptThreadJoggingFunc(MessageContainer* requestContainer)
+{
+ attemptJogCounter = 0;
+ ustrncpy (AttemptJoggingToken, requestContainer->token,36);
+ Report("AttemptThreadJoggingFunc",__FILE__,__LINE__,0xFF,RpWarning,(int)ATTEMPT_JOG_TIMEOUT,0);
+ LoadingControlId = AddControlCallback("Load jog",AttemptThreadJoggingCallback, eOneSecond,TemplateDataReadCBFunction,0,0,0);
+ ThreadJoggingFunc(30);
+ return OK;
+}
+
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
index 0861b677b..43938c871 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h
@@ -88,6 +88,8 @@ uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer);
uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer);
uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer);
uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer);
+uint32_t AttemptThreadJoggingFunc(MessageContainer* requestContainer);
+
void ThreadCheckArcHeadCovers(void);
uint32_t Thread_Load_End(void);
uint32_t ThreadLoadingRestartReport(void); //sending after a failure in the finalizing stage
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index bc4e6cb8f..8d41f3b9a 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -337,7 +337,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}**/
//}
-#ifdef BTSR_NO_TFU
+#ifdef BTSR_NO_PULLER_TFU
if (CurrentControlledSpeed[WINDER_MOTOR]>100)
length = dyeingspeed/10;
#endif
@@ -917,7 +917,7 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag)
uint32_t Release_Right_TFU_Tension()
{
uint32_t status = OK;
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
if (RTFU_Up == true)
{
Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0);
@@ -931,7 +931,7 @@ int SecondFeederCorrection = 4;
int PrepareWaitCount = 0;
uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadValue)
{
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
MotorStop (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,Soft_Stop); //per L6470 errata between mov and run commands
Report("Adjust_Right_TFU_Tension_2ndCallback x more steps",__FILE__,__LINE__,MotorId,RpMessage,SecondFeederCorrection,0);
if (JobIsActive()==false)
@@ -955,7 +955,7 @@ uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadVa
}
uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue)
{
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
Report("Adjust_Right_TFU_Tension_Callback",__FILE__,__LINE__,MotorId,RpMessage,0,0);
MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,SecondFeederCorrection* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Adjust_Right_TFU_Tension_2nd_Callback,1000);
RTFU_Up = true;
@@ -966,7 +966,7 @@ uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue)
uint32_t Adjust_Right_TFU_Tension(double tension)
{
uint32_t status = OK;
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
if (tension > 0.5) //0 = lower position, 1 = high position
{
if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT)
@@ -1093,11 +1093,13 @@ uint32_t ThreadPrepareState(void *JobDetails)
IntersegmentLength = JobTicket->intersegmentlength;
PrepareWaitCount = 0;
-#ifndef BTSR_NO_TFU
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension);
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0);
+#ifndef BTSR_NO_PULLER_TFU
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension);
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpWarning,(int)pullertension,0);
+#endif
+#ifndef BTSR_NO_FEEDER_TFU
status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension);
ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpWarning,(int)feedertension,0);
#endif
@@ -1219,7 +1221,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
/////////////////////////////////////////////////////
MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize);
-#ifndef BTSR_NO_TFU
+#ifndef BTSR_NO_FEEDER_TFU
if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0);
@@ -1233,6 +1235,7 @@ uint32_t ThreadPrepareState(void *JobDetails)
SpeedControlId = AddControlCallback(NULL,ThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
}
#endif
+#ifndef BTSR_NO_PULLER_TFU
if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0);
@@ -1246,7 +1249,8 @@ uint32_t ThreadPrepareState(void *JobDetails)
PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep);
PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
}
-#ifndef BTSR_NO_TFU
+#endif
+#ifndef BTSR_NO_FEEDER_TFU
if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled
{
if (ControlIdtoMotorId[Motor_i] != 0xFF)
@@ -1261,6 +1265,8 @@ uint32_t ThreadPrepareState(void *JobDetails)
//AddControlCallback(NULL,ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i);
#endif
}
+#endif
+#ifndef BTSR_NO_PULLER_TFU
if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled
{
if (ControlIdtoMotorId[Motor_i] != 0xFF)