aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-18 16:24:06 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-18 16:24:06 +0200
commit2d453e76dbc75ed10c7e953f735d9aedcbfd3529 (patch)
tree69cbffb18186f8fed6777e34c00b57a24d414564 /Software/Embedded_SW
parente29b3fcf2531b0c50cf1707e552ba72baa060800 (diff)
downloadTango-2d453e76dbc75ed10c7e953f735d9aedcbfd3529.tar.gz
Tango-2d453e76dbc75ed10c7e953f735d9aedcbfd3529.zip
fixes
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c12
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c6
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c7
5 files changed, 14 insertions, 17 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
index 779d7e82f..ae862505a 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
@@ -354,7 +354,7 @@ uint32_t MotorRunCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
{
angle = Calculate_Arm_Distance(Arm_Drier_Center,temp);
- if ((angle<400)||(angle>16000))
+ if (abs(angle)<400)
{
BusyFlag = NOTBUSY;
}
@@ -376,7 +376,7 @@ uint32_t MotorRunCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
Report("motor timeout",__FILE__,__LINE__,MotorId,RpMessage,MotorTimeout[MotorId],0);
Busy = BUSY;
}
- Report("MotorRunCallBackFunctionMotorRunCallBackFunction curr prev return",__FILE__,encoder,temp,RpWarning,AccumulatedArmMovement,0);
+ Report("MotorRunCallBackFunction curr prev return",__FILE__,encoder,temp,RpWarning,AccumulatedArmMovement,0);
//call the module callback
if (MotorCallback[MotorId])
{
@@ -1128,10 +1128,10 @@ float Calculate_Arm_Angle(uint32_t Drier_Center,uint32_t Current_Angle)
int Calculate_Arm_Distance(uint32_t Drier_Center,uint32_t Current_Angle)
{
int angle;
- if (Current_Angle >= Drier_Center)
+ //if (Current_Angle >= Drier_Center)
angle = Current_Angle - Drier_Center;
- else
- angle = Current_Angle + 0x3FFF - Drier_Center;
+ //else
+ // angle = Current_Angle + 0x3FFF - Drier_Center;
ReportWithPackageFilter(DiagnosticsFilter,"Calculate_Arm_Distance",__FILE__,angle,Current_Angle,RpMessage,Drier_Center,0);
return angle;
}
@@ -1163,7 +1163,7 @@ uint32_t LoadingArmReset_Callback(uint32_t MotorId, uint32_t ReadValue)
{
ReportWithPackageFilter(DiagnosticsFilter,"LoadingArmReset_Callback OK",__FILE__,__LINE__,Arm_Drier_Center,RpMessage,ReadValue,0);
MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0);
- if ((angle<400)||(angle>16000))
+ if (abs(angle)<400)
//if (fabs(angle)<0.2)
{
ReportWithPackageFilter(DiagnosticsFilter,"drier center proximity",__FILE__,temp,Arm_Drier_Center,RpMessage,angle,0);
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
index c7f8740d1..9a14cd1b8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
@@ -475,7 +475,7 @@ uint32_t Diagnostics_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_
angle = Calculate_Arm_Distance(D_DrierPrevLocation,temp);
- if ((angle<14000 )||(BusyFlag == BUSY)) // OK - take another round
+ if ((abs (angle)<14000 )||(BusyFlag == BUSY)) // OK - take another round
{
responseContainer.has_error = true;
responseContainer.error = ERROR_CODE__GENERAL_ERROR;
@@ -611,7 +611,7 @@ uint32_t Diagnostics_Dryer_Loading_Callback(uint32_t MotorId, uint32_t ReadValue
ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading_Callback",__FILE__,(int)angle,(int)ReadValue,RpMessage,temp,0);
MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,D_numberOfCycles);
- if ((angle>14000 )&&(ReadValue == NOTBUSY)) // OK - take another round
+ if ((abs(angle)>14000 )&&(ReadValue == NOTBUSY)) // OK - take another round
{
D_DrierPrevLocation = temp;
//ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index fcd1c05a2..3a2bbc347 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -591,10 +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)))
+ /*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);
@@ -1935,6 +1935,8 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId)
}
}
+ if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0)
+ IDS_Cleaning_Stop_Cleaning_Solution(NULL);
IDS_StopLubrication();
Init_CleaningStageCounter();//set the counter before relocating
HeadCard_Actuators_Relocate();
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index cdb726b5e..c3f15aff8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -258,7 +258,7 @@
{
CallbackCounter--;
}
- if ((angle>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round
+ if ((abs(angle)>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round
{
Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
index 626bcde7c..869485b71 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c
@@ -217,12 +217,7 @@ uint32_t StoreDancerConfigMessage(int DancerId)
status |= MCU_E2PromProgram(DancerAddress[Dancer_i],DancersCfg[Dancer_i].zeropoint);
- Report("~~~~~~Store eeprom 0",__FILE__,DancersCfg[0].zeropoint,(int)DancersCfg[1].zeropoint,RpWarning,(int)DancersCfg[2].zeropoint,0);
-#ifdef FOUR_WINDERS
- status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_3,DancersCfg[HARDWARE_DANCER_3].zeropoint);
- status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_4,DancersCfg[HARDWARE_DANCER_4].zeropoint);
- Report("~~~~~~Store eeprom 1",__FILE__,__LINE__,(int)DancersCfg[HARDWARE_DANCER_3].zeropoint,RpWarning,(int)DancersCfg[HARDWARE_DANCER_4].zeropoint,0);
-#endif
+ Report("~~~~~~Store eeprom dancer",__FILE__,__LINE__,Dancer_i,RpWarning,(int)DancersCfg[Dancer_i].zeropoint,0);
/*
response_buffer = my_malloc(hardware_configuration__get_packed_size(&DancerConfig));
if (response_buffer)