Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

Linear Interpolation of EtherCAT Bus Motion Controller

Today, Zmotion brings how to draw the pentagram through two-axis linear interpolation.

Here are word description, routine codes simulation displaying and video showing.

Let’s see the details.


01
XPLC864E2 Bus Motion Controller

XPLC864E2 is a kind of multi-axis economical bus motion controller, and the volume of XPLC864E2 is small but the communication function is full. It supports RS232 serial port, RS485 serial port, network port, CAN bus and EtherCAT bus to connect to external equipment. For multiple network channels, it can be extended through the interchanger.

In addition, XPLC864E2 motion controller supports using pulse axes and bus axes mixed, and there are 8 motor axes totally. Except EtherCAT interface, outputs can be configured as 8 pulse signal outputs. And there are two encoder inputs, which are configured by input.

Even though, XPLC864E2 only has 8 motor axes, it can be extended to 12 axes to achieve linear interpolation, electronic cam, electronic gear, synchronization follow, virtual axis setting, etc.

What's more, for XPLC series motion controllers, they can be used in all kinds of applications that are online or offline.

1679017919509742.png






02
Linear Interpolation

(1) method and principle

The linear interpolation algorithm adopts the data sampling method. Specifically, it uses a small straight line to approach the given trajectory. And then the distance to be moved by each axis in the next interpolation period will be output, which means it is not necessary to interpolate once for each pulse equivalent, the high feed rates can be achieved.

Data sampling method is used by linear interpolation as mentioned above, but what is it?

Actually, the principle is to use the idea of time division, that is, according to the feed speed f and the interpolation period t, divide the profile curve into sections of the profile step length I, I=ft, and then calculate the coordinate increment of each axis participating in the interpolation motion in each interpolation cycle.

image 2.png

 

(2) what is linear interpolation

A. linear interpolation features

Firstly, let's see the motion process.

It selects the axis number/axis group through the "BASE" command, then controls the multi-axis linkage, the linear motion is completed.

The first axis selected by BASE is the main axis, and axis parameters of interpolation all use main axis parameters, such as, UNITS, SPEED, etc., then send "MOVE" linear interpolation instruction, it will execute in sequence in main axis' motion buffer area. If you need to cancel linear interpolation, using CANCEL command to achieve emergency stop.

Main Features:

--support 16 axes linear interpolation--

base(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)

--support multi-channel interpolate synchronously

BASE(0,1)

MOVE(100,200)

BASE(2,3,4)

MOVE(30,40,50)

 

(3) how to calculate parameters  

Here, we take 2-axis linear interpolation as example, axis 0 and axis participate in linear interpolation motion, please see below graphic.

In the plane, it moves from point A to point B, axis X and axis Y open at the same time, and achieve the end point synchronously.

Set motion distance of axis 0 is X, set motion distance of axis 1 is Y. The master axis is axis 0 (the first axis of main axis), so interpolation all adopt parameters of axis 0.  

image 3.png

If the main axis motion speed of interpolation is S (set speed of axis 0), then actual speed of each axis is the separate speed of main axis, which means they don't equal to S, at this time:

Distance of interpolation: X=[(∆X)2+(∆Y)2]½

Actual speed of axis 0: S0=S× X/X

Actual speed of axis 1: S1=S× X/X

 

(4) how to achieve linear interpolation

There is linear interpolation algorithm built in XPLC864E2, it supports 8 EtherCAT bus axes to do linkage linear interpolation, 12 axes can be expanded, use MOVE linear interpolation instruction, it is easy to complete interpolation effectively.

1679018059212528.png

A. Instructions related to linear interpolation

--MOVE: send pulse to drive, achieve linear interpolation.

Grammar:

MOVE(distance1 [,distance2[,distance3 [,distance4...]]])

MOVEABS(distance1 [,distance2 [,distance3 [,distance4...]]])

MOVESP(distance1 [,distance2 [,distance3 [,distance4...]]])

MOVEABSSP(distance1 [,distance2 [,distance3 [,distance4...]]])

--BASE: select which axis to participate in interpolation, namely, send MOVE to which axes.

Grammar:

BASE(axis1 [,axis 2 [,axis 3 [,axis 4...]]])

--SPEED_RATIO: the interpolation motion speed ratio is controlled freely, the current speed = SPEED * SPEED_RATIO.

Grammar:

SPEED_RATIO(axis No.) = value

--MOVE_PAUSE: motion pause and resume, MOVE_PAUSE is to pause, MOVE_RESUME is to resume.

Grammar:

MOVE_PAUSE(mode)

--C ANCEL: cancel motion, axis / axis group decelerates to stop, CANCEL(2) means emergency stop, RAPIDSTOP(2) means all axes stop rapidly.

Grammar:

CANCEL(mode) AXIS (main axis), RAPIDSTOP(mode)

 

B. Types of linear interpolation

--3 forms can be selected--

MOVE: relative motion

The distance parameter of interpolation is the relative distance to current interpolation starting point, SPEED speed parameter is used.

For example:

image 5.png

image 6.png

image 7.png

MOVEABS: absolute motion

The distance parameter of interpolation is the absolute distance to origin point, ABS suffix is added behind MOVE relative motion instruction, and SPEED speed parameter is used.

For example:

image 8.png

image 9.png

image 10.png

MOVESP/MOVEABSSP

The instructions that are with SP use FROCE_SPEED to set speed parameter compulsively to move, not the SPEED. It only needs to add SP suffix behind MOVE or MOVEABS. And FORCE_SPEED parameter can enter motion buffer area to achieve dynamic speed.

Example 1 (SP instruction):

image 11.png

image 12.png

image 13.png

 

C. Other examples.

--MOVESP dynamic speed--

MOVESP linear interpolation motion uses the speed set by FORCE_SPEED instruction, and starting speed of each SP motion can be customized through STARTMOVE_SPPED, ending speed of each SP motion can be customized through ENDMOVE_SPPED, please note when they are not used, set bigger values.

Codes:

image 14.png

Curve:

when speed is 0, it starts to move for completing three linear interpolation motions. The first motion's speed is 50, the second is 60 and the third one is 80.

image 15.png

--Speed ratio control--

In linear interpolation motion, SPEED_RATIO can be used to set the ratio of current motion speed, make current motion speed = SPEED*SPEED_RATIO, and when the instruction was sent out, the command will take effect at once. Therefore, dynamic speed can be achieved through this command.

Codes:

image 16.png

Curve:

image 17.png

--Pause and resume--

MOVE_PAUSE is used to pause the motion, there are several modes:

image 18.png

Codes:

image 19.png

Curve:

image 20.png







03
Linear Interpolation Routine


(1) two axes continuous interpolation is to complete "pentagram".

Routine codes:

image 21.png

Sampled waveform:

image 22.png

Sampled 2-axis interpolation trajectory:

image 23.png  

(2) pentagram video

image 24.jpg


ABOUT ZMOTION

That's all, thank you for your reading -- Linear Interpolation of EtherCAT Bus Motion Controller.

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 .


Copyright © 2013-2024 Shenzhen Zmotion Technology Co.,Ltd Design by Zmotion    粤ICP备13037187号 Motion Controller-Motion Control Card