aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-13 01:30:54 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-13 01:30:54 +0200
commita793aababd2b255dda42540715792167164e1e94 (patch)
tree16be906cfaf2300839d6dfbdb744789c648c2828 /Software/Embedded_SW/Embedded/Modules/Control
parenta63b5db93859fac695d1b9faea23b79e3a070179 (diff)
parent283c4c55b62346772a5d1b48f4efc2504067cbfc (diff)
downloadTango-a793aababd2b255dda42540715792167164e1e94.tar.gz
Tango-a793aababd2b255dda42540715792167164e1e94.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c5
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c4
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
{