Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

EtherCAT Edge Programmable Industrial Motion Controller (4): C++ Motion Control Single-Axis Development

For Zmotion EtherCAT motion edge controller ZMC432H , we had learnt its hardware information, API function encapsulation principle, and RTSys development, debug, and diagnosis. Today, let's see another development method, that is, development on host computer.

Here, C++ motion control development will be introduced.

EtherCAT motion control edge controller ZMC432H supports self-researched and self-controlled software and hardware. And this EtherCAT edge controller is an independent motion controller that is compatible with EtherCAT bus and pulse.

32 axes motion control can be achieved. At the same time, Zmotion remote HMI function is valid, which means network configuration display is provided to watch and adjust parameters in real-time.

1.png

ZMC432H has rich hardware interfaces and control functional modules, then effective and stable motion control and real-time data acquisition can be achieved to meet application requirements of both industrial control and industrial internet.

What's more, Linux system is built in ZMC432H. That is, it can be connected through local LOCAL interface, then, instruction interaction speed can be faster. The one interaction time of one single instruction and multiple instructions is about 40us.

2.png

video description


1. C++ Motion Control Development

(1) Build New MFC Project, and Add Function Library

a. open VS2022, click "File"--"New"-"Project (Ctrl + Shift + N)"

b. choose "Visual C++" and "MFC Application Program".

c. click "Next".

d.for the application program type, choose "based on Dialogue", then click "next" or "OK".

e. obtain Zmotion C++ function library, you can download it from here or contact us, then copy C++ library files and corresponding head files into current new created project.

3.png

f. add static library and corresponding head files: right click the current project file (here, single_move), and select "add (D)", "current project (G) Shift + Alt + A", then in pop-up window, add state library and head files in order.

g. state the head file you will use and define controller connection handle.

4.png

h. it's time to do MFC project development.


(2) Check PC Function Manual

The PC programming function library manual can be obtained from "download/software manual", or please contact us.

Then there are many function interfaces' command.

Like:

a. connect to controller, then get link handle.

5.png

b. configure axis parameters.

6.png

c. interfaces of single-axis motion.

7.png

d. watch axis state.

8-1.png

8-2.png


(3) Axis Parameters Configuration & Single-axis Motion Control in MFC

a. single-axis routine.

9.png

b. in event processing function of link button, call the "controller connection" interface function "ZAux_OpenEth" to connect to controller, when linked successfully, open timer 1 to watch controller state.

10.png

c. through timer 1, watch controller information.

11.png

d. through setting button's event processing function, configure axis parameters for controller.

12.png

e. through event processing function of "open button", do single-axis motion.

13.png

f. through event processing function of "stop button", stop axis motion.

14.png



2. Debug and Watch

Compile the routine, and at the same time, connect ZDevelop software to controller to watch controller's state.

(1) Connect RTSys / ZDevelop to controller, watch controller's basic parameters.

15.png


(2) Through RTSys "oscilloscope" function, capture axis motion waveform.

a. axis 0, in "inching motion", acceleration is 100, S curve time is 0.

16.png

b. axis 1, in "inching motion", acceleration is 100, S curve time is 250.

17.png

c. axis 2, in "inching motion", acceleration is 1000, S curve time is 0.

18.png

d. axis 3, in "inching motion", acceleration is 1000, S curve time is 500.

19.png


(3) Single-axis motion routine video introduction.

20.jpg

video description







ABOUT ZMOTION

That's all, thank you for your reading -- EtherCAT Edge Programmable Industrial Motion Controller (4): C++ Motion Control Single-Axis Development

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