Merge pull request #25 from emmanuelsrlok/ecruz/ChillerUpdate
Chiller daiking return temp and flow switch added
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#include "Strategies/Strategy_PID.h"
|
#include "Strategies/Strategy_PID.h"
|
||||||
#include "Strategies/Strategy_Ramp.h"
|
#include "Strategies/Strategy_Ramp.h"
|
||||||
#include "Strategies/Strategy_Totalizer.h"
|
#include "Strategies/Strategy_Totalizer.h"
|
||||||
|
#include "Strategies/Strategy_SingleValue.h"
|
||||||
#include "Equipment/Equipment.h"
|
#include "Equipment/Equipment.h"
|
||||||
#include "ModbusPoints/Modbus_Point.h"
|
#include "ModbusPoints/Modbus_Point.h"
|
||||||
#include "ModbusPoints/Modbus_FloatDecorator.h"
|
#include "ModbusPoints/Modbus_FloatDecorator.h"
|
||||||
@@ -40,6 +41,7 @@ RunningState<ModbusRTU>::RunningState() {
|
|||||||
addStrategy("Actual Capacity", new PIDStrategy("Active SP", 1000, "Supply Temp"));
|
addStrategy("Actual Capacity", new PIDStrategy("Active SP", 1000, "Supply Temp"));
|
||||||
addStrategy("Comp1 Percent RLA", new RampStrategy(0.0f, 5.0f, 1000));
|
addStrategy("Comp1 Percent RLA", new RampStrategy(0.0f, 5.0f, 1000));
|
||||||
addStrategy("Comp2 Percent RLA", new RampStrategy(0.0f, 5.0f, 1000));
|
addStrategy("Comp2 Percent RLA", new RampStrategy(0.0f, 5.0f, 1000));
|
||||||
|
addStrategy("Return Temp", new SingleValueStrategy(85,3.0f, 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,7 +72,6 @@ State<ModbusRTU>* RunningState<ModbusRTU>::update(Equipment<ModbusRTU>* equipmen
|
|||||||
static_cast<PIDStrategy*>(PID_Strat)->setLimits(0.0f, highCapacityLimit);
|
static_cast<PIDStrategy*>(PID_Strat)->setLimits(0.0f, highCapacityLimit);
|
||||||
float currentSP = 50.0f; // Default value
|
float currentSP = 50.0f; // Default value
|
||||||
int currentMode = getPointValue(equipment, "Chiller Mode Output");
|
int currentMode = getPointValue(equipment, "Chiller Mode Output");
|
||||||
|
|
||||||
// Determine the correct setpoint based on the current operating mode.
|
// Determine the correct setpoint based on the current operating mode.
|
||||||
switch(currentMode){
|
switch(currentMode){
|
||||||
case 1:
|
case 1:
|
||||||
@@ -119,6 +120,8 @@ State<ModbusRTU>* RunningState<ModbusRTU>::update(Equipment<ModbusRTU>* equipmen
|
|||||||
setPointValue(equipment, "Chiller Mode Output", 2.0f);
|
setPointValue(equipment, "Chiller Mode Output", 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float SupplyTemp = getPointValue(equipment, "Supply Temp");
|
||||||
|
setPointValue(equipment, "Return Temp", SupplyTemp + 14.0f);
|
||||||
|
|
||||||
setPointValue(equipment, "Active SP", currentSP);
|
setPointValue(equipment, "Active SP", currentSP);
|
||||||
// Apply any strategies defined for the standby state
|
// Apply any strategies defined for the standby state
|
||||||
@@ -137,6 +140,8 @@ void RunningState<ModbusRTU>::enterState(Equipment<ModbusRTU>* equipment) {
|
|||||||
Serial.println("Enter Running State...");
|
Serial.println("Enter Running State...");
|
||||||
// You could also update a Modbus register to show the "standby" state
|
// You could also update a Modbus register to show the "standby" state
|
||||||
setPointValue(equipment, "Run Enabled", 1);
|
setPointValue(equipment, "Run Enabled", 1);
|
||||||
|
setPointValue(equipment, "Flow Switch", 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "ModbusPoints/Modbus_FloatDecorator.h"
|
#include "ModbusPoints/Modbus_FloatDecorator.h"
|
||||||
#include "Equipment/Equipment.h"
|
#include "Equipment/Equipment.h"
|
||||||
#include "Strategies/Strategy_Ramp.h"
|
#include "Strategies/Strategy_Ramp.h"
|
||||||
|
#include "Strategies/Strategy_SingleValue.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -33,6 +34,7 @@ template<>
|
|||||||
StandbyState<ModbusRTU>::StandbyState() {
|
StandbyState<ModbusRTU>::StandbyState() {
|
||||||
addStrategy("Comp1 Percent RLA", new RampStrategy(0,5,1000));
|
addStrategy("Comp1 Percent RLA", new RampStrategy(0,5,1000));
|
||||||
addStrategy("Comp2 Percent RLA", new RampStrategy(0,5,1000));
|
addStrategy("Comp2 Percent RLA", new RampStrategy(0,5,1000));
|
||||||
|
addStrategy("Return Temp", new SingleValueStrategy(85,3.0f, 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,6 +77,7 @@ void StandbyState<ModbusRTU>::enterState(Equipment<ModbusRTU>* equipment) {
|
|||||||
// Logic to run when the equipment enters this state
|
// Logic to run when the equipment enters this state
|
||||||
Serial.println("Enter Standby State...");
|
Serial.println("Enter Standby State...");
|
||||||
setPointValue(equipment, "Run Enabled", 0);
|
setPointValue(equipment, "Run Enabled", 0);
|
||||||
|
setPointValue(equipment, "Flow Switch", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ modbusMap mb_map[] =
|
|||||||
{HR, 100, 0, "State Control"}, //Internal to control from Modscan
|
{HR, 100, 0, "State Control"}, //Internal to control from Modscan
|
||||||
{HR, 101, 0, "Fault Code"},
|
{HR, 101, 0, "Fault Code"},
|
||||||
{HR_FLOAT, 102, 0, "Supply Temp"},
|
{HR_FLOAT, 102, 0, "Supply Temp"},
|
||||||
|
{HR_FLOAT, 103, 0, "Return Temp"}, //+14
|
||||||
|
{HR_FLOAT, 104, 0, "Flow Switch"},
|
||||||
{HR, 0, 0, "Chiller Local-Network"},
|
{HR, 0, 0, "Chiller Local-Network"},
|
||||||
{HR, 1, 0, "Chiller Enable Output"},
|
{HR, 1, 0, "Chiller Enable Output"},
|
||||||
{HR, 2, 0, "Run Enabled"},
|
{HR, 2, 0, "Run Enabled"},
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ RunningState<ModbusIP>::RunningState() {
|
|||||||
|
|
||||||
addStrategy("Source 1 Volts AB", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
addStrategy("Source 1 Volts AB", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
||||||
addStrategy("Source 1 Volts BC", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
addStrategy("Source 1 Volts BC", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
||||||
addStrategy("Source 1 Volts CA", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
addStrategy("Source 2 Volts CA", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
||||||
addStrategy("Source 2 Volts AB", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 2 Volts AB", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
addStrategy("Source 2 Volts BC", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 2 Volts BC", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
addStrategy("Source 2 Volts CA", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 2 Volts CA", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
|
|||||||
Reference in New Issue
Block a user