diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-17 20:21:31 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-17 20:21:31 +0300 |
| commit | 97150bf5a7f5844d9da47523e3136ce87c305ba0 (patch) | |
| tree | cce125b1cd9d5e3214f2465d595e0d96ba690e3d /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | 0f5d23b3a4d38e5a68436acf3a96822d59249f46 (diff) | |
| parent | efa84762d3e271e489eb4aaa530b6271942adffe (diff) | |
| download | Tango-97150bf5a7f5844d9da47523e3136ce87c305ba0.tar.gz Tango-97150bf5a7f5844d9da47523e3136ce87c305ba0.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 4 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 50 |
2 files changed, 20 insertions, 34 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index e40be86a0..a8ca46574 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -166,13 +166,13 @@ uint32_t CalculateNumberOfSteps (uint32_t Counter, bool direction) if (Counter) { - if (Counter%InternalWinderCfg.spoolbackingrate == 0) + if (Counter%InternalWinderCfg.spoolbackingrate == 1) { NumberOfSteps -= (Counter/InternalWinderCfg.spoolbackingrate); REPORT_MSG(ScrewNumberOfSteps, "Head Backing"); ScrewNumberOfSteps--; } - if ((Counter%InternalWinderCfg.SpoolBottomBackingRate == 0)||(Counter%InternalWinderCfg.SpoolBottomBackingRate == 0)) + if ((Counter%InternalWinderCfg.SpoolBottomBackingRate == 0)||(Counter%InternalWinderCfg.SpoolBottomBackingRate == 1)) { if (direction != MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index a64ac6cef..6a0bac394 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -145,16 +145,16 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) return 0xFFFFFFFF; } index = IfIndex&0xFF; - if (CurrentRequestedLength == 0.0) - return OK; +// if (CurrentRequestedLength == 0.0) +// return OK; if (index != FEEDER_MOTOR) { LOG_ERROR (IfIndex, "Wrong Motor"); return 0xFFFFFFFF; } CurrentPosition = MotorGetPosition(ThreadMotorIdToMotorId[index]); - if (CurrentPosition == 0) - return OK; //unusable data +// if (CurrentPosition == 0) +// return OK; //unusable data if (initialpos == 0xFFFF) { PreviousPosition = CurrentPosition; @@ -184,6 +184,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) if (MotorDataIndex == 99) MotorDataIndex = 0; static int pooler_counter = 0; pooler_counter++; + TotalProcessedLength+= (length/100); if (pooler_counter%10 == 0) { if (PrepareState == true) @@ -195,8 +196,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) } else { - TotalProcessedLength+= (CurrentProcessedLength/100); - SendJobProgress(CurrentProcessedLength,0,false, "Progress"); + SendJobProgress(TotalProcessedLength,0,false, "Progress"); } } @@ -297,7 +297,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //read value is the dancer angle int i,index=MAX_THREAD_MOTORS_NUM; int DancerId; - static int pooler_counter = 0; int32_t TranslatedReadValue, avreageSampleValue = 0; //double tempcalcspeed = 0; uint32_t calculated_speed; @@ -354,7 +353,18 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) avreageSampleValue += MotorSamples[index][i]; avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode; //Stop Execution if the dancer moves too much - + if (index == POOLER_MOTOR) + { + if (JobCounter > eOneSecond) + { + if (ReadBreakSensor()==ERROR) + { + LOG_ERROR(index, "ReadBreakSensor Error"); + //SendJobProgress(0.0,0,false, "ReadBreakSensor Error"); + //EndState(CurrentJob,"ReadBreakSensor Error" ); + } + } + } if ((abs(avreageSampleValue)> DancerStopActivityLimit[index])&&(JobCounter > eOneSecond)) { usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); @@ -396,30 +406,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); } } - if (index == FEEDER_MOTOR) - { - pooler_counter++; - if (pooler_counter>=1000) - { - //float error_integered = MotorControlConfig[index].m_calculatedError*1000; - /*{ - "HeaterGroupId": 0, - "Zone1Temp": 80, - "Zone2Temp": 2641, - "Heater1Active": false, - "Heater2Active": false, - "Heater1Percentage": 3, - "Heater2Percentage": 4000, - "InfoMessage": "Standard DC" -} void HeatingTestSendResonse(uint32_t status, bool last,bool heater1Active,bool heater2Active, int temperature1, int temperature2,int Heater1Percentage,int Heater2Percentage, char* Message) - -}*/ - //HeatingTestSendResonse(0, false,true,true, MotorDriverRequest[22].Speed,MotorDriverRequest[18].Speed,MotorDriverRequest[15].Speed,MotorDriverRequest[3].Speed, "MotorSpeed"); - - //HeatingTestSendResonse(0, false,true,true, /*OriginalMotorSpd_2PPS[index]*/_speed,OriginalMotorSpd_2PPS[index]/*(int)error_integered*/,MotorControlConfig[index].m_calculatedError,ReadValue, "FeederSpeed"); - // pooler_counter = 0; - } - } return OK; } |
