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.
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.
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.
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.
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.
b. configure axis parameters.
c. interfaces of single-axis motion.
d. watch axis state.
(3) Axis Parameters Configuration & Single-axis Motion Control in MFC
a. single-axis routine.
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.
c. through timer 1, watch controller information.
d. through setting button's event processing function, configure axis parameters for controller.
e. through event processing function of "open button", do single-axis motion.
f. through event processing function of "stop button", stop axis motion.
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.
(2) Through RTSys "oscilloscope" function, capture axis motion waveform.
a. axis 0, in "inching motion", acceleration is 100, S curve time is 0.
b. axis 1, in "inching motion", acceleration is 100, S curve time is 250.
c. axis 2, in "inching motion", acceleration is 1000, S curve time is 0.
d. axis 3, in "inching motion", acceleration is 1000, S curve time is 500.
(3) Single-axis motion routine video introduction.
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.