Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

ZMotion Motion Control Development Tutorial in LabVIEW (3) -- EtherCAT Bus Initialization

Today, ZMotion shares What EtherCAT Motion Control Card ECI2828 Axis Parameters Are & How To Do EtherCAT Bus Initialization Through LabVIEW. 


Let's begin, learn together !



PART
01
ECI2828 Motion Control Card Hard Introduction

ECI2828 series motion control card supports linear interpolation of up to 16 axes, including any circular interpolation, space arc, helical interpolation, electronic cam, electronic gear, synchronous follow, virtual axis, robot structure, etc. In addition, real-time motion control can be achieved through optimized network communication protocol.

Also it is valid for ECI2828 to connect Ethernet, 232 communication interface to computer, then it receives computer's instructions to run. What's more, each expansion module can be connected through EtherCAT bus and CAN bus to extend inputs, outputs or motion axes.

image 1.png

Application programs of ECI2828 series motion control card can be developed by VC, VB, VS, C++, C#, etc., and dynamic library "zmotion.dll"is needed when program is in motion. At the same time, ZDevelop and controller can be connected for debugging easily and watching conveniently

image 2.png






PART
02
LabVIEW Basic Axes Parameters Introduction

ATYPE: axis function type configuration, only the property of axis can be set (axis property can be checked through hardware manual or in ZDevelop, "connect to controller" -- "State the controller")

UNITS: pulse amount, assign each unit to sent how many pulses, 5 decimal precision is valid.

ACCEL: axis acceleration, unit is units/s/s. When in multi-axis motion, acceleration speed of interpolation is main axis acceleration. It is recommended to set acceleration and deceleration well before motion, which means don't modify during motion, otherwise, speed curve might be changed.

DECEL: axis deceleration, unit is units/s/s. When in multi-axis motion, as the deceleration of interpolation motion. When it is set as 0, equaling to ACCEL value automatically to do symmetric acceleration and deceleration. It is recommended to set acceleration and deceleration well before motion, which means don't modify during motion, otherwise, speed curve might be changed.

ACCEL: axis speed, unit is units/s. When in multi-axis motion, as the speed of interpolation speed. It takes effect immediately when SPEED is modified. And dynamic speed changing can be achieved, but it will shake in changing moment. For smooth, please use SPEED_RATIO instruction.

Above are basic parameters for controlling axis motion. If there is any problem for hardware connection, these 5 parameters are set well, then motion of servo or step motor can be controlled.

image 3.png






PART
03
Bus Initialization File Preparation

Generally, the bus initialization file can be edited and programmed by ZMotion development environment "ZDevelop"

image 4.jpg

We can open ".zpj" project directly. This project includes "ECAT init.bas" file. Or open "ECAT initial.bas" file to modify initialization program.






PART
04
LabVIEW Program Introduction

Before, let's see how LabVIEW programs ?

4.1 LabVIEW Program Structure -- "while" loop structure

image 5.jpg

As the name suggests, the while loop structure is similar to the while in C language, or the while loop used in the ZMotion development environment ZDevelop, then to scan the program cyclically. We can control whether the while loop ends through BOOL type input, and connect ! to the display control to display the while loop count.

4.2 LabVIEW Program Structure -- "Event Structure"

image 6.jpg

Event structure is the main structure when we do human-machine interaction. In this structure, we can freely add trigger events of external control.

For example, in front board, we add one "EtherNet connection" control. Then, we could add the event of this control in event structure, when the control is pressed, relative procedure will be executed.

image 7.jpg

image 8.jpg

image 9.jpg

At this time, when we pressed "Ethenet connection" control, one message box will pop up, which shows "press by mouse", this is the character constant that need to be shown.

4.3 LabVIEW Program Structure -- condition structure

image 10.jpg

This is similar to "if" command of C Language. When "?" is entered as "true" in condition structure, program in "true" will be executed. Also, When "?" is entered as "false" in condition structure, program in "false" will be executed.

4.4 LabVIEW Program Structure -- program running sequence

In LabVIEW, usually, function added at the last will be executed firstly.

image 11.jpg

Therefore, we could use sequence structure to classify for execution in order.

image 12.jpg

image 13.jpg






PART
05
LabVIEW Initialization EtherCAT Bus

5.1 Download Initialization File Function

image 13 (form).jpg


5.2 Function Case in LabVIEW

Following, take routine 8 - bus motion control routine as example to introduce how to use ZAux_BasDown function ?

(1) At first, add "[download Bas file] value change" event in event structure.

image 14.jpg

Namely, in control interface, when "download Bas file" button is pressed, this event will be triggered.

(2) Next, it is the condition in "condition structure", when the handle is not 0, "true" program in condition structure will be executed.

image 15.jpg

In "condition structure", there is one "file dialog box" control, which can open one dialog box to select for downloading files. Then, select the bus file that needs to be initialized.

image 16.jpg

(3) After initialization, we could see axis status is 65, which represents cps position mode is used.

image 17.jpg


5.3 Axis status display in LabVIEW

Axis status updates real-time, so axis parameters in controller needs to be accessed circularly. Here, we can edit "read axis parameter" program in "timeout" event of event structure. The "timeout" event is executed by default when other events are not triggered.

