aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Heaters
diff options
context:
space:
mode:
authorRonen Sberlo <ronen.s@twine-s.com>2020-11-10 17:06:03 +0200
committerRonen Sberlo <ronen.s@twine-s.com>2020-11-10 17:06:03 +0200
commit499b4bfb9be0ac5347b20be783a73a0f81da675d (patch)
tree7996698fcae2e2f09a5c62fee05737e4f2703ca5 /Software/Embedded_SW/Embedded/Modules/Heaters
parente1256dfae6be171880ebe69868b100933f96afcb (diff)
downloadTango-499b4bfb9be0ac5347b20be783a73a0f81da675d.tar.gz
Tango-499b4bfb9be0ac5347b20be783a73a0f81da675d.zip
cross pressure sensors
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Heaters')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c19
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h2
2 files changed, 13 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
index 59a0aee51..42def625c 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c
@@ -58,7 +58,7 @@ extern uint8_t Head_Fan_PWM_Command[2];
uint32_t PressureSensorV0[2] = {0, 0};
uint8_t HeadBlowersCloseLoopTime[2] = {2, 2};
uint8_t HeadBlowersEnable = 1;
-uint8_t BlowerIdToSensorId[2] = {HEAD_PT100_ZONE_5_0X84_0, HEAD_PT100_ZONE_7_0X86_0}; //HEAD_FAN_RIGHT, HEAD_FAN_LEFT
+uint8_t BlowerIdToSensorId[2] = {HEAD_PT100_ZONE_7_0X86_0, HEAD_PT100_ZONE_5_0X84_0}; //HEAD_FAN_RIGHT, HEAD_FAN_LEFT
typedef struct
{
@@ -181,11 +181,16 @@ int HeadBlowerSensorIdToFanId(uint8_t sensorId)
return HEAD_FAN_LEFT;
}
+int HeadBlowerFanIdToBlowerId(uint8_t FanId)
+{
+ return BlowerIdToSensorId[FanId];
+}
+
bool HeadBlowerFlowControl(double Q_value, uint8_t blowerId)
{
double currentFlow = 0.0;
- currentFlow = PressureSensorGetPressure(BlowerIdToSensorId[blowerId]);
+ currentFlow = PressureSensorGetPressure(blowerId);
HeadBlowerPidFunc(Q_value,currentFlow, blowerId);
return OK;
}
@@ -270,7 +275,7 @@ void ArcHeadAlarms(void)
count4 = (count4 < 0)?(0):(count4);
}
- currentFlow = PressureSensorGetPressure(HEAD_PT100_ZONE_5_0X84_0);
+ currentFlow = PressureSensorGetPressure(HEAD_FAN_RIGHT);
if (currentFlow > 5.0) {
if (++count5 == ARC_ALARM_LIMIT)
AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH, true);
@@ -290,7 +295,7 @@ void ArcHeadAlarms(void)
count6 = (count6 < 0)?(0):(count6);
}
- currentFlow = PressureSensorGetPressure(HEAD_PT100_ZONE_7_0X86_0);
+ currentFlow = PressureSensorGetPressure(HEAD_FAN_LEFT);
if (currentFlow > 5.0) {
if (++count7 == ARC_ALARM_LIMIT)
AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH, true);
@@ -369,12 +374,12 @@ int HeadBlowersGetPWM(uint8_t blowerId)
return Head_Fan_PWM_Command[blowerId];
}
-double PressureSensorGetPressure(uint8_t SensorId)
+double PressureSensorGetPressure(uint8_t FanId)
{
double V0, Vm, Q;
- int FanId;
+ int SensorId;
- FanId = HeadBlowerSensorIdToFanId(SensorId);
+ SensorId = BlowerIdToSensorId[FanId];
V0 = PressureSensorV0[FanId];
Vm = (double)(MillisecGetTemperatures(SensorId));
Vm /= 10.0;
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
index a23abf559..ee60a75cc 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
@@ -44,7 +44,7 @@ uint32_t HeatersEnd(void);
void HeatersControlStart(void);
void HeatersControlStop(void);
uint32_t Heaters_Init(void);
-double PressureSensorGetPressure(uint8_t SensorId);
+double PressureSensorGetPressure(uint8_t FanId);
int HeadBlowersGetRPM(uint8_t fanId);
uint32_t PressureSensorInit();
void HeadBlowersInit();