You are on page 1of 10

NC Positioning Control Instruction

FUN 147
MHSPO

FUN 147
MHSPO

Multi-Axis High Speed Pulse Output


Gp : Group number (01)
SR

: Starting register for positioning program


(example explanation)

WR : Starting register for instruction operation (example


explanation).

It controls 9 registers, which the other

program cannot repeat in using.

Range
Operand
Gp
SR
WR

HR

DR

ROR

R0
D0
R5000

R3839 D3999 R8071

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.

(When the execution control input EN

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

NC Positioning Control Instruction


FUN 147
MHSPO
***

Multi-Axis High Speed Pulse Output

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.

The interfaces for positioning control

M1991

ON : Stop or pause FUN147, slow down then stop pulse output


OFF : Stop or pause FUN147, stop pulse output immediately

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

ON : Gp0 has finished the last step

M1935

ON : Gp1 has finished the last step

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

Gp0 vector speed

DR4070

Gp1 vector speed

D4060

Gp0 error code

D4061

Gp1 error code

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

The remaining pulse


counts to be transmitted
DR4072
DR4074
DR4076
DR4078

FUN147 doesnt support dynamic change for its output frequency during the pulse transmitting.

13-10

NC Positioning Control Instruction


FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

FUN 147
MHSPO

z Format of positioning program with linear interpolation:


SR: Starting register of registers block which reserved to store positioning program, explained as follows:
SR
SR+1

A55CH

The effective positioning program; its starting register must be A55CH

Total steps

SR+2
SR+3

The first positioning point (step) of positioning program


(every step owns 15 registers for coding).

SR+15
SR+16

The Nth step of positioning program.

SR+N15+2

1 3 - 11

NC Positioning Control Instruction


FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

FUN 147
MHSPO

z Explanation for working register of instruction operation:


WR is the starting of working registers.
WR+0

Being executed or stopped step

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

NC Positioning Control Instruction


FUN 147
MHSPO

FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

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

The possible error codes

7 : Parameter 6 error

for FUN141 execution

8 : Parameter 7 error
9 : Parameter 8 error
10 : Parameter 9 error
13

Parameter 12 error

14

Parameter 13 error

15

Parameter 14 error

30 : Error of variable address for speed setting


31 : Error of setting value for speed setting
32 : Error of variable address for stroke setting
33 : Error of setting value for stroke setting
34 : Illegal positioning program
35 : Length error of total step
36 : Over the maximum step
37 : Limited frequency error
38 : Initiate/stop frequency error

The possible error codes

39 : Over range of compensation value for movement


40 : Over range of moving stroke

for FUN140 and FUN147


execution

41 : ABS positioning is not allowed within DRVC commands


42 : DRVZ cant follow DRVC
50 : Illegal operation mod of DRVZ
51 : Illegal DOG input number
52 : Illegal PG0 input number
53 : Illegal CLR output number
60 : Illegal linear interpolation command
Note : The content of error indication register will keep the latest error code.

Making sure that no more error to

happen, you can clear the content of error indication register to be 0, and it still maintains the value at 0.

13-13

NC Positioning Control Instruction


FUN 147
MHSPO

FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

Editing Servo Program Table with WinProladder


Click the Servo Program Table Item which in project windows :
Project name
Table Edit
Servo Program Table

Click right button and select

New Table

Table Type : Multi-Axis positioning table


Table Name : For modify or debug, you can give a convenient name.
Table Starting address : Enter the address which Starting register of

13-14

NC Positioning Control Instruction


FUN 147
MHSPO
z

Multi-Axis High Speed Pulse Output

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.

Extended positioning instructions for linear interpolation are listed as follows:

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

NC Positioning Control Instruction


FUN 147
MHSPO
Instruction
LINE

FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

Operand

Explanation

ADRXYZWUt y LINE is used for linear interpolation in endless movement


or
or
ABS
Ps y There are 6 operands to construct LINE instruction as LINs
description
Where,
y The stroke setting for each axis means the output ratio between the
XStroke setting of Ps0
active axes, the axis with longest movement is followed by others
YStroke setting of Ps1
i.e. In LINE mode, if the stroke settings are 10005003000( In Ps),
ZStroke setting of Ps2
WStroke setting of Ps3
it means if Ps0 axis sends 1000Ps, then Ps1 and Ps2 will send
500Ps and 300Ps respectively. (Axis Ps3 doesnt work due to the
setting value is 0).
It will follow this ratio (1000/500/300/0) for pulse output until the
FUN147 instruction is stopped or exists from the LINE mode.

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

NC Positioning Control Instruction


FUN 147
MHSPO

FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

EXT

X0X255

y External trigger instruction; when it is in pulse output (the number of pulses


sending is not complete yet), if the status of external trigger is ON, it will
perform the step assigned by GOTO immediately. If the status of external
trigger is still OFF when the pulse output has been complete, it is the same
as WAIT instruction; waiting the trigger signal ON, then perform the step
assigned by GOTO.

or Y0Y255
or M0M1911
or S0S999

NEXT

GOTO

y When matching the transfer condition of WAIT, ACT, EXT instruction, by


using GOTO instruction to describe the step to be executed.

or 1N
or Rxxxx

NEXT: It represents to perform the next step.

or Dxxxx

1N : To perform the described number of step


Rxxxx: The step to be performed is stored in register Rxxxx
Dxxxx: The step to be performed is stored in register Dxxxx

MEND
z

End of the positioning program.

The editing for positioning programming with linear interpolation:


First, it must complete the FUN147 instruction before the editing of positioning program, and assigned in
FUN147 instruction the starting register of registers block to store positioning program. While editing the
positioning program, it will store the newly edited positioning program to the assigned registers block; for
every one positioning point (called as one step) edited, it owns 15 registers for coding.

If there are N

positioning points, it will be used by N 15 + 2 registers in total.


Note: The registers storing the positioning program can not be repeated in using!
z

Format and example for the positioning program with linear interpolation:

001 SPD 5000

; Vector speed is 5K Hz

LIN

ADR,500,400,300,200 Ut

; Moving forward 500(Ps0)/400(Ps1)/300(Ps2)/200(Ps3) units

WAIT

Time,100

; Wait for 1 second

GOTO NEXT

; Perform the next step

002 SPD R1000


LIN

ADR,D100,D200,

WAIT

Time,R500

; Vector speed is stored in DR1000 (R1001 and R1000)


,

, Ut

GOTO NEXT
003 SPD R1002
LIN

ADR,0 ,0,R300,R400, Ps

; Moving stroke is stored in DD100(Ps0) & DD200(Ps1)


; The waiting time is stored in R500
; To perform the next step
; Vector speed is stored in DR1002 (R1003 and R1002)
; Moving stroke is stored in DR300(Ps2) & DR400(Ps3)

WAIT X0

; Wait until X0 ON

GOTO 1

; Perform the first step

13-17

NC Positioning Control Instruction


FUN 147
MHSPO

Multi-Axis High Speed Pulse Output

FUN 147
MHSPO

Example and figure for description


The positioning program with linear interpolation instruction as below:

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

You might also like