Today, Zheng Motion Assistant will share with you the hardware wiring of the EtherCAT motion control card ECI2828 and how to use LabVIEW to acquire controller parameters and generate oscilloscope waveforms.
I. ECI2828 Hardware Introduction
The ECI2828 series motion control card supports up to 16-axis linear interpolation, arbitrary circular interpolation, spatial circular interpolation, helical interpolation, electronic cams, electronic gears, synchronous following, virtual axes, and robot commands; it uses an optimized network communication protocol to achieve real-time motion control.
The ECI2828 series motion control card supports Ethernet and a RS-232 communication interface to connect to a computer, receive commands from the computer, and can connect to various expansion modules via EtherCAT and CAN buses to expand the number of input/output points or motion axes.
Applications for the ECI2828 series motion control card can be developed using software such as VC, VB, VS, C++, and C#. The program requires the dynamic library zmotion.dll to run. During debugging, the ZDevelop software can be connected to the controller simultaneously for easier debugging and observation.
Typical connection configuration diagram of ECI2828 series
II. Motion Control Development using LabVIEW
1. Download the LabVIEW Vi function library "zauxdll" folder from the "CD-ROM data" to your computer, and then copy it to the LabVIEW/user.lib folder under the LabVIEW installation path.
Zauxdll function library path
Paste the path to the Zauxdll function library.
2. Review the PC function manual and familiarize yourself with the relevant function interfaces.
(1) The PC function manual is also included in the CD-ROM materials. The specific path is as follows: "CD-ROM materials\8.PC functions\Function library 2.1\ZMotion function library programming manual V2.1.pdf"
(2) PC programming typically involves connecting the controller and industrial PC via the network port. The network port connection function interface is ZAux_OpenEth(); if the connection is successful, this interface will return a connection handle. By manipulating this connection handle, control of the controller can be achieved.
ZAux_OpenEth() Interface Description:
(3) Use the axis parameter setting related instructions to operate the link handle "g_handle" to set the axis parameters of the controller. The axis parameter setting related instructions are as follows.
(4) Obtain the contents of the table register and import them into the oscilloscope data source.
Get the planned location:
Feedback speed:
Get planning speed:
Location for obtaining feedback:
Electronic cam motion:
3. Data acquisition for motion control using LabVIEW.
(1) Create a new Vi. On the front panel, right-click the mouse and select controls to design the UI. As shown in the figure, the left side is the connection interface and the acquisition of points, data sources, etc., and the right side is the location of the oscilloscope graphic planning.
(2) In the program editing box, use the mouse to add a "While loop" in the added frame, and add an "Event structure" in the "While loop". Right-click and select Add Event Branch, select the "Timeout" event, get the number of sampling points of the current data source, and import the data source data into the oscilloscope and display it as a waveform.
(3) Select the event structure, right-click and select Add Event Branch. In the loop structure, when the handle is empty, the controller with the current IP will be automatically obtained. Then, the "Z Aux Open Eth.vi" function is used in the event branch to connect to the controller to realize the function of connecting the controller button.
(4) Select the event structure, right-click and select Add Event Branch, select the "Disconnect" value to change, and then use the "Z Aux Close.vi" function in the event branch to disconnect the controller to realize the function of the disconnect button.
(5) Select the event structure, right-click and select Add Event Branch, select the "Trigger" value to change, and then use the "Z Aux Trigger.vi" function in the event branch to trigger the oscilloscope capture, so as to realize the trigger instruction capture data source and store the data in the table register.
(6) Select the event structure, right-click and select Add Event Branch, select Start Acquisition and change the value, and then use the "Z Aux Execute.vi" function to call the instruction SCOPE to start and acquire data from the data source and store it in the table register.
(7) Select the event structure, right-click to select the event, select "XY plot:" the mouse changes, and then read the coordinate position of the mouse in the corresponding range of the XY oscilloscope and XY2 oscilloscope in real time in this event branch and display it on the interface.
(8) Select condition structure. When the sine motion button is pressed, the two-stage trigger sine motion uses the tiling sequence structure to execute the two electronic cam motion instructions in sequence. The “Z Aux Cam.vi” function is used to perform the corresponding electronic cam motion according to the data pre-loaded in the table register.
III. Debugging and Monitoring
Compile and run the example program, connect to the ZDevelop software, and use a single-axis mini-program to move a sine wave trajectory, capture the waveform, and compare the LabVIEW oscilloscope waveform with the ZDevelop software waveform.
1. The algorithm instructions for generating sine wave data are as follows.
·DIM num_p,scale,m,t 'Variable definition: num_p=100, scale=500 FOR p=0 TO num_p TABLE(p,((-SIN(PI*2*p/num_p)/(PI*2))+p/num_p)*scale) 'table stores cam table motion parameters NEXT
2. Capture oscilloscope waveform.
The waveform displayed on the A.ZDevelop software oscilloscope is shown in the figure below:
B. LabVIEW oscilloscope waveform, the oscilloscope data source is DPOS data content, which is consistent with the DPOS waveform of the ZDevelop software oscilloscope:
C. LabVIEW oscilloscope waveform, the oscilloscope data source is VP_Speed data content, which is consistent with the VP_speed waveform of the ZDevelop software oscilloscope:
3. ZDevelop software debugging video.
That concludes our presentation on motion control and data acquisition using the EtherCAT motion control card in LabVIEW.
For more exciting content, please follow the "Zheng Motion Assistant" WeChat official account. For related development environment and example code, please contact Zheng Motion's technical sales engineer: 400-089-8936.
This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to jointly improve China's intelligent manufacturing level. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.