Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

EtherCAT Motion Control Card QT Development Tutorial (1)


Today, Zmotion talks about how to develop EtherCAT motion control card by QT. And there is one complete tutorial series that composed by three aspects.

Here, the first part, we will show you how to configure development environment with one simple motion control application example, specifically, the linear interpolation motion control.

Let's begin.



1. Hardware Support


Before our development configuration, we need to know which hardware we could use. Here, ECI2828 motion control card is used. Actually Zmotion ZMC series motion controllers and other models of ECI motion control cards all can be chosen, which depends on your own requirements.

--Brief Basic Introduction--

ECI2828 not only belongs to economical motion control card, but also supports rich motion control functions, such as, up to 16 axes linear interpolation, any circular interpolation, space arc, helical interpolation, electronic cam, synchronous follow, virtual axis, robot instructions, etc. And real-time motion control can be achieved through optimized network communication protocol.

--Hardware Configuration--

ECI2828 motion control card is linked with PC through ethernet and RS232, then card can receive the command from PC to run. When there is no enough motion axes, IO or analog resources, expansion modules can be connected through EtherCAT bus and CAN bus.

1.png

--Programming Method--

For Zmotion motion controller and motion control card, there are two programming methods , host computer programming languages or ZBasic, ZPLC, ZHMI that are developed by Zmotion. Here, upper computer programming platform QT is used for ECI2828, and VC, VB, VS, C++, C#, and others all can be used. It only needs to call dynamic library "zmotion.dl" when programming is running. While debugging, we could connect ECI2828 to ZDevelop that is one free programming software launched by Zmotion itself for debugging and observing.

2.png



2. How to Develop Motion Control by Qt


(1) New Build Qt Project

a. build one new Qt project

3.png

b. select project path

4.png

c. select Qt compile set (kits)

5.png

d. select basic type

6.png


(2) Copy Files Related to Function Library to New Created Project

7.png


(3) Add Static Library (zmotion.lib) of Function Library to New Created Project

a. add function library 1

8.png

b. add function library 2

9.png

c. add function library 3

10.png

d. add head file related to function library to project

11.png

e. state head file and define connection handle

12.png



3. Software Support


We talked about hardware support above, now let's see what we have and what we need to use in the software level.

For host computer development, Zmotion provides one uniform PC function library, there are PC programming manual and examples of each platform and each programming language. They can be referred from here or contact us directly.

Generally, ethernet is used to connect controller to IPC, the corresponding connection interface is ZAux_OpenEth(), if the connection is successful, the interface will return one link handle, then it can control the controller through this handle.

Next, let's see some basic operation PC commands.

(1) how to build the connection

13.png

(2) how to achieve multi-axis interpolation

14.png

(3) how to get axis position information

15.png

(4) how to get axis speed information

16.png



4. How to Develop Multi-Axis Interpolation Motion by Qt


(1) Multi-Axis Interpolation Motion in Qt Interface

17.png


(2) Development Steps

a. call controller link interface "ZAux_OpenEth()" in construct function to build the connection with controller, when connected successfully, open timer to monitor controller axis information.

18.png

b. update each axis' position and speed information through the timer.

19.png

c. call multi-axis interpolation command to do multi-axis interpolation motion through open button.

20.png

d. call axis stop command to stop motion through slot function of stop button.

21.png




5. How to Transplant Routine to Linux Device


(1) Copy  Corresponding Linux Library to Project Folder

22.png


(2) Add Function Library's Static Library (libzmotion.so) to New Created Project.

a. add function library 1

23.png

b. add function library 2

24.png

c. add function library 3

25.png


(3) Compile Again, Then Run Directly.

26.png


(4) Debug & Monitor

Compile and run the routine, at the same time connect to ZDevelop software to debug. In this way, axis parameters and motion situation all can be watched in real-time.

--multi-axis interpolation X-Y position waveform--

27.png

--multi-axis interpolation X-Y position waveform (continuous interpolation is OFF)--

28.png





ABOUT ZMOTION

That's all, thank you for your reading -- EtherCAT Motion Control Card QT Development Tutorial (1) | Development Environment Configuration & Simple Motion Control Example

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 focuses on development of motion control technology and general motion control products, it is a national high and new technology enterprise. 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. Here, Zmotion provides motion controller, motion control card, vision motion controller, expansion module and HMI. In addition, there is one program software developed by Zmotion -- ZDevelop. It is a good choice for you to program and compile. And program through upper computer, there is PC manual.

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...)

Have a good day, best wishes, see you next time.


2013-2023 版权所有 Zmotion Corp. Copyright Reserved 粤ICP备13037187号-1