From db94be7a673886297f5a6dfe4331793452a9f609 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 12 May 2019 09:03:07 +0300 Subject: keep alive counter reset. some file system trace data. --- Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 5a77a013d..8fb7024be 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -133,11 +133,12 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer) return OK; } +bool FileDone = false; +FRESULT lFresult = FR_OK; uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) { //uint32_t status = OK; FRESULT Fresult = FR_OK; - bool FileDone = false; MessageContainer responseContainer; @@ -153,8 +154,8 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) // memcpy (&ReceivedFileHandle,request->uploadid,sizeof(ReceivedFileHandle)); //if (ReceivedFileHandle == FileHandle) //{ - KeepAliveOneSecondCounter = 0; Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes ); + lFresult = Fresult; if(Fresult != FR_OK) { LOG_ERROR (Fresult,"f_write error"); @@ -202,9 +203,10 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) 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(request->buffer.data); file_chunk_upload_request__free_unpacked(request,NULL); my_free(responseContainer.data.data); - SendChars(container_buffer, container_size); + SendCharsWithType(container_buffer, container_size,MESSAGE_TYPE__FileChunkUploadResponse); if (FileDone == true) Task_setPri(CommRxTaskHandle, 9); -- cgit v1.3.1 From 5f6a459aab9a781dc143d8a6eb214408ead6906d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 19 May 2019 19:28:56 +0300 Subject: PID - fabs() enabled small integral values. empty waste indication. --- .../Embedded/Common/SWUpdate/FileSystem.c | 1 + .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Common/report/reportInit.c | 10 ++ .../Embedded_SW/Embedded/Modules/Control/PIDAlgo.c | 2 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 4 +- .../Embedded/Modules/Heaters/Heaters_print.c | 2 + .../Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 2 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 8 +- .../Embedded_SW/Embedded/Modules/Thread/Thread.h | 1 + .../Embedded/Modules/Thread/Thread_init.c | 6 +- .../Embedded/Modules/Thread/Thread_print.c | 138 +++++++++++++++------ .../Embedded_SW/Embedded/Modules/Waste/Waste.h | 1 + .../Embedded/Modules/Waste/Waste_init.c | 2 + .../Embedded/Software Release Notes.txt | 1 + .../StateMachines/Initialization/InitSequence.c | 2 +- 15 files changed, 131 insertions(+), 51 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 8fb7024be..68745b390 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -154,6 +154,7 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) // memcpy (&ReceivedFileHandle,request->uploadid,sizeof(ReceivedFileHandle)); //if (ReceivedFileHandle == FileHandle) //{ + KeepAliveOneSecondCounter = 0; Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes ); lFresult = Fresult; if(Fresult != FR_OK) diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index 24bc7d0ab..21c7eb041 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,3,10,3}; +TangoVersion_t _gTangoVersion = {1,4,0,0}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index bc3cbe20b..0d5836acf 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -38,6 +38,8 @@ #include "PMR/debugging/StartDebugLogResponse.pb-c.h" #include "PMR/debugging/StopDebugLogResponse.pb-c.h" +#include "modules/General/process.h" + /*PackageHandle ControlFilter; PackageHandle HeatersFilter; PackageHandle JobFilter ; @@ -147,6 +149,14 @@ uint32_t ReportInitMessage(MessageContainer* requestContainer) uint32_t RESC = SysCtlResetCauseGet (); LOG_ERROR(RESC,"Reset Reason Register"); /*SysCtlResetCauseClear(RESC);*/ +#ifdef TEST_PID_THREAD + Task_sleep(1000); + dyeingspeed = 50; + ThreadJoggingFunc(50); + ThreadPreSegmentState(NULL,0); + Task_sleep(2000); + ThreadAbortJoggingFunc(); +#endif return status; } uint32_t StopReportInitMessage(MessageContainer* requestContainer) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c index a443b4785..dd9841777 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c @@ -46,7 +46,7 @@ float AdvancedPIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_ error = _setPoint - _mesuredParam; //In case of error too small then stop integration - if(abs(error) > params->epsilon) + if(fabs(error) > params->epsilon) { *_integral = *_integral + error*params->dt; } diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 2fa4c9fe4..184aa52be 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -265,10 +265,10 @@ void DiagnosticsLoadDigitalValues(void) DigitalOutputState[11].value = DataUpdated; DigitalOutputState[12].interfaceio = INTERFACE_IOS__GPI_WCONTAINER_FULL; - DigitalOutputState[12].value = WHS_IsContainerOverflow(); + DigitalOutputState[12].value = WHS_IsContainerFull(); DigitalOutputState[13].interfaceio = INTERFACE_IOS__GPI_WCONTAINER_WARN; - DigitalOutputState[13].value = WHS_IsContainerFull(); + DigitalOutputState[13].value = WHS_IsContainerEmpty(); DigitalOutputState[14].interfaceio = INTERFACE_IOS__GPO_SPARE1_1; /*waste lower cartridge presence*/ DigitalOutputState[14].value = WHS_WasteCartridgeLowerPresent(); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index b401af289..0ac355910 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -258,6 +258,7 @@ uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId) } HeaterRecalculateHeaterParams(HeaterId, 0); DeActivateHeater(HeaterId); + HeaterPIDConfig[HeaterId].m_SetParam = 0; HeaterReady[HeaterId] = true; } else if (HeaterId < MAX_AC_HEATERS) //AC Heaters @@ -286,6 +287,7 @@ uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId) } DeActivateHeater(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain); DeActivateHeater(HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary); + HeaterPIDConfig[HeaterId].m_SetParam = 0; HeaterReady[HeaterId] = true; } diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 74ae94fd4..d312dcb78 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -117,7 +117,7 @@ uint32_t IDS_HomeDispenserCallback(uint32_t motorId, uint32_t ReadValue) // HomingActive[DispenserId]= false; Report("Start backlash",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0); DispenserHomingControlId[DispenserId] = AddControlCallback( IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 ); - + Task_sleep(10); MotorSetDirection(motorId,MotorsCfg[motorId].directionthreadwize); MotorSetSpeed(motorId, 1000); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 4e965350a..604ddf214 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -289,8 +289,8 @@ void FreeBrushStopFileData(JobDescriptionFileBrushStop *BrushStop); { JobTicket* JobTicket = JobDetails; uint8_t *SegmentPtr = 0, *BrushStopPtr = 0; - JobDescriptionFileBrushStop *BrushStop; - JobDescriptionFileSegment *Segment; + JobDescriptionFileBrushStop *BrushStop = NULL; + JobDescriptionFileSegment *Segment = NULL; int Dispenser_i, Brush_i,DispenserId; uint32_t Bytes = 0,readBytes = 0,ImmediateRead = 0,SegmentSize = 0,BrushStopSize = 0; uint32_t status = OK; @@ -325,8 +325,8 @@ c. Go to step 2.a x Segment.BrushStopsCount. DispenserUsedInJob[Dispenser_i] = false; } n_segments = 0; - if (EnableCleaning == true) - DispenserUsedInJob[CLEANER_DISPENSER] = true; +// if (EnableCleaning == true) +// DispenserUsedInJob[CLEANER_DISPENSER] = true; if (JobTicket->enablelubrication == true) { //DispenserUsedInJob[LUBRICANT_DISPENSER] = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index 97f3811c7..19201c708 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -17,6 +17,7 @@ #include "thread_ex.h" +#define NORMAL_COEF_DIVIDER 100 typedef struct { uint32_t startoffsetpulses; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index 4454565c1..265c751c6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -106,18 +106,18 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request) #ifdef TEST_LONGER_PID_THREAD MotorsControl[Motor_i].pvinputfilterfactormode = 10; //test longer control #endif - for (i = 0;i < MotorsControl[Motor_i].pvinputfilterfactormode; i++) + for (i = 0;i < (int)MotorsControl[Motor_i].pvinputfilterfactormode; i++) { MotorSamples[Motor_i][i] = 0; //reset the samples value for control beginning MotorSpeedSamples[Motor_i][i] = 0; } NormalizedErrorCoEfficient[Motor_i] = (2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits); - temp=(10*(temp-1)*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm); + temp=(NORMAL_COEF_DIVIDER*(temp-1)*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm); NormalizedErrorCoEfficient[Motor_i] = NormalizedErrorCoEfficient[Motor_i] / temp; // uint32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES]; temp = 1<<(DancersCfg[ThreadMotorIdToDancerId[Motor_i]].resolutionbits); - temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm*2); + temp = (temp*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].maximalmovementmm*3/2); DancerStopActivityLimit[Motor_i] = temp/(2*PI*DancersCfg[ThreadMotorIdToDancerId[Motor_i]].armlength); return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 50547656a..25485290b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -137,13 +137,11 @@ void ThreadUpdateProcessLength (double length, void *Funcptr) CurrentRequestedLength = length*100;//Centimetres CurrentProcessedLength = 0; ProcessedLengthFuncPtr = (ProcessedLengthFunc)Funcptr; - initialpos = 0xFFFF; - Poolerinitialpos = 0xFFFF; } char Lenstr[150]; uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) { - uint32_t positionDiff = 0; + uint32_t positionDiff = 0,prevprev; double length = 0.0; int index = MAX_THREAD_MOTORS_NUM; @@ -172,6 +170,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) PreviousPosition = CurrentPosition; initialpos = 0; } + prevprev = PreviousPosition; positionDiff = Control_Delta_Position_Pass(CurrentPosition,PreviousPosition); //positionDiff = positionDiff / MotorsCfg[ThreadMotorIdToMotorId[index]].microstep; PreviousPosition = CurrentPosition; @@ -181,8 +180,16 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) //positionDiff = positionDiff / MotorsCfg[ThreadMotorIdToMotorId[index]].microstep; length = (double)(positionDiff)*LengthCalculationMultiplier; - } + if (length > 1000) + { + usnprintf(Lenstr, 100, "length huge: length %d, diff 0x%x, pos 0x%x prev 0x%x",(int)length*100,(int)positionDiff,PreviousPosition,prevprev); + SendJobProgress(0.0,0,false, Lenstr); + Report(Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); + + } + + } CurrentProcessedLength+=length; static int pooler_counter = 0; @@ -278,11 +285,11 @@ uint32_t ThreadSpeedControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) index = IfIndex&0xFF; SpeedSamples[MotorSamplePointer[index]] = speed;//(-1 * TranslatedReadValue); MotorSamplePointer[index]++; - if (MotorSamplePointer[index] >= MotorsControl[index].pvinputfilterfactormode) + if (MotorSamplePointer[index] >= (int)MotorsControl[index].pvinputfilterfactormode) MotorSamplePointer[index] = 0; - for (i=0;i>8 != IfTypeThread) { LOG_ERROR (IfIndex, "Wrong Interface type"); @@ -405,6 +430,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) } return OK; } + KeepReadValue = ReadValue; TranslatedReadValue = ReadValue - DancersCfg[DancerId].zeropoint; if (index == POOLER_MOTOR) { @@ -415,15 +441,15 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //TranslatedReadValue = 0;//test MotorSamples[index][MotorSamplePointer[index]] = TranslatedReadValue;//(-1 * TranslatedReadValue); MotorSamplePointer[index]++; - if (MotorSamplePointer[index] >= MotorsControl[index].pvinputfilterfactormode) + if (MotorSamplePointer[index] >= (int)MotorsControl[index].pvinputfilterfactormode) MotorSamplePointer[index] = 0; #ifdef TEST_LONGER_PID_THREAD else // test: handle tension once in pvinputfilterfactormode milliseconds return OK; #endif - for (i=0;i= 5000) + //if (index == WINDER_MOTOR) //feeder unit handles errors opposite to left unit + //{ + // Report("MotorSpeedUpdated",__FILE__,index,OriginalMotorSpd_2PPS[index],RpWarning,CurrentControlledSpeed[index],0); + //} + /`*if (JobCounter >= 3000) { MotorSpeedSamples[index][MotorSpeedSamplePointer[index]] = CurrentControlledSpeed[index];//(-1 * TranslatedReadValue); MotorSpeedSamplePointer[index]++; @@ -515,28 +546,45 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) avreageMotorSampleValue = avreageMotorSampleValue / MAX_CONTROL_SAMPLES; //Report("MotorSpeedUpdated",__FILE__,index,OriginalMotorSpd_2PPS[index],RpWarning,avreageMotorSampleValue,0); OriginalMotorSpd_2PPS[index] = avreageMotorSampleValue; - } - } + }*`/ + }*/ calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index]; //calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*CurrentControlledSpeed[index]; +#ifndef TEST_PID_THREAD if (abs(calculated_speed-CurrentControlledSpeed[index])> MotorControlConfig[index].m_ingnoreValue) +#else + if (index == FEEDER_MOTOR) //feeder unit handles errors opposite to left unit +#endif { - /*if (keepdata == true) - { - calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; - MotorId[controlIndex] = index; - readValue[controlIndex] = ReadValue; - AveragereadValue[controlIndex] = avreageSampleValue; - calculatedspeed[controlIndex] = calculated_speed; - NormError[controlIndex] - = MotorControlConfig[index].m_mesuredParam; - mIntegral[controlIndex] = MotorControlConfig[index].m_integral; - timestamp[controlIndex] = msec_millisecondCounter; - if (controlIndex++>=MAX_THREAD_CONTROL_LOG) - controlIndex = 0; - }*/ CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); + if (((JobCounter % 2000) == index*100)&&(index == WINDER_MOTOR)) //feeder unit handles errors opposite to left unit + { + Report("MotorSpeedUpdated",__FILE__,index,OriginalMotorSpd_2PPS[index],RpWarning,CurrentControlledSpeed[index],0); + } +#ifdef TEST_PID_THREAD + int len; + if ((JobCounter % 2000) == index*100) + //if (keepdata == true) + { + /*calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; + MotorId[controlIndex] = index; + readValue[controlIndex] = ReadValue; + AveragereadValue[controlIndex] = avreageSampleValue; + calculatedspeed[controlIndex] = calculated_speed; + NormError[controlIndex] = MotorControlConfig[index].m_mesuredParam; + mIntegral[controlIndex] = MotorControlConfig[index].m_integral; + timestamp[controlIndex] = msec_millisecondCounter;*/ + len = usnprintf(TMessage, 150, "read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d", + ReadValue,avreageSampleValue,(int)(MotorControlConfig[index].m_mesuredParam*1000000), + (int)(MotorControlConfig[index].m_integral*1000000000),(int)((MotorControlConfig[index].m_mesuredParam*MotorControlConfig[index].m_params.dt)*1000000000), + (int)(MotorControlConfig[index].m_calculatedError*1000),(int)calculated_speed); + Report(TMessage,__FILE__,__LINE__,DancerId,RpError,ReadValue,0); + //Task_sleep(100); + //if (controlIndex++>=MAX_THREAD_CONTROL_LOG) + // controlIndex = 0; + } +#endif } else MotorFailedSample[index]++; @@ -658,8 +706,10 @@ bool InitialProcess = false; ControlIdtoMotorId[Motor_i] = 0xFF; CurrentControlledSpeed[Motor_i] = 0; } +#ifndef TEST_PID_THREAD ControlIdtoMotorId[Motor_i] = AddControlCallback(ThreadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); //AddControlCallback(ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); +#endif } 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 { @@ -670,7 +720,9 @@ bool InitialProcess = false; CurrentControlledSpeed[Motor_i] = 0; ControlIdtoMotorId[Motor_i] = 0xFF; } +#ifndef TEST_PID_THREAD ControlIdtoMotorId[Motor_i] = AddControlCallback(ThreadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); +#endif } if (Motor_i == WINDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled { @@ -681,17 +733,23 @@ bool InitialProcess = false; CurrentControlledSpeed[Motor_i] = 0; ControlIdtoMotorId[Motor_i] = 0xFF; } +#ifndef TEST_PID_THREAD ControlIdtoMotorId[Motor_i] = AddControlCallback(ThreadControlCBFunction, eOneMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); +#endif } // if (HW_Motor_Id == HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled // AddControlCallback(ThreadSpeedControlCBFunction, eOneMillisecond,TemplateDataReadCBFunction,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],0); if (Motor_i == HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled continue; } - //testDancersControl(); +#ifdef TEST_PID_THREAD + testDancersControl(); +#endif PrepareReady(Module_Thread,ModuleDone); //set 3 dancers to the profile positions InitialProcess = true; + initialpos = 0xFFFF; + Poolerinitialpos = 0xFFFF; return OK; } @@ -709,6 +767,8 @@ void SetOriginMotorSpeed(float process_speed) //MotorControlConfig[Motor_i].m_SetParam = motor_speed; OriginalMotorSpd_2PPS[Motor_i] = (int) motor_speed; CurrentControlledSpeed[Motor_i] = (int) motor_speed; + Report("Original Speed",__FILE__,Motor_i,motor_speed,RpWarning,process_speed,0); + for (i = 0; i <= MAX_CONTROL_SAMPLES; i++) MotorSpeedSamples[Motor_i][i] = motor_speed; } @@ -732,8 +792,10 @@ uint32_t ThreadPreSegmentState(void *SegmentDetails, uint32_t SegmentId) SetOriginMotorSpeed(process_speed); ThreadControlActive = true; PrepareState = false; +#ifndef TEST_PID_THREAD // set the new speed in the dryer motor to the speed of the new segment MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING, OriginalMotorSpd_2PPS[DRYER_MOTOR]); +#endif #ifdef HUNDRED_MICROSECONDS_DANCER_READ MillisecLogInit(); #endif diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste.h index 74f7b40ef..a0a758b94 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste.h @@ -100,6 +100,7 @@ U8 WHS_HW_test(void); bool WHS_IsEmptying(); bool WHS_IsContainerFull(); +bool WHS_IsContainerEmpty(); bool WHS_IsContainerOverflow(); bool WHS_WasteCartridgeLowerPresent(); bool WHS_WasteCartridgeMiddlePresent(); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c index 7d24f9618..962b941af 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c @@ -99,6 +99,8 @@ struct WHS_information struct WHS_information WHS_info; bool WHS_IsContainerFull(){return WHS_info.WHS_sensors.waste_tank_full_sensor;} +bool WHS_IsContainerEmpty(){return WHS_info.WHS_sensors.waste_tank_empty_sensor;} + bool WHS_IsContainerOverflow(){return WHS_info.WHS_sensors.waste_tank_over_flow_sensor;} bool WHS_WasteCartridgeLowerPresent(){return WHS_info.WHS_sensors.waste_cartridge1_precense_sensor;} bool WHS_WasteCartridgeMiddlePresent(){return WHS_info.WHS_sensors.waste_cartridge2_precense_sensor;} diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index c02824117..a6a82ae6d 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -10,6 +10,7 @@ Modules: Alarm handling: many unusful alarm removed: motors, heating process, midtank empty Diagnostic data reduced significantly in frequency Waste state machine disabled for ITMA + improve backlash after homing Drivers: VOC Gas sensor fixes. Lubricant valve workaround until FPGA will be fixed diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 8ee3c8181..bdf8bd15d 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -190,7 +190,7 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); else - Control_Voltage_To_Blower(2700); + Control_Voltage_To_Blower(3000); Safety_Init(); InitStages++; //InitSequenceStateMachine(InitStages); -- cgit v1.3.1