In last article, we have lea rntwhat is motion controller PSO (position synchronous motion) function and PSO related commands.
Today, let's continue, the second part of PSO function, that is, PSO modes.
There are several PSO modes for motion controller, we can select suitable trigger mode modes to meet requirements for actual applications.
Here, it will introduce PSO modes one by one in details, including one video that shows operations in program platform ZDevelop.
At first, we need one controller that supports PSO function. Here, ZMC460N dual-bus motion controller is used.
For ZMC460N EtherCAT & RTEX bus controller, it is introduced before, please refer to last article or Zmotion product position.
PSO position synchronous output function is used to control high-speed switch on / off of laser or dispensing valve, then use linear interpolation and plane circular interpolation function to complete processing trajectory. In addition, the continuous interpolation function is used to make multiple interpolation speed continuous to promote production efficiency.
For PSO commands, they are mainly still HW_PSWITCH2 (hardware position comparison output) and HW_TIMER (hardware timer).
Then, let's see corresponding modes for each instruction.
--HW_PSWITCH2--Hardware Position Comparison Output
There are two types of modes:
a. compare data saved in TABLE, pulse width is determined by data span and motion speed, therefore, it needs to write data intoTABLEbefore comparison, then call them from TABLE.
The related modes aremode 1, 3, 7, 2D(25, 26), 3D (36, 36).
b. compare inequal-span and in cycle, which meansno need TABLE, it only needs to set the position where triggers the comparison and set periods through "HW_PSWITCH2", then set pulse width of each comparison output through "HW_TIMER". This kind of mode is with more parameter settings, and output with different distance can be achieved through multiple commands.
The related mode ismode 6. Mode 5 doesn't need TABLE and HW_TIMER, equal-space output & comparison in cycle can be realized.
Now, let's enter our main content, learn the PSO modes.
Please note modes are with different parameters, so there are several comparison trigger methods for all kinds of needs in actual applications.
See one by one in details.
Mode=1: single-axis comparison
HW_PSWITCH2(1,opnum,opstate,tablestart,tableend[,direction])
mode: 1-open comparer
opnum: relevant outputs
opstate: output status of the first comparison position
tablestart: TABLE No. that saves the first comparison point's absolute coordinate
tablesend: TABLE No. that saves the last comparison point's absolute coordinate
direction: the first coordinate to judge direction, 0-negative, 1-positive, -1-no direction used.
This mode is very easy. It needs TABLE register to save position coordinates that requires comparison output, then under PSO control, when reaching one comparison point position, it will inverse it, until all coordinates completed. Please refer to below image, it shows 6 comparison points' OP output, P means comparison point.
Example:
6 comparison coordinates: TABLE(0, 100, 150, 250, 300, 400, 450)
HW_PSWITCH2(1, 0, 1, 0, 5, 1): mode 1, OUT0, the first comparison point outputs ON, table address is 0-5, move forward.
when axis 0 reaches one comparison position, OP(0) is inverted once, until all TABLE compared, OP holds the last inversion status.
XY Mode
Mode=2: clear comparison position
HW_PSWITCH(2)
mode: 2-stop and delete comparison points that are not compared.
It needs to call this mode before using to clear data that may not be completed. In addition, it is also valid during the motion, that is, it also can be used to stop comparison.
Mode=3: vector comparison
HW_PSWITCH2(3, opnum, opstate, tablestart, tableend)
mode: 3-open comparer
opnum: relevant output
opstate: output status of the first comparison position
tablestart: TABLE No. where the first comparison point VECTOR_MOVED coordinate is
tableend: TABLE No. where the end comparison point VECTOR_MOVED coordinate is
Note: comparison points are written intoTABLE, when reached one comparison vector position, OP is inversed once. And when using vector distance comparison, it compares withVECTOR_MOVED, it is recommended to set initial value of "VECTOR_MOVED" before continuous motion.
Example:
6 vector position : TABLE(0, 100, 150, 250, 300, 400, 450)
HW_PSWITCH2(3, 0, 1, 0, 5): mode 3, OUT0, the first comparison point outputs ON, table address is 0-5 (vector coordinates)
when vector composed position VECTOR_MOVED(0) of axis 0 and axis 1 interpolation reaches one comparison position, OP(0) is inverted once, until all TABLE compared, OP holds the last inversion status.
XYZ mode
HW_PSWITCH2(4, opnum, opstate, vectstart)
mode: 4-open comparer
opnum: relavant output
opstate: output status of the first comparison position
vectstart: current motion distance VECTOR_MOVED of comparison position
When reached one comparison vector position, OP is inversed, then the comparison ends.
Example:
TABLE is not used.
HW_PSWITCH2(4, 0, 1, 100): mode 4, OUT0, the first comparison point outputs ON, comparison point vector coordinate is 100.
when vector composed position VECTOR_MOVED(0) of axis 0 and axis 1 interpolation reaches at 100 vector comparison position, OP(0) is inverted once, comparison completes.
XYZ Mode
Mode=5: vector comparison, pulse in cycle
HW_PSWITCH2(5,opnum, opstate, vectstart, repes, cycledis, ondis)
mode: 5-open comparer
opnum: relavant output
opstate: output status of the first comparison position
vectstart: current motion distance VECTOR_MOVED of comparison position
repes: repeat cycle, compare twice in one period, output valid state firstly, then output invalid state
cycledis: cycle distance, output opstate every other distance, then restore invalid state after ondis
ondis: output valid state distance, cycledis- ondis is invalid state distance
This mode doesn't need TABLE, but all coordinates refer to vector coordinates. It starts to compare from vectstart, and one comparison is triggered every other cycledis. In addition, repes is the repeat comparison cycle, when comparison signal is triggered each time, turn off the signal after holding ondis to wait for next period trigger.
Example:
TABLE is not used.
HW_PSWITCH2(5, 0, 1, 50, 8, 30, 5): mode 5, OUT0, start to compare from vector position 50, and trigger the comparison every other 30 distance, compare 8 times in total. When comparison is triggered, moves 5 then turns off.
when vector composed position VECTOR_MOVED(0) of axis 0 and axis 1 interpolation reaches at 50 vector comparison position, OP(0) is inverted once, then every 30 to open OP once, after moving 5, OP will be closed, all repeat 8 times.
XYZ mode
Mode=6: vector comparison method, cycle mode, used together with HW_TIMER
HW_PSWITCH2 (6,opnum,opstate,vectstart,repes,cycledis)
mode: 6-open comparer
opnum: relevant outputs
opstate: output status of the first comparison position
vectstart: comparison point VECTOR_MOVED current motion distance
repes: repeat period, compare once in one cycle
cycledis: period distance, output opstate every time after cycledis
Also, this mode doesn't need TABLE, it only needs to specify the "VECTOR_MOVED"ofthe first trigger position, including the times of comparison period, the distance of each output.Then, use "HW_TIMER" to control the pulse width and times of position output when achieves one period each time.
For HW_TIMER, it can control multiple OP inversion when reached one trigger point. When HW_TIMER completes, waiting for next period to be triggered.
Example:
TABLE is not used.
HW_PSWITCH2(6, 0, 1, 50, 15, 30): mode 6, OUT0, the first comparison point outputs ON, it starts to compare from vector position 50, and trigger the comparison every other 30 distance, compare 15 times in total.
HW_TIMER(2, 100000, 60000, 1, OFF, 0): the hardware timing period is 100000us, the pulse width is 60000us, output pulses once of each comparison.
when vector composed position VECTOR_MOVED(0) of axis 0 and axis 1 interpolation reaches at 50 vector comparison position, OP(0) is inverted once, then every 30 to open OP once, after 60000us, OP will be closed, all repeat 15 times.
XYZ Mode
Mode=7, vector comparison, used together HW_TIMER
HW_PSWITCH2 (7,opnum,opstate,tablestart,tableend[,optimeus, optimes, cycltimeus])
mode: 7-open comparer, opstate is not inverted, then it can matched with HW_TIMER
opnum: relevant outputs
opstate: output status of the first comparison position
tablestart: TABLE No. where the first comparison point VECTOR_MOVED coordinate is
tableend: TABLE No. where the end comparison point VECTOR_MOVED coordinate is
[select one from below parameters and HW_TIMER, HW_TIMER can be edited independently to adjust parameters dynamically]
optimeus: dynamically modify HW_TIMER valid time
optimes: dynamically modify trigger pulses of HW_TIMER, 0-not to output
cyctimeus: dynamically modify pulse period time of HW_TIMER
In this mode,comparison points are still saved into TABLE. And coordinates refer to vector coordinates, it will trigger OP when reached one TABLE comparison vector position, at this time, OP pulse width and comparison times of each time are controlled by HW_TIMER. When reached next TABLE position, OP will be triggered again.
Example:
TABLE(0 , 100, 150, 250, 300, 400, 450): 6 vector position
HW_PSWITCH2(7, 0, 1, 0, 5): mode 7, OUT0, the first comparison point outputs ON, TABLE address is 0-5 (vector coordinates)
HW_TIMER(2, 50000, 30000, 2, OFF, 0): the hardware timing period is 50000us, the pulse width is 30000us, output pulses twice of each comparison.
when vector composed position VECTOR_MOVED(0) of axis 0 and axis 1 interpolation reaches one TABLE position, OP(0) is inverted once, each trigger outputs twice, period is 500ms, after outputting 300ms valid pulses, OP will be closed, until all TABLE comparison points complete
XYZ Mode