01. Introduction to EMC Series Bus Controllers
The EMC series bus controller is an independent bus motion controller developed by Leadshine with independent intellectual property rights. It is designed based on the mainstream EtherCAT expansion bus and supports motion control of up to 64 axes. The main body supports backplane bus expansion, including different types of modules such as IO, AD/DA, and encoders, which is more convenient and efficient than general EtherCAT expansion. The EMC series controllers interact with PCs via network cables, and up to 254 EMC controllers can be networked to achieve distributed control.
Meanwhile, the EMC series also boasts powerful motion control capabilities. In addition to supporting various point-to-point motion planning modes such as T-type, S-type, and S plus, as well as common motion planning functions such as trajectory look-ahead, it also integrates a variety of industry control algorithms such as instruction caching, PSO spacing comparison, and two-dimensional pitch compensation, which are highly compatible with the common process requirements of industries such as 3C, semiconductor, laser, and dispensing.
The EMC series bus controllers are divided into the general-purpose point-to-point 3000 series and the high-end trajectory 5000 series. They are compatible with the original DMC series function interfaces, support multiple systems such as Windows/Linux/macOS, and are suitable for a wide variety of application scenarios.
02. Unified API Interface
The EMC bus controller and control card use the same set of function interfaces and support common development languages such as C, C++, C#, LabVIEW, and Python. At the same time, the EMC bus control supports common operating systems such as Windows, Linux, and MacOS.
The EMC bus controller documentation package provides corresponding header files and function libraries for different programming languages, as shown in the diagram above. The APIs used are consistent across all languages, greatly improving program portability. For specific instructions on calling the libraries in each language, please refer to the "Leica Control EMC Bus Controller User Manual".
Meanwhile, the EMC bus controller also provides usage examples for commonly used functions in commonly used programming languages, as shown in the figure above. Customers can refer to the corresponding code to quickly familiarize themselves with the use of the corresponding functions.
03. Project Setup
This tutorial will use the C# programming language.
Create a new C# project
Open Visual Studio 2010, select File → New → Project to open the New Project interface, as shown in the image below:
Select "Visual C#" as the development language and "Windows Forms Application" as the application type, then click "OK" to complete project creation, as shown in the image below:
The completed project is shown in the image below:
Adding header files and function libraries
Locate the "LTDMC.cs" file in the header file directory provided by the manufacturer, right-click the project name, and add the corresponding header file, as shown in the image below:
In the pop-up window, select the corresponding header file to complete the addition. You can then see the corresponding header file and its function description in the project, as shown in the image below:
Finally, place the function library corresponding to the bit width into the corresponding debug directory, as shown in the image below:
At this point, the project setup is complete, and C# development can begin.
04. Controller Initialization
Before calling the EMC controller's function calls, the program needs to initialize the EMC controller; otherwise, direct calls will result in an error. The initialization function is described below:
short dmc_board_init_eth(WORD CardNo,char* ipaddr)
Function: Controller initialization function, allocates system resources.
Parameter: CardNo (Controller Link Number)
The iPadDR connection string corresponds to the IP address of the controller.
Return value: Error code
Note: A return value of 0 indicates normal initialization, while a non-zero value indicates an initialization error.
The code for the initialization function is as follows:
05. Zeroing Movement
Before performing precise motion control, the origin of the motion coordinate system must be set. Each motion platform is equipped with an origin sensor (also called an origin switch). The process of locating the origin switch and setting that location as the platform's coordinate origin is called homing motion. The following is a list of homing motion related functions for the EMC bus controller:
The EMC bus controller provides functions related to the homing motion, and the parameters are transmitted to the driver, which then performs the homing function. The handling of the homing offset differs among drivers; please refer to the respective driver's manual for details. The following is a schematic diagram of the Leadshine L7EC homing mode 34 operating logic:
The code for implementing the zero-return motion is as follows:
06. Single-axis motion
Single-axis point-to-point motion is the most common type of motion control in applications. EMC bus controllers support both absolute and relative coordinates when describing motion trajectories, as shown in the diagram below:
Meanwhile, the EMC bus controller also supports T/S type planning mode for single-axis motion. The relevant functions for single-axis motion are shown in the table below:
The code for implementing point movement is as follows:
07. Debugging and Monitoring
The compilation and execution routine is shown in the figure below. Motion 4.2 also provides a status display for the controller. In the early stages, Motion 4.2 can be used directly to monitor the EMC status.
Motion 4.2 monitors axis status
Click "Status Monitoring → Axis Status Monitoring" to bring up the axis monitoring interface shown in the image below. The current display shows information about axis 0 in constant-speed motion, as shown in the image below:
Trace
While axis motion status and position monitoring provide a coarse overview of the current axis status, they cannot fully capture the entire motion process. This makes it easy for customers to miss crucial information when troubleshooting, increasing the difficulty of the process. Motion 4.2 offers a Trace function, which continuously collects and plots curves of the axis's position, velocity, and acceleration information over a certain period. The corresponding interface can be accessed by clicking "Status Monitoring → Trace," as shown in the image below.
To add data, click "Settings" to open the interface, then right-click to add the axis numbers you want to collect, as shown in the image below:
Clicking "Start" initiates data acquisition. The routine starts a fixed-length motion on axis 0. Once the motion is received, clicking "Stop" closes the acquisition. Motion 4.2 will automatically generate the corresponding position, velocity, and acceleration curves, as shown in the following figure:
Motion 4.2's axis status monitoring and trace collection are commonly used for customer troubleshooting. The detailed and intuitive display effectively improves the efficiency of customer troubleshooting and shortens the time spent on handling anomalies.
08. Application Scenarios
EMC series bus motion controllers can be applied to automation equipment in various industries. They are mainly targeted at industries such as 3C, basic electronics, special machine tools, and semiconductors.
That concludes our technical sharing on "EMC Series EtherCAT Bus Motion Controller (Part 3): Single-Axis Motion and Status Monitoring". For more exciting content about EMC series bus controllers, please continue to follow the "Leica Control Technology" WeChat official account. Next time, we will share "EMC Series EtherCAT Bus Motion Controller (Part 4): High-Speed Position Comparison and Latching".