FX Series Programmable Controlers Applied Instructions 5
5.13.4 Servo Wiring Example
Example of connection to a Mitsubishi MR-J2-*A servo.
Note. The PLC required for this connection is a SINK Transistor output type.
*1 Connect to programmable controller when absolute position detection is required.
*2 Ports CN1A, CN1B, CN2 & CN3 are the same shape. Do not confuse them.
*3 Connect a limit switch to the servo amplifier.
*4 ONLY use a transistor output type PLC.
5-159
FX Series Programmable Controlers Applied Instructions 5
5.13.5 Example Program
The following example program for forward/reverse operation uses the I/O assignment shown
in section 5.13.4 Servo Wiring Example.
During operation positioning is performed using the absolute position method shown below.
In this example the actual output frequency for the first step, acceleration, and the last step,
deceleration, can be obtained using the following expression.
A = Maximum speed (D8146, D8147)
A 2 C 1000 = Output B = Acceleration/Deceration time
100000 2 200 1000 = 500Hz
Step Ladder program.
*1 When the maximum speed or Acceleration/deceleration do not have to be changed from
their initial values, programming is not required.
5-160
FX Series Programmable Controlers Applied Instructions 5
*2 The maximum size of a JOG command is 999,999 pulses, as this is the maximum number
of output pulses for a FNC 158 (DRVI) instruction. If a greater distance is required execute
more than one JOG command.
5-161
FX Series Programmable Controlers Applied Instructions 5
5-162
FX Series Programmable Controlers Applied Instructions 5
*3 The instruction drive timing is delayed by one opeation cycle to prevent simultaneous
driving of positioning instructions.
5-163
FX Series Programmable Controlers Applied Instructions 5
5.13.6 ABS (FNC 155)
Operands
Mnemonic Function Program steps
S D1 D2
ABS Reads the absolute X,Y,M,S Y,M,S T,C,D,V,Z DABS
FNC 155 position from a servo 13 steps
Absolute current motor
value read
Operation:
This instruction reads the absolute position data
when a Mitsubishi servo motor, MR-H or MR-J2,
equipped with absolute positioning function is
connected. [S] is the first of three inputs used for
communication flags (see drawing below), [D 1] is
the first of three communication outputs and [D2] is the data destination register.
Points to note:
a)This instruction is 32-Bit. Be sure to input as “DABS”
b)Read starts when the instruction drive contact turns ON. When the read is complete, the
execution complete flag M8029 is energized.
If the instruction drive contact is turned OFF during read, read is aborted.
c)When designing a system, set the servo amplifier to be ON earlier than the power of the
PLC, or so that they are both powered ON at the same time.
d)The device [D2] to which the absolute value is read, can be set within a word device range.
However, the absolute value should be transferred at some point to the correct registers
(D8141 & D8140)
e)The DABS instruction drive contact uses an input which is always ON, even after the
absolute value is read.
If the instruction drive contact turns OFF after the read is complete, the servo ON (SON)
signal will turn OFF and the operation disabled.
f)Even if the servo motor is equipped with an absolute position detection function, it is good
practice to execute a zero return operation during initial system set up.
FX1S-30MT MR-H-A MR-J2-A
CN1 CN1
ABS (bit 0)
X000 PF 24 X000 D01 4
ABS (bit 1)
X001 ZSP 23 X001 ZSP 19
Send Data Ready Flag
X002 TLC 25 X002 TLC 6
COM SG 16 COM SG 10
+
24V
Servo On
Y004 SON 12 Y004 SON 12
ABS Data Forwarding Mode
Y005 D13 44 Y005 ABSM 44
ABS Data Request
Y006 D14 45 Y006 ABSR 45
COM4
5-164
FX Series Programmable Controlers Applied Instructions 5
5.13.7 ZRN (FNC 156)
Operands
Mnemonic Function Program steps
S1 S2 S3 D
ZRN Return to zero home K,H,KnX,KnY, X,Y, Y ZRN:
FNC 156 point after machine KnM,KnS M,S Note: 9 steps
Zero return ON or initial setting. T,C,D,V,Z Y000 or DZRN:
Y001 only 17 steps
Contents:
When executing incremental or absolute
positioning, the PLC stores the current position
va l u e s w h i c h in c r e a s e o r d e c r e a s e d u r in g
operation.
Using these values, the PLC always knows the
machine position. However when the power to the PLC is turned off, this data is lost. To cope
with this the machine should return to the zero point when the power is turned ON, or during
initial set up, to teach the zero position.
[S1] is the Zero Return Speed, [S2] is the Creep Speed, [S3] is the Near Point Signal, and [D] is
the Pulse Output Designation.
Points to note:
a)Users may specify zero return speed [S1] as, 16-bit 10 to 32,767Hz or 32-bit 10 to 100kHz.
b)Users may specify the creep speed [S2} of 10 to 32,767Hz
c)If any device other than an input relay (X) is specified for the Near point signal [S3] it will be
affected by the operation cycle of the PLC and the dispersion of the zero point may be large.
d)Only Y000 or Y001 can be used for the pulse output [D].
Because of the nature of the high speed output, transistor type output units should be used
with this instruction. Relay type outputs will suffer a greatly reduced life, and will cause false
outputs to occur.
To ensure a ‘clean’ output signal when using transistor type units, the load current should be
200mA or higher with the FX2N Series. The load current should be 10 - 100mA with the FX1S/
1N Series. It may be necessary to use ‘pull up’ resistors.
e)If M8140 is set to ON, the clear signal is sent to the servo motor when the return to zero point
is complete.
f)Related device numbers.
D8141 (upper digit) & D8140 (lower digit) : Current value register of Y000 (32-bit)
D8143 (upper digit) & D8142 (lower digit) : Current value register of Y001 (32-bit)
D8147 (upper digit) & D8146 (lower digit) : Maximum speed when FNC156, FNC158 or
FNC159 are executed 100~100,000Hz.
D8148 : Acceleration/Deceleration time adopted when FNC156, FNC158 or FNC159 are
executed.
5-165
FX Series Programmable Controlers Applied Instructions 5
M8145 : Y000 pulse output stop (immediate)
M8146 : Y001 pulse output stop (immediate)
M8147 : Y000 pulse output monitor (BUS/READY)
M8148 : Y001 pulse output monitor (BUS/READY)
g)When a Mitsubishi MR-H or MR-J2 servo amplifier equipped with absolute position detection
function is used, the current position of the servo can be read by FNC 155 (ABS).
• Dog search function is not supported. Start zero return from the front side of the Near point
signal.
• Attention should be paid to the instruction drive timing.
5-166
FX Series Programmable Controlers Applied Instructions 5
5.13.8 PLSV(FNC157)
Operands
Mnemonic Function Program steps
S D1 D2
PLSV Variable speed K,H, Y Y,M,S PLSV
FNC 157 pulse output KnX,KnY, Note: 9 steps
Pulse V KnM,KnS Y000 or DPLSV
T,C,D,V,Z Y001 only 17 steps
Operation:
This is a variable speed output pulse instruction,
with a rotation direction output.
[S] is the Pulse Frequency, [D1] is the Pulse Output
Designation, and [D 2 ] is the Rotation Direction
Signal.
Points to note:
a)Users may use output pulse frequencies [S 1 ] of, 16-bit 10 to 32,767Hz or 32-bit 10 to
100kHz.
b)Only Y000 or Y001 can be used for the pulse output [D1].
Because of the nature of the high speed output, transistor type output units should be used
with this instruction. Relay type outputs will suffer a greatly reduced life, and will cause false
outputs to occur.
To ensure a ‘clean’ output signal when using transistor type units, the load current should be
200mA or higher with the FX2N Series. The load current should be 10 - 100mA with the FX1S/
1N Series. It may be necessary to use ‘pull up’ resistors.
c)Rotation direction signal output [D2} operated as follows: if [D2] = OFF, rotation = negative, if
[D2] = ON, rotation = positive.
d)The pulse frequency [S] can be changed even when pulses are being output.
e)Acceleration/deceleration are not performed at start/stop. If cushion start/stop is required,
increase or decrease the output pulse frequency [S] using the FNC67 RAMP instruction.
f)If the instruction drive contact turns off while pulses are output, the machine stops without
deceleration
g)Once the instruction drive contact is off, re-drive of the instruction is not possible while the
pulse output flag (Y000 : [M8147] Y001 : [M8148]) is ON.
h)The normal or reverse direction is specified by the positive or negative sign of the output
pulse frequency [S]
i)Related device numbers.
D8141 (upper digit) & D8140 (lower digit) : Current value register of Y000 (32-bit)
D8143 (upper digit) & D8142 (lower digit) : Current value register of Y001 (32-bit)
M8145 : Y000 pulse output stop (immediate)
M8146 : Y001 pulse output stop (immediate)
M8147 : Y000 pulse output monitor (BUS/READY)
M8148 : Y001 pulse output monitor (BUS/READY)
• Attention should be paid to the instruction drive timing.
5-167
FX Series Programmable Controlers Applied Instructions 5
5.13.9 DRVI (FNC 158)
Operands
Mnemonic Function Program steps
S1 S2 D1 D2
DRVI Increment K,H, Y Y,M,S DRVI
FNC 158 positioning KnX,KnY, Note: 9 steps
Drive to KnM,KnS Y000 or DDRVI
increment T,C,D,V,Z Y001 only 17 steps
Operation:
This instruction is for single speed positioning in
the form of incremental movements.
[S 1 ] is the Number of Pulses, [S 2 ] is the Pulse
Output Frequency, [D 1] is the Pulse Output Designation, and [D2] is the Rotation Direction
Signal.
Points to note:
a)The maximum number of pulses [S1] available are: 16-bit -32,768 to 32,767 pulses or 32-bit
-999,999 to 999,999 pulses.
b)Users may use output pulse frequencies [S2], 16-bit 10 to 32,767Hz or 32-bit 10 to 100kHz.
c)Only Y000 or Y001 can be used for the pulse output [D1].
Because of the nature of the high speed output, transistor type output units should be used
with this instruction. Relay type outputs will suffer a greatly reduced life, and will cause false
outputs to occur.
To ensure a ‘clean’ output signal when using transistor type units, the load current should be
200mA or higher with the FX2N Series. The load current should be 10 - 100mA with the FX1S/
1N Series. It may be necessary to use ‘pull up’ resistors.
d)Rotation direction signal output [D2] operated as follows: if [D2] = OFF, rotation = negative, if
[D2] = ON, rotation = positive.
e)If the contents of an operand are changed while the instruction is executed, it is not reflected
on the operation. The new contents become effective when the instruction is next driven.
f)If the instruction drive contact turns off while the instruction is being executed, the machine
decelerates and stops. At this time the execution complete flag M8029 does not turn ON.
g)Once the instruction drive contact is off, re-drive of the instruction is not possible while the
pulse output flag (Y000 : [M8147], Y001 : [M8148]) is ON.
h)For operation in the incremental drive method, the travel distance from the current position is
specified with either a positive or a negative symbol.
i)The minimum value of output pulse frequency which can be actually used is determined by
the following equation
MaxSpeed [D8147,D8146]Hz 2 Acceleration\Deceleration D8148 ms 1000
5-168
FX Series Programmable Controlers Applied Instructions 5
f)Related device numbers.
D8145 : Bias speed adopted when either FNC158, DRVI or FNC159, DRVA are executed
D8147 (upper digit) & D8146 (lower digit) : Maximum speed when FNC156, FNC158 or
FNC159 are executed 100~100,000Hz.
D8148 : Acceleration/Deceleration time adopted when FNC156, FNC158 or FNC159 are
executed.
M8145 : Y000 pulse output stop (immediate)
M8146 : Y001 pulse output stop (immediate)
M8147 : Y000 pulse output monitor (BUS/READY)
M8148 : Y001 pulse output monitor (BUS/READY)
• Attention should be paid to the instruction drive timing.
5-169
FX Series Programmable Controlers Applied Instructions 5
5.13.10 DRVA(FNC 159)
Operands
Mnemonic Function Program steps
S1 S2 D1 D2
DRVA Absolute K,H, Y Y,M,S DRVA
FNC 159 positioning KnX,KnY, Note: 9 steps
Drive to KnM,KnS Y000 or DDRVA
absolute T,C,D,V,Z Y001 only 17 steps
Operation:
This instruction is for single speed positioning
using a zero home point and absolute
measurements.
[S 1 ] is the Number of Pulses, [S 2] is the Output
Frequency, [D1] is the Pulse Output Designations, and [D2] is the Rotation Direction Signal.
Points to note:
a)The target position for absolute positioning [S 1] can be: 16-bit -32,768 to 32,767 pulses or
32-bit -999,999 to 999,999 pulses.
b)Users may use output pulse frequencies [S2], 16-bit 10 to 32,767Hz or 32-bit 10 to 100kHz.
c)Only Y000 or Y001 can be used for the pulse output [D1].
Because of the nature of the high speed output, transistor type output units should be used
with this instruction. Relay type outputs will suffer a greatly reduced life, and will cause false
outputs to occur.
To ensure a ‘clean’ output signal when using transistor type units, the load current should be
200mA or higher with the FX2N Series. The load current should be 10 - 100mA with the FX1S/
1N Series. It may be necessary to use ‘pull up’ resistors.
d)Rotation direction signal output [D2] operated as follows: if [D2] = OFF, rotation = negative, if
[D2] = ON, rotation = positive.
e)If the contents of an operand are changed while the instruction is executed, it is not reflected
on the operation. The new contents become effective when the instruction is next driven.
f)If the instruction drive contact turns off while the instruction is being executed, the machine
decelerates and stops. At this time the execution complete flag M8029 does not turn ON.
g)Once the instruction drive contact is off, re-drive of the instruction is not possible while the
pulse output flag (Y000 : [M8147], Y001 : [M8148]) is ON.
h)For operation in the absolute drive method, the travel distance from the zero point is
specified.
i)The minimum value of output pulse frequency which can be actually used is determined by
the following equation
MaxSpeed [D8147,D8146]Hz 2 Acceleration\Deceleration D8148 ms 1000
5-170
FX Series Programmable Controlers Applied Instructions 5
f)Related device numbers.
D8145 : Bias speed adopted when either FNC158, DRVI or FNC159, DRVA are executed
D8147 (upper digit) & D8146 (lower digit) : Maximum speed when FNC156, FNC158 or
FNC159 are executed 100~100,000Hz.
D8148 : Acceleration/Deceleration time adopted when FNC156, FNC158 or FNC159 are
executed.
M8145 : Y000 pulse output stop (immediate)
M8146 : Y001 pulse output stop (immediate)
M8147 : Y000 pulse output monitor (BUS/READY)
M8148 : Y001 pulse output monitor (BUS/READY)
• Attention should be paid to the instruction drive timing.
5-171