0% found this document useful (0 votes)
2 views30 pages

Chapter 14

Chapter 14 discusses the integration of NC positioning control within FB-PLC systems, highlighting the transition from ordinary motors to advanced stepping and servo motors for improved precision and efficiency. It outlines various methods for controlling these motors, including digital I/O, analogue output, and high-speed pulse commands, with a focus on the advantages of high-speed pulse control. The chapter also details the configuration procedures and hardware wiring for effective positioning control, emphasizing the simplicity and cost-effectiveness of the integrated system.

Uploaded by

Roman Rivera
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views30 pages

Chapter 14

Chapter 14 discusses the integration of NC positioning control within FB-PLC systems, highlighting the transition from ordinary motors to advanced stepping and servo motors for improved precision and efficiency. It outlines various methods for controlling these motors, including digital I/O, analogue output, and high-speed pulse commands, with a focus on the advantages of high-speed pulse control. The chapter also details the configuration procedures and hardware wiring for effective positioning control, emphasizing the simplicity and cost-effectiveness of the integrated system.

Uploaded by

Roman Rivera
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 14 The NC positioning control of FB-PLC

People use ordinary motor to exercise positioning control in early stage; since the speed and precision demand
was not so high then, it was enough to fulfill the demand. As the increasing of mechanical operation speed for the
efficiency purpose, finished product quality standard, and precision demands are getting higher, the stopping position
control of motor is no more what the ordinary motor is capable to do. The best solution for this problem is to adopt NC
positioning controller which incorporate with stepping or servo motor to do the position control. In the past, the extremely
high cost limited the prevailing of its usage; however, the technology advance and cost decreasing, which made the
pricing affordable, had helped to increase the prevailing of usage gradually. To cope with this trend, the FB-PLC
integrated into its internal ASIC chip the special NC positioning controller that is available on the market, therefore makes
it free from the bothersome data transaction and linking procedure between PLC and special NC positioning controller.
Furthermore, it greatly lowered the entire gadget cost hence provides the user the solution for a good bargain, high quality,
simple, and convenient integrated NC positioning control with PLC.

14.1 The methods of NC positioning

The methods for controlling interface of PLC and stepping or servo driver are as follows:
Giving command by way of digital I/O: Easy to use but less dexterity in application.
Giving command by way of analogue output: Better dexterity in controlling reaction but it is with a higher cost and
easy to be interfered by noise.
Giving command by way of communication: There is no standard for communication protocol and it is confined in
communication reaction thus constitutes a bottleneck for application.
Giving command by way of high speed pulse: The cost is low and is easy to precisely controlled.
Of these methods, controlling stepping or servo driver with high speed pulse is more frequently used method. The
main unit of PLC contains multi-axis high speed pulse output and hardware high speed counter, and it can provide easy
using, designing for positioning program editing. Therefore it makes the related application even more convenient and
comfortable.

Following two kinds are frequently used NC server system that constituted by PLC associates with server drivers:
Semi closed loop control

The PLC is responsible for sending high speed pulse command to server driver. The shift detection signal
installed on servo motor will forward directly to server driver, closed loop reaches only to server driver and
servo motor. The superior point is that the control is simple and the precision is satisfactory (which is suitable
for most of the applications). The defect is that it can’t fully reflect the actual shift amount after the
transmission element; furthermore, the element being consumed, become aging, or has defect will not be able
to be compensated nor checked to verify.

Closed loop control

The PLC is responsible for sending high speed pulse command to server driver. In addition to that the shift
detection signal installed on servo motor which will be forwarded directly to server driver, the attached shifting
detector installed after the transmission element can fully reflect the actual shift amount and forward it to the
high speed counter that PLC contains. So as to make the control becomes more delicate, and help to avoid
the defect of above mentioned semi close loop.

14.2 Absolute coordinate and relative coordinate


The designation of moving distance can be assigned by absolute location (absolute coordinate positioning), or
assigned by relative distance (relative coordinate positioning). And the DRV instruction is used to drive motor.

While marking the moving distance with absolute coordinate,


if it is located at 100mm at the present, for moving to 300 mm, the positioning instruction is : DRV ABS, ,300 , Ut
if it is located at 300mm at the present, for moving to 0mm, the positioning instruction is : DRV ABS, , 0 , Ut.

While marking the moving distance with relative coordinate,


if it is located at 100mm at the present, for moving to 300 mm, the positioning instruction is : DRV ADR, +, 200, Ut.
if it is located at 300mm at the present, for moving to 0mm, the positioning instruction is : DRV ADR, −, 300, Ut.

14-1
Absolute coordinate labeling

Program coding for location of 300mm moving to 0mm:

DRV ABS, , 0,Ut


... ...
-100 0 100 200 300

Program coding for location of 100mm moving to 300mm:


DRV ABS, ,300,Ut

Relative coordinate labeling

Program coding for location of 300mm moving to 0mm:

DRV ADR,-,300,Ut
... ...
-100 0 100 200 300

Program coding for location of 100mm moving to 300mm:


DRV ADR,+,200,Ut

14.3 Procedures of using FB-PLC positioning control

Start

Configure the high speed pulse output (HSPSO) function


under PROLADDER or FP-07 configuration function. Switch
the Y0〜Y7 output of FB-PLC to HSPSO circuit in the ASIC, For the wiring layout, please refer to section
------
and determine the working mode of output pulse (U/D, 14.4.2.
CK/DR, A/B), and complete the hardware wiring layout
between PLC and positioning driver.

Each axis of motor is controlled by one FUN140 (it can also by


more than one, but only one can be active at any time); then
employs the FUN140 extended positioning instruction (SPD, Please refer to FUN140 and its extended
DRV,… etc.) to coding for the needed positioning control ------ positioning instruction for the function and usage
program that will be saved into register block assigned by explanation.
FUN140 SR operand. Once the FUN 140 input control
started, it can exercise the positioning controls.

If it needs to do close loop control, it can employ the FB-PLC


hardware high speed counter to count the feedback pulse
(e.g. Encoder etc.) after transmission element to achieve.

End

14-2
14.4 Explanation for the positioning control hardware of FB-PLC

14.4.1 Structure of output circuit of HSPSO