image 18.jpg

Here, "timeout" event has two "condition structure", one is the axis parameter reading. In this axis parameter reading condition structure, when the connection handle is not 0, then "condition structure" read by axis parameters is in execution status. Namely, when the controller is connected, axis parameters are in real-time "reading" status all the time.

Another "condition structure" is "bus initialization show program", when one variable among "file download mark", "initialization status" and "connection handle" doesn't meet the requirements, bus node, then read "Bus_InitStatus" initialization completion mark in initialization file and "Bus_TotalAxisNum" bus total axes again.

5.4 EtherCAT interaction in LabVIEW

How to achieve SDO communication program of EtherCAT -- programs in "Set" & "Read" of "event structure".

image 19.jpg

(1) "Set" event program

image 20.jpg

It could be seen, only one "ZAux_BusCmd_SDOWrite" function is called in "set" event.

(2) "Read" event program

image 21.jpg

Also, "read" can be achieved only by calling "ZAux_BusCmd_SDORead" function.





PART
06
Debug and Watch

6.1 ECI2828 is connected to PC through TCP/IP, so several links can be built. Therefore, before starting LabVIEW program, we could use ZMotion development environment ZDevelop to watch controller running status.

image 22.jpg

Through printing information, bus initialization is done.

6.2 Oscilloscope use

Connect to ZDevelop software -- axis parameters in right to watch controller status / "View" -- "Scope", watch axis motion situation in oscilloscope.

image 23.jpg

Current command position and feedback (DPOS & MPOS) can be real-time watched through oscilloscope.

image 24.jpg

6.3 Debug Video

image 25.jpg






That's all, thank you for your reading -- Application Development Tutorial in LabVIEW.

For more information, please pay close attention to   "Support"  and   "Download"   , and there are other platforms about ZMOTION --   Youtube  &   LinkedIn  &   Twitter  &   Tiktok  &   Facebook including technical information (development environment, routine code), product showing, company development, etc.

Hope to meet you, talk with you and be friends with you.
  Welcome!

This article is edited by ZMOTION, here, share with you, let's learn together. ZMOTION: DO THE BEST TO USE MOTION CONTROL.

Note: Copyright belongs to ZMotion Technology, if there is reproduction, please indicate article source. Thank you
.

ZMOTION Technology  has attracted experienced talents from famous companies or institutions, such as Huawei, ZET, Huazhong University of Science and Technology etc. ZMOTION insists self- innovating and collaborating with comprehensive universities, to research basic knowledge of motion control. Due to its concentration and hard work in motion control technology, ZMOTION already become one of the fastest growing industrial motion control companies in China, and is also the rare company who has managed core technologies of motion control and real time industrial control software completely.

ZMotion Technology  provides motion control card, motion controller  , vision motion controller, expansion module and HMI. ( more keywords  for ZMOTION: EtherCAT motion control card, EtherCAT motion controller, motion control system, vision controller, motion control PLC, robot controller, vision positioning...)





Reference
  1. LabVIEW: https://en.wikipedia.org/wiki/LabVIEW

  2. Video Description:  https://www.youtube.com/channel/UCUeMHePZfrfBYM4_KtH_Euw/featured

  3. ZMotion Technology: https://www.zmotionglobal.com

  4. Contact us: http://www.zmotionglobal.com/contactus.html

  5. ZMotion PC Program Manual: http://www.zmotionglobal.com/upload/Zmotion%20Program%20Manual%20V2.1.pdf

  6. ZDevelop Software: http://www.zmotionglobal.com/download_list_14.html

  7. ECI2828 Motion Control Card:  ECI2828,PRODUCTS,ZMOTION TECHNOLOGY (zmotionglobal.com)





End
Technical Support

Economical EtherCAT Motion Controller (5) -- How Multi-Task Programming Of Motion Controller Is ?

Economical EtherCAT Motion Controller (3) -- Multi-axis Linear Interpolation & Electronic Cam Achievement Through PLC

Economical EtherCAT Motion Controller (2) -- ZBasic Achieves Multi-axis Linear Interpolation Motion
Economical EtherCAT Motion Controller (1) -- Function Introduction & Application

 

ZMotion Motion Control Development Tutorial in LabVIEW (2) -- Homing Routine Motion

ZMotion Motion Control Development Tutorial in LabVIEW

ZMotion Application Development Tutorial -- Motion Control Card & VC6.0

 

Development Tutorial -- EtherCAT Motion Control Card & Python

How To Use Open Linux Platform of ZMotion XPLC516E Motion Controller (2) – LOCAL Interface Connection

How to use Open Linux Platform of ZMotion XPLC516E (1) ? -- detailed steps through Qt development

 

Motion Control Card Application in ROS System (2)

Motion Control Card Application in ROS System (1)

EtherCAT motion control card -- Custom Curve

Hardware Comparison Output with High-precision Application in Vision Fly-Shooting

Zmotion EtherCAT Bus Controller Application in 5-axis CNC Processing

ZMOTION EtherCAT Bus Controller Application in Parallel Robotic Arm

Multi-Programming of ZPlc and Zbasic

Multi-task function of ZMC controller



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

Contact Us-Youtube