Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

Motion Control Quick Start (16-1) | Zmotion Controller EtherCAT Bus Initialization Introduction

Welcome.

Zmotion shared  15 contents about motion control with you before, you can check them from here. They can help you how to quick start our Zmotion motion control.

Today, an important knowledge on EtherCAT bus motion control will be introduced "How to Initialize EtherCAT Bus Controller".

Here includes all information, from materials, program to result showing.

Let's begin.


1
What We Need?



(1) Hardware & Software



--Hardware--

one ZMC432 controller, it has EtherCAT bus interface

one set of Panasonic EtherCAT servo driver + motor

one PC

two cables with shield

one 24V DC

several wiring terminals and connecting cables

--software--

1.png

Left: Zmotion ZDevelop V3.10.10 controller programming software. It can be downloaded from here, and application programs can be run directly, it is easy to edit, debug and compile, please refer to "ZDevelop Programming Manual" for details, or contact us directly.

Right: Panasonic servo driver host computer debug software. It can be downloaded and installed from Panasonic official website.


(2) Hardware Wiring



--controller wiring--

2.png

a: main power: connect E+24V of controller main power to 24V DC power +, and connect EGND to 24V DC power -

b: Ethernet: connect controller EtherNET to PC ethernet through one cable

c: EtherCAT: connect controller EtherCAT to servo driver X2A or X2B through one cable

3.png

Please note there are two EtherCAT interfaces of the servo motor. For some drivers, two ports can be connected without the rule. But some divide them intoEtherCAT IN and EtherCAT OUT, usually IN is used to connect to upper level device, OUT is used to connect to behind level device, so the connection sequence must be correct.

--drive wiring--

For wiring of servo driver, motor and encoder, please refer to driver manual. Connect drive to 220V city power.




2
Controller & PC Connection

Connect controller to PC through serial port or ethernet.

Then, here, ethernet connection method will be introduced mainly.

(1) how to build ethernet communication



Use cable to connect controller to PC at first, and power on controller, then open ZDevelop programming software, click"Controller"--"Connect", "connect to controller" window will be opened.

4.png

Through this window, native IP can be viewed rapidly. At this time, please check whether they are in the same net segment.

When selecting the IP from the list, valid IP addresses within the current LAN will be found automatically (when controller is powered on and POWER and RUN are ON, IP address of this controller can be checked).

When there are multiple controllers in the same network, and the IP drop-down list does not display the IP address of the target controller, you can use an IP scan to view all currently available controller IP addresses. After the scan is complete, close this window and select again.

5.png

After correct IP is selected, a message will appear in "output" window.

6.png

Notes: the controller factory IP is 192.168.0.11, the "Connect to Controller" window displays the local IP address,please pay attention to set the respective IPs of the wired network card and the wireless network card. For PC and controller, their IP addresses must be the same network segment,which means front three segments are the same but the last segment is different.If they are not in the same segment, it needs to modify one IP.


(2) how to modify controller IP address



Use serial port to connect to controller, then IP address can be obtained.

--method 1--

"controller"--"modify IP address" window can modify controller IP address directly.

7.png

--method 2--

Send "IP_ADDRESS" command.

8.png

When the command is sent, it disconnects automatically. In "output" command, error information will be printed, now please select new IP address (192.168.0.23) through ethernet to connect again. And the new IP is valid all the time.


(3) how to modify PC IP address



Here, take WIN10 as the example.

control panel -- Internet -- Internet & Share Center -- Ethernet -- "Property"

Then, in property window, find Internet protocol version 4 (TCP/IPv4), now, it can be configured freely. When it is modified, remember to click "OK".

Then, open ZDevelop -- Connect to Controller window, select correct IP to connect again.




3
EtherCAT Servo Drive Parameters Configuration

(1) Communication Period



Generally, EtherCAT servo drive supports different cycles,250us, 500us, 1ms, 2ms and 4ms. When connecting, it automatically matches the controller cycle. And it is necessary to ensure that the controller and the servo cycle are consistent. When auto-matching fails, which means they can not communicate, please upgrade controller firmware to modify controller cycle.

Usually, controller default cycle is 1ms. And specific controller period can be read by "SERVO_PERIOD".

The smaller the servo period, the finer the position control and the faster the response.


(2) Drive PDO Setting



The full name of PDO isProcess Data Object, which refers toperiodical data interaction between the master station and the slave station in the EtherCAT bus network. It can be regarded as an array, different function codes are saved in each array element, then PDO executes corresponding operations in one cycle. Then these function codes are called as data dictionaries that are represented by 4-digit hexadecimal.

9.png

PxPDO: data is transferred to slave station from master station.

TxPDO: data is transferred to master station from slave station.

For EtherCAT, controller is the master station, the servo driver is the slave station.

