diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-18 13:22:38 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-18 13:22:38 +0300 |
| commit | 28bd12840b74ce42a9c63eb9f909b925d067d80d (patch) | |
| tree | 1b85b039244c8c50fbf5bb5933065a07412cb677 /Software/Embedded_SW/Embedded/Modules | |
| parent | 02bc7f8e417b1c24eb35764167ad068452a36e2a (diff) | |
| parent | 27f843a93af1fdda7e79ad4e1579f7f2de3d2e8d (diff) | |
| download | Tango-28bd12840b74ce42a9c63eb9f909b925d067d80d.tar.gz Tango-28bd12840b74ce42a9c63eb9f909b925d067d80d.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
7 files changed, 54 insertions, 14 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index 047500c19..452643ed3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -351,7 +351,7 @@ uint32_t HeaterRecalculateSharedHeatersParams(uint32_t deviceId, uint32_t new_ou Heater1000Slices = HeaterControl[HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w].outputproportionalpowerlimit * NumberOFSlicesInUse / 100; Heater200aSlices = HeaterControl[HARDWARE_PID_CONTROL_TYPE__DryerHeater200w1].outputproportionalpowerlimit * NumberOFSlicesInUse / 100; -#warning temporary disable time slice control as we are working with one heater in run time +//#warning temporary disable time slice control as we are working with one heater in run time /* if ((Heater1000Slices + Heater200aSlices +2)>NumberOFSlicesInUse) { LOG_ERROR (NumberOFSlicesInUse, "proportional time slices too high too high"); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index e6042953a..4c25aa508 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -46,7 +46,7 @@ HeaterCommand HeaterCmd[MAX_HEATERS_NUM]; uint32_t ControlIdtoHeaterId [MAX_HEATERS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; uint32_t DryerHeaterMaxTempControl = 0xFF; #warning the PT100 id for the dryer control is number2 - dryer internal ambient sensor. -//#warning the PT100 for head 4 is number 5 + uint32_t HeaterId2PT100Id[MAX_HEATERS_NUM] = {TEMP_SENSE_ANALOG_DRYER_TEMP2,TEMP_SENSE_ANALOG_DRYER_TEMP1,TEMP_SENSE_ANALOG_DRYER_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,TEMP_SENSE_ANALOG_MIXCHIP_TEMP}; uint32_t DryerInternalPT100Id = TEMP_SENSE_ANALOG_DRYER_TEMP3; bool HeatersRestart = false; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h index c96078771..a3134c303 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h @@ -14,6 +14,7 @@ uint32_t IDSPrepareState(void *JobDetails); uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId); uint32_t IDSSegmentState(void *JobDetails, int SegmentId); +uint32_t IDSDistanceToSpoolState(void); uint32_t IDSEndState(void *JobDetails); uint32_t IDS_DispenserPidRequestMessage(HardwarePidControl* request); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index bea552f59..bfdb7b5d7 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -47,6 +47,7 @@ uint32_t ControlIdtoDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xF int OriginalDispenserSpd_2PPS[MAX_SYSTEM_DISPENSERS] = {0,0,0,0,0,0,0,0}; bool DispenserPreSegmentReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; bool DispenserSegmentReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; +bool DispenserDistanceToSpoolReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; int JobBrushStopId = 0; uint32_t IDS_DispenserPidRequestMessage(HardwarePidControl* request) @@ -134,7 +135,6 @@ void DispenserPrepareReady(void) DispenserControlConfig[Motor_i].m_SetParam = 0;//need to update SetParams on presegment stage MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize); //set the dispenser to the -#warning activate valve /*Start the dispensers to build initial pressure * check different handling for dispensers that participate in the first segment and idle dispensers * start control for initial pressure @@ -166,7 +166,8 @@ void DispenserPrepareReady(void) PreSegmentReady(Module_IDS,ModuleDone); return OK; // all configured heaters are ready } - //******************************************************************************************************************** + +//******************************************************************************************************************** uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) { //set the speed only before the first segment, speed is constant accros job @@ -280,6 +281,41 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) return OK; } + //******************************************************************************************************************** + uint32_t IDS_Valve_DistanceToSpoolReady(uint32_t deviceID, uint32_t ReadValue) + { + int i; + DispenserDistanceToSpoolReady[deviceID] = true; + for (i=0;i<MAX_SYSTEM_DISPENSERS;i++) + { + if (DispenserDistanceToSpoolReady[i] == false) + { + return OK; //not all configured heaters are ready + } + } + DistanceToSpoolReady(Module_IDS,ModuleDone); + return OK; // all configured heaters are ready + } + //******************************************************************************************************************** + uint32_t IDSDistanceToSpoolState(void) + { + int Dispenser_i,DispenserId; + TimerMotors_t HW_Motor_Id; + + for (Dispenser_i = 0;Dispenser_i < MAX_SYSTEM_DISPENSERS;Dispenser_i++) + { + HW_Motor_Id = DispenserIdToMotorId[Dispenser_i]; + if (MotorsCfg[HW_Motor_Id].hardwaremotortype != DispenserIdToMotorId[Dispenser_i])//unconfigured dispenser + continue; + DispenserDistanceToSpoolReady[Dispenser_i] = false; + Control3WayValvesWithCallback ((Valves_t)Dispenser_i, MidTank_Dispenser, IDS_Valve_DistanceToSpoolReady); //direction: MidTank_Dispenser or Dispenser_Mixer + + MotorStop(HW_Motor_Id,Hard_Hiz); + + } + + return OK; + } //******************************************************************************************************************** uint32_t IDSEndState(void *JobDetails) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index a8ca46574..0ec10a072 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -183,7 +183,7 @@ uint32_t CalculateNumberOfSteps (uint32_t Counter, bool direction) } } - return CalculateNumberOfSteps; + return NumberOfSteps; } uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag) @@ -225,7 +225,7 @@ uint32_t WinderPresegmentReady(uint32_t deviceID, uint32_t ReadValue) uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId) { - JobTicket* JobTicket = JobDetails; + //JobTicket* JobTicket = JobDetails; float screw_speed = 0; float RotationsPerSecond; @@ -280,18 +280,18 @@ uint32_t Winder_End(void) } void Winder_ScrewHomeLimitSwitchInterrupt(void) { - uint32_t status; + //uint32_t status; //handle glitch - send information to the next time that the motor stops if (Winder_ScrewHoming) { MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); //stop ASAP } - status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out + MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out } void Winder_ScrewOutLimitSwitchInterrupt(void) { //handle glitch - send information to the next time that the motor stops - uint32_t status; - status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out + //uint32_t status; + MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize);//make sure to move the cart out } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 56e88204f..df88da8c8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -11,6 +11,7 @@ #define FEEDER_DANCER HARDWARE_DANCER_TYPE__RightDancer #define NUM_OF_DANCERS HARDWARE_DANCER_TYPE__RightDancer+1 //} DANCER_ENUM; +extern double TotalProcessedLength; uint32_t InternalWindingConfigMessage(JobSpool* request); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 6a0bac394..ad3c731cb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -196,7 +196,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) } else { - SendJobProgress(TotalProcessedLength,0,false, "Progress"); + SendJobProgress(TotalProcessedLength,0,false, NULL); } } @@ -352,7 +352,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) for (i=0;i<MotorsControl[index].pvinputfilterfactormode;i++) avreageSampleValue += MotorSamples[index][i]; avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode; - //Stop Execution if the dancer moves too much + /* if (index == POOLER_MOTOR) { if (JobCounter > eOneSecond) @@ -365,10 +365,12 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) } } } + */ + //Stop Execution if the dancer moves too much 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); - + usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); + JobAbortedByUser = true; EndState(CurrentJob,Message ); } NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index]; |
