Modbus Communication – Variable Frequency Drive (VFD) - Lenze
This article explains where a variable frequency drive (VFD) can be used and how to set up communication with the Modbus TCP protocol using specific Lenze products. The same principles can be adopted with other frequency converters brands.
Definition
A frequency converter – or variable frequency drive (VFD) – is an electric device that can change voltage or frequency of AC (alternative current). Internally, AC current is converted into DC (direct current) and then back to AC with a different frequency or voltage. This happens internally via diodes, capacitors, and electronic switches. A typical application is the drive of AC motors, where the speed can be controlled changing the frequency of the current. In this case the voltage remains the same before and after frequency conversion. In the UR ecosystem, a typical application can be the drive of the AC motor of a conveyor.
Lenze products
Lenze has developed frequency converters that have I/O availability and can communicate with other devices with different communication protocols. Cabinet (Cabinet), Open Air (Protec) and Motor (Motec) variants (series i510 and i550) all have the same Modbus TCP capability.
Typical UR Application
This article is suited for the following robot applications:
- Robot-Centric Applications:
The robot controls all the devices with I/O signals. - PLC-Centric Applications:
The PLC controls all the devices with I/O signals.
Some Robotic-Centric applications using a Lenze device can optimize the space and the electrical wiring system.
The following example shows a typical palletizing solution:
- The robot could command the tool and other devices near the controller through its I/O.
- The Variable Frequency Drive could command one or more conveyors' motors through its I/O.
- The Frequency controller could be attached or located near these devices
In solutions like this, the robot and the frequency controller must exchange data. This connection could be made through Modbus TCP communication.
Modbus Communication
Modbus is a request-response protocol implemented using a client-server relationship. It can be used connecting one ethernet cable from the UR robot controller to the frequency converter. For everything to work, configure both the robot and the frequency controller and follow the Lenze Modbus guidelines and conventions.
- To set up the robot controller, you can find a specific Modbus communication guide on the support site HERE.
- To set up the Lenze hardware use the software "EASY starter" available on the Lenze website.
How to set up the communication:
Basic Settings
- Activate network control = > Constant TRUE [1] (P430.037)
- Select setpoint source = > Network [5] (P201.001)
- Select the running digital input = > Constant TRUE [1] (P400.002)
IP Settings
- Select the page for the Modbus TCP communication;
- Enter the TCP/IP address (192.168.124.16 in this case).
Modbus commands
In this application the robot works as the client, and the frequency converter as the server. The robot commands the conveyor (turning it on/off, changing its frequency) and receives feedback (actual status / actual frequency) through Modbus. Customizable signals can also be exchanged.
You can find the Lenze convention below.
Lenze Convention
Standard mapping
Register status - INPUTS
Register address |
ModBus register |
Lenze parameters |
Designation |
2000 |
42001 |
0x400C:001 |
Status Word (1) |
2001 |
42002 |
0x400B:005 |
Actual frequency (Hz/100) |
2002 |
42003 |
0x603F |
Error code |
2013 |
42012 |
0x60FD |
Digital input status (2) |
(1) Status word (Modbus register 2000)
(2) Digital input status (Modbus Register 2013)
Registers control - OUTPUTS
Modbus register |
Register address |
Lenze parameters |
Designation |
2100 |
42101 |
0x400B:001 |
Control Word (1) |
2101 |
42102 |
0x400B:005 |
Network setpoint (Hz/100) |
(1) Control Word (Modbus Register 2100)
Application examples
Application examples
The following examples were made from the previously detailed convention.
- Activate Network control
To command the variable frequency drive (VFD) through ModBus communication, the server has to command the Bit5 of the register 2100.
- Check the Network control status
The Server can verify if the network control is active through the Bit5 of the register 2000.
- Turning On/Off the motor
The client has to access to the register 2100, to the Bit0 (running forward, CW), or the Bit1 (running reverse, CCW).
- Check the status On/Off of the motor
The client has to access the register 2000, to the Bit3 (running forward, CW), or the Bit4 (running reverse, CCW). The Bit4 can be accessed to check is the motor is ready.
- Activate Network setpoint control
To activate the Network setpoint control, the server has to command the Bit6 of the register 2100. This activate the possibility of changing the frequency value.
- Check the frequency control setpoint status
To check if the Network setpoint control is active, the server has to command the Bit6 of the register 2000.
- Setting the frequency
The client can set the frequency through the register 2101. The number sent has the following measurement unit: Hz/100.
- Read the actual frequency
The client can read the actual frequency value through the register 2001. The number received has the following measurement unit: Hz/100.
- Error codes
If a warning or an error shows up, it can be read at the register 2002. To understand the meaning, you can see the Lenze product manual available on their website.
- Reset an error
The client can access the register 2100, to the Bit2, to reset an error after its occurrence.
- Read VFD Inputs
To read inputs of other devices connected to the frequency converter, the client has to access the register 2013. Only some bits are available.
- Exchanging customize data
You can also exchange customizable I/O data. For that, the register 2500 can be access for output data, while 2501 can be used for read input data.
Equipment testing
The following example is of the Modbus configuration made to test the equipment.
To communicate with the Lenze device, the server IP address has been written (192.168.124.16) and only Input/Output Registers have been used. See the URscript Programming Language manual to learn about Modbus functions and their parameters. To avoid conflicts, verify these functions in a program directly and set up configurations within the ‘MODBUS Client IO Setup’ screen of the installation.
To set an output register see the function:
- modbus_set_output_register
To read an input register see the function:
- integer_to_binary_list
This example shows the tests that were done:
- The register 2000 is being watched. The decimal value is 354, but it must be converted in binary, which is, in 16 bits, 0000000101100010. In the actual status the Network control and the setpoint control are active. A warning raised up (2nd bit).
- The register 2001 is communicating the actual frequency value (0 Hz/100).
- The register 2100 is being used to command the variable frequency drive. The values shown was settled up to turn on the motor.
- The register 2101 shows the last frequency value commanded (1000 Hz/100).
- The register 2002 is indicating the error status og the Frequency Converter. The value is 12834, but it must be converted in Hexadecimal number, which is 3222. Looking at the product manual available on the Lenze website, the error is only a warning indicating a voltage issue.
- The register 2500 is used to command customizable data, but the last value settled is 0.
- The register 2501 is accessed to read customizable data. The value is 4224, that must be converted in binary, which is 0001000010000000 in binary.
This is an example of the program made to test the equipment:
- The frequency value was being changed between a value of 1000 [Hz/100] and 2000 [Hz/100].
- The register 2501 (Custom_status) has been read and the 10th bit has been saved in a specific variable.
Wiring for STO
The Lenze variador can include a STO (Safety Torqe Off) Module that is already included or can be added to the frequency controller to increase the safety level of the application. The STO function is the most common and basic drive integrated safety-related function. If STO is activated, no more power, which can cause rotation or motion, is applied to the motor.
See the user manual, electrical interface, to evaluate your required interlock wiring.