According to different main unit, it provides 1 axis (FBE-20MCT/FBN-19MCT), 2 axis (FBE-28MCT/FBN-26MCT), and
4 axis (FBE-40MCT/FBN-36MCT) of NC position control respectively. For the frequency of output pulse, it includes
20KHz (single phase) /10KHz (double phase) of single ended transistor output model (FBE-xxMCT), and high speed
differential output model (FBN-xxMCT) which can reach 512KHz (for both single/double phase), two series of models.

High speed pulse output circuit share to use the Y0〜Y7 exterior output of FB-PLC. While it is not yet using the
HSPSO function (haven’t configured the PSO function under configuration function), the Y0〜Y7 exterior output of
FB-PLC is corresponding to the Y0〜Y7 status of internal output relay. When the HSPSO has been configured, the Y0
〜Y7 exterior output will switch directly to HSPSO output circuit within ASIC, which has no relation with Y0〜Y7 relay
inside PLC.

The following is the detailed signals list for respective axis output of main unit and the selectable output modes:

Output modes
Axis No. Exterior output Remark
U/D output K/R output A/B output
PSO0 Y0 , Y1 Y0=U , Y1=D Y0=K , Y1=R Y0=A , Y1=B Valid for all FBx-xxMCT main unit
PSO1 Y2 , Y3 Y2=U , Y3=D Y2=K , Y3=R Y2=A , Y3=B Not for FBE-20MCT & FBN-19MCT.
PSO2 Y4 , Y5 Y4=U , Y5=D Y4=K , Y5=R Y4=A , Y5=B
Only for FBE-40MCT & FBN-36MCT.
PSO3 Y6 , Y7 Y6=U , Y7=D Y6=K , Y7=R Y6=A , Y7=B

14.4.2 Hardware wiring layout for FB-PLC positioning control

Take the 0_th axis (PSO0) of FBE and FBN main unit for example, it is illustrated with diagrams as follows; the others
are the same.

A, FBE single ended output wiring layout.

Driver (photocouple input)


FB E main unit

A phase
(or U or CK)

External power supply

B phase
(or D or DR)

14-3
Driver (OP input)

FB E main unit

A phase
(or U or CK)

External power supply

B phase
(or D or DR)

B、FBN differential output wiring layout

FB N main unit Driver (Photocouple input)

Y0 A phase (or U or CK)

Twisted pair

Y1 B phase (or D or DR)

FB N main unit Driver (Line receiver input)

Y0 A phase (or U or CK)

Twisted pair

Y1 B phase (or D or DR)

(For line receiver input, it must make PLC connect to FG of driver to eliminate common mode voltage)

14-4
14.5 The Explanation for the Position Control Function of FB-PLC

The position control function of FB-PLC incorporates the dedicated NC position controller, which is available in the
market, into the PLC. This makes the PLC and NC controller be able to share the same data block without the demand
of complicated works like data exchange and synchronized controlling between these two systems. And it can still use
the usual NC positioning control instruction (e.g. SPD , DRV,… etc.).

One main unit can control up to 4 axis of their position control, and can drive multi axis simultaneously. However,
it provides only point to point positioning and speed control, but it does not provide linear or circular interpolation function.
When the system is applying for more than 4 axis, it can also employ CPU LINK function of FB-PLC to attain control over
more positioning actions.

The NC position control instruction for FBE、FBN main units are identical to each other. The difference is only on the
different circuit output, as previously revealed. Hereby we assume that FBE main unit is used in the control of
stepping motor with lower speed, and FBN main unit is used in high speed servo motor control. Consequently, we
illustrate only with the connecting diagram of FBE main unit that driving stepping motor and the diagram of FBN main
unit that driving servo motor. Of course we can also use FBE main unit to drive servo motor or use FBN mainunit to
drive stepping motor instead, they can still work perfectly, as long as its circuit structure (single ended or differential)
and frequency can match.

14-5
14.5.1 Interface of Stepping Motor
FBE main unit
Y0 Forward turning pulse

Stepping motor
or pulse signal
Y0
Stepping
F
B Y1 Backward turning pulse motor
E or turning direction driver
| Y1
2
0 Z phase signal
F M
B C Xn
E T
| Forward turning pulse
2 Y2

Stepping motor
8 or pulse signal
Y2
M Stepping
C Backward turning pulse motor
T Y3
or turning direction driver
Y3
Z phase signal
F Xn
B
E
| Y4 Forward turning pulse
4

Stepping motor
or pulse signal
0 Y4
M Stepping
C Y5 Backward turning pulse motor
T or turning direction driver
Y5
Z phase signal
Xn

Y6 Forward turning pulse

Stepping motor
or pulse signal
Y6
Stepping
Y7 Backward turning pulse motor
or turning direction driver
Y7
Z phase signal
Xn

Stepping motor is designed to receive input pulse to attain to the control of desired angle or distance, therefore the
turning angle and the input pulse count has a positive correlation ship, and the turning speed also depends on the
input pulse frequency.
N : Revolving speed of motor (RPM)
N (RPM) = 60 × f / n f : Pulse frequency (Ps/Sec)
n : Pulse counts for motor to turn for a revolution (Ps/ Rev).
n = 360 / θs θs : Angle (Deg)
FULL HALF
Basic
Phase Pulse counts for Pulse counts for
pulse angle Pulse angle Pulse angle
turning one revolution turning one revolution
0.36 ° 0.36 ° 1000 0.18 ° 2000
5 phase
0.72 ° 0.72 ° 500 0.36 ° 1000
4 phase 0.90 ° 0.90 ° 400 0.45 ° 800
2 phase 1.80 ° 1.80 ° 200 0.90 ° 400

14-6
14.5.2 Interface of Servo Motor

FBN Main unit Servo driver

