4.0 KiB
4.0 KiB
| title | description | keywords |
|---|---|---|
| OmronE5 Component | Modbus RTU interface for Omron E5 temperature controllers | omron, e5, temperature, controller, modbus, rtu, rs485 |
OmronE5
Path: src/components/OmronE5.h
Revision History: Initial documentation
The OmronE5 component provides a Modbus RTU interface for Omron E5 series temperature controllers. It enables reading current temperature values (PV), setting target temperatures (SP), and controlling the device operation through an RS485 interface.
Requirements
Hardware
- RS485 interface connected to ESP32
- Omron E5 series temperature controller(s) with Modbus RTU capability
Software
- RS485 and Modbus RTU communication enabled in configuration
- Modbus slave ID configuration for each Omron device
Features
- Temperature monitoring (PV - Process Value)
- Temperature control (SP - Setpoint)
- Device status monitoring (running, heating, cooling, auto-tuning)
- Run/stop control
- Optional statistics collection (error rates, heating patterns, energy consumption)
- Optional cooling support
- Modbus TCP to RTU mapping for remote access
Dependencies
- Component - Base component class
- ModbusRTU - Modbus RTU communication
- ModbusTypes - Modbus data types
- OmronE5Types - Omron E5 specific types
- ValueWrapper - Value state management
graph TD
OmronE5 --> Component
OmronE5 --> ModbusRTU
OmronE5 --> ValueWrapper
OmronE5 --> OmronE5Types
Component --> Arduino
ModbusRTU --> RS485
Behaviour
The OmronE5 component operates by regularly polling connected Omron E5 controllers via Modbus RTU, storing current values and status information, and providing both read and write functionality to control the temperature regulation process.
stateDiagram-v2
[*] --> Initialize
Initialize --> ReadValues: setup() complete
ReadValues --> UpdateState: Data received
UpdateState --> ReadValues: After interval
ReadValues --> HandleCommand: Command received
HandleCommand --> UpdateState
UpdateState --> CalculateStatistics: If ENABLE_TRUTH_COLLECTOR
TODOs
Performance
- Consider optimizing polling frequency based on controller response time
- Implement batch reading of multiple controllers when multiple devices are present
- Evaluate caching strategies for frequently accessed values
Security
- Implement validation for setpoint ranges to prevent unsafe temperature settings
- Consider adding authentication for critical temperature control operations
- Add CRC validation for Modbus communications to ensure data integrity
Compliance
- Ensure temperature control limits comply with relevant safety standards
- Document energy consumption monitoring for regulatory reporting
- Validate operations against Omron E5 series specifications
Recommendations
- Configure appropriate read intervals based on the temperature control requirements
- Implement error handling for communication failures
- Use the statistics collection feature for process optimization and energy monitoring
- When controlling multiple devices, consider staggering polling to prevent bus congestion
Example
Below is an example of how to create and initialize an OmronE5 component:
#ifdef ENABLE_RS485_DEVICES
#ifdef ENABLE_OMRON_E5
// Initialize Omron E5 temperature controllers
for (uint8_t i = 0; i < NUM_OMRON_DEVICES; i++)
{
uint8_t slaveId = OMRON_E5_SLAVE_ID_BASE + i;
omronE5Devices[i] = new OmronE5(this, slaveId);
if (omronE5Devices[i])
{
components.push_back(omronE5Devices[i]);
Log.infoln(F("OmronE5 initialized. SlaveID:%d"), slaveId);
}
else
{
Log.errorln(F("OmronE5 initialization failed for SlaveID:%d"), slaveId);
}
}
#endif
#endif