ups update

This commit is contained in:
Emmanuel HC
2025-10-14 19:35:39 -05:00
parent a514780b14
commit f63f3a1ed1
8 changed files with 68 additions and 58 deletions

View File

@@ -193,4 +193,11 @@ platform = espressif32
board = dfrobot_firebeetle2_esp32e
extends = common_env_options
build_flags = -D USE_MODBUS_IP
build_src_filter = -<*> +<EPMS/ATS/ATS_Woodward_DTSC200A_TCP>
build_src_filter = -<*> +<EPMS/ATS/ATS_Woodward_DTSC200A_TCP>
[env:UPS_Vertiv_APM2_TCP]
platform = espressif32
board = dfrobot_firebeetle2_esp32e
extends = common_env_options
build_flags = -D USE_MODBUS_IP
build_src_filter = -<*> +<EPMS/UPS/UPS_Vertiv_APM2_TCP>

View File

@@ -21,10 +21,10 @@
* @{
*/
#include <ModbusIP_ESP8266.h>
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 = "QTS_CDR_Arduino"; /**< @brief The SSID of the WiFi network. */
const char *password = "123abc456"; /**< @brief The password for the WiFi network. */
IPAddress local_IP(172, 17, 33, 178); /**< @brief The static IP address for the device. */
IPAddress gateway(172, 17, 33, 1); /**< @brief The gateway IP address. */
IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */
ModbusIP mb;
@@ -110,6 +110,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 85, 0, "CB0_TotalKVarExport" },
{IR_FLOAT, 87, 0, "CB0_LN_Avg" },
{IR_FLOAT, 89, 0, "CB0_LL_Avg" },
{IR_FLOAT, 93, 0, "CB0_TotalKWh" },
// Circuit Breaker 1 (OB01)
{IR_FLOAT, 101, 0, "CB1_V1N" },
@@ -158,7 +159,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 187, 0, "CB1_LN_Avg" },
{IR_FLOAT, 189, 0, "CB1_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 2 (OB02)
{IR_FLOAT, 201, 0, "CB2_V1N" },
{IR_FLOAT, 203, 0, "CB2_V2N" },
{IR_FLOAT, 205, 0, "CB2_V3N" },
@@ -205,7 +206,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 287, 0, "CB2_LN_Avg" },
{IR_FLOAT, 289, 0, "CB2_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 3 (OB03)
{IR_FLOAT, 301, 0, "CB3_V1N" },
{IR_FLOAT, 303, 0, "CB3_V2N" },
{IR_FLOAT, 305, 0, "CB3_V3N" },
@@ -252,7 +253,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 387, 0, "CB3_LN_Avg" },
{IR_FLOAT, 389, 0, "CB3_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 4 (OB04)
{IR_FLOAT, 401, 0, "CB4_V1N" },
{IR_FLOAT, 403, 0, "CB4_V2N" },
{IR_FLOAT, 405, 0, "CB4_V3N" },
@@ -299,7 +300,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 487, 0, "CB4_LN_Avg" },
{IR_FLOAT, 489, 0, "CB4_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 5 (OB05)
{IR_FLOAT, 501, 0, "CB5_V1N" },
{IR_FLOAT, 503, 0, "CB5_V2N" },
{IR_FLOAT, 505, 0, "CB5_V3N" },
@@ -346,7 +347,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 587, 0, "CB5_LN_Avg" },
{IR_FLOAT, 589, 0, "CB5_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 6 (OB06)
{IR_FLOAT, 601, 0, "CB6_V1N" },
{IR_FLOAT, 603, 0, "CB6_V2N" },
{IR_FLOAT, 605, 0, "CB6_V3N" },
@@ -393,7 +394,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 687, 0, "CB6_LN_Avg" },
{IR_FLOAT, 689, 0, "CB6_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 7 (OB07)
{IR_FLOAT, 701, 0, "CB7_V1N" },
{IR_FLOAT, 703, 0, "CB7_V2N" },
{IR_FLOAT, 705, 0, "CB7_V3N" },
@@ -440,7 +441,7 @@ modbusMap mb_map[] = {
{IR_FLOAT, 787, 0, "CB7_LN_Avg" },
{IR_FLOAT, 789, 0, "CB7_LL_Avg" },
// Circuit Breaker 1 (OB01)
// Circuit Breaker 8 (OB08)
{IR_FLOAT, 801, 0, "CB8_V1N" },
{IR_FLOAT, 803, 0, "CB8_V2N" },
{IR_FLOAT, 805, 0, "CB8_V3N" },

View File

@@ -62,69 +62,71 @@ modbusMap mb_map[] =
{
{HR, 15, 0, "State Control"}, //Internal to control from Modscan
{HR, 16, 0, "Fault Code"}, //Internal Fault code from Modscan
{DI, 20, 0, "Bypass Not Ready"},
{DI, 244, 0, "System Shutdown-EPO"},
{DI, 247, 0, "System Fan Failure"},
{DI, 245, 0, "Fuse Failure"},
{DI, 239, 0, "Internal Comms Failure"},
{DI, 254, 0, "UPS Output on Bypass"},
{DI, 249, 0, "System Output Off"},
{DI, 11, 0, "Output Overload"},
{DI, 20, 0, "Bypass Not Ready"},
{DI, 239, 0, "Internal Comms Failure"},
{DI, 244, 0, "System Shutdown-EPO"},
{DI, 245, 0, "Fuse Failure"},
{DI, 247, 0, "System Fan Failure"},
{DI, 249, 0, "System Output Off"},
{DI, 254, 0, "UPS Output on Bypass"},
{DI, 263, 0, "Battery Low"},
{IR, 183, 0, "UPS Battery Status"},
{IR, 180, 0, "Battery Time Remaining"},
{IR, 29, 0, "Bypass Input Frequency"},
{IR, 30, 0, "Bypass Power Phase A"},
{IR, 31, 0, "Bypass Power Phase B"},
{IR, 32, 0, "Bypass Power Phase C"},
{IR, 23, 0, "Bypass Input Voltage RMS A-B"},
{IR, 26, 0, "Bypass Input Voltage RMS A-N"},
{IR, 24, 0, "Bypass Input Voltage RMS B-C"},
{IR, 27, 0, "Bypass Input Voltage RMS B-N"},
{IR, 25, 0, "Bypass Input Voltage RMS C-A"},
{IR, 28, 0, "Bypass Input Voltage RMS C-N"},
{IR, 175, 0, "DC Bus Voltage"},
{IR, 1, 0, "System Input RMS A-B"},
{IR, 2, 0, "System Input RMS B-C"},
{IR, 3, 0, "System Input RMS C-A"},
{IR, 4, 0, "System Input RMS A-N"},
{IR, 5, 0, "System Input RMS B-N"},
{IR, 6, 0, "System Input RMS C-N"},
{IR, 7, 0, "System Input RMS Current Phase A"},
{IR, 8, 0, "System Input RMS Current Phase B"},
{IR, 9, 0, "System Input RMS Current Phase C"},
{IR, 10, 0, "System Input Frequency"},
{IR, 17, 0, "System Input Apparent Power Phs A"},
{IR, 18, 0, "System Input Apparent Power Phs B"},
{IR, 19, 0, "System Input Apparent Power Phs C"},
{IR, 14, 0, "System Input Power Phase A"},
{IR, 15, 0, "System Input Power Phase B"},
{IR, 16, 0, "System Input Power Phase C"},
{IR, 11, 0, "System Input Power Factor Phs A"},
{IR, 12, 0, "System Input Power Factor Phs B"},
{IR, 13, 0, "System Input Power Factor Phs C"},
{IR, 1, 0, "System Input RMS A-B"},
{IR, 4, 0, "System Input RMS A-N"},
{IR, 2, 0, "System Input RMS B-C"},
{IR, 5, 0, "System Input RMS B-N"},
{IR, 3, 0, "System Input RMS C-A"},
{IR, 6, 0, "System Input RMS C-N"},
{IR, 50, 0, "System Output Frequency"},
{IR, 14, 0, "System Input Power Phase A"},
{IR, 15, 0, "System Input Power Phase B"},
{IR, 16, 0, "System Input Power Phase C"},
{IR, 17, 0, "System Input Apparent Power Phs A"},
{IR, 18, 0, "System Input Apparent Power Phs B"},
{IR, 19, 0, "System Input Apparent Power Phs C"},
{IR, 23, 0, "Bypass Input Voltage RMS A-B"},
{IR, 24, 0, "Bypass Input Voltage RMS B-C"},
{IR, 25, 0, "Bypass Input Voltage RMS C-A"},
{IR, 26, 0, "Bypass Input Voltage RMS A-N"},
{IR, 27, 0, "Bypass Input Voltage RMS B-N"},
{IR, 28, 0, "Bypass Input Voltage RMS C-N"},
{IR, 29, 0, "Bypass Input Frequency"},
{IR, 30, 0, "Bypass Power Phase A"},
{IR, 31, 0, "Bypass Power Phase B"},
{IR, 32, 0, "Bypass Power Phase C"},
{IR, 38, 0, "System Output Voltage RMS A-B"},
{IR, 39, 0, "System Output Voltage RMS B-C"},
{IR, 40, 0, "System Output Voltage RMS C-A"},
{IR, 41, 0, "System Output Voltage RMS A-N"},
{IR, 42, 0, "System Output Voltage RMS B-N"},
{IR, 43, 0, "System Output Voltage RMS C-N"},
{IR, 44, 0, "System Output RMS Current Phase A"},
{IR, 45, 0, "System Output RMS Current Phase B"},
{IR, 46, 0, "System Output RMS Current Phase C"},
{IR, 61, 0, "System Output Apparent Power"},
{IR, 50, 0, "System Output Frequency"},
{IR, 51, 0, "System Output Power Factor Phs A"},
{IR, 52, 0, "System Output Power Factor Phs B"},
{IR, 53, 0, "System Output Power Factor Phs C"},
{IR, 54, 0, "System Output Power Phase A"},
{IR, 55, 0, "System Output Power Phase B"},
{IR, 56, 0, "System Output Power Phase C"},
{IR, 57, 0, "System Output Apparent Power Phs A"},
{IR, 58, 0, "System Output Apparent Power Phs B"},
{IR, 59, 0, "System Output Apparent Power Phs C"},
{IR, 60, 0, "System Output Power"},
{IR, 54, 0, "System Output Power Phase A"},
{IR, 55, 0, "System Output Power Phase B"},
{IR, 56, 0, "System Output Power Phase C"},
{IR, 51, 0, "System Output Power Factor Phs A"},
{IR, 52, 0, "System Output Power Factor Phs B"},
{IR, 53, 0, "System Output Power Factor Phs C"},
{IR, 38, 0, "System Output Voltage RMS A-B"},
{IR, 41, 0, "System Output Voltage RMS A-N"},
{IR, 39, 0, "System Output Voltage RMS B-C"},
{IR, 42, 0, "System Output Voltage RMS B-N"},
{IR, 40, 0, "System Output Voltage RMS C-A"},
{IR, 43, 0, "System Output Voltage RMS C-N"},
{IR, 61, 0, "System Output Apparent Power"},
{IR, 164, 0, "UPS Loading Status"},
{IR, 175, 0, "DC Bus Voltage"},
{IR, 180, 0, "Battery Time Remaining"},
{IR, 183, 0, "UPS Battery Status"},
};
//Size of modbus map used in FOR cycles, automatically calculated.