Hardware Position Comparison Output and Encoder Latch XPCIE1032H Host Computer C Development 6 .

Mondo Technology Updated on 2024-01-31

Introduction to the xPCIe1032H features

XPCIE1032H is an EtherCAT bus motion control card based on PCI Express, which can choose 6-64 axis motion control, supports multiple high-speed digital input and output, and can easily realize multi-axis synchronous control and high-speed data transmission. The XPCIE1032H motion control card integrates powerful motion control functions, combined with the MotionRT7 motion control real-time soft core, to solve the non-real-time pain points of PC Windows development in high-speed and high-precision applications, and the instruction interaction speed is 10 times faster than that of traditional PCI PCIe.

The XPCIE1032H motion control card supports PWM and PSO functions, and has 16 input and 16 output universal IO ports on board, of which all the output ports are high-speed output ports, which can be configured as 4-channel PWM output ports or 16-channel high-speed PSO hardware comparison output ports. The inputs include 8 high-speed inputs, which can be configured as 4 high-speed color mark latches or 2 encoder inputs.

XPCIE1032H motion control card with MotionRT7 motion control real-time core, using the local local interface connection, through high-speed intra-core interaction, can achieve faster instruction interaction, a single instruction and multiple instructions at a time can reach about 3-5us.

The combination of the XPCIE1032H motion control card and the MotionRT7 motion control real-time kernel has the following advantages:

1.It supports the development of a variety of host computer languages, and all series of products can call the same set of API function libraries

2.With the help of intra-core interaction, motion commands can be quickly invoked with response times as fast as microseconds, which is 10 times faster than traditional PCI PCIe

3.Solve the problem of non-real-time control system of traditional PCI PCIe motion control card in Windows environment

4.It supports 1D, 2D, and 3D PSO (high-speed hardware position comparison output), which is suitable for applications such as visual aerial photography, precision dispensing, and laser energy control

5.A high-speed input interface is provided for easy position latching

6.It supports EtherCAT bus and pulse output hybrid linkage and hybrid interpolation.

When developing a project using the XPCIE1032H motion control card and the MotionRT7 motion control real-time kernel, the following steps are typically required:

1.Install the driver and identify the control card XPCIE1032H;

2.Open and execute the file 'motionrt710.'exe" to configure parameters and run the motion control real-time kernel;

3.Use zdevelop software to connect to the controller for parameter monitoring. Please use PCI local mode when connecting, and make sure that the zdevelop software version is in 310 or more;

4.Complete the development of the control program, and connect to the motion control card through the local link to realize real-time motion control.

Comparison with traditional PCI PCIe card and PLC test data results:

We can see from the test comparison results that the XPCIE1032H motion control card with the real-time motion control kernel MotionRT7, in the way of local link (intra-core interaction), the efficiency of instruction interaction is very stable, when the number of tests increases from 1W to 10W, the interaction time of a single instruction and the interaction time of multiple instructions fluctuate little, which is very suitable for high-speed and high-precision applications. xPCIe1032H control card installationPower off your computer.

Open the computer case, select a free XPCie card slot, and use a screwdriver to remove the corresponding bezel strip.

Insert the motion control card into the slot and tighten the set screws on the baffle strip.

XPCIE1032H Driver Installation and ConnectionRefer to Previous Articles EtherCAT Ultra-high-Speed Real-Time Motion Control Card XPCIE1032H Host Computer C Development (1): Driver Installation and Connection.

1. C language for motion control project development

2. Introduction to related PC function instructionsFor more information about PC functions, please refer to ZMotot PC Library Programming Manual v21.1”。

1. Introduction to the output function of hardware position comparison

2. Introduction to latch-related instructions

Find the control you need in the FORM design interface and drag it into the form to design the UI interface, and the effect is as follows.

3. Introduction to relevant procedures and functions1.Location comparison function(1) The principle and application of position synchronous output PSO

PSO (Position Synchronized Output) is the position synchronous output, which is essentially to control the OP high-speed synchronous output signal by collecting the real-time encoder feedback position (the pulse position that can be output without an encoder) and comparing it with the position set by the comparison mode.

The PSO is generally phase-synchronized with the synchronous output signal of the laser (or dispensing jet valve and other equipment), and the output switch is triggered at constant spatial (or constant-time) intervals at all stages of the motion trajectory, including acceleration, deceleration and constant velocity segments, so that the pulse energy acts evenly on the processed object.

The PSO function is characterized by a high-speed and stable output signal, because the output accuracy is high enough, so that the output signal can be triggered at a fixed distance throughout the entire trajectory regardless of the overall speed, that is, it moves at a very fast speed in the straight part and decelerates in the fillet part while ensuring a constant output spacing.

Usually the rounded part of the processing part occupies a relatively small part of the whole processing process, so that the production capacity can be maximized while ensuring the processing effect.

