Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

Economical EtherCAT Motion Controller (3) -- Multi-axis Linear Interpolation & Electronic Cam Achievement Through PLC

XPLC006E Function Introduction

XPLC006E is a kind of multi-axis economical EtherCAT bus motion controller developed by ZMotion Technology, and XPLC series motion controllers can be applied in all kinds of occasions that need offline or online operation.


image XPLC006E.png

XPLC006E has 6 motor axes itself, and motion control of 12 axes at most can be achieved (including virtual axes). Also, it supports 12-axis linear interpolation, electronic cam, electronic gear, synchronous follow, virtual axis setting, etc.

In addition, XPLC006E cost-effective controller supports multi-task run synchronously. At the same time, it can do simulation on PC directly. There are several valid programming methods, such as, Basic / PLC ladder diagram / HMI configuration in ZDevelop software and commonly used upper computer software.

For PC upper computer API programming, following interfaces are supported: C#, C++, LabVIEW, VB, matlab, Qt, Linux, .Net, iMAC, Python, ROS, etc.

image 1.png

→Actually, according to different axis numbers, there are XPLC004E, XPLC006E and XPLC008E

There is one note: XPLC006E belongs to bus motion controller, which means it only supports EtherCAT bus axes, pulse axes and encoder axes are invalid. Then, it uses EtherCAT bus and drive to communication with refresh cycle of 1ms.




XPLC864E2 Function Introduction

Let's see XPLC864E2, it is upgraded on the basis of XPLC006E, which means, it supports all functions of XPLC006E mentioned above, and usages are basically the same. However, some resource spaces are better than XPLC006E. What's more, XPLC864E2 supports 32 inputs, 32 outputs, 2 ADs and 2 DAs in hardware level, pulse axis and bus axis can be hybrid used. The number of real axes is 8 totally. Except EtherCAT interface, in hardware of output, signal output of 8 axes in pulse direction can be configured, and be with 2 encoder inputs set by input configuration.

Same, XPLC864E2 supports PLC, Basic and HMI configuration programming methods. For PC upper computer API programming, following interfaces are supported: C#, C++, LabVIEW, VB, matlab, Qt, Linux, .Net, iMAC, Python, ROS, etc.

XPLC864E2.png


image 2.png







01
Preparations

Firstly, download the latest edition ZMotion program software "ZDevelop V3.10.09" in "ZMotion Technology" -- "Download" or you could just contact me (Aileen -- E: zlm@zmotion.com.cm, T & Wechat & Whatsapp: +86 19925228195)

Then, prepare one XPLC series economy EtherCAT bus motion controller, and do wiring according to above XPLC006E reference wiring.

[ Note: if there is no controller, ZBasic development also can be done -- download the program into simulator. And the simulator is built in ZDevelop software installation package ]

image 5.png





02
Download PLC into Controller

(1) New build project item, and download program files into controller for motion. Please refer to below process showing.

image 6.png

(2) Open ".zpj" file -- connect to controller -- download the program -- program can run.

image 7.png

It is recommended to set only one main file for PLC automatic operation, so that the PLC has only one main loop, and other modules are called in the main loop.

PLC commands are not case-sensitive. Please refer to the "ZMotion PLC Programming Manual" for PLC commands. The manual can be quickly opened in the help menu bar of the software.

image 8.png






03
PLC Ladder of Diagram Program

The ladder diagram programming method is to draw the sequential control ladder diagram on the programming interface by using sequence symbols and soft element numbers. Since the sequential control loop is represented by contact symbols and coil symbols, which means the display is more intuitive and the program content is easier to understand.

What's more, it is more convenient to monitor and debug the program in the ladder diagram display state. The ladder diagram display example is shown below.

image 9.png

Please attention, END program end command must be included in program ending. Otherwise, it will report errors, and it can't be downloaded into controller for execution.

image 10.png

(1) For PLC instructions, there are several types according to instruction usages.

A. commonly used instructions: fetching contacts, output coils, timers, counters, etc.

B. contact comparison instructions: compare the values of two registers, and if the condition is met, the contact will be conducted.

C. transfer and comparison instructions: compare and transfer data between registers according to the rules.

D. loop and jump instructions: including conditional loop instruction and jump to subroutine execution instructions.

E. operation instructions: including four arithmetic operations and logical operation instructions.

F. shift instruction: move the data of the source operand bit by bit.

G. data processing instructions: perform other operations, such as encoding, decoding, etc.

H. floating-point arithmetic instructions: operations on 32-bit floating-point numbers.

I. other instructions: parameters related to axis motion.

(2) There are 16-bit PLC instructions and 32-bit PLC instructions according to operands bit.

16-bit data and 32-bit data are processed using different instructions. Except for the data length, the two are the same in other respects, and the processing data types both are with signed numbers.

→ 16-bit instruction -- the value range transmitted: -32768 -+32767.

→ 32-bit instruction -- the value range transmitted: -2147483648 - +2147483647.

(32-bit instructions generally occupy two consecutive 16-bit spaces)

(3) There are consecutive execution type and pulse execution type according to execution methods.

