diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-12-13 01:36:14 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-12-13 01:36:14 +0200 |
| commit | 10ed2886c61b94ed0ec294e40d260d2a69ef2cc1 (patch) | |
| tree | fd439c24cf0cd48350f42cbfa54aeb90d563e5da /Software/Embedded_SW/Embedded/Modules/Control | |
| parent | 2a73ff05b9bf95da0f9fe10aa7823bd70f01f01e (diff) | |
| parent | a793aababd2b255dda42540715792167164e1e94 (diff) | |
| download | Tango-10ed2886c61b94ed0ec294e40d260d2a69ef2cc1.tar.gz Tango-10ed2886c61b94ed0ec294e40d260d2a69ef2cc1.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 5 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index eb72de61b..ad5a1d5ca 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -544,8 +544,12 @@ int MillisecCalculateTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId) calc = TemperatureSum[SensorId] / (TemperatureCount[SensorId]-2); if (TemperatureSum[SensorId]>10) { + if(abs(TemperatureMax[SensorId]-TemperatureMin[SensorId])>2000) + { + if ((Head_Type == HEAD_TYPE_FLAT_WITHOUT_CARD)||(SensorId!=TEMP_SENSE_AN_ENCLOSURETEMP3)) Report("Millisec Temp spike",__FILE__,SensorId,(int)TemperatureMax[SensorId],RpWarning,(int) TemperatureMin[SensorId],0); + } } TemperatureSum[SensorId] = 0; TemperatureCount[SensorId] = 0; @@ -645,7 +649,6 @@ uint32_t MillisecLowLoop(uint32_t tick) //Screw_ENC_Velocity_to_DAC(); - for testing the screw enc if (Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD) StartPT100 = TEMP_SENSE_ANALOG_DRYER_TEMP1; - if (Ten_msTick) { //Speed_Data = Read_Speed_Sensor_TypeII(); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index e02bd8191..e6da43178 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -83,6 +83,7 @@ typedef struct DataReadCBFunction ControlDataReadPtr; ControlCBFunction ControlCallbackPtr; uint32_t ControlTiming; + uint32_t LastCalled; char *Name; }ControlDeviceStruc; @@ -613,10 +614,13 @@ uint32_t ControlLowLoop(uint32_t tick) { if (tick - ControlArray[ControlLowDevice_i].StartTick<=skipped_ticks) continue; + if (tick - ControlArray[ControlLowDevice_i].LastCalled<=skipped_ticks) + continue; if (ControlArray[ControlLowDevice_i].ControlTiming == eOneMillisecond) continue; if (ControlArray[ControlLowDevice_i].StartTick == tick) continue; + ControlArray[ControlLowDevice_i].LastCalled = tick; if (((tick - ControlArray[ControlLowDevice_i].StartTick)%ControlArray[ControlLowDevice_i].ControlTiming)<=skipped_ticks) // run the control on exact intervals { |
