This article will introduce "how to develop motion control & how to capture data by LabVIEW for EtherCAT motion controller" .
Here, take ZMC408CE EtherCAT motion controller as an example.
ZMC408CE EtherCAT Motion Controller
ZMC408CE is one 8-axis high-performance EtherCAT motion controller developed by Zmotion. This controller includes many communication interfaces, such as, EtherCAT, EtherNET, RS232, CAN, U disk, etc. In addition, it supports rich motion control functions, linear interpolation, circular interpolation, helical interpolation, electronic cam, electronic gear, synchronous follow, and so on.
For the development, there are two methods. First one, ZMC408CE supports PLC, Basic, and HMI. Second one, ZMC408CE supports PC host computer languages, like, C#, C++, LabVIEW, Matlab, Qt, Linux, VB.Net, Python, etc., and they all use the same one set of API function.
Motion control of ZMC408CE is 8-axis, but it can be up to 32 axes through expansion module. It can use pulse axis (with encoder feedback) or EtherCAT axis. For general IO, there are 24 inputs and 16 outputs, some are high-speed. Among outputs, 8 outputs (OUT0-OUT7) support hardware comparison output, hardware timer, motion precision in motion, and PWM.
1. How to Develop Motion Control by LabVIEW?
(1) Build LabVIEW Project
(2) Download "zauxdll" folder of LabVIEW Vi function library into PC, then copy it into "LabVIEW/user.lib".
(3) PC Function | Related Interfaces
Zmotion provides general API function, it includes all kinds of host computer languages. The manual can be obtained from here or contact us.
A. ZAux_OpenEth(): connection
B. ZAux_Direct_GetTable: get data from table, and import oscillocope data source
C. ZAux_Direct_GetDpos: get DPOS (demand position)
D. ZAux_Direct_GetMspeed: get feedback speed
E. ZAux_Direct_GetVpSpeed: get planning speed
F. ZAux_Direct_GetMpos: get MPOS (measurement position)
G. ZAux_Direct_Cam: do eletronic cam motion
(4) How to Get Real-Time Data
A. creat new vi in front board, and right click the mouse to select "control" to do UI designning, as it is shown in the below, the left is "connection" interface, the right is planning position of oscilloscope.
B. add "while" loop in added frame through mouse, then add "event structure" in "while", and right click to choose "add event branch", the "timeout" event, then get current needed data and import them into oscilloscope.
C. select event structure, and right-click to select "add event branch". In "while" structure, when the handle is blank, it will automatically get current controller IP, then use "Z Aux Open Eth.vi" function to connect to controller.
D. select event structure, and right-click to select "add event branch", the "disconnect" value changing, then use "Z Aux Close.vi" function to disconnect the connection.
E. select event structure, and right-click to select "add event branch", the "trigger" value changing, then use "Z Aux Trigger.vi" function to trigger oscillscope to capture the data.
F. select event structure, and right-click to select "add event branch", the "ON SCOPE " value changing, then use "Z Aux Execute.vi" function to call "SCOPE" command to open data acquisition, and save them into table register.
G. select event structure, and right-click to select "event", the "XY Graphic:" mouse changing . Then in this event branch, the coordinate position of the mouse within the corresponding range of the XY oscilloscope and the XY2 oscilloscope is read in real time and displayed on the interface.
H. select the condition structure. When the sine motion button is pressed, the two sine motions execute the two electronic cam motion commands in the sequence of tiling. Use the "Z Aux Cam.vi" function to move corresponding electronic cam motions according to data that has been loaded in table register in advance.
2. Debug & Watch
Compile the routine, and connect to ZDevelop / RTSys at the same time. Then run one "SIN" waveform trajectory through the corresponding single-axis routine. When the motion is running, capture the real-time data through LabVIEW oscillocope and ZDevelop oscilloscope synchronously.
(1) Algorithm Command: generate SIN waveform data
(2) Waveform Comparison
A. ZDevelop and LabVIEW captures DPOS demand position.
--ZDevelop Oscilloscope Waveform--
--LabVIEW Oscilloscope Waveform--
It can be seen they are consistent.
B. ZDevelop and LabVIEW captures VP_SPEED.
Also, their waveforms are the same.
ABOUT ZMOTION
That's all, thank you for your reading -- EtherCAT Motion Controller LabVIEW Motion Control Development & Real-Time Data Reading.
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.