For example, 6040h control word (used to control servo axis, such as, enable, on, off, alarm, reset, etc.), and each data dictionary Index includes 32 Sub-Index. For functions and initial values of data dictionary, please refer to drive manual.

10.png

Actually, data dictionary No. and functions are determined. And all standard EtherCAT devices use the same data dictionary, only "bit" needs to be set.

And during the EtherCAT initialization, drive PDO configuration must be done.

There are more than 20 kinds of settings for drive PDO, for Zmotion EtherCAT controller, use "DRIVE_PROFILE"instruction. Please refer to "ZBasic Program Manual".

11.png

DRIVE_PROFILE=-1 indicates driver's inner default PDO list, and specific data dictionaries of inner PDO can be obtained from driver manual.

If the existing configuration of DRIVE_PROFILE cannot meet the requirements, customize the PDO, that is, use SDO related commands to operate the data dictionary to set required PDO. Including corresponding parameters modification, SD0 instruction can read it then configure, or through drive software.

SDO command:

-- data dictionary reading --

SDO_READ (slot No., device No., data dictionary No., data dictionary subNo., data type, data position in TABLE)

SDO_READ_AXIS (axis No., data dictionary No., data dictionary subNo., data type, data position in TABLE)

-- Data dictionary writing --

SDO_WRITE (slot No., device No., data dictionary No., data dictionary subNo., data type, data value to be written)

SDO_WRITE_AXIS (axis No., data dictionary No., data dictionary subNo., data type, data value to be written)

If you want to know how to customize PDO, please contact us.


(3) Drive Parameters Setting



How to set / modify driver's parameters?

--steps--

a. connect to the driver through USB cable or WLAN, here, connect PC USB to driver X1

b. power ondriver

c. open Panasonic driver software PANATERM

d. a window pops up, select "communicate with driver through USB", drive information will be obtained and displayed in the window automatically, then click "OK".

e. it is time to set parameters for the drive: click "D display" -- "Object Editor", find required data dictionary, then directly modify in "Setting Value".

f. when modified, transfer parameter to driver, and write it into driver EEPROM.

g. power on driver again, parameter takes effect.

--an example: set UNITS pulse amount--

UNITS meanspulse amount, that is,how many pulses are sent when motor rotates one circle.

And other basic parameters, SPEED, ACCEL, DECEL and motion commands all take "UNITS" as basic unit.

From below, set electronic cam ratio through data dictionary 6091h, set the molecular through 6091h-01h, and set denominator through 6091h-02h. Now, the electronic cam gear is 1/1, 6092h-01h sets as 10000, which means 10000 pulses sent by motor in one revolution, then corresponding UNITS is 10000. And MOVE(2) means 20000 pulses, motor will rotate 2 circles.

12.png

--another method--

Use SDO command:

SDO_(Bus_Slot, iNode, $6091, 1, 7, 1)        'electronic gear ratio numerator

SDO_(Bus_Slot, iNode, $6091, 2, 7, 1)        'electronic gear ratio denominator

SDO_(Bus_Slot, iNode, $6092, 1, 7, 10000)    'the number of pulses of motor in one round

When modified, use drive software to read 6092h-01h value, and it will be 10000.


(4) Driver IO Signals



Drive has own IN signals for protection, and they are ON by default. If no external signals are connected, driver will alarm. Therefore, it is more convenient to debug when they are OFF, setting as 0 to close them. And please note it needs to map IO No. before using, then connect to actual signals.

--how to set / modify IO signal--

Click "Parameter" in PANATERM main interface, select needed IO signal, then modify directly in "Setting Value".

--how to map drive IO--

It needs PDO that includes data dictionary 60FDh, then use DRIVE_IO command to set drive IO address.

DRIVE_IO (axis No.) = IO starting No.

For example:

DRIVE_PROFILE (iAxis) = 5          'set PDO mode that is with IO map

DRIVE_IO (iAxis) = i_IoNum        'set drive input / output IO starting number

Note: drive mapping IO No. range and other bus devices' IO No. can't repeat.


(5) Write Parameters into Drive



As mentioned above, when parameters are set, click"transfer" firstly, then click "EEPROM".

When power on again, values take effect, and modifies are recorded.


(6) Map Drive Axis No.



For drives connected on EtherCAT bus, it needs AXIS_ADDRESS command to map drive axis No.

Generally, device No. of connected devices on EtherCAT bus are numbered automatically from 0 according to connection sequence, drive No. is the same.

When mapped, use BASE command to select drive axis No. and send pulses to control motions of connected motors.

This axis mapping operation is edited in the bus initialization program, that is, after the bus scanning and before the bus opening.

--how to use AXIS_ADDRESS--

AXIS_ADDRESS (axis No.) = (slot No. <<16) + drive No. + 1

Copyright © 2013-2024 Shenzhen Zmotion Technology Co.,Ltd Design by Zmotion    粤ICP备13037187号 Motion Controller-Motion Control Card