→ consecutive execution: each scan period executes once when conditions are met.

→ pulse execution: only execute once when conditions are met.

(Note: consecutive execution instruction + symbol P = pulse execution instruction)

(4) PLC soft-element form

image 11.png

The data type of counter C and timer T is related to the instruction used when accessing. When accessing through 16-bit instruction, the lower 16 bits are automatically used, and when accessing through 32-bit instruction, 32 bits are used.

(5) Corresponding relation between PLC and related register of Basic.

image 12.png






04
PLC Calls Basic Instructions

PLC can call Basic standard instructions through EXE instructions or EXEP instructions.

EXEP instructions are pulse format of EXE instructions, which can be used to call Basic standard instruction only when drive output is from OFF to ON.

Grammar Format:  "EXE   @BASIC instruction" is equal to "BASIC instruction".

image 13.png

Note: When using the EXE instruction to call the register, refer to the syntax of Basic after @, and "EXE @DT0=10" cannot appear, the correct writing should be "EXE @TABLE(0)=10".

Call the Basic linear interpolation syntax in the PLC as shown in the above figure, the linear interpolation PLC syntax "MOVE D0 D2", the operand should be in the format supported by the PLC operand, and the interpolation data is transmitted by the register, which means it cannot be given directly.

image 14.png






05
PLC Linear Interpolation Routine

Control pulse axis 0 and axis 1 do linear interpolation motion, then axis parameters and motion instructions call Basic instruction through EXE, and download edited program into XPLC006E for debugging and running.

(1) PLC control program.

image 15.png


(2) Program description

When the program is powered on and initialized, various parameters of the axis are initialized.

And when the rising edge of X0 is triggered, assign values to the registers D0 and D2 that store the moving distance of the two axes. When triggered by the rising edge of X1, the oscilloscope sampling is started, the MOVE linear interpolation movement is enabled and M0 is self-locking. The moving distance of axis 0 is 300, and motion distance of axis 1 is 400.

M8100 is the IDLE mark of axis 0. When the motion is completed, axis 0 stops, M8100 turns to ON, M1 is set for one cycle, the normally closed contact of M1 is disconnected for one cycle, and M0 self-locking is canceled.

Press X1 again, MOVE executes the linear interpolation motion of axis 0 and axis 1.

X2 is the emergency stop button, if the axis presses X2 during motion, it will stop quickly according to the value set by FASTDEC fast deceleration.

(3) Positions and speed curv of axis 0 and axis 1 captured by oscilloscope.

image 16.png

(4) Achieved program of above PLC program in Basic.


FOR i=0 TO 10         'MODBUS_BIT register is cleared

   MODBUS_BIT(i)=0

NEXT

BASE(0,1)                 'axis 0 and axis 1 parameters are initialized

UNITS = 100,100

ATYPE =1,1

SPEED = 200,200

ACCEL = 1000,1000

DECEL = 1000,1000

SRAMP = 200,200

DPOS = 0,0

MPOS = 0,0

FASTDEC = 20000,20000

WHILE 1                                 'loop detection input

   IF IN_SCAN(0,2) THEN         'scan electric level changes of IN0-2

   IF IN_EVENT(1)> 0 THEN     'open

       TRIGGER

       MOVE(300,400)

   ELSEIF IN_EVENT(2)> 0 THEN      'stop

       RAPIDSTOP(2)

   ENDIF

 ENDIF

WEND

END







06
PLC Shear-Cutting (Electronic Cam) Routine.

The PLC completes the shearing process by calling the MOVESLINK automatic cam command of Basic. The slave axis of the MOVESLINK automatic cam automatically plans the speed to follow the main axis movement. For the instruction usage, please refer to ZBasic Program Manual. And the main components of the PLC program are as follows:

(1) initialization part:

image 17.png

(2) select shearing axis No.

image 18.png

(3) axis parameters initialization:

image 19.png

(4) shearing parameters initialization:

image 20.png

(5) shearing motion

image 21.png

HMI interface: it can set shear processing parameters and control shearing motion. Also, it can show current axis position information at the same time.

image 22.png

The chasing shear waveform is as follows. The main axis is a conveyor belt moving at a constant speed. In the first stage, the slave axis (axis 1) follows the main axis (axis 2) from the initial position to accelerate. Then, the second stage, speeds of master axis and slave axis are the same, which means they achieve synchronization. Then, it is ready to return to the initial position after cutting downwards. In the third stage, the slave axis follows the main axis and decelerates to 0. In the fourth stage, the slave axis returns to the initial position in reverse to prepare for the next round of chasing shear.

image 23.png







That's all, thank you for your reading -- Economical EtherCAT Motion Controller (3) --  Multi-axis Linear Interpolation & Electronic Cam Achievement Through PLC.

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  has attracted experienced talents from famous companies or institutions, such as Huawei, ZET, Huazhong University of Science and Technology etc. ZMOTION insists self- innovating and collaborating with comprehensive universities, to research basic knowledge of motion control. 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.             

 

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...)

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

Contact Us-Youtube