4.6 KiB
4.6 KiB
| title | description | keywords |
|---|---|---|
| OmronE5 - Temperature Controller Component | Interface for Omron E5 series temperature controllers via Modbus RTU | omron, e5, temperature controller, modbus, rs485, industrial automation |
OmronE5
Path: ./src/components/OmronE5.cpp
Revision History: Initial documentation
The OmronE5 component provides an interface to Omron E5 series temperature controllers via Modbus-RTU over RS485. It enables temperature monitoring, setpoint control, and advanced heat rate analytics for industrial control applications.
REQUIREMENTS
- Hardware:
- RS485 transceiver module connected to ESP32
- Properly configured Omron E5 controller with Modbus RTU capabilities
- Software:
ENABLE_RS485must be defined in the configuration- Optional
ENABLE_TRUTH_COLLECTORfor advanced statistical analysis - Optional
ENABLE_COOLINGfor cooling mode support
FEATURES
- Read Process Value (PV) and Setpoint (SP) from the controller
- Control the temperature setpoint
- Monitor controller running/heating/cooling status
- Start and stop the temperature controller
- Advanced statistics (with TRUTH_COLLECTOR enabled):
- Track mean error between PV and SP
- Calculate heat rate (oscillations per minute)
- Monitor power consumption (Wh)
- Calculate PV/SP response lag
- Track longest heating duration in time windows
- Estimate energy costs
DEPENDENCIES
- ArduinoLog - Logging functionality
- Component - Base component system
- ModbusRTU - Modbus RTU communication
- ModbusTypes - Modbus data types
- OmronE5Types - Omron E5 specific constants
- xstatistics - Statistical calculations (when TRUTH_COLLECTOR enabled)
- ValueWrapper - Value change tracking
graph TD
OmronE5 --> RTU_Base
RTU_Base --> Component
OmronE5 --> OmronE5Types
OmronE5 --> ModbusTypes
OmronE5 --> ValueWrapper
OmronE5 --> xstatistics
BEHAVIOUR
The component operates through read/write operations to specific Modbus registers on the Omron controller, with additional statistical analysis when enabled.
stateDiagram-v2
[*] --> Setup
Setup --> Running
Running --> Reading: Every _readInterval ms
Reading --> ProcessData: onRegisterUpdate
ProcessData --> UpdateStats: When TRUTH_COLLECTOR enabled
ProcessData --> CheckHeatUpState
UpdateStats --> Running
CheckHeatUpState --> Running
Running --> HandleCommands: When command received
HandleCommands --> SetSP
HandleCommands --> RunStop
HandleCommands --> Info
HandleCommands --> ResetStats: When TRUTH_COLLECTOR enabled
SetSP --> Running
RunStop --> Running
Info --> Running
ResetStats --> Running
TODOS
PERFORMANCE
- Consider optimizing the read interval based on controller activity
- Reduce read frequency during stable operations to minimize bus traffic
- Group register reads where possible to minimize transaction overhead
SECURITY
- Add range validation for all incoming Modbus values
- Implement authentication for control operations if needed in sensitive installations
- Consider adding checksums for critical value modifications
COMPLIANCE
- Ensure component behavior complies with relevant industrial control standards
- Verify compatibility with different firmware versions of Omron E5 controllers
- Document any deviations from standard Modbus implementations
RECOMMENDATIONS
- Configure the Omron E5 controller with compatible Modbus RTU settings (baud rate, parity)
- Set appropriate register access permissions on the controller
- Use the TRUTH_COLLECTOR feature for diagnostics and optimization
- When using cooling functionality, ensure the controller is properly configured for heat/cool control
EXAMPLE
The following example demonstrates how to initialize an OmronE5 component within a parent component:
#ifdef ENABLE_RS485
// Create Omron E5 device with slave ID 1
OmronE5* temperatureController = new OmronE5(
this, // owner component
1, // Modbus slave ID
300 // read interval in ms
);
if (temperatureController)
{
components.push_back(temperatureController);
Log.infoln(F("OmronE5 temperature controller initialized. SlaveID:%d, ReadInterval:%d"),
1, 300);
}
else
{
Log.errorln(F("OmronE5 temperature controller initialization failed."));
}
#endif