From aa204e615ebeb67df394ac730888d8535af11957 Mon Sep 17 00:00:00 2001 From: RobertJDavis Date: Thu, 6 Nov 2025 17:40:55 -0700 Subject: [PATCH] PHX3 uploading to EPMS devices Changed "SEL_2440 (MVG)" to "SEL_2440_MVG" so device can load onto Arduino. Uploaded existing EPMS code to PHX3 EPMS Arduinos. Changes to run status bit of UMAS CRAH. Modified a few PHX3 VFD ACH580 registers from HR to HR_10x. --- platformio.ini | 17 +++++++++++-- src/BMS/CHILLER/CH_York_YVAA_RTU/config.h | 4 +-- src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.cpp | 25 ------------------- src/BMS/CRAH/CRAH_UMAS_TCP/State_Fail.cpp | 2 +- src/BMS/CRAH/CRAH_UMAS_TCP/State_Running.cpp | 4 +-- src/BMS/CRAH/CRAH_UMAS_TCP/State_Standby.cpp | 2 +- src/BMS/CRAH/CRAH_UMAS_TCP/config.h | 18 ++++++------- src/BMS/VFD/PHX3_VFD_ABB_ACH580_RTU/config.h | 14 +++++------ .../ATS/ATS_Woodward_DTSC200A_TCP/config.h | 6 ++--- src/EPMS/Breaker/BKR_ABB_EMax2_TCP/config.h | 8 +++--- src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h | 6 ++--- src/EPMS/GEN/GEN_HSE/config.h | 8 +++--- .../README.md | 0 .../State_Fail.cpp | 0 .../State_Running.cpp | 0 .../State_Standby.cpp | 0 .../{SEL_2440 (MVG) => SEL_2440_MVG}/config.h | 8 +++--- .../{SEL_2440 (MVG) => SEL_2440_MVG}/main.cpp | 0 18 files changed, 55 insertions(+), 67 deletions(-) rename src/EPMS/MVG/{SEL_2440 (MVG) => SEL_2440_MVG}/README.md (100%) rename src/EPMS/MVG/{SEL_2440 (MVG) => SEL_2440_MVG}/State_Fail.cpp (100%) rename src/EPMS/MVG/{SEL_2440 (MVG) => SEL_2440_MVG}/State_Running.cpp (100%) rename src/EPMS/MVG/{SEL_2440 (MVG) => SEL_2440_MVG}/State_Standby.cpp (100%) rename src/EPMS/MVG/{SEL_2440 (MVG) => SEL_2440_MVG}/config.h (88%) rename src/EPMS/MVG/{SEL_2440 (MVG) => SEL_2440_MVG}/main.cpp (100%) diff --git a/platformio.ini b/platformio.ini index efbda27..2ff69aa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,6 @@ [platformio] - default_envs = CH_York_YVAA_RTU ; Select here the name of the configuration you want to download [env] @@ -232,4 +231,18 @@ platform = espressif32 board = dfrobot_firebeetle2_esp32e extends = common_env_options build_flags = -D USE_MODBUS_IP -build_src_filter = -<*> + \ No newline at end of file +build_src_filter = -<*> + + +[env:GEN_HSE] +platform = espressif32 +board = dfrobot_firebeetle2_esp32e +extends = common_env_options +build_flags = -D USE_MODBUS_IP +build_src_filter = -<*> + + +[env:SEL_2440_MVG] +platform = espressif32 +board = dfrobot_firebeetle2_esp32e +extends = common_env_options +build_flags = -D USE_MODBUS_IP +build_src_filter = -<*> + \ No newline at end of file diff --git a/src/BMS/CHILLER/CH_York_YVAA_RTU/config.h b/src/BMS/CHILLER/CH_York_YVAA_RTU/config.h index ee3284c..86dc254 100644 --- a/src/BMS/CHILLER/CH_York_YVAA_RTU/config.h +++ b/src/BMS/CHILLER/CH_York_YVAA_RTU/config.h @@ -54,7 +54,7 @@ */ modbusMap mb_map[] = { - {COIL, 0, 0, "Chiller Start Command"}, // Use in Modscan - Hard IO in SCP, Used for Arduino simulation only. Signal should come from PLC. + {COIL, 0, 1, "Chiller Start Command"}, // Use in Modscan - Hard IO in SCP, Used for Arduino simulation only. Signal should come from PLC. {COIL, 1, 0, "Sys 1 Alarm"}, // Use in Modscan - Hard IO in SCP, Used for Arduino simulation only --> INDICATION ONLY (assumption) {COIL, 2, 0, "Sys 2 Alarm"}, // Use in Modscan - Hard IO in SCP, Used for Arduino simulation only --> INDICATION ONLY (assumption) {COIL, 3, 0, "Sys 1 Fan Fault ON"}, // Use in Modscan - Used for Arduino simulation only --> FAILSTATE (assumption) @@ -99,7 +99,7 @@ modbusMap mb_map[] = {HR, 31, 77, "Sys 2 Operational Code"}, // 77:not running, 78:running, 82:free cooling {HR, 32, 0, "Sys 2 Fault Code"}, // 56:condenser fan VSD warning - {HR, 39, 0, "Local Leaving Temp Setpoint"}, + {HR, 39, 72, "Local Leaving Temp Setpoint"}, {HR_10x, 49, 0, "Sys 2 Condenser Temp"}, {HR_10x, 140, 0, "Sys 1 Fan KW"}, diff --git a/src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.cpp b/src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.cpp index f980695..8fdfcc1 100644 --- a/src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.cpp +++ b/src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.cpp @@ -119,29 +119,4 @@ void updateAnalogs(Equipment* equipment){ else if (equipment->getModbus_Point("RA Humidity High Alarm ON")->getValue()==1){ equipment->setModbus_Point("Return Air Humidity", 65.0f); } -} - -/** - * @brief This function is used to update the Control Mode (feedback), - * based on the selected BMS Control Source and BMS Enable Source. - * - * This is a function used in the update() of the Standby, Running, and Fail States. - * -*/ -void checkHB(Equipment* equipment){ - Modbus_Point* PLC_Heartbeat = equipment -> getModbus_Point ("PLC Heartbeat"); - int BMS_Control_Source = BMS_Control_Source_Pt ? BMS_Control_Source_Pt->getValue() : 0; - int BMS_Enable_Source = BMS_Enable_Source_Pt ? BMS_Enable_Source_Pt->getValue() : 0; - int Control_Mode_Selected = Control_Mode_Pt ? Control_Mode_Pt->getValue() : -1; - - if (BMS_Control_Source == 0 && BMS_Enable_Source == 2) { - Control_Mode_Selected = 0; - } else if (BMS_Control_Source == 1 && BMS_Enable_Source == 2) { - Control_Mode_Selected = 1; - } else if (BMS_Enable_Source == 0) { - Control_Mode_Selected = 2; - } - equipment->setModbus_Point("Control Mode Selected", Control_Mode_Selected); - - equipment->setModbus_Point("General Alarm", 0); } \ No newline at end of file diff --git a/src/BMS/CRAH/CRAH_UMAS_TCP/State_Fail.cpp b/src/BMS/CRAH/CRAH_UMAS_TCP/State_Fail.cpp index eed9417..ceeb819 100644 --- a/src/BMS/CRAH/CRAH_UMAS_TCP/State_Fail.cpp +++ b/src/BMS/CRAH/CRAH_UMAS_TCP/State_Fail.cpp @@ -116,7 +116,7 @@ void FailState::enterState(Equipment* equipment) { for (const auto& desc : motorStatusDescriptions) { Modbus_Point* point = equipment->getModbus_Point(desc); if (point) { - point->setValue(1); + point->setValue(0); } }; diff --git a/src/BMS/CRAH/CRAH_UMAS_TCP/State_Running.cpp b/src/BMS/CRAH/CRAH_UMAS_TCP/State_Running.cpp index a7b797b..a1c8f16 100644 --- a/src/BMS/CRAH/CRAH_UMAS_TCP/State_Running.cpp +++ b/src/BMS/CRAH/CRAH_UMAS_TCP/State_Running.cpp @@ -176,7 +176,7 @@ void RunningState::enterState(Equipment* equipment) { for (const auto& desc : motorStatusDescriptions) { Modbus_Point* point = equipment->getModbus_Point(desc); if (point) { - point->setValue(0); + point->setValue(1); } } } @@ -201,7 +201,7 @@ void RunningState::exitState(Equipment* equipment) { for (const auto& desc : motorStatusDescriptions) { Modbus_Point* point = equipment->getModbus_Point(desc); if (point) { - point->setValue(1); + point->setValue(0); } } } \ No newline at end of file diff --git a/src/BMS/CRAH/CRAH_UMAS_TCP/State_Standby.cpp b/src/BMS/CRAH/CRAH_UMAS_TCP/State_Standby.cpp index 5c86a7a..2b78791 100644 --- a/src/BMS/CRAH/CRAH_UMAS_TCP/State_Standby.cpp +++ b/src/BMS/CRAH/CRAH_UMAS_TCP/State_Standby.cpp @@ -126,7 +126,7 @@ void StandbyState::enterState(Equipment* equipment) { for (const auto& desc : motorStatusDescriptions) { Modbus_Point* point = equipment->getModbus_Point(desc); if (point) { - point->setValue(1); + point->setValue(0); } }; diff --git a/src/BMS/CRAH/CRAH_UMAS_TCP/config.h b/src/BMS/CRAH/CRAH_UMAS_TCP/config.h index 409f130..186fa3b 100644 --- a/src/BMS/CRAH/CRAH_UMAS_TCP/config.h +++ b/src/BMS/CRAH/CRAH_UMAS_TCP/config.h @@ -99,15 +99,15 @@ modbusMap mb_map[] = {IR, 50, 0, "Alarm Fan 7"}, {IR, 54, 0, "Alarm Fan 8"}, {IR, 58, 0, "Alarm Fan 9"}, - {IR, 27, 1, "Run Status Fan 1"}, // Send to PLC - {IR, 31, 1, "Run Status Fan 2"}, // Send to PLC - {IR, 35, 1, "Run Status Fan 3"}, // Send to PLC - {IR, 39, 1, "Run Status Fan 4"}, // Send to PLC - {IR, 43, 1, "Run Status Fan 5"}, // Send to PLC - {IR, 47, 1, "Run Status Fan 6"}, // Send to PLC - {IR, 51, 1, "Run Status Fan 7"}, // Send to PLC - {IR, 55, 1, "Run Status Fan 8"}, // Send to PLC - {IR, 59, 1, "Run Status Fan 9"}, // Send to PLC + {IR, 27, 0, "Run Status Fan 1"}, // Send to PLC + {IR, 31, 0, "Run Status Fan 2"}, // Send to PLC + {IR, 35, 0, "Run Status Fan 3"}, // Send to PLC + {IR, 39, 0, "Run Status Fan 4"}, // Send to PLC + {IR, 43, 0, "Run Status Fan 5"}, // Send to PLC + {IR, 47, 0, "Run Status Fan 6"}, // Send to PLC + {IR, 51, 0, "Run Status Fan 7"}, // Send to PLC + {IR, 55, 0, "Run Status Fan 8"}, // Send to PLC + {IR, 59, 0, "Run Status Fan 9"}, // Send to PLC {IR, 25, 0, "Speed Fan 1"}, {IR, 29, 0, "Speed Fan 2"}, {IR, 33, 0, "Speed Fan 3"}, diff --git a/src/BMS/VFD/PHX3_VFD_ABB_ACH580_RTU/config.h b/src/BMS/VFD/PHX3_VFD_ABB_ACH580_RTU/config.h index 79b6515..78bff06 100644 --- a/src/BMS/VFD/PHX3_VFD_ABB_ACH580_RTU/config.h +++ b/src/BMS/VFD/PHX3_VFD_ABB_ACH580_RTU/config.h @@ -66,12 +66,12 @@ modbusMap mb_map[] = {HR, 100, 0, "Speed Feedback"}, // 1800 rpm max {HR, 105, 0, "Output Frequency"}, // 60 Hz @100% speed {HR, 106, 0, "Motor Current"}, // 65 FLA - {HR, 109, 0, "Motor Torque"}, // % of nominal torque - {HR, 110, 0, "DC Voltage"}, // approx 678 VDC @100% speed + {HR_10x, 109, 0, "Motor Torque"}, // % of nominal torque + {HR_10x, 110, 0, "DC Voltage"}, // approx 678 VDC @100% speed {HR, 112, 0, "Output Voltage"}, // 480 VAC - {HR, 116, 0, "Motor Shaft Power"}, // 50 hp ~ 36.77 kW + {HR_10x, 116, 0, "Motor Shaft Power"}, // 50 hp ~ 36.77 kW {HR, 118, 0, "Inverter MWh counter"}, - {HR, 119, 0, "Inverter kWh counter"}, + {HR_10x, 119, 0, "Inverter kWh counter"}, {HR, 510, 0, "Inverter Temperature"}, // RJD: Changed from HR_10x to HR, % of fault limit {HR, 519, 0, "Diagnostic Word"}, // not used in program. Bit 9:Drive Over-Temp Alarm @@ -83,10 +83,10 @@ modbusMap mb_map[] = {HR, 4600, 0, "Speed Scaling"}, // ADD: 1800 rpm {HR, 4601, 0, "Frequency Scaling"}, // ADD: 60 Hz {HR, 9905, 0, "Nominal Current"}, // ADD: 65 A - {HR, 9906, 0, "Nominal Voltage"}, // ADD: 480 V - {HR, 9907, 0, "Nominal Frequency"}, // ADD: 60 Hz + {HR_10x, 9906, 0, "Nominal Voltage"}, // ADD: 480 V + {HR_10x, 9907, 0, "Nominal Frequency"}, // ADD: 60 Hz {HR, 9908, 0, "Nominal Speed"}, // ADD: 1800 rpm - {HR, 9909, 0, "Nominal Power"}, // ADD: 50 hp + {HR_10x, 9909, 0, "Nominal Power"}, // ADD: 50 hp }; //Size of modbus map used in FOR cycles, automatically calculated. diff --git a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h index 3f7bcf0..1223b95 100644 --- a/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h +++ b/src/EPMS/ATS/ATS_Woodward_DTSC200A_TCP/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "QTS_CDR_Arduino"; /**< @brief The SSID of the WiFi network. */ + const char *ssid = "ArduinoWifiB"; /**< @brief The SSID of the WiFi network. */ const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(172, 17, 33, 173); /**< @brief The static IP address for the device. */ - IPAddress gateway(172, 17, 33, 1); /**< @brief The gateway IP address. */ + IPAddress local_IP(172, 17, 32, 82); /**< @brief The static IP address for the device. */ + IPAddress gateway(172, 17, 32, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ ModbusIP mb; diff --git a/src/EPMS/Breaker/BKR_ABB_EMax2_TCP/config.h b/src/EPMS/Breaker/BKR_ABB_EMax2_TCP/config.h index 3887572..22baf7d 100644 --- a/src/EPMS/Breaker/BKR_ABB_EMax2_TCP/config.h +++ b/src/EPMS/Breaker/BKR_ABB_EMax2_TCP/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "wifi_name"; /**< @brief The SSID of the WiFi network. */ - const char *password = "wifi_password"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(172, 17, 22, 152); /**< @brief The static IP address for the device. */ - IPAddress gateway(172, 17, 22, 254); /**< @brief The gateway IP address. */ + const char *ssid = "ArduinoWifiB"; /**< @brief The SSID of the WiFi network. */ + const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ + IPAddress local_IP(172, 17, 32, 90); /**< @brief The static IP address for the device. */ + IPAddress gateway(172, 17, 32, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ ModbusIP mb; diff --git a/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h b/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h index b77bc05..7dd406b 100644 --- a/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h +++ b/src/EPMS/Breaker/BKR_ABB_XT_TCP/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "QTS_CDR_Arduino"; /**< @brief The SSID of the WiFi network. */ + const char *ssid = "ArduinoWifiB"; /**< @brief The SSID of the WiFi network. */ const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(172, 17, 33, 154); /**< @brief The static IP address for the device. */ - IPAddress gateway(172, 17, 33, 1); /**< @brief The gateway IP address. */ + IPAddress local_IP(172, 17, 32, 102); /**< @brief The static IP address for the device. */ + IPAddress gateway(172, 17, 32, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ ModbusIP mb; diff --git a/src/EPMS/GEN/GEN_HSE/config.h b/src/EPMS/GEN/GEN_HSE/config.h index 49fa677..f5c4439 100644 --- a/src/EPMS/GEN/GEN_HSE/config.h +++ b/src/EPMS/GEN/GEN_HSE/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "wifi_name"; /**< @brief The SSID of the WiFi network. */ - const char *password = "wifi_password"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(192, 168, 1, 234); /**< @brief The static IP address for the device. */ - IPAddress gateway(192, 168, 1, 1); /**< @brief The gateway IP address. */ + const char *ssid = "ArduinoWifiB"; /**< @brief The SSID of the WiFi network. */ + const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ + IPAddress local_IP(172, 17, 32, 81); /**< @brief The static IP address for the device. */ + IPAddress gateway(172, 17, 32, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ ModbusIP mb; diff --git a/src/EPMS/MVG/SEL_2440 (MVG)/README.md b/src/EPMS/MVG/SEL_2440_MVG/README.md similarity index 100% rename from src/EPMS/MVG/SEL_2440 (MVG)/README.md rename to src/EPMS/MVG/SEL_2440_MVG/README.md diff --git a/src/EPMS/MVG/SEL_2440 (MVG)/State_Fail.cpp b/src/EPMS/MVG/SEL_2440_MVG/State_Fail.cpp similarity index 100% rename from src/EPMS/MVG/SEL_2440 (MVG)/State_Fail.cpp rename to src/EPMS/MVG/SEL_2440_MVG/State_Fail.cpp diff --git a/src/EPMS/MVG/SEL_2440 (MVG)/State_Running.cpp b/src/EPMS/MVG/SEL_2440_MVG/State_Running.cpp similarity index 100% rename from src/EPMS/MVG/SEL_2440 (MVG)/State_Running.cpp rename to src/EPMS/MVG/SEL_2440_MVG/State_Running.cpp diff --git a/src/EPMS/MVG/SEL_2440 (MVG)/State_Standby.cpp b/src/EPMS/MVG/SEL_2440_MVG/State_Standby.cpp similarity index 100% rename from src/EPMS/MVG/SEL_2440 (MVG)/State_Standby.cpp rename to src/EPMS/MVG/SEL_2440_MVG/State_Standby.cpp diff --git a/src/EPMS/MVG/SEL_2440 (MVG)/config.h b/src/EPMS/MVG/SEL_2440_MVG/config.h similarity index 88% rename from src/EPMS/MVG/SEL_2440 (MVG)/config.h rename to src/EPMS/MVG/SEL_2440_MVG/config.h index 3b97232..88714a4 100644 --- a/src/EPMS/MVG/SEL_2440 (MVG)/config.h +++ b/src/EPMS/MVG/SEL_2440_MVG/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "wifi_name"; /**< @brief The SSID of the WiFi network. */ - const char *password = "wifi_password"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(192, 168, 1, 234); /**< @brief The static IP address for the device. */ - IPAddress gateway(192, 168, 1, 1); /**< @brief The gateway IP address. */ + const char *ssid = "ArduinoWifiB"; /**< @brief The SSID of the WiFi network. */ + const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ + IPAddress local_IP(172, 17, 32, 88); /**< @brief The static IP address for the device. */ + IPAddress gateway(172, 17, 32, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ ModbusIP mb; diff --git a/src/EPMS/MVG/SEL_2440 (MVG)/main.cpp b/src/EPMS/MVG/SEL_2440_MVG/main.cpp similarity index 100% rename from src/EPMS/MVG/SEL_2440 (MVG)/main.cpp rename to src/EPMS/MVG/SEL_2440_MVG/main.cpp