NC Positioning Control Instruction FUN 147 Mhspo Multi-Axis High Speed Pulse Output FUN 147 Mhspo
NC Positioning Control Instruction FUN 147 Mhspo Multi-Axis High Speed Pulse Output FUN 147 Mhspo
NC Positioning Control Instruction FUN 147 Mhspo Multi-Axis High Speed Pulse Output FUN 147 Mhspo
FUN 147
MHSPO
FUN 147
MHSPO
Range
Operand
Gp
SR
WR
HR
DR
ROR
R0
D0
R5000
01
Instruction Explanation
1. The FUN147 (MHSPO) instruction is used to support the linear interpolation for multi-axis motion control, it
consists of the motion program written and edited with text programming. We named every position point as
a step (which includes output frequency, traveling distance, and transfer conditions). Every step of positioning
point owns 15 registers for coding.
2. The FUN147 (MHSPO) instruction can support up to 4 axes for simultaneous linear interpolation; or 2 sets of 2-axis
linear interpolation (i.e. Gp0 = Axes Ps0 & Ps1 ; Gp1 = Axes Ps2 & Ps3)
3. The best benefit to store the positioning program into the registers is that in the case of association with MMI
(Man Machine Interface) to operate settings, it may save and reload the positioning program via MMI when
replacing the molds.
4. When execution control EN=1, if the other FUN147/FUN140 instructions to control Ps03 are not active
(corresponding status of Ps0=M1992, Ps1=M1993, Ps2=M1994, and Ps3=M1995 will be ON), it will start to
execute from the next step of positioning point (when goes to the last step, it will be restarted from the first
step to perform); if Ps03 is controlled by other FUN147/FUN140 instruction (corresponding status of
Ps0=M1992, Ps1=M1993, Ps2=M1994, and Ps3=M1995 would be OFF), this instruction will acquire the pulse
output right of positioning control once the controlling FUN147/FUN140 has released the control right.
5. When execution control input EN =0, it stops the pulse output immediately.
6. When output pause PAU =1 and execution control EN was 1 beforehand, it will pause the pulse output.
When output pause PAU =0 and execution control is still 1, it will continue the unfinished pulse output.
7. When output abort ABT=1, it stops pulse output immediately.
becomes 1 next time, it will restart from the first step of positioning point to execute.)
8. While the pulse is in output transmitting, the output indication ACT is ON.
9. When there is execution error, the output indication ERR will be ON.
(The error code is stored in the error code register.)
10. When each step of positioning point is complete, the output indication DN will be ON.
13-9
FUN 147
MHSPO
The working mode of Pulse Output must be set (without setting, Y0Y7 will be treated as general output) to
be one of U/D, or A/B mode, thus the Pulse Output may have a regular output.
U/D mode : Y0 (Y2, Y4, Y6), it sends out upward counting pulse.
Y1 (Y3, Y5, Y7), it sends out downward counting pulse.
A/B mode : Y0 (Y2, Y4, Y6), it sends out the phase A pulse.
Y1 (Y3, Y5, Y7), it sends out the phase B pulse.
The output polarity for Pulse Output can select to be Normal ON or Normal OFF.
M1991
M1992
ON : Ps0 is ready
OFF : Ps0 is in action
M1993
ON : Ps1 is ready
OFF : Ps1 is in action
M1994
ON : Ps2 is ready
OFF : Ps2 is in action
M1995
ON : Ps3 is ready
OFF : Ps3 is in action
M1934
M1935
M2000 : ON, multi axes act simultaneously (At the same scan to execute the motion control
instructions FUN140/FUN147 for different axes, they will have the pulse output at
the same time without any time delay between them)
DR4068
DR4070
D4060
D4061
D4062
The step number (positioning point) which has been completed of Gp0.
D4063
The step number (positioning point) which has been completed of Gp1.
Ps
No.
Ps0
Ps1
Ps2
Ps3
Current output
frequency
DR4080
DR4082
DR4084
DR4086
Current pulse
position
DR4088
DR4090
DR4092
DR4094
FUN147 doesnt support dynamic change for its output frequency during the pulse transmitting.
13-10
FUN 147
MHSPO
A55CH
Total steps
SR+2
SR+3
SR+15
SR+16
SR+N15+2
1 3 - 11
FUN 147
MHSPO
WR+1
Working flag
WR+2
Controlled by system
WR+3
Controlled by system
WR+4
Controlled by system
WR+5
Controlled by system
WR+6
Controlled by system
WR+7
Controlled by system
WR+8
Controlled by system
WR+0 : If this instruction is in execution, the content of this register represents the step (1N) being performed.
If this instruction is not in execution, the content of this register represents the step where it stopped at
present
When execution control EN =1, it will perform the next step, i.e. the current step plus 1 (if the current
step is at the last step, it will restart to perform from the first step).
Before starting the execution control EN =1, the user can renew the content of WR+0 to determine
starting from which step to perform (when the content of WR+0 =0, and execution control EN =1, it
represents that the execution starts from the first step).
WR+1 : B0B7, total steps
B8 = ON, output paused
B9 = ON, waiting for transfer condition
B10 = ON, endless output
B12 = ON, pulse output transmitting (the status of output indicator ACT)
B13 = ON, instruction execution error (the status of output indicator ERR)
B14 = ON, finished being executed step (the status of output indicator DN)
*** When step which has been completed, the output indication DN will turn ON and keep such status if
suspending ; the user may turn OFF the status of DN by using the rising edge of output coil controlled by
"DN" to clear the content of WR+1 register to be 0, and it can be attained.
13-12
FUN 147
MHSPO
Error indication
Error code
R4060Ps0
0 : Error free
R4061Ps1
1 : Parameter 0 error
R4062Ps2
2 : Parameter 1 error
R4063Ps3
3 : Parameter 2 error
D4060Gp0
4 : Parameter 3 error
D4061Gp1
5 : Parameter 4 error
6
Parameter 5 error
7 : Parameter 6 error
8 : Parameter 7 error
9 : Parameter 8 error
10 : Parameter 9 error
13
Parameter 12 error
14
Parameter 13 error
15
Parameter 14 error
happen, you can clear the content of error indication register to be 0, and it still maintains the value at 0.
13-13
FUN 147
MHSPO
New Table
13-14
FUN 147
MHSPO
For easy programming and trouble shooting, the WinProladder provides the text editing environment to edit
the motion program (servo program table) for FUN147 execution.
Instruction
Operand
SPD
XXXXXX or
Rxxxx
or
Dxxxx
LIN
ADRXYZWUt
or
or
ABS
Ps
Where,
XStroke setting of Ps0
YStroke setting of Ps1
ZStroke setting of Ps2
WStroke setting of Ps3
Explanation
y Setting of the vector speed for linear interpolation
1 setting value 1840000
y Moving speed in frequency or velocity (FUN141 Parameter_0=0
represents velocity; Parameter_0=1 or 2 for frequency; the
system default is frequency). The operand can be input directly
with constant or variable (Rxxxx, Dxxxx); when the operand is
variable, it needs 2 registers, e.g. D10 represents D10 (Low
Word) and D11 (High Word), which is the setting of frequency
or velocity.
y When selecting to use the velocity setting, the system will
automatically convert the velocity setting to corresponding
output frequency
y The corresponding axis frequency for output will be calculate
from the setting of the vector speed
y Output frequency range: 1output frequency921600 Hz.
y Moving stroke setting in Ps or mm,Deg,Inch
(When FUN141 Parameter_0=1, the setting stroke in Ut is Ps;
Parameter_0=0 or 2, the setting stroke in Ut is mm, Deg, Inch;
the system default for Ut is Ps).
y When 6_th operand of LIN is Ut (not Ps) , according to the
settings of parameter 1, 2, 3 of FUN141, the system will convert
the corresponding pulse count to output.
y There are 6 operands to construct LIN instruction as follows:
1_st operand: coordinate selection.
ADR or ABS: ADR, relative distance movement
ABS, absolute position movement
2_nd5_th operands: moving stroke setting for each axis
It can directly input with constant or variable
XXXXXXXX:
(Rxxxx, Dxxxx); it needs 2 registers when
or
adopting the variable, e.g. R0 represents R0
XXXXXXXX
(Low Word) and R1 (High Word) as the
or Rxxxx
setting of moving stroke.
or Dxxxx
Positive setting value moves forward
Negative setting value moves backward
*** When the setting of moving stroke is 0 or in space and 1_st
operand is ADR, it means no movement for this axis
*** When the setting of moving stroke is in space and 1_st
operand is ABS, it means no movement for this axis
Maximum setting for one movement must be under 1999999 Ps
6_th operand: resolution of stroke setting
Ut or Ps: for Ut, the resolution is one unit
(it is determined by parameter 0, 3 of FUN141); for Ps, the
enforced resolution is one pulse.
13-15
FUN 147
MHSPO
Operand
Explanation
Note: Comparison explanation between the relative coordinate positioning (ADR) and the absolute coordinate
positioning (ABS)
To move from position 30000 to 10000, the coding for programming is:
DRV ADR,,40000,Ut or DRV ABS, ,10000,Ut
-10000
10000
20000
30000
Ut
To move from position 10000 to 10000, the coding for programming is:
DRV ADR,+,20000,Ut or DRV ABS, ,10000,Ut
Instruction
WAIT
Operand
Time, XXXXX
or Rxxxx
or Dxxxx
or X0X255
or Y0Y255
or M0M1911
or S0S999
Explanation
y When pulse output is complete, performing the wait instruction to go to the
assigned step. There are 5 kind of operands that explained as follows:
Time: The waiting time (the unit is 0.01 second), it can be directly input with
constant or variable (Rxxxx or Dxxxx); when it is time up, performs
the step that assigned by GOTO.
X0X255: Waiting until the input status is ON, it performs the step that
assigned by GOTO.
Y0Y255:Waiting until the output status is ON, it performs the step that
assigned by GOTO.
M0M1911: Waiting until the internal relay is ON, it performs the step that
assigned by GOTO.
S0S999: Waiting until the step relay is ON, it performs the step that
assigned by GOTO.
13-16
FUN 147
MHSPO
EXT
X0X255
or Y0Y255
or M0M1911
or S0S999
NEXT
GOTO
or 1N
or Rxxxx
or Dxxxx
MEND
z
If there are N
Format and example for the positioning program with linear interpolation:
; Vector speed is 5K Hz
LIN
ADR,500,400,300,200 Ut
WAIT
Time,100
GOTO NEXT
ADR,D100,D200,
WAIT
Time,R500
, Ut
GOTO NEXT
003 SPD R1002
LIN
ADR,0 ,0,R300,R400, Ps
WAIT X0
; Wait until X0 ON
GOTO 1
13-17
FUN 147
MHSPO
It means the moving stroke setting for axis Ps0(X axis) is 1000 Ps, for axis Ps1(Y axis) is 500 Ps; both axes
Ps2 and Ps3 are inactive due to the setting values are 0.
13-18