Merge pull request #24 from emmanuelsrlok/ecruz/ChillerUpdate
Ecruz/chiller update
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = ATS_Woodward_DTSC200A_TCP ; Select here the name of the configuration you want to download
|
default_envs = ATS_Eaton_ATC900_RPD_TCP ; Select here the name of the configuration you want to download
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
upload_port = COM15
|
upload_port = COM15
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -56,7 +56,9 @@ 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,10 +41,10 @@ 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 AC", 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 AC", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 2 Volts CA", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
addStrategy("Source 1 Frequency", new SingleValueStrategy(0.0f, 0.0f, 1000));
|
addStrategy("Source 1 Frequency", new SingleValueStrategy(0.0f, 0.0f, 1000));
|
||||||
addStrategy("Source 2 Frequency", new SingleValueStrategy(60.0f, 1.0f, 1000));
|
addStrategy("Source 2 Frequency", new SingleValueStrategy(60.0f, 1.0f, 1000));
|
||||||
|
|
||||||
@@ -83,9 +83,9 @@ State<ModbusIP>* RunningState<ModbusIP>::update(Equipment<ModbusIP>* equipment)
|
|||||||
float load = static_cast<float>(I_load);
|
float load = static_cast<float>(I_load);
|
||||||
float rating = static_cast<float>(I_rating);
|
float rating = static_cast<float>(I_rating);
|
||||||
float real_load = rating * (load/100.0f);
|
float real_load = rating * (load/100.0f);
|
||||||
Strategy_Behavior* ampsA_svs = getStrategy("S2 Amps A");
|
Strategy_Behavior* ampsA_svs = getStrategy("Amps A");
|
||||||
Strategy_Behavior* ampsB_svs = getStrategy("S2 Amps B");
|
Strategy_Behavior* ampsB_svs = getStrategy("Amps B");
|
||||||
Strategy_Behavior* ampsC_svs = getStrategy("S2 Amps C");
|
Strategy_Behavior* ampsC_svs = getStrategy("Amps C");
|
||||||
|
|
||||||
static_cast<SingleValueStrategy*>(ampsA_svs)->setSetpoint(real_load);
|
static_cast<SingleValueStrategy*>(ampsA_svs)->setSetpoint(real_load);
|
||||||
static_cast<SingleValueStrategy*>(ampsB_svs)->setSetpoint(real_load);
|
static_cast<SingleValueStrategy*>(ampsB_svs)->setSetpoint(real_load);
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ StandbyState<ModbusIP>::StandbyState() {
|
|||||||
// You can add initialization code here if needed
|
// You can add initialization code here if needed
|
||||||
addStrategy("Source 1 Volts AB", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 1 Volts AB", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
addStrategy("Source 1 Volts BC", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 1 Volts BC", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
addStrategy("Source 1 Volts AC", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
addStrategy("Source 1 Volts CA", new SingleValueStrategy(480.0F, 2.0f, 1000));
|
||||||
addStrategy("Source 2 Volts AB", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
addStrategy("Source 2 Volts AB", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
||||||
addStrategy("Source 2 Volts BC", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
addStrategy("Source 2 Volts BC", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
||||||
addStrategy("Source 2 Volts AC", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
addStrategy("Source 2 Volts CA", new SingleValueStrategy(0.0F, 0.0f, 1000));
|
||||||
addStrategy("Source 1 Frequency", new SingleValueStrategy(60.0f, 1.0f, 1000));
|
addStrategy("Source 1 Frequency", new SingleValueStrategy(60.0f, 1.0f, 1000));
|
||||||
addStrategy("Source 2 Frequency", new SingleValueStrategy(0.0f, 0.0f, 1000));
|
addStrategy("Source 2 Frequency", new SingleValueStrategy(0.0f, 0.0f, 1000));
|
||||||
|
|
||||||
@@ -78,9 +78,9 @@ State<ModbusIP>* StandbyState<ModbusIP>::update(Equipment<ModbusIP>* equipment)
|
|||||||
float load = static_cast<float>(I_load);
|
float load = static_cast<float>(I_load);
|
||||||
float rating = static_cast<float>(I_rating);
|
float rating = static_cast<float>(I_rating);
|
||||||
float real_load = rating * (load/100.0f);
|
float real_load = rating * (load/100.0f);
|
||||||
Strategy_Behavior* ampsA_svs = getStrategy("S1 Amps A");
|
Strategy_Behavior* ampsA_svs = getStrategy("Amps A");
|
||||||
Strategy_Behavior* ampsB_svs = getStrategy("S1 Amps B");
|
Strategy_Behavior* ampsB_svs = getStrategy("Amps B");
|
||||||
Strategy_Behavior* ampsC_svs = getStrategy("S1 Amps C");
|
Strategy_Behavior* ampsC_svs = getStrategy("Amps C");
|
||||||
|
|
||||||
static_cast<SingleValueStrategy*>(ampsA_svs)->setSetpoint(real_load);
|
static_cast<SingleValueStrategy*>(ampsA_svs)->setSetpoint(real_load);
|
||||||
static_cast<SingleValueStrategy*>(ampsB_svs)->setSetpoint(real_load);
|
static_cast<SingleValueStrategy*>(ampsB_svs)->setSetpoint(real_load);
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#include <ModbusIP_ESP8266.h>
|
#include <ModbusIP_ESP8266.h>
|
||||||
const char *ssid = "QTS_CDR_Arduino"; /**< @brief The SSID of the WiFi network. */
|
const char *ssid = "esrlok_portable"; /**< @brief The SSID of the WiFi network. */
|
||||||
const char *password = "123abc456"; /**< @brief The password for the WiFi network. */
|
const char *password = "m7g6eNMe?cy8S@z"; /**< @brief The password for the WiFi network. */
|
||||||
IPAddress local_IP(172, 17, 30, 241); /**< @brief The static IP address for the device. */
|
IPAddress local_IP(192, 168, 1, 15); /**< @brief The static IP address for the device. */
|
||||||
IPAddress gateway(172, 17, 30, 1); /**< @brief The gateway IP address. */
|
IPAddress gateway(192, 168, 1, 1); /**< @brief The gateway IP address. */
|
||||||
IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */
|
IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */
|
||||||
|
|
||||||
ModbusIP mb;
|
ModbusIP mb;
|
||||||
@@ -62,8 +62,8 @@ modbusMap mb_map[] =
|
|||||||
{
|
{
|
||||||
{HR, 9, 0, "ATS_Source"}, //Internal to control from Modscan
|
{HR, 9, 0, "ATS_Source"}, //Internal to control from Modscan
|
||||||
{HR, 10, 0, "ATS_Load"}, //Internal Fault code from Modscan
|
{HR, 10, 0, "ATS_Load"}, //Internal Fault code from Modscan
|
||||||
{HR, 11, 0, "ATS_Input"}, //Internal Fault code from Modscan
|
{HR, 11, 0, "ATS_Rating"}, //Internal Fault code from Modscan
|
||||||
{HR, 12, 0, "ATS_Fault"}, //Internal Fault code from Modscan
|
{HR, 12, 0, "ATS_Input"}, //Internal Fault code from Modscan
|
||||||
{DI, 999, 0, "Source 1 Available"},
|
{DI, 999, 0, "Source 1 Available"},
|
||||||
{DI, 1000, 0, "Source 2 Available"},
|
{DI, 1000, 0, "Source 2 Available"},
|
||||||
{DI, 1001, 0, "Source 1 Active"},
|
{DI, 1001, 0, "Source 1 Active"},
|
||||||
|
|||||||
Reference in New Issue
Block a user