Today, the motion assistant will share with you the hardware wiring of the EtherCAT motion control card ECI2828 and how to use LabVIEW to develop look-ahead motion for continuous interpolation of small line segments.
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) Use the axis parameter setting related instructions to operate the link handle "g_handle" to set the axis parameters of the controller. The instructions related to look-ahead mode setting are as follows.
Set corner deceleration:
Set the corner deceleration angle:
Set the stop deceleration angle:
Set the speed limit radius of the small circle:
Global variable access:
3. Look-ahead motion for continuous interpolation of small line segments using LabVIEW.
(1) Create a new Vi. In 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 right side is the position of the corresponding points of multiple small line segments.
(2) In the program editing box, use the mouse to select "Tile sequence structure" and then right-click to select "Add frame after". Then add "While loop" in the added frame and "Event structure" in "While loop".
The "timeout handling" function in the event structure monitors the controller's motion state, speed, position, remaining buffer, and current mark running number.
(3) Select the event structure, right-click and select Add Event Branch, select Change the “Connection” value, and then use the “Z Aux Open Eth.vi” function in the event branch to connect 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 "Coordinate Zeroing" value change, and then use the "Z Aux Direct Set Dpos.vi" function in the event branch to set the controller axis position to 0, so as to realize the function of the coordinate zeroing button.
(6) Select the event structure, right-click and select Add Event Branch, select Change the “Stop” value, and then use the “Z Aux Direct Single Cancel.vi” function in the event branch to stop the axis movement.
(7) Select the event structure, right-click to select the timeout event, select "start" to change the value, and then use the relevant Vi function in this event branch to set the motion parameters of the controller and start the motion to realize the function of the motion button.
A. By calling the Vi function related to axis parameter settings in frame 0 of the "cascaded sequential structure" in this event branch, the controller axis parameters are first set and the continuous interpolation function is enabled.
B. In the first frame of the "layered sequence structure" in this event branch, set the corresponding look-ahead mode and parameters such as acceleration/deceleration, starting speed, deceleration angle, and stopping angle using the relevant Vi function to make the motion process relatively smooth.
C. In the second frame of the "layered sequential structure" in this event branch, the motion small line segment is continuously interpolated, and during the motion, it is determined whether the remaining buffer size is sufficient to continue loading into the buffer, and the current motion label is read and displayed on the interface.
III. Debugging and Monitoring
Compile and run the routines, and connect to the ZDevelop software for debugging, monitoring the axis parameters and motion status of the motion control.
1. CornerMode Feature Preview Settings Instructions.
The system's speed forecasting function can, on the one hand, plan the overall command, that is, plan the speed of each segment as a whole. Combined with the acceleration and deceleration control within the command segment, it can enable the machine tool to maintain high-speed operation, improve efficiency, and make the load movement smoother, eliminating the need for stop-and-go operation. The system achieves this through the Merge speed fusion function.
On the other hand, in order to limit mechanical impact and overcutting while ensuring high-speed operation, deceleration recognition is also required by recognizing trajectory changes in advance.
This allows the system to decelerate in advance at a safe deceleration rate, achieved through deceleration/stop fusion and shock suppression functions. Overall, the speed prediction function improves overall machine efficiency, reduces impact, increases flexibility, reduces component wear, and extends equipment lifespan.
The corner deceleration function solves the problem that when the angle between commands is too large, if the vehicle is still running at a relatively high speed, a large mechanical impact will be generated at the angle, causing the trajectory to deviate.
The controller will identify the angle between the trajectory changes between commands in advance, compare its relationship with the deceleration/stop angle, and decide in advance whether to decelerate to ensure a smooth transition at the command connection point.
2. Check the axis movement by turning on the oscilloscope.
As shown in the figure below, when the angle of the transition from OA to segment AB is less than the deceleration angle, no deceleration is performed in segment S1-S2. When the angle of the transition from AB to segment BC is greater than the deceleration angle, deceleration is performed, as in segment S2-S3. When the angle of the transition from BC to segment CD is greater than the stopping angle, the speed needs to be reduced to zero, as in segment S3-S4.
Connect to the ZDevelop software to monitor the controller status through the axis parameters on the right side of the software. Alternatively, click "View" → "Oscilloscope" to open the oscilloscope and monitor the axis movement.
A. When the chamfer mode is enabled, the graphics will be processed with chamfering at the corners, as shown in the comparison below:
Chamfering mode not enabled
Enable chamfer mode
B. After activating the corner deceleration mode, when the corner angle reaches a certain deceleration angle or stopping angle, the corner position will be processed accordingly, as shown in the figure below:
Corner deceleration mode not activated
Turn off corner deceleration mode
3. ZDevelop software debugging video.
This concludes our fifth installment on building intelligent equipment using EtherCAT motion control cards and 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.