XPCIE1032H is one EtherCAT PCI Express motion control card developed by Zmotion Technology.
And one software kernel is built.
In former lessons, we have learnt how to use C# to develop XPCIE1032H EtherCAT motion control card basically and how to debug it through RTSys.
RTSys can be used to debug PC programmed project. You can check corresponding article (lesson 6) and videos.
You could review them:
*Articles*
Lesson 1: we have learnt how to install MotionRT7 software drive.
Lesson 2: we have learnt how to build controller connection in C#
Lesson 3: we have learnt how to initialize EtherCAT in C#
Lesson 4: we have learnt how to switch EtherCAT modes in C#
Lesson 5: we have learnt how to configure IN as Encoder & OUT as Pulse in C#
Lesson 6: we have learnt how to debug C# program by RTSys
*Videos*
*XPCIE1032H Video Introduction*: https://youtu.be/B1ktSxIRa44
(1) XPCIE1032H C# Drive Install Video Help: https://youtu.be/0C96S5_hVf0
(2) XPCIE1032H C# Routine Speed Test: https://youtu.be/MYc8r18zh5U
(3) XPCIE1032H C# EtherCAT Initialization: https://youtu.be/uxnFbc3YoGQ
(4) XPCIE1032H C# EtherCAT Modes CSP, CSV, CST Switching: https://youtu.be/m_rShHHsAeE
(5) XPCIE1032H C# EtherCAT IO Configurations of IN Encoder & OUT Pulse: https://youtu.be/_tVoJiw8yDM
(6) XPCIE1032H C# Program Debugging by RTSys: https://youtu.be/WhgDjTMWAa4
(7) XPCIE1032H C# PSO & Position Latch : https://youtu.be/-z8SCA8uKq8
Still, provide one C# simple routine to help you understand PSO & Encoder Position Latch functions.
[What is PSO & Encoder Latch Functions]
[XPCIE1032H OUT for PSO & IN for Latch]
[One C# Program of PSO & Latch] -- If you need full codes, please contact us.
A. PSO Introduction
PSO: position synchronized output.
Specifically, it captures real-time encoder feedback position “MPOS” (pulse output position without encoder), then compares MPOS with the position that has already been set under comparison mode. In this way, control output OP synchronously output signals at high-speed, like below shown.
Generally, PSO and the laser (or dispensing spraying valve, etc.) output the signal at the same time to do phase synchronization. That is, the trajectory’s all phases (acceleration, deceleration, constant speed) trigger the output switch with the space of constant space / time, to make pulse energies process evenly on the object.
*PSO Properties*
It can output signals stably and at high-speed.
Its output accuracy is high enough, no need to consider the total speed, signals can be output with one fixed distance.
*PSO Function*
For one motion trajectory that uses PSO will be like right one:
Line motions are fast, even in corner deceleration, stable output is also achieved.
And as we all know, corner processing is just one small part, compared to other normal actions. When it is processed well by PSO, increasing the production capacity.
B. How to Achieve PSO
For Zmotion Technology, use ZAux_Direct_HwPswitch2 function to do PSO in C# (and other PC languages). It makes controller’s high-speed IO output the signal, the respond speed can be up to us level.
ZAux_Direct_HwPswitch2 (handle, axisnum, mode, opnum, opstate) | |
Handle | Connection handle |
Axisnum | The axis No. to compare output |
Mode | Compare modes: l Mode 1 – open comparator l Mode 2 – stop and delete uncompleted comparison points l Mode 3 – vector comparison l Mode 4 – vector comparison, single-point l Mode 5 – vector comparison, period pulse mode l Mode 6 – vector comparison, period pulse mode, used together with ZAux_Direct_HwTimer command. |
Opnum | The output No. |
Opstate |
The first comparison point’s output state. |
ModePara1 | Multi-function parameter |
ModePara2 | Multi-function parameter |
ModePara3 | Multi-function parameter |
ModePara4 | Multi-function parameter |
For details, please refer to Zmotion PC Programming Manual. |
A. Latch Introduction
“Position Latch”: record current encoder position by controller’s high-speed IN ports.
Specifically, when the latch signal is triggered, reading current position information into position register, clearing the former one latched position at the same time. Namely, the position of the last trigger is read.
Applications: packaging, printing, dispensing, vision fly-shooting, etc.
B. How to Achieve Latch
For Zmotion Technology, use ZAux_Direct_Regist function to latch position in C# (and other PC languages).
ZAux_Direct_Regist (handle, iaxis, imode) | |
Handle | Connection handle |
iaxis | The axis No. |
imode | Latch modes: l 1 – when meets Z pulse rising edge, send the absolute position to RegPo l 2 – when meets Z pulse falling edge, send the absolute position to RegPos l 3 – when meets input signal R0 rising edge, send the absolute position to RegPos l 4 –when meets input signal R0 falling edge, send the absolute position to RegPos l 5-21 (please refer to Zmotion PC Programming Manual) |
Not all Zmotion motion controllers support PSO function / position latch function.
XPCIE1032H card supports PSO and latch both.
It can be seen it has 16 inputs and 16 outputs.
A. XPCIE1032H IN
XPCIE1032H 16 inputs are 8 high-speed inputs and 8 normal inputs.
Among 8 high-speed inputs, IN0-IN3 can be configured as latch IN.
B. XPCIE1032 OUT
XPCIE1032H 16 outputs are all high-speed outputs. And they OUT0-OUT15 support hardware comparison output PSO function / precise output.
C. IO of Latch & PSO Wiring
(1) Related Commands of the C# Program of PSO & Latch
Except above described “ZAux_Direct_HwPswitch2” and “ZAux_Direct_Regist” commands, the commands in the form will also be used to do PSO and latching.
PSO Function C# Commands | |
ZAux_Direct_HwPswitch2 | PSO |
ZAux_Direct_HwTimer | Restore electric level after one certain time of PSO |
Latch Function C# Commands | |
ZAux_Direct_Regist | Latch single-position |
ZAux_Direct_GetRegPosB | Return to latch register 2 (ZAux_Direct_GetMarkB) measured position (ZAux_Direct_Mpos) |
ZAux_Direct_GetRegPos | Return to latch register 1 (ZAux_Direct_GetMark) measured position (ZAux_Direct_Mpos) |
ZAux_Direct_GetMark | The return state of reading latch event 0 |
ZAux_Direct_GetMarkB | The return state of reading latch event 1 |
For much information, please refer to Zmotion PC programming manual.
Download Add. : https://www.zmotionglobal.com/download_list_17.html
Contact Us: https://www.zmotionglobal.com/contactus.html
Including the C# library file.
How to call the PC library file, please review lesson 2 .
(2) C# Program of PSO & Latch Introduction
A. UI Interface
It can be known this program contains connection, state showing, PSO, latch, and motion.
B. C# Program of PSO Function
C. C# Program of Position Latch Function
(3) C# Program PSO & Latch Running Effect
After coding, it is time to compile and run the program. RTSys also can be connected to help debug, watching motion control axis parameters and motion situation.
Before testing, do wiring for latch IN and PSO OP.
*How to test it*
Step 1: connect to XPCIE1032H card through LOCAL.
Step 2: open PSO hardware position comparison at first.
Step 3: set high-speed comparison output OUT0 as PSO function, the comparison axis is axis 0, compare 4 points: 100, 200, 300, 400, and the first comparison output state as 1 (ON).
Step 4: open encoder latch function, set the latch axis No. as 3, choose latch mode 3.
Step 5: select axis 0 as motion axis (check axis 0), and enter the distance as 5000, at last, connect IN0 and OP0.
Then, when the axis moves 100, 200, 300, and 400, electric level will be triggered and changed, at the same time, save latched position.
Operation Effect of SCOPE Data