The positive motion PSO function is implemented by calling the Zaux Direct HWPSWITCH2 function interface, which uses hardware to realize the high-speed comparison output of IO, and the response speed reaches the microsecond level, so it is called hardware comparison output.

2) Procedure flow chart

3) Relevant examples.

private void button2 click(object sender, eventargs e) motion button.

Updated UI parameters.

updata_value();

Determine whether to connect to the controller.

if (g_handle == (intptr)0)

int iret = 0;

axisnum = 0;

Obtain the number of axes.

foreach (control item in this.controls)

if (item is checkbox)

Determine whether to select an axis.

if (axisnum == 0)

int axislist = new int[axisnum];

float distancelist = new float[axisnum];

foreach (int item in axislist)

axislist[iret++]= -1;

Gets the axis array and distance of motion.

foreach (control item in this.controls)

if (item is checkbox)

Initialize the output port.

for (int i = 0; i < 3; i++)

iret = zmcaux.zaux_direct_setop(g_handle, i, 0);

Select the axis of the movement.

iret = zmcaux.zaux_direct_base(g_handle, axisnum, axislist);

Initialize motion parameters.

foreach (int item in axislist)

iret = zmcaux.zaux_direct_hwtimer(g_handle, 2, 0, 0, 0, 0, 0);Turn off the hardware timer.

The status of the starting output port is set.

int tempoutstatus = 0;

if (modepara2 == 0)

tempoutstatus = 1;

elsetempoutstatus = 0;

Hardware timer settings.

if (m_timer_ifopen == false)

else hwpswitch settings.

if (m_pos_ifopen)

if (iret != 0)

Initialize the vector position.

switch (psomode)

PSO command settings.

switch (psomode)

if (iret != 0)

else triggers the oscilloscope.

zmcaux.zaux_trigger(g_handle);

Multi-axis interpolation motion.

iret = zmcaux.zaux_direct_move(g_handle, axisnum, axislist, distancelist);

2.Latch function1) The principle of latching and the principle of application latching is to record the position of the current encoder through the induction of the high-speed input port. When the latching signal is triggered, the current position information is immediately obtained into the position latch, and the position coordinates of the previous latch are cleared. When reading latch position information, the latched position information is read when the last latch signal was triggered. Latches are generally used in packaging, printing, dispensing, visual flying, etc.

2) Procedure flow chart

3) Relevant examples.

private void button1 click(object sender, eventargs e) to start latching.

int iret = 0;

if (m_regist_ifopen == false)

else if (reglistlistsel == 4 ||reglistlistsel == 5)

else if (reglistlistsel > 5 ||reglistlistsel < 9)

iret = zmcaux.zaux_direct_regist(g_handle, m_registaxis, registmode);

timer2.start();

The M regist ifopen flag changes to true to indicate that latching is enabled.

Reverses the settings of the button.

m_regist_ifopen = true;

It is not allowed to modify the latching shaft shaft number.

Change the start latch button to stop latching.

combobox1.enabled = false;

button1.text = "Stop latching";

else

4. Introduction to the IO interface of XPCIE1032H1.Introduction to the io specification

2.IO terminal definition

3.Terminal Definition Table

In the following content, the effect demonstration is to use the high-speed output port 0 to achieve the high-speed output of the PSO, and the high-speed input port 0 to realize the latched input. 4.IO wiring diagram

Fifth, the effect demonstrationAfter following the above development process, compile and run the routine. At the same time, it is connected to zdevelop software for debugging and monitoring the axis parameters and motion of the motion control.

Set as shown in the following figure: After Local is connected to the control card, first enable the PSO hardware position comparison output function

Step 1: Set the high-speed comparison output port 0, the output status of the first comparison point is 1, and set the comparison axis to 0. Set 4 comparison points, and the coordinates of the comparison points are: 100, 200, 300, 400.

Step 2: Turn on the encoder latch function: set the latch axis number to 0 and the latch mode to 3.

Step 3: Check the motion axis number 0 and fill in the motion distance 5000, and finally connect the input port 0 and output port 0.

That is, when the axis moves to 100, 200, 300, 400, the level change will be triggered, and the position of the latch will be saved by latching.

Schematic diagram of routine wiring.

Schematic diagram of the parameter settings.

Schematic diagram of the effect demonstrationThe oscilloscope waveform is shown in the figure below

Hardware Position Comparison Output and Encoder Latch Routines Explained:

This time, the hardware position comparison output and encoder latch of the forward motion technology: EtherCAT ultra-high-speed real-time motion control card XPCIE1032H host computer C development (6), shared here.

For the full *** address and more exciting content, please pay attention to the "Positive Sports Assistant"*

This article was originally written by Positive Motion Technology, welcome everyone**, learn together, and improve the level of intelligent manufacturing in China together. The copyright of the article belongs to Zhengxing Sports Technology, if there is **please indicate the article**.

Related Pages