UP, CK, A
Y0
DN, DIR, B
Y1
F CLR (Clear the servo's error counter)
B Y8
N PG0 (Z phase signal)
| X2 # 1
DOG (Near home sensing)
1 X3
9 SERVO READY
F M Xn
C SERVO END
B T Xm
N
|
2 UP, CK, A
Y2
6 DN, DIR, B
M Y3
C CLR (Clear the servo's error counter)
T Y9
PG0 (Z phase signal)
X6 # 2
DOG (Near home sensing)
X7
SERVO READY
F Xn
SERVO END
B Xm
N
|
3 UP, CK, A
6 Y4
M DN, DIR, B
Y5
C CLR (Clear the servo's error counter)
T Y10
PG0 (Z phase signal)
X10 # 3
DOG (Near home sensing)
X11
SERVO READY
Xn
SERVO END
Xm

UP, CK, A
Y6
DN, DIR, B
Y7
CLR (Clear the servo's error counter)
Y11
PG0 (Z phase signal)
X14 # 4
DOG (Near home sensing)
X15
SERVO READY
Xn
SERVO END
Xm

※ Except that the Y0〜Y7 of above diagram are for dedicated purpose, Y8〜Y11 and respective inputs can be
adjusted for using according to demand.

※ The left over travel, right over travel limit switchs for safity detection also need to be connected to PLC to assure
proper operation.

14-7
14.5.3 Working Diagram Illustration for Servo Motor

Servo driver

Forward turning pulse


FBN-19MCT
FBN-26MCT Up/down Deviation
counter
FBN-36MCT
Backward turning pulse
Clear the error counter (CLR) D/A conversion

Error counter

Position reached (FINISH)

F→ V conversion -
Feedback pulse

Amplifier
Servo motor

The Encoder of servo motor feedback the shifting detection signal to servo driver. The driver gets the pulse
frequency, and pulse count of input signal (pulse command), as well as the frequency and pulse count of feedback
signal processed with internal error counter and frequency to voltage conversion circuit, and acquired the pulse and
turning speed deviations. Using these operations to control the servo motor, so as to obtain a high speed, precise
speed and positional closed-loop processing system.

The revolving speed of servo motor depends on the pulse frequency of input signal; the turning stroke of motor is
determined by pulse count.

Generally speaking, the final control error deviation of servo motor is ±1 pulse.

14.6 Explanation of Function for NC Position Control Instruction

The NC position control of FB-PLC has following four related instructions:

FUN140 (HSPSO) high speed pulse output instruction, which includes following 8 extension positioning
instructions:

1. SPD 5. ACT
2. DRV 6. EXT Used for positioning program coding and
3. DRVC 7. GOTO stored to SR operand area of FUN140

4. WAIT 8. MEND

FUN141 (MPARA) positioning parameter setting instruction

FUN142 (PSOFF) enforcing pulse output stop instruction.

FUN143 (PSCNV) converting the current pulse value to displaying value instruction.

The following function explanations are for the above mentioned 4 instructions:

14-8
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

Ps : The set number of Pulse Output (0〜3)


[Link] 0:Y0 & Y1
Execution control EN Ps : ACT 1:Y2 & Y3
SR : 2:Y4 & Y5
Pause PAU WR: 3:Y6 & Y7
ERR
SR: Starting register for positioning program
(example explanation)
Abort ABT DN
WR: Starting register for instruction operation (example
explanation). It controls 7 registers, which the other
program cannot repeat in using.

Range HR DR ROR K
R0 D0 R5000
Ope- ∣ ∣ ∣
rand R3839 D3071 R8071
Ps 0〜3
SR ○ ○ ○
WR ○ ○ ○*

Instruction Explanation

1. The NC positioning program of FUN140 (HSPSO) instruction is a program written and edited with text
programming. We named every position point as a step (which includes output frequency, traveling distance,
and transfer conditions). For one FUN140, it can be arranged with 250 steps of positioning points at the most,
with every step of positioning point controlled by 9 registers.

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

3. The NC positioning of this instruction without linear interpolation function.

4. When execution control “EN”=1, if the other FUN140 instructions to control Ps0 〜 3 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 Ps0〜3 is controlled by other 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 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 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.

14-9
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

*** The working mode of Pulse Output must be set (without setting, Y0〜Y7 will be treated as general output) to
be one of U/D, K/R, 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.

K/R Mode: Y0 (Y2, Y4, Y6), it sends the pulse out.


Y1 (Y3, Y5, Y7), it sends out the directional signal;
ON=upward counting, OFF= downward counting.

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.

hThe output polarity for Pulse Output can select to be Normal ON or Normal OFF.
hThe working mode of Pulse Output can be set in PROLADDER “HSC” (DOS version) setting page.

【Interface processing signals】

M1992: ON, Ps0 Ready


M1996: ON, Ps0 has finished the last step.
OFF, Ps0 is in action
M1993: ON, Ps1 Ready M1997: ON, Ps1 has finished the last step.
OFF, Ps1 is in action
M1994: ON, Ps2 Ready M1998: ON, Ps2 has finished the last step.
OFF, Ps2 is in action
M1995: ON, Ps3 Ready M1999: ON, Ps3 has finished the last step.
OFF, Ps3 is in action

M2000: ON, multi axes acting simultaneously (At the same scan, when execution control “EN”= 1of FUN140
instructions which control Ps0〜3, their pulses output will be sent at the same time without any time lag).
: OFF, as the FUN140 for Ps0〜3 starts, corresponding axis pulse output will be sent immediately; since
the ladder program is executed in sequence, therefore even the FUN140 for Ps0〜3 started at the same
scan, there must be some time lag between them.

Current output Current PS The remaining PS counts


Ps No. Error code
frequency position to be transmitted
Ps0 DR4080 DR4088 DR4072 R4060
Ps1 DR4082 DR4090 DR4074 R4061
Ps2 DR4084 DR4092 DR4076 R4062
Ps3 DR4086 DR4094 DR4078 R4063

※ R4056: When the value of low byte=5AH, it can be dynamically changed for its output frequency during the
high speed pulse output transmitting at any time.
When the value of low byte is not 5AH, it can not be dynamically changed for its output frequency
during the high speed pulse output transmitting.
When the value of high byte is 1, auto slow down will be initiated when dynamic changing frequency.
When the value of high byte is not 1, auto slow down will be negated when dynamic changing
frequency. The default value of R4056 is 0
R4064: The step number (positioning point) which has been completed of Ps0.
R4065: The step number (positioning point) which has been completed of Ps1.
R4066: The step number (positioning point) which has been completed of Ps2.
R4067: The step number (positioning point) which has been completed of Ps3.

14-10
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

Format of positioning program:

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

SR A55AH The effective positioning program; its starting register must be A55AH

SR+1 Total steps 1〜250

SR+2

SR+3

SR+4

SR+5

SR+6 The first positioning point (step) of positioning program


(every step controlled by 9 registers).
SR+7

SR+8

SR+9

SR+10

The N_th step of positioning program.

SR+N×9+2

1 4 - 11
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

Explanation for working register of instruction operation:

WR is the starting register.

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+0: If this instruction is in execution, the content of this register represents the step (1〜N) 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:B0〜B7, total steps

B8 =ON, output paused

B9 =ON, waiting for transfer condition

B10=ON, endless output (the stroke operand of DRV command is set to be 0 Ut)

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

*** Once the FUN140 instruction has been started (the B12 of WR+1=ON) and if suspended by a shut down for
emergency or switchover from auto to manual mode while the pulse output has not yet completed, this
instruction will be negated at next execution. It must clear the WR+1 register to be 0 before restarts the
instruction next time, so as to make the instruction be initiated again; otherwise, the pulse output will not
appear!

*** Whether execution control “EN” =0 or 1, executing the FUN140 instruction every scan , there won’t have the
situation mentioned above.

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

14-12
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

Error indication Error code

R4060(Ps0) 0 : Error free

R4061(Ps1) 1 : Parameter 0 error

R4062(Ps2) 2 : Parameter 1 error

R4063(Ps3) 3 : Parameter 2 error

4 : Parameter 3 error The possible error codes

5 : Parameter 4 error for FUN141 execution

7 : Parameter 6 error

8 : Parameter 7 error

9 : Parameter 8 error

10 : Parameter 9 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 The possible error codes

36 : Over the maximum step for FUN140 execution

37 : Limited frequency error

38 : Initiate/stop frequency error


39 : Over range of compensation value for movement

40 : Over range of moving stroke

41 : ABS positioning is not allowed within DRVC commands

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; as long as the content maintains at 0,
it represents that there’s no error happened.

14-13
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

To make it easy to edit, read, and maintain the positioning program, we have extended following related
instructions under FUN140 instruction. The user may edit, and modify the positioning program directly in
PROLADDER (if you are editing the program with PROLADDER in DOS version, key in the complete
FUN140 instruction and then move cursor to location of FUN140 instruction and press “ALT” “Z” at the
same time and it will display and allow to edit the positioning program. While editing the positioning
program, simultaneously pressed “Shift” “INS” means to insert a positioning point at the cursor location;
simultaneously pressed “Shift” “DEL” means to delete the positioning point at the cursor location;
simultaneously pressed “ALT” “INS” or “Shift” “+” means to add a positioning point to the bottom).
Extended positioning instructions are listed as follows:
Instruction Operand Explanation
SPD XXXXXX or Moving speed in frequency or velocity (FUN141 Parameter_0=0
Rxxxx or represents velocity; Parameter_0=1 or 2 for frequency; the
Dxxxx 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.
When selecting to use the velocity setting, the system will
automatically convert the velocity setting to corresponding
output frequency.
Output frequency range: 10≦output frequency≦512000 Hz.
*** When the output frequency is 0, this instruction will wait until
the setting value isn’t 0 to execute the positioning pulse
output.
*** When the setting value of frequency is smaller than 10, pulse
output goes with 10Hz.

DRV ADR ,+ ,XXXXXXXX,Ut Moving stroke setting in Ps or mm,Deg,Inch


ADR ,+ ,XXXXXXXX,Ps (When FUN141 Parameter_0=1, the setting stroke in Ut is Ps;
ADR ,− ,XXXXXXXX,Ut Parameter_0=0 or 2, the setting stroke in Ut is mm, Deg, Inch;
ADR ,− ,XXXXXXXX,Ps the system default for Ut is Ps).
ADR , , XXXXXXXX,Ut When 4_th operand of DRV is Ut (not Ps) , according to
ADR , ,−XXXXXXXX,Ut parameter setting of 1, 2, 3 of FUN141, the system will convert
ADR , , XXXXXXXX,Ps the corresponding pulse count to output.
ADR , ,−XXXXXXXX,Ps There are 4 operands to construct DRV instruction as follows:
ADR ,+ ,Rxxxx,Ut
1_st operand: coordinate selection.
ADR ,+ ,Rxxxx,Ps
ADR ,− ,Rxxxx,Ut ADR or ABS: ADR, relative distance movement
ADR ,− ,Rxxxx,Ps ABS, absolute position movement
ADR , ,Rxxxx,Ut 2_nd operand:
ADR , ,Rxxxx,Ps revolving direction selection (Valid for ADR only).
ADR ,+ ,Dxxxx,Ut '+' , forward or clockwise
ADR ,+ ,Dxxxx,Ps '−' , backward or counterclockwise
ADR ,− ,Dxxxx,Ut ' ' ,direction is determined by the setting value
ADR ,− ,Dxxxx,Ps (positive value: forward; negative value: backward)
ADR , ,Dxxxx,Ut
3_rd operand: moving stroke setting
ADR , ,Dxxxx,Ps
ABS , , XXXXXXXX,Ut XXXXXXXX: It can directly input with constant or variable
ABS , ,−XXXXXXXX,Ut or (Rxxxx, Dxxxx); it needs 2 registers when
ABS , , XXXXXXXX,Ps −XXXXXXXX adopting the variable, e.g. R0 represents R0
ABS , ,−XXXXXXXX,Ps (Low Word) and R1 (High Word) as the
or Rxxxx setting of moving stroke.
ABS , ,Rxxxx,Ut
ABS , ,Rxxxx,Ps or Dxxxx
ABS , ,Dxxxx,Ut *** When the setting of moving stroke is 0 and 4_th operand is Ut,
ABS , ,Dxxxx,Ps it represents to revolve endless, and current PS position will
not be updated.
Stroke setting range: −99999999 ≤ stroke setting ≤ 99999999
4_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 Ps.

14-14
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

Instruction Operand Explanation


DRVC ADR,+,XXXXXXXX,Ut The usage of DRVC and the operand explanation is the same as
or or or or DRV’s instruction.
ABS,−, Rxxxx ,Ps *** DRVC is used to do successive speed changing control (8 speeds
or at the most).
Dxxxx *** Of the successive speed changing control, only the first DRVC
instruction can use the absolute value coordinate for positioning.
*** The revolution direction of DRVC can only be decided by ‘+’ or ‘−’.
*** The revolution direction only determined by the first DRVC of
successive DRVC instructions; i.e. the successive speed
changing control can only be the same direction.
*** The output frequency of DRVC must be ≥ 141Hz.
For example: successive 3 speed changing control
001 SPD 10000 * Pulse frequency = 10KHz.
DRVC ADR,+,20000,Ut * Forward 20000 units.
GOTO NEXT
002 SPD 50000 * Pulse frequency =50 KHz
DRVC ADR,+,60000,Ut * Forward 60000 units.
GOTO NEXT
003 SPD 3000 * Pulse frequency = 3KHz.
DRV ADR,+,5000,Ut * Forward 5000 units.
WAIT X0 * Wait until X0 ON to restart from
GOTO 1 the first step to execute.

Note: The number of DRVC instructions must be the number of


successive speeds deducted by 1, i.e. the successive speed
changing control must be ended with the DRV instruction.
The above mentioned example is for successive 3 speeds changing
control, which used 2 DRVC instructions and the third must use DRV
instruction.
Diagram illustration for the above mentioned example:
f

f2
50000

f1
10000
f3
3000

20000 60000 5000 Ut

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 0 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

14-15
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

Instruction Operand Explanation

WAIT Time, XXXXX When pulse output is complete, performing the wait instruction for going
to the next step. There are 5 kind of operands that explained as follows:
or Rxxxx
Time: The waiting time (the unit is 0.01 second), it can be directly input with
or Dxxxx
constant or variable (Rxxxx or Dxxxx); when it is time up, performs
the step that assigned by GOTO.
or X0〜X255 X0〜X255: Waiting until the input status is ON, it performs the step that
assigned by GOTO.
or Y0〜Y255
Y0〜Y255:Waiting until the output status is ON, it performs the step that
or M0〜M1911
assigned by GOTO.
or S0〜S999
M0〜M1911: Waiting until the internal relay is ON, it performs the step that
assigned by GOTO.
S0〜S999: Waiting until the step relay is ON, it performs the step that
assigned by GOTO.

ACT Time,XXXXX After the time to output pulses described by operand of ACT, it performs
or Rxxxx immediately the step that assigned by GOTO, i.e. after the pulse output for
or Dxxxx a certain time, it performs the next step immediately. The action time (the
unit is 0.01 second) can be directly input with constant or variable (Rxxxx
or Dxxxx); when the action time is up, it performs the step assigned by
GOTO.

EXT X0〜X255 External trigger instruction; when it is in pulse output (the number of pulses
or Y0〜Y255 sending is not complete yet), if the status of external trigger is ON, it will
or M0〜M1911 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
or S0〜S999
as WAIT instruction; waiting the trigger signal ON, then perform the step
assigned by GOTO.

GOTO NEXT When matching the transfer condition of WAIT, ACT, EXT instruction, by
or 1〜N using GOTO instruction to describe the step to be executed.
or Rxxxx NEXT: It represents to perform the next step.
or Dxxxx 1〜N: 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 The end of the positioning program.

14-16
NC Positioning Control Instruction

FUN 140 High Speed Pulse Output FUN 140


HSPSO (Including the Extended Positioning Instruction) HSPSO

The coding for positioning programming:

First,it must complete the FUN140 instruction before the editing of positioning program, and assigned in
FUN140 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 is controlled by 9 registers. If there are N
positioning points, it will be controlled by N × 9 + 2 registers in total.

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

Format and example for the positioning program 1:


001 SPD 5000 ; Pulse frequency = 5KHz.
DRV ADR,+,10000,Ut ; Moving forward 10000 units.
WAIT Time,100 ; Wait for 1 second.
GOTO NEXT ; Perform the next step.
002 SPD R1000 ; Pulse frequency is stored in DR1000 (R1001 and R1000).
DRV ADR,+,D100,Ut ; Moving forward,the stroke is stored in DD100 (D101 and D100).
WAIT Time,R500 ; The waiting time is stored in R500.
GOTO NEXT ; To perform the next step.
003 SPD R1002 ; Pulse frequency is stored in DR1002 (R1003 and R1002).
DRV ADR,−,D102,Ut ; Moving backward,the stroke is stored in DD102 (D103 and D102).
EXT X0 ; When external trigger X0 (slow down point) ON, it performs the next
GOTO NEXT ; step immediately.
004 SPD 2000 ; Pulse frequency = 2KHz.
DRV ADR,−,R4072,Ps ; Keep outputing the remain (stored in DR4072).
WAIT X1 : Wait until X1 ON,
GOTO 1 : Perform the first step.

Format and example for the positioning program 2:


001 SPD R0 ; Pulse frequency is stored in DR0 (R1 & R0).
DRV ABS, ,D0,Ut ; Move to the position stored in DD0 (D1 & D0).
WAIT M0 ; Wait until M0 ON,
GOTO NEXT ; Perform the next step.
002 SPD R2 ; Pulse frequency is stored in DR2 (R3 & R2).
DRV ADR, ,D2,Ut ; Moving stroke is stored in DD2 (D3 & D2);working direction determined
; by the sign of setting value
MEND ; End of positioning program

14-17
Example for FUN140 Program Application

Program example: Jog forward


As the jog forward button has been pressed for less than 0.5 second (changeable), it sends out only one
(changeable) pulse;
As the jog forward button has been pressed for more than 0.5 second (changeable), it continuously sends pulses
out (the frequency is 10KHz, changeable), until the release of the jog forward button to stop the pulse transmitting;
or it may be designed to send N pulses out at the most.

Jog forward button


EN RST M1 • Clear finish signal.

EN RST R 2000 • Perform from the first step every time.


Jog
forward Servo Manual Condition
button ready operation for action
M1 M0
( )
M0

M0 [Link] M1000
EN PS : 0 ACT ( )
Positioning Program: SR : R 5000 M1001
001 SPD 1000 PAU WR: R 2000 ERR ( )
DRV ADR,+,1,Ps
WAIT TIME,50 M1002
ABT DN ( )
GOTO NEXT
002 SPD 10000
DRV ADR,+,999999,Ut
MEND

M0 M1996 • When the last step been complete,


EN SET M1
set finish signal.

Program example: Jog Backward


As the jog backward button has been pressed for less than 0.5 second (changeable) it sends out only one
(changeable) pulse;
As the jog backward button has been pressed for more than 0.5 second (changeable), it continuously sends
pulses out (the frequency is 10KHz, changeable), until the release of the jog backward button to stop the pulse
transmitting; or it may be designed to send N pulses out at the most.
Jog backward button • Clear finish signal.
EN RST M3 • Perform from the first step every time.
• When the last step been complete,
set finish signal.
EN RST R 2007
Jog
backward Servo Manual Condition
button ready operation for action M3 M2
( )
M2

M2 [Link]
M1003
EN PS : 0 ACT ( )
SR : R 5020 M1004
Positioning Program: PAU WR: R 2007 ERR ( )
001 SPD 1000
DRV ADR,−,1,Ps M1005
WAIT TIME,50 ABT DN ( )
GOTO NEXT
002 SPD 10000
DRV ADR,−,999999,Ut
MEND
M2 M1996
EN SET M3

14-18
NC Positioning Instruction

FUN 141 FUN 141


Instruction of Parameter Setting for Positioning Program
MPARA MPARA

[Link]
Ps: The set number of Pulse Output (0〜3).
Execution control EN Ps : ERR
SR: Starting register for parameter table, it has totally 18
SR :
parameters which controlled by 24 registers.

Range HR DR ROR K
R0 D0 R5000
Ope- ∣ ∣ ∣
rand R3839 D3071 R8071
Ps 0〜3
SR ○ ○ ○

Instruction explanation
[Link] instruction is not necessary if the system default for parameter value is matching what users need.
However, if it needs to open the parameter value to do dynamic modification, this instruction is required.
[Link] instruction incorporates with FUN140 for positioning control purpose.
3. Whether the execution control input “EN” = 0 or 1, anyway, this instruction will be performed.
4. When there is error in parameter value, the output indication “ERR” will be ON, and the error code is appeared
in the error code register.

Explanation for the parameter table:


SR =Starting register of parameter table, suppose it is R2000.

R2000 (SR+0) 0〜2 Parameter 0 System default =1


R2001 (SR+1) 1〜65535 Ps/Rev Parameter 1 System default =2000
1〜999999 µM/Rev
DR2002 (SR+2) 1〜999999 mDeg/Rev Parameter 2 System default =2000
1〜999999×0.1 mInch/Rev
R2004 (SR+4) 0〜3 Parameter 3 System default =2
10〜512000 Ps/Sec
DR2005 (SR+5) Parameter 4 System default =512000
1〜153000
10〜512000 Ps/Sec
DR2007 (SR+7) Parameter 5 System default =10000
1〜153000
0〜10000 Ps/Sec
R2009 (SR+9) Parameter 6 System default =0
0〜153000
R2010 (SR+10) 0〜32767 Parameter 7 System default =0
R2011 (SR+11) 0〜30000 Parameter 8 System default =5000
R2012 (SR+12) 0〜1 Parameter 9 System default =0
R2013 (SR+13) -32768〜32767 Parameter 10 System default =0
R2014 (SR+14) -32768〜32767 Parameter 11 System default =0
R2015 (SR+15) Reserved Parameter 12 System default =0
R2016 (SR+16) Reserved Parameter 13 System default =1
DR2017 (SR+17) -999999〜999999 Parameter 14 System default =0
10〜512000 Ps/Sec
DR2019 (SR+19) Parameter 15 System default =20000
1〜153000
10〜512000 Ps/Sec
DR2021 (SR+21) Parameter 16 System default =1000
1〜153000
R2023 (SR+23) 0〜255 Parameter 17 System default =10

14-19
NC Positioning Instruction

FUN 141 FUN 141


Instruction of Parameter Setting for Positioning Program
MPARA MPARA

Explanation for the parameter:

Parameter 0: The setting of unit, its default is 1.

When the setting value is 0, the moving stroke and speed setting in the positioning program will
all be assigned with the unit of mm, Deg, Inch, so called machine unit.
When the setting value is 1, the moving stroke and speed setting in the positioning program will
all be assigned with the unit of Pulse, so called motor unit.

When the setting value is 2, the moving stroke setting in the positioning program will all be
assigned with the unit of mm, Deg, Inch, and the speed setting will all be assigned with the unit
of Pulse/Sec, which is called as compound unit.

Parameter 0, unit setting “0” machine unit “1” motor unit “2” compound unit

Parameter 1, 2 Must be set No need to set Must be set

Parameter 3, 7, 10, 11 mm,Deg,Inch Ps mm,Deg,Inch

Parameter 4,5,6,15,16 Cm/Min,Deg/Min,Inch/Min Ps/Sec Ps/Sec

Parameter 1: Pulse count/1 revolution, its default is 2000, i.e. 2000 Ps/Rev.
The pulse counts needed to turn the motor for one revolution
A= 1〜65535 (for value greater than 32767, it is set with hexadecimal) Ps/Rev

Parameter 2: Movement/1 revolution, its default is 2000, i.e. 2000 Ps/Rev.


The movement while motor turning for one revolution.
B=1〜999999 µM/Rev
1〜999999 mDeg/Rev
1〜999999×0.1 mInch/Rev

Parameter 3: The resolution of moving stroke setting, its default is 2.

Parameter 0 Set value=0, machine unit; Set value=2, compound unit; Set value=1, motor unit
Parameter 3 mm Deg Inch Ps
Set value =0 ×1 ×1 ×0.1 ×1000
Set value =1 ×0.1 ×0.1 ×0.01 ×100
Set value =2 ×0.01 ×0.01 ×0.001 ×10
Set value =3 ×0.001 ×0.001 ×0.0001 ×1

Parameter 4: The limited speed setting, its default is 512000, i.e. 512000 Ps/Sec.
Motor and compound unit: 10〜512000 Ps/Sec.
Machine unit: 1〜153000 (cm/Min, ×10 Deg/Min, Inch/Min).
However, the limited frequency can’t be greater than 512000 Ps/Sec.
f_max =(V_max ×1000×A)/(6×B)≤ 512000 Ps/Sec
f_min ≥ 10 Ps/Sec

Note: A = Parameter 1, B =Parameter 2.

14-20
NC Positioning Instruction

FUN 141 FUN 141


Instruction of Parameter Setting for Positioning Program
MPARA MPARA

Parameter 5: Reserved, it is recommended for jog speed, the default = 10000 Ps/Sec.

Parameter 6: Initiate/Stop speed, the default = 0.


Motor and compound unit: 0〜10000 Ps/Sec.
Machine unit: 0〜15300 (cm/Min, ×10 Deg/Min, Inch/Min).
However, thelimited frequency can’t be greater than 512000 Ps/Sec.

Parameter 7: Backlash compensation, the default =0.


Setting range: 0〜32767 Ps.
While backward traveling, the traveling distance will be added with this value automatically.

Parameter 8: Acceleration/Deceleration time setting, the default = 5000, and the unit is mS.
Setting range: 0〜30000 mS.
The setting value represents the time required to accelerate from idle state upto limited speed
state or declerate from the limited speed state down to the idle state.

Parameter 9: Coordinnate direction setting, the default =0.


Setting value =0, while in forward pulse output, the current Ps value is adding up.
While in backward pulse output, the current Ps value is deducting down.
Setting value =1, while in forward pulse output, the current Ps value is deducting down.
While in backward pulse output, the current Ps value is adding up.

Parameter 10: Forward movement compensation, the default = 0.


Setting range: −32768〜32767 Ps.
When it is in forward pulse output, it will automatically add with this value as the moving
distance.

Parameter 11: Backward movement compensation, the default =0.


Setting range: −32768〜32767 Ps.
When it is in backward pulse output, it will automatically add with this value as the moving
distance.

Parameter 12: Reserved.

Parameter 13: Reserved.

Parameter 14: Reserved, it is recommended to be used as machine's home position, the default = 0.

Parameter 15: Reserved, it is recommended to be used as return home speed, the default = 20000 Ps/Sec.

Parameter 16: Reserved, it is recommended to be used as slow down speed while returning home ,
the default = 1000 Ps/Sec.

Parameter 17: Reserved, it is recommended to be used as the setting value of Z phase count, the default = 10.

14-21
NC Positioning Instruction

FUN 142 FUN 142


Enforcing to Stop Pulse Output
PSOFF PSOFF

142.P N: 0〜3, enforces the asigned set number of Pulse Output


Stop control EN PSOFF N to stop its output.

Instruction Explanation

1. When stop control “EN” =1, or “EN↑” ( instruction) changes from 0→1, this instruction will enforce the
assigned set number of Pulse Output to stop its output.
2. When applying in the process of return home , as the home has returned, it can immediately stop the pulse
output by using this instruction, so as to make it stop at the same position every time when performing
machine homing.

Program example

; When M0 changes from 0→1, it enforces the


M0 142.P Ps0 to stop the pulse output.
EN PSOFF 0

14-22
NC Positioning Instruction

FUN 143 Converting the Current Pulse Value to the Displaying Value FUN 143
PSCNV (mm, Deg, Inch, PS) PSCNV

Ps: 0〜3; converting the asigned pulse position to mm (Deg,


[Link] Inch, PS) which has the same unit as the set point, so
Execution control EN Ps : as to make the current position displayed.
D :
D: Registers that store the current position after conversion.
It uses 2 registers, e.g. D10 represents D10 (Low
Word) and D11 (High Word) two registers.

Range HR DR ROR K
R0 D0 R5000
Ope- ∣ ∣ ∣
rand R3839 D3071 R8071
Ps 0〜3
D ○ ○ ○*

Instruction Explanation
[Link] execution control “EN” =1 or “EN↑” (P instruction) changes from 0→1, this instruction will convert the
assigned current pulse position (PS) to be the mm (or Deg, Inch, or PS) that has the same unit as the set
value, so as to make current position displaying.

[Link] the FUN140 instruction has been performed, it will then be able to get the correct conversion value by
executing this instruction.

Program Example

M0 [Link] ; When M0=1, it converts the current pulse position of


EN PS : 0 Ps0 (DR4088) to the mm (or Deg or Inch or PS) that
D : D 10 has the same unit as the set value, and store it into the
DD10 to make the current position displaying.

14-23
14.7 Machine Homing

The machine set which undertakes relative model Encoder as shifting detector usually need the reset action for
the reference of positioning coordinate; we called this action as machine homing (seeking for zero reference).

The machine homing diagram for NC servo unit is as follows:

Method 1:
Return home speed

Slow down speed


Left over travel limit switch Near home sensing Right over travel limit switch

When it encounters the near home signal, starts the Z phase counting.

Z phase counting is up, the pulse output stops, then send out the CLR signal to clear the error counter of servo
driver.

e.g.:
X3: Near home sensing input is configured as interrupt input; in the case of machine homing, it starts HSC4 to
begin counting in INT3 interrupt service subroutine.
X2: Z phase counting input, it is configured as UP input of HSC4; the X2+ is prohibited to interrupt in regular time,
when executing machine homing and X3 near home interrupt occurred, it starts HSC4 to begin Z phase
counting. When HSC4 counting is up, it stops the pulse output, prohibit the X2+ interrupt, set home
position to signal, and sends out the CLR signal to clear the error counter of servo driver. Please consult
program example.

Method 2: According to application demand, it may slow down when encountering the near home sensor, while over
the sensor a little far away, stop the pulse output, and then traveling slowly with backward direction; the
very moment when it get out of near home sensor (the sensing signal changes from 1→0), it is treated as
machine home. This program is simpler!

(1)
Home speed
(2) Slow down
speed
(3)
Stop
(4) Slowly (5)
backward Stop

Near home signal 1→0, machine zero reference

Left over travel limit switch Near home sensing Right over travel limit switch

X3: Near home sensing input; it is configured as falling edge interrupt input.

• Once encountering the near home sensor, it will enable X3 falling edge interrupt, and slow down to stop
within the near home sensing range.
• Slowly backward traveling until the near home sensing signal changes from 1→0.
• When the near home sensing signal changes from 1→0, it performs the INT3- interrupt service
subroutine immediately.
• The INT3- interrupt service subroutine: Stops the pulse output immediately, prohibits the X3- interrupt,
sets home position to signal, and sends out CLR signal to clear the error counter of servo driver.
(Please consult the example program.)

14-24
Program Example 1: Machine homing (method 1)
X2: Configured as the UP input of HSC4, and connected to Z phase input.
X3: Configured as the rising edge interrupt input, and connected to near home sensing input.
【Main Program】
M1924 146
EN DIS X2+I • Prohibits X2+ interruption
(HSC4 does not count)
[Link]
EN Ps : 0 ERR • Parameter table R2900→R2923.
SR : R 2900

M92
EN RST M50
• Clears the homing completion signal.

EN RST M5 • Clears the instruction completion


signal for homing

EN RST M1007 • Clears the error signal.

EN RST R 2014 • Clears the step pointer, it starts from


the first step to execute.
D
EN RST R 4112 • Clears the current value of HSC4.

• Clears the High Word of preset value


EN RST R 4115
for HSC4.
[Link]
EN S : R 2923 • Fill the prset value of HSC4 with the
D : R 4114 content of Parameter 17 of FUN141.
SERVO Manual
M92 READY operation M5 M50 M1007 M4
( )
M4

M4 [Link] M1006
EN Ps : 0 ACT ( ) • Configure R5000〜R5199 as the
Positioning program:
SR : R 5040 M1007 read only register (ROR) before
001 SPD R2919
DRV ADR,−,999999,Ut PAU WR: R 2014 ERR ( ) programming, after then, when
EXT X3 storing program, the Ladder
GOTO NEXT ABT DN program will automatically contains
002 SPD R2921
the positioning program.
DRV ADR,−,9999,Ut
MEND
M4 M1996
EN SET M5 • Homing instruction completed

M50 M51
( ) • Signal for homing completion

M51 [Link]
EN S : 0 • Fill the current PS registers with 0,
D : R 4088 while homing completed.

Y8 .01S
EN T0 50 TUP • Signal to clear error counter of servo
driver -- Y8 is ON for 0.5 second.
T0
EN RST Y8

14-25
【Sub Program】

65
LBL X3+I • X3 rising edge interrupt service subroutine.

M4 145
EN EN X2+I • Enables HSC4 counting if homing.
69
RTI

65
LBL HSC4I • Interrupt service subroutine of HSC4
(Z phase counting is up)
M4 142
EN PSOFF 0 • Stops pulse output immediately.

146
EN DIS X2+I • Prohibits rising edge interrupt of X2.

Y8
( ) • Output to clear error counter of servo
driver.
M50
( ) • Sets the homing completion signal.

[Link]
EN D : Y8
N : 1 • Sends output immediately.

69
RTI

14-26
Program Example 2: Machine homing (method 2)

X3: Connected to near home sensing input, and configured as falling edge interrupt input.

【Main Program】

M1924 67
EN CALL INIT
65
LBL HOME

Servo Manual Left over


Homing ready operation travel limit M20
( )
M20
EN RST M50 • Clears the homing completion signal.

• Clears the instruction completion


EN RST M5
signal for homing.
D
• Clears the step pointer, it starts from
EN RST R2014
SERVO the first step to execute.
M20 READY M5 M50 M4
( )
M4

M4 X3 145P
EN EN X3-I • Enable X3− (falling edge) interrupt.

M4 [Link] M1006 • Configure R5000〜R5199 to be the


EN Ps : 0 ACT ( ) read only register (ROR) before
Positioning Program: SR : R 5040 programming, after then, when storing
001 SPD R2919
PAU WR: R 2014 ERR program, the Ladder program will
DRV ADR,−,999999,Ut
EXT X3 automatically contains the positioning
GOTO NEXT ABT DN program.
002 SPD 1000
DRV ADR,−,1000,Ps
WAIT TIME,10
GOTO NEXT
003 SPD R200
DRV ADR,+,999999,Ut
MEND

M4 M1996
EN SET M5 • Homing instruction completed.

M50 M51
( ) • Signal for homing completion.
M51
EN SET Y8 • Output to clear error counter of servo
driver -- Y8 is ON for 0.3 second.
Y8 .01S
EN T0 30 TUP

T0
EN RST Y8

[Link]
EN S : 0 • Fill the current PS registers with 0.
D : R 4088

14-27
【Sub Program】

65
LBL INIT
146
EN DIS X3-I • Prohibits X3− interrupt
[Link]
EN Ps : 0 ERR • Parameter table R2900〜R2923
SR : 2900

68
RTS

65
LBL X3-I (I) X3 falling edge interrupt service
subroutine.

M4 142
EN PSOFF 0 • Stops pulse output immediately
146
EN DIS X3-I • Prohibits X3− interrupt

M50
( ) • Sets the homing completion signal.
69
RTI

14-28
Program Example 3: JOG Forward

Jog forward button


EN RST M1 • Clears the completion signal

D
• Starts from the first step every
EN RST R 2000
jog execution.
Jog
forward Servo Manaul Acting
button ready operation condition M1 M0
( )
M0

M0 [Link] M1000
EN PS : 0 ACT ( )
Positioning program: SR : R 5000 M1001
001 SPD 1000
PAU WR: R 2000 ERR ( )
DRV ADR,+,1,Ps
WAIT TIME,50
GOTO NEXT ABT DN
002 SPD R2907
DRV ADR,+,99999999,Ut
MEND
M0 M1996 • As the execution of last step
EN SET M1
completed, it sets up the
completion signal.

Program Example 4: JOG Backward

Jog backward button


EN RST M3 • Clears the completion signal.

D
EN RST R 2007 • Starts from the first step every
Jog jog execution.
backward Servo Manaul Acting
button ready operation condition M3 M2
( )
M2

M2 [Link] M1003
EN PS : 0 ACT ( )
Positioning Program
SR : R 5020 M1004
001 SPD 1000
DRV ADR,−,1,Ps PAU WR: R 2007 ERR ( )
WAIT TIME,50
GOTO NEXT ABT DN
002 SPD R2907
DRV ADR,−,99999999,Ut
MEND
M2 M1996
EN SET M3 • As the execution of the last step
completed, it sets up the
completion signal.

14-29
Program Example 5: Step by step, One cycle, Continuous positioning control.

M93 : Start
M101 : Step by step operation mode
M102 : One cycle operation mode
M103 : Continuous operation mode
M104 : Regular shut down.
M105 : Emergency stop.

M93
EN RST M7
• Clears shut down signal.

EN RST M1010 • Clears the error signal.

EN RST M1011 • Clears the step completion signal.

M101 • Except step by step mode, the step


EN RST R 2021
pointer is cleared to be 0; it starts
from the first step to execute.
EN RST R 2022 • Clears being active bit of FUN140
SERVO
M93 READY M105 M1010 M6
( )
M6 M101 M1011

M101 M7

M6 [Link] M1009
EN PS : 0 ACT ( )

Positioning program: SR : R 5100 M1010


PAU WR: R 2021 ERR ( )
001 SPD 1000
DRV ADR,+,20000,Ut M1011
WAIT TIME,100 ABT DN ( )
GOTO NEXT
002 SPD 20000
DRV ADR,+,40000,Ut
WAIT M200
GOTO NEXT
003 SPD 25000
DRV ADR,−,50000,Ut
WAIT TIME,500
GOTO NEXT
004 SPD 5000
DRV ADR,−,10000,Ut
WAIT X16
GOTO 1

M1996
M6 M102
EN SET M7 • Set up the shut down signal.
M103 M104

14-30

You might also like