How to configure and run a Yaskawa Drive using ModbusRTU on the ic92xx controller with PLC Open FBs
This application note show how to set up a modbus RTU communication between the IC92xx and a Yaskawa Drive with I Cube Engineer >=V2023.6
1. Supported Components
| Component Name | Version |
|---|---|
| iC9200 series | ≥ 2023.6 |
| SLIO module CP040 (040-1CA00) | ≥1.00 |
| iCube Engineer | ≥ 2023.6 |
| GA700 & GA800 | ≥1034 |
| GA500 | ≥1017 |
2. Libraries
-
Y_DataTypes_Toolbox
(
≥ 2023.6)
-
Y_PLCopenPart1_Toolbox
(
≥ 2023.6)
-
Y_IOModule_Toolbox
(≥ 2023.6)
3. Solution details
3.1 Wiring Details
iC9226M CPU needs CP040 module (ref: 040-1CA00) to establish RS485 communication to Drives.
The CP040 can be connected on a fieldbus coupler or directly on the slicebus of the controller.
In case of the slicebus usage, make sure to use a Power module (ref: 007-1AB00) to supply the CP040.
Connect CP040 to Drives as following:
- CP040: Pin 2 (RxD+) to Drive D+
- CP040: Pin 6 (RxD-) to Drive D-
- CP040: Pin 7 (Gnd) to Drive AC
- Activate Terminator: CP: Bridge CP: Pin 4 - Pin 8
3.2 Communication Settings
3.2.1 Drive Communication Settings:
Set the following parameters:
Cycle power of Drive or set H5-20 = 1 to activate modifications of H5-Parameters.
| Parameter | Value | Description |
|---|---|---|
| B1-01 | 2 (= source Modbus RTU) | Frequency Reference Selection |
| B1-02 | 2 (= source Modbus RTU) | Run Command Selection |
| H5-01 | User’s value | Drive Modbus RTU address |
| H5-02 | Same value defined in ICE “baud rates” | Communication Speed selection (baud rates) |
| H5-03 | Same value defined in ICE “Parity” | Communication Parity Selection |
| H5-04 | User’s Value | Communication Error Stop Method |
| H5-06 | Same value defined in ICE “Delay Time” | Drive Transmit wait Time |
| H5-11 | 1 (= no enter command required) | Information: The Driver set H5-11 = 1. Do not change. |
Recommended settings:
- Baud rate 115.2kbps H5-02 = 8
- Parity No H5-03 = 0
- Error Stop Ramp to Stop H5-04 = 0
- Drive Transmit Wait Time H5-06 = 0ms
3.2.2 iCube Engineer Communication Settings
Note: Master Delay in ICE is recommended to set to 0 ms
This FAQ
Modbus RTU Communication Details for Drives and generic Modbus Devices describes the Bus cycle time, Task cycle time and SliceBus Settings in detail.
3.2.3 Modbus RTU concept to handle Yaskawa Drive and Generic Device
Here below is a general concept of modbus RTU network with Yaskawa library. The Yaskawa inverters are handled with
Y_PLCopenPart1_Toolbox FB(see list of the supported FBs for MBRTU section below) and the Generic device on the same network are handled with
Y_IM_GenericDeviceRTUDriver.
The limit available on the network are 10 generic devices and 10 inverters.
Note: Due to the serial communication, the more Devices on the network, the slower the respond time of each Device becomes.
Further details of the communication management to Yaskawa Drives and Generic Devices are described here:
Modbus RTU Communication Details for Drives and generic Modbus Devices
3.2.4 Definition of Modbus Communication Registers
This chapter describes how to link the
Y_IM_ModbusMasterRTUto the CP module using IN and OUT Ports.
Step 1:
Define Variable ModbusOutputData and ModbusInputData (Type: YtByteArray60) in POU: Main as Port
Variables:
Step 2: Link in PLCnext / GSD Port List:
3.2.5 Definition of Axis Structures and User Units / Limits
Define and Initialize at startup the Axis Structure:
Global Variable Definition: Init:
or in POU: INIT:
- Set H5-01 = 0x1F for Drive node 31
- Cycle power of Drive or set H5-20 = 1 to activate modifications of Memobus Communication parameters.
The Structure g_PM_VFD_AxisData from datatype Yt_PM_VFD_AxisStructure is defined automatically when creating an instance of e.g.
MC_Power
(from
Y_PLCopenPart1_Toolbox) using Inv01 as Axis_Ref.
AXIS_REF
and Axis Data structure are linked by:
[1] is the first MBRTU Drive axis on this network.
plcOpen FBs use velocity user units in s-1 and acceleration user units in s-2.
The scaling to the mechanical construction has to be defined in POU INIT:
PM_VFD_AxisData.AxisArray[1].AxisInfo.DriveConversion.posScale
PM_VFD_AxisData.AxisArray[1].AxisInfo.DriveConversion.posScale
The definition of posScale is used to convert the Velocity User Units [s-1] to Drive Frequency Reference [Hz].The scaling uses: motor nominal speed [rpm] at nominal motor frequency [Hz] )E1-04).
Use default setting of o1-03 = 0
(Comment: The scaling from Hz to 0.01Hz is done internally)
Example:
Calculation Output frequency [Hz] = Velocity reference [s-1] * 60.0 * MaxOutput Frequency /PM_VFD_AxisData.AxisArray[1].
AxisInfo.DriveConversion.posScale
e.g. Velocity reference = 22.6667[s-1] * 60.0 * 50.0 / 1360.0 = 50.0Hz
The posScale is used also for the actual Velocity.
Modify this calculation to respect also the mechanical construction (belt,...) and gear.
MC_MoveVelocityand
MC_StopFB use acceleration user unit in [s-2]. The ramps for acceleration (C1-01) and deceleration (C1-02) are in [s].
The values have to be within the allowed range for C1-01 and C1-02 := 0.0s .... 6000.0s
The values have to be within the allowed range for C1-01 and C1-02 := 0.0s .... 6000.0s
Acceleration = MaxOutputFrequency (E1-04) / Acceleration Time (C1-01) ->
min acceleration [C1-01 = 6000.0s] = PM_VFD_AxisData.AxisArray[1]. AxisInfo.DriveConversion.posScale / 6.0 / 60000 [0.1s.]
max acceleration [C1-01 = 0.1s] = PM_VFD_AxisData.AxisArray[1]. AxisInfo.DriveConversion.posScale / 6.0 / 1 [0.1s.] With .Softlimit.Velocity.Enabled := FALSE the limits of (E1-04 / E1-09) are valid. In the above example the softlimits are same as the Drive limits.
With .Softlimit.Accleration.Enabled := FALSE (same for Deceleration) the Drive limits (.posScale and C1-01/C1-02 range) are used. In the above example the acceleration and deceleration must be within 1s and 30s.
Note:
Take care when using a different Maximum Output Frequency (E1-04). e.g. E1-04 = 87Hz
Example:
Calculation Acceleration Time (C1-01 in s) =
PM_VFD_AxisData.AxisArray[1].
AxisInfo.DriveConversion.posScale / (60.0 * Acceleration Reference [s-2]).
Acceleration Time (C1-01 in s) for Acceleration 5.0s-2 = 1360 [min-1] / (60.0 [s/min] * 5.0[s-2]) = 4.53s
3.2.6 Main RTU Driver and Motion Axis Driver
The Modbus RTU CP040 module establish communication with
Y_IM_MainRTUDriver to :
- the Yaskawa Drives (using Y_MotionAxisDriver FB)
- the others Modbus RTU devices (using Y_IM_GenericDeviceRTUDriver).
Example:
- Set Y_IM_MainRTUDriver. Enable:= TRUE after initialization.
- Enable Y_MotionAxisDriver when Y_IM_MainRTUDriver.VALID:= TRUE.
- Use the Motion FBs (e.g. MC_Power) only when Y_MotionAxisDriver.Valid:= TRUE.
3.2.6 Supported PLCopen FBs with ModbusRTU Fieldbus
- Y_MotionAxisDriver
- MC_Power
- MC_MoveVelocity
- MC_Stop
- MC_Reset
- MC_ReadStatus
-
MC_ReadActualVelocity
- MC_ReadAxisError
- Y_ReadDriveParameter
- Y_WriteDriveParameter
3.2.7 Application example with MC_Power, MC_MoveVelocity, MC_Stop
Set
MC_Power.Enable:= TRUE and
MC_MoveVelocity.Execute:= TRUE, set a velocity, acceleration and deceleration reference to run the Drive in Velocity Mode.
To stop the Drive set
MC_Stop:= TRUE and
MC_MoveVelocity.Execute:= FALSE.