NJ - NX-series CPU Unit Motion Control User's Manual
NJ - NX-series CPU Unit Motion Control User's Manual
NJ/NX-series
CPU Unit
Motion Control
User’s Manual
NX701-1
NX102-1
NX102-90
NX1P2-1
NX1P2-9
NJ501-
NJ301-1
NJ101-10
CPU Unit
W507-E1-23
NOTE
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior
written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe-
less, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained in this publication.
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other
countries for OMRON factory automation products.
• Microsoft, Windows, Excel, and Visual Basic are either registered trademarks or trademarks of Microsoft Corpora-
tion in the United States and other countries.
• EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.
• ODVA, CIP, CompoNet, DeviceNet, and EtherNet/IP are trademarks of ODVA.
Other company names and product names in this document are the trademarks or registered trademarks of their
respective companies.
Copyrights
• Microsoft product screen shots reprinted with permission from Microsoft Corporation.
• This product incorporates certain third party software. The license and copyright information associated with this
software is available at http://www.fa.omron.co.jp/nj_info_e/.
Introduction
Introduction
Thank you for purchasing an NJ/NX-series CPU Unit.
This manual contains information that is necessary to use the Motion Control Function Module of an
NJ/NX-series CPU Unit. Please read this manual and make sure you understand the functionality and
performance of the NJ/NX-series CPU Unit before you attempt to use it in a control system.
Keep this manual in a safe place where it will be available for reference during operation.
Intended Audience
This manual is intended for the following personnel, who must also have knowledge of electrical sys-
tems (an electrical engineer or the equivalent).
• Personnel in charge of introducing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of installing and maintaining FA systems.
• Personnel in charge of managing FA systems and facilities.
For programming, this manual is intended for personnel who understand the programming language
specifications in international standard IEC 61131-3 or Japanese standard JIS B 3503.
Applicable Products
This manual covers the following products.
NX-series CPU Units
• NX701-17££
• NX701-16££
• NX102-12££
• NX102-11££
• NX102-10££
• NX102-90££
• NX1P2-11££££
• NX1P2-11££££1
• NX1P2-10££££
• NX1P2-10££££1
• NX1P2-90££££
• NX1P2-90££££1
• NX1P2-9B££££
• NX1P2-9B££££1
Part of the specifications and restrictions for the CPU Units are given in other manuals. Refer to Rele-
vant Manuals on page 3 and Related Manuals on page 28.
NJ/NX-series
manuals that are relevant to your system configuration and application before you use the NJ/NX-ser-
Troubleshooting Manual
Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac
The following table provides the relevant manuals for the NJ/NX-series CPU Units. Read all of the
¡
User’s Manual
NJ-series SECS/GEM CPU Units
User's Manual
NJ/NX-series Database Connection CPU Units
User's Manual
NX-series CPU Unit
FINS User’s Manual
NJ/NX-series CPU Unit OPC UA
User’s Manual
NJ/NX-series CPU Unit
¡
Built-in EtherNet/IP Port User’s Manual
Manual
¡
Built-in EtherCAT Port User´s Manual
NJ/NX-series
Motion Control Instructions Reference Manual
NJ/NX-series CPU Unit
¡
Motion Control User’s Manual
NJ/NX-series
Instructions Reference Manual
NX-series NX1P2 CPU Unit
¡
Hardware User’s Manual
NX-series NX1P2 CPU Unit
¡
Hardware User’s Manual
NX-series NX102 CPU Unit
¡
¡
Hardware User’s Manual
NX-series CPU Unit
¡
Hardware User’s Manual
Using EtherNet/IP
Using EtherCAT
RON robots
trollers
Units
Units
Units
NJ/NX-series CPU Unit Motion Control User’s Manual (W507)
NJ/NX-series
¡
Troubleshooting Manual
NJ/NY-series NC Integrated Controller
¡
¡
User’s Manual
NJ-series NJ Robotics CPU Unit
¡
¡
User's Manual
NJ-series Robot Integrated CPU Unit
¡
¡
User’s Manual
NJ-series SECS/GEM CPU Units
¡
¡
User's Manual
NJ/NX-series Database Connection CPU Units
¡
¡
User's Manual
NX-series CPU Unit
¡
¡
FINS User’s Manual
NJ/NX-series CPU Unit OPC UA
¡
¡
User’s Manual
NJ/NX-series CPU Unit
¡
¡
Built-in EtherNet/IP Port User’s Manual
Manual
¡
Built-in EtherCAT Port User´s Manual
NJ/NX-series
¡
Motion Control Instructions Reference Manual
NJ/NX-series CPU Unit ¡
¡
Motion Control User’s Manual
NJ/NX-series
¡
Instructions Reference Manual
NX-series NX1P2 CPU Unit
¡
Built-in I/O and Option Board User's Manual
Basic information
¡
Software User’s Manual
NJ-series CPU Unit
Hardware User’s Manual
NX-series NX1P2 CPU Unit
Hardware User’s Manual
NX-series NX102 CPU Unit
Hardware User’s Manual
NX-series CPU Unit
Hardware User’s Manual
Using EtherNet/IP
Using EtherCAT
Using EtherCAT
Using OPC UA
Using OPC UA
Software settings
botics function
botics function
RON robots
RON robots
Using FINS
Using FINS
tion service
tion service
functions
functions
ing
4
5
Relevant Manuals
NJ/NX-series
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the error management concepts and the error items. However,
refer to the manuals that are indicated with triangles for details on errors corresponding to the products with the manuals that are indi-
¡
Troubleshooting Manual
NJ/NY-series NC Integrated Controller
r
¡
User’s Manual
NJ-series NJ Robotics CPU Unit
r
¡
User's Manual
NJ-series Robot Integrated CPU Unit
r
¡
User’s Manual
NJ-series SECS/GEM CPU Units
r
¡
User's Manual
NJ/NX-series Database Connection CPU Units
r
¡
User's Manual
NX-series CPU Unit
r
¡
r
¡
User’s Manual
NJ/NX-series CPU Unit
¡
¡
Built-in EtherNet/IP Port User’s Manual
Manual
¡
Built-in EtherCAT Port User´s Manual
NJ/NX-series
Motion Control Instructions Reference Manual
NJ/NX-series CPU Unit ¡
¡
Motion Control User’s Manual
NJ/NX-series
Instructions Reference Manual
NX-series NX1P2 CPU Unit
¡
Software User’s Manual
NJ-series CPU Unit
¡
Hardware User’s Manual
NX-series NX1P2 CPU Unit
¡
Hardware User’s Manual
NX-series NX102 CPU Unit
¡
Hardware User’s Manual
NX-series CPU Unit
¡
Hardware User’s Manual
Using EtherNet/IP
Using EtherCAT
Using EtherCAT
Using OPC UA
botics function
RON robots
Using FINS
tion service
Maintenance
functions
ging
*1.
Manual Structure
Manual Structure
Page Structure
The following page structure is used in this manual.
A step in a procedure 1 Join the Units so that the connectors fit exactly.
4-3 Mo u n t i n g U n i t s
4 Page tab
2 Gives the number
Lock
Release
Slider
Manual name NJ-series CPU Unit Hardware User’s Manual (W500) 4-9
This illustration is provided only as a sample. It may not literally appear in this manual.
Special Information
Special information in this manual is classified as follows:
Additional Information
Additional information to read as required.
This information is provided to increase understanding or make operation easier.
Version Information
Information on differences in specifications and functionality for Controller with different unit versions
and for different versions of the Sysmac Studio is given.
Precaution on Terminology
In this manual, "download" refers to transferring data from the Sysmac Studio to the physical Control-
ler and "upload" refers to transferring data from the physical Controller to the Sysmac Studio.
For the Sysmac Studio, "synchronization" is used to both "upload" and "download" data. Here,
"synchronize" means to automatically compare the data for the Sysmac Studio on the computer with
the data in the physical Controller and transfer the data in the direction that is specified by the user.
1
1 10
Introduction to the 2
2 11
Motion Control
1 Function Module 10
10 Sample Programming
3
3 A
Motion Control
Configuration and
2 Principles
11
11 Troubleshooting
4
4 I
Configuring Axes
3 and Axes Groups A
A Appendices
5
7
5 Motion Control Parameters
8
6 Motion Control Programming
9
7 Manual Operation
8 Homing
CONTENTS
Introduction .............................................................................................................. 1
Intended Audience...........................................................................................................................................1
Applicable Products .........................................................................................................................................1
Relevant Manuals..................................................................................................... 3
Manual Structure...................................................................................................... 6
Page Structure.................................................................................................................................................6
Special Information ..........................................................................................................................................6
Precaution on Terminology ..............................................................................................................................7
Safety Precautions................................................................................................. 19
Versions .................................................................................................................. 23
Checking Versions .........................................................................................................................................23
Unit Versions of CPU Units and Sysmac Studio Versions .............................................................................27
Related Manuals..................................................................................................... 28
Revision History..................................................................................................... 32
Section 8 Homing
8-1 Outline of Homing..................................................................................................................8-2
8-2 Homing Procedure.................................................................................................................8-5
8-2-1 Setting Homing Parameters ........................................................................................................8-5
8-2-2 Monitoring the Homing Operation ............................................................................................. 8-11
Section 11 Troubleshooting
11-1 Overview of Troubleshooting ............................................................................................. 11-2
Appendices
A-1 Connecting the 1S-series Servo Drive................................................................................ A-2
A-1-1 Wiring the Servo Drive ............................................................................................................... A-2
A-1-2 Servo Drive Settings .................................................................................................................. A-2
A-2 Connecting the G5-series Servo Drive ............................................................................. A-11
A-2-1 Wiring the Servo Drive ..............................................................................................................A-11
A-2-2 Servo Drive Settings .................................................................................................................A-11
A-3 Connecting to Encoder Input Terminals........................................................................... A-21
A-3-1 Wiring to Encoder Input Terminals ........................................................................................... A-21
A-3-2 Settings for Encoder Input Terminals ....................................................................................... A-21
A-4 Connecting to NX Units...................................................................................................... A-27
A-5 PDS State Transition........................................................................................................... A-28
A-5-1 PDS State Control Method ....................................................................................................... A-28
A-5-2 Main Circuit Power Supply OFF Detection............................................................................... A-29
A-6 Terminology......................................................................................................................... A-30
A-6-1 NJ/NX-series Controller ........................................................................................................... A-30
Index
Warranties
Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and work-
manship for a period of twelve months from the date of sale by Omron (or such other period ex-
pressed in writing by Omron). Omron disclaims all other warranties, express or implied.
Limitations
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, ABOUT
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OF
THE PRODUCTS. BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE
PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE.
Omron further disclaims all warranties and responsibility of any type for claims or expenses based
on infringement by the Products or otherwise of any intellectual property right.
Buyer Remedy
Omron’s sole obligation hereunder shall be, at Omron’s election, to (i) replace (in the form originally
shipped with Buyer responsible for labor charges for removal or replacement thereof) the non-com-
plying Product, (ii) repair the non-complying Product, or (iii) repay or credit Buyer an amount equal
to the purchase price of the non-complying Product; provided that in no event shall Omron be re-
sponsible for warranty, repair, indemnity or any other claims or expenses regarding the Products
unless Omron’s analysis confirms that the Products were properly handled, stored, installed and
maintained and not subject to contamination, abuse, misuse or inappropriate modification. Return
of any Products by Buyer must be approved in writing by Omron before shipment. Omron Compa-
nies shall not be liable for the suitability or unsuitability or the results from the use of Products in
combination with any electrical or electronic components, circuits, system assemblies or any other
materials or substances or environments. Any advice, recommendations or information given orally
or in writing, are not to be construed as an amendment or addition to the above warranty.
WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS BASED IN CONTRACT,
WARRANTY, NEGLIGENCE OR STRICT LIABILITY.
Further, in no event shall liability of Omron Companies exceed the individual price of the Product on
which liability is asserted.
Application Considerations
Suitability of Use
Omron Companies shall not be responsible for conformity with any standards, codes or regulations
which apply to the combination of the Product in the Buyer’s application or use of the Product. At Buy-
er’s request, Omron will provide applicable third party certification documents identifying ratings and
limitations of use which apply to the Product. This information by itself is not sufficient for a complete
determination of the suitability of the Product in combination with the end product, machine, system, or
other application or use. Buyer shall be solely responsible for determining appropriateness of the par-
ticular Product with respect to Buyer’s application, product or system. Buyer shall take application re-
sponsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY OR IN LARGE QUANTITIES WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE
HAS BEEN DESIGNED TO ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS
PROPERLY RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIP-
MENT OR SYSTEM.
Programmable Products
Omron Companies shall not be responsible for the user’s programming of a programmable Product, or
any consequence thereof.
Disclaimers
Performance Data
Data presented in Omron Company websites, catalogs and other materials is provided as a guide for
the user in determining suitability and does not constitute a warranty. It may represent the result of
Omron’s test conditions, and the user must correlate it to actual application requirements. Actual per-
formance is subject to the Omron’s Warranty and Limitations of Liability.
Change in Specifications
Product specifications and accessories may be changed at any time based on improvements and oth-
er reasons. It is our practice to change part numbers when published ratings or features are changed,
or when significant construction changes are made. However, some specifications of the Product may
be changed without any notice. When in doubt, special part numbers may be assigned to fix or estab-
lish key specifications for your application. Please consult with your Omron’s representative at any
time to confirm actual specifications of purchased Product.
Safety Precautions
Refer to the following manuals for safety precautions.
• NX-series CPU Unit Hardware User's Manual (Cat. No. W535)
• NX-series NX102 CPU Unit Hardware User's Manual (Cat. No. W593)
• NX-series NX1P2 CPU Unit Hardware User's Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat No. W500)
Versions
Hardware revisions and unit versions are used to manage the hardware and software in NJ/NX-series
Units and EtherCAT slaves. The hardware revision or unit version is updated each time there is a
change in hardware or software specifications. Even when two Units or EtherCAT slaves have the
same model number, they will have functional or performance differences if they have different hard-
ware revisions or unit versions.
Checking Versions
You can check versions on the ID information indications or with the Sysmac Studio.
For NX701
The ID information on an NX-series NX701-££££ CPU Unit is shown below.
ID information indication
Note The hardware revision is not displayed for the Unit whose hardware revision is blank.
For NX102
The ID information on an NX-series NX102-££££ CPU Unit is shown below.
Note The hardware revision is not displayed for the Unit whose hardware revision is blank.
For NX1P2
The ID information on an NX-series NX1P2-£££££££ CPU Unit is shown below.
MAC address
PORT1 : ££££££££££££
PORT2 : ££££££££££££
Hardware
Unit version Ver.1.££ HW Rev. £ revision
LOT No. DDMYY£ xxxx
ID information indication
Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.
For NJ-series
The ID information on an NJ-series NJ501-££££ CPU Unit is shown below.
ID information indication
Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.
1 Right-click CPU Rack under Configurations and Setup - CPU/Expansion Racks in the Multi-
view Explorer and select Production Information.
The Production Information Dialog Box is displayed.
1 Double-click CPU Rack under Configurations and Setup - CPU/Expansion Racks in the
Multiview Explorer. Or, right-click CPU Rack under Configurations and Setup - CPU/
Expansion Racks in the Multiview Explorer and select Edit from the menu.
The Unit Editor is displayed.
2 Right-click any open space in the Unit Editor and select Production Information.
The Production Information Dialog Box is displayed.
1 Click the Show Detail or Show Outline Button at the lower right of the Production Information
Dialog Box.
The view will change between the production information details and outline.
The information that is displayed is different for the Outline View and Detail View. The Detail
View displays the unit version, hardware revision, and various versions. The Outline View dis-
plays only the unit version.
Note The hardware revision is separated by “/” and displayed on the right of the hardware version. The
hardware revision is not displayed for the Unit that the hardware revision is in blank.
1 Double-click EtherCAT under Configurations and Setup in the Multiview Explorer. Or, right-
click EtherCAT under Configurations and Setup and select Edit from the menu.
The EtherCAT Tab Page is displayed.
2 Right-click the master on the EtherCAT Tab Page and select Display Production Information.
The Production Information Dialog Box is displayed.
The unit version is displayed after “Rev.”
1 Click the Show Detail or Show Outline Button at the lower right of the Production Information
Dialog Box.
The view will change between the production information details and outline.
Related Manuals
The following are the manuals related to this manual. Use these manuals for reference.
Revision History
A manual revision code appears as a suffix to the catalog number on the front and back covers of the
manual.
Revision
Date Revised content
code
01 July 2011 Original production
02 January 2012 • Added information on the NJ301-££££.
• Made changes accompanying release of unit version 1.01 of the CPU Unit.
03 May 2012 • Made changes accompanying release of unit version 1.02 of the CPU Unit.
• Corrected mistakes.
04 August 2012 Made changes accompanying release of unit version 1.03 of the CPU Unit.
05 February 2013 Made changes accompanying release of unit version 1.04 of the CPU Unit.
06 April 2013 • Made changes accompanying release of unit version 1.05 of the CPU Unit.
• Corrected mistakes.
07 June 2013 • Made changes accompanying release of unit version 1.06 of the CPU Unit.
• Corrected mistakes.
08 December • Made changes accompanying release of unit version 1.08 of the CPU Unit
2013 • Corrected mistakes.
09 July 2014 • Made changes accompanying release of unit version 1.09 of the CPU Unit.
• Corrected mistakes.
10 January 2015 • Made changes accompanying release of unit version 1.10 of the CPU Unit.
• Corrected mistakes.
11 January 2015 • Made changes accompanying release of the NX-series NX701-££££ CPU
Unit and the NJ-series NJ101-10££ CPU Unit.
• Corrected mistakes.
12 April 2016 • Made changes accompanying release of unit version 1.11 of the CPU Unit.
• Corrected mistakes.
13 July 2016 • Made changes accompanying release of unit version 1.12 of the CPU Unit.
• Corrected mistakes.
14 October 2016 • Made changes accompanying addition of NX-series NX1P2 CPU Units.
• Made changes accompanying release of unit version 1.13 of the CPU Unit.
• Corrected mistakes.
15 January 2017 Corrected mistakes.
16 October 2017 Corrected mistakes.
17 April 2018 • Made changes accompanying addition of NX-series NX102 CPU Units.
• Made changes accompanying the transfer of explanation for event codes
and errors to the NJ/NX-series Troubleshooting Manual.
• Corrected mistakes.
18 July 2018 Corrected mistakes.
19 January 2019 Corrected mistakes.
Revision
Date Revised content
code
20 April 2019 • Made changes accompanying addition of the 1S-series AC Servomotor/
Servo Drive models.
• Made changes accompanying addition of functions.
21 July 2019 Corrected mistakes.
22 October 2019 • Made changes accompanying addition of NX1P2-9B££££.
• Corrected mistakes.
23 August 2020 Made changes accompanying addition of NJ501-R£££.
1-1 Features
The Motion Control Function Module (sometimes abbreviated to “MC Function Module”) is a software
function module that is built into the CPU Unit.
The MC Function Module can perform motion control for up to 256 axes through the EtherCAT port
that is built into the CPU Unit.
Cyclic communications are performed with Servo Drives and other devices that are connected to the
EtherCAT port to enable high-speed, high-precision machine control.
Additional Information
PLCopen®
PLCopen® is an association that promotes IEC 61131-3. It has its headquarters in Europe
and a world-wide membership. PLCopen® standardizes function blocks for motion control to
define a program interface for the languages specified in IEC 61131-3 (JIS B 3503).
Jerk
Jerk is the rate of change in the acceleration rate or deceleration rate. If you specify the jerk,
the velocity graph will form an S-curve for acceleration and deceleration.
Additional Information
What Is EtherCAT?
EtherCAT is an open high-speed industrial network system that conforms to Ethernet (IEEE
802.3). Each node achieves a short communications cycle time by transmitting Ethernet
frames at high speed. A mechanism that allows sharing clock information enables high-pre-
cision synchronized control with low communications jitter.
Sysmac Studio
The Sysmac Studio is connected to the peripheral USB port on the CPU Unit with a commercially
available USB cable. You can also connect it to the built-in EtherNet/IP port on the CPU Unit with
Ethernet cable.
Sysmac Studio
Peripheral USB port
NX701/NJ-series Controller
LAN USB
Or
EtherNet/IP
EtherCAT Network
Configuration
Built-in EtherNet/IP port EtherCAT
Built-in EtherCAT port
Some of the functions of the MC Function Module are different when NX-series Position Inter-
face Units are used. Refer to the NX-series Position Interface Units User’s Manual (Cat. No.
W524) for details.
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are re-
quired to use the NX-series Position Interface Units.
Sysmac Studio
The Sysmac Studio is connected to the built-in EtherNet/IP port on the CPU Unit with an Ethernet
cable.
Sysmac Studio
LAN EtherNet/IP
Some of the functions of the MC Function Module are different when NX-series Position Inter-
face Units are used. Refer to the NX-series Position Interface Units User’s Manual (Cat. No.
W524) for details.
START
Add axes. *4
Perform jogging.
*1. Refer to Sysmac Studio Version 1 Operation Manual (Cat. No. W504).
*2. If actual slave devices are connected, you can apply the actual EtherCAT network configuration to the config-
uration setup online.
If no slave devices are connected, you can select EtherCAT slave devices offline to set up the EtherCAT net-
work configuration.
*3. Refer to NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501).
*4. Refer to Section 3 Configuring Axes and Axes Groups on page 3-1.
*5. Refer to Section 4 Checking Wiring from the Sysmac Studio on page 4-1.
Additional Information
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the proce-
dures for the NX-series Position Interface Units.
A
Programming Write a program to perform jogging. *1
Yes
Debugging Error?
END
1-4 Specifications
1-4 Specifications
This section gives the specifications of the MC Function Module.
The NX102-90££ Units and NJ101-90££ Units do not provide the Motion Control Function 1
Module.
NX701-
Item
17££ 16££
Number of Maximum number of controlled axes*1 256 axes 128 axes
controlled ax-
es
Motion control axes*2 256 axes 128 axes
NX102-
Item
12££ 11££ 10££ 90££
Number of controlled Maximum number of controlled axes*1 15 axes 4 axes
axes
Motion control axes*2 11 axes ---
Single-axis position control 4 axes
axes*3
Maximum number of used real axes*4 12 axes 8 axes 6 axes 4 axes
NX1P2-
Item
1-4 Specifications
11££ 10££ 90££ 9B££
Number of controlled Maximum number of controlled axes*1 12 axes 10 axes 4 axes 2 axes
axes
Motion control axes*2 8 axes 6 axes ---
Single-axis position control 4 axes 2 axes
axes*3
Maximum number of used real axes*4 8 axes 6 axes 4 axes 2 axes
1
Used motion control servo 4 axes 2 axes ---
axes
NJ501-
Item
£5££ £4££ £3££
Number of control- Maximum number of controlled axes*1 64 axes 32 axes 16 axes
led axes
Motion control axes*2 64 axes 32 axes 16 axes
Single-axis position con- ---
trol axes*3
Maximum number of used real axes*4 64 axes 32 axes 16 axes
NJ301- NJ101-
Item
1-4 Specifications
12££ 11££ 10££
Number of control- Maximum number of controlled axes*1 15 axes*2 *3 15 axes*2 *4 6 axes
led axes
Motion control axes*5 15 axes*2 *3 15 axes*2 *4 6 axes
Single-axis position con- ---
trol axes*6
Maximum number of used real axes*7 8 axes 4 axes 2 axes
1
Used motion control ser- 8 axes 4 axes 2 axes
vo axes
Item Description
Controllable Servo Drives OMRON 1S-series Servo Drives with built-in EtherCAT com-
munications or G5-series Servo Drives with built-in EtherCAT
communications*1 *2
Controllable encoder input terminals OMRON GX-series GX-EC0211/EC0241 EtherCAT Remote
I/O Terminals*3
Item Description
Controllable Position Interface Units*2*4 OMRON NX-EC0£££ Incremental Encoder Input Units
OMRON NX-ECS£££ SSI Input Units
OMRON NX-PG0£££ Pulse Output Units
Control method Control commands using EtherCAT communications
Control modes Position control,
Velocity control,
and Torque control
Unit conversions Position units Pulse, mm, μm, nm, degree, and inch
Electronic gear ratio Pulse per motor rotation/travel distance per motor rotation, or
(Pulse per motor rotation × Motor gear ratio)/(Work travel dis-
tance per rotation × Work gear ratio)
Positions that can be managed Command positions and actual positions
Axis types Servo axes, Virtual servo axes, Encoder axes, and Virtual en-
coder axes
Position command values Negative or positive long reals (LREAL) or 0
(command units*5)
Velocity command values Negative or positive long reals (LREAL) or 0
(command units/s)
Acceleration command values and deceleration command Positive long reals (LREAL) or 0
values (command units/s2)
Jerk command values Positive long reals (LREAL) or 0
(command units/s3)
Single axes Single-axis po- Absolute positioning Positioning is performed for a target position that is specified
sition control with an absolute value.
Relative positioning Positioning is performed for a specified travel distance from
the command current position.
Interrupt feeding Positioning is performed for a specified travel distance from
the position where an interrupt input was received from an ex-
ternal input.
Cyclic synchronous abso- A command position is output each control period in Position
lute positioning*2 Control Mode.
Single-axis ve- Velocity control Velocity control is performed in Position Control Mode.
locity control
Cyclic synchronous veloc- A velocity command is output each control period in Velocity
ity control Control Mode.
Single-axis tor- Torque control The torque of the motor is controlled.
que control
Single-axis Starting cam operation A cam motion is performed using the specified cam table.
synchronized
control
Ending cam operation The cam motion for the axis that is specified with the input pa-
rameter is ended.
Starting gear operation A gear motion with the specified gear ratio is performed be-
tween a master axis and slave axis.
Positioning gear operation A gear motion with the specified gear ratio and sync position
is performed between a master axis and slave axis.
Ending gear operation The specified gear motion or positioning gear motion is
ended.
Synchronous positioning Positioning is performed in sync with a specified master axis.
Master axis phase shift The phase of a master axis in synchronized control is shifted.
Item Description
1-4 Specifications
Combining axes The command positions of two axes are added or subtracted
and the result is output as the command position.
Single-axis Powering the Servo The Servo in the Servo Drive is turned ON to enable axis mo-
manual opera- tion.
tion
Jogging An axis is jogged at a specified target velocity.
Auxiliary func- Resetting axis errors Axes errors are cleared. 1
tions for single-
axis control
Start velocity*2 You can set the initial velocity when axis motion starts.
Axes Multi-axes co- Absolute linear interpola- Linear interpolation is performed to a specified absolute posi-
groups ordinated con- tion tion.
trol
Relative linear interpola- Linear interpolation is performed to a specified relative posi-
tion tion.
Circular 2D interpolation Circular interpolation is performed for two axes.
Axes group cyclic syn- A positioning command is output each control period in Posi-
chronous absolute posi- tion Control Mode.
tioning*2
Auxiliary func- Resetting axes group er- Axes group errors and axis errors are cleared.
tions for multi- rors
axes coordinat-
ed control
Item Description
Enabling axes groups Motion of an axes group is enabled.
Disabling axes groups Motion of an axes group is disabled.
Changing the axes in an The Composition Axes parameter in the axes group param-
axes group*2 eters can be overwritten temporarily.
Stopping axes groups All axes in interpolated motion are decelerated to a stop.
Immediately stopping ax- All axes in interpolated motion are stopped immediately.
es groups
Setting axes group over- The blended target velocity is changed during interpolated
ride factors motion.
Reading axes group posi- The command current positions and actual current positions
tions*2 of an axes group can be read.
Common Cams*6 Setting cam table proper- The end point index of the cam table that is specified in the
items ties input parameter is changed.
Saving cam tables The cam table that is specified with the input parameter is
saved in non-volatile memory in the CPU Unit.
Generating cam tables*2 The cam table that is specified with the input parameter is
generated from the cam property and cam node.
Parameters Writing MC settings Some of the axis parameters or axes group parameters are
overwritten temporarily.
Changing axis parame- You can access and change the axis parameters from the
ters*2 user program.
Auxiliary Count modes You can select either Linear Mode (finite length) or Rotary
functions Mode (infinite length).
Unit conversions You can set the display unit for each axis according to the
machine.
Acceleration/ Automatic acceleration/ Jerk is set for the acceleration/deceleration curve for an axis
deceleration deceleration control motion or axes group motion.
control Changing the acceleration You can change the acceleration or deceleration rate even
and deceleration rates during acceleration or deceleration.
In-position check You can set an in-position range and in-position check time to
confirm when positioning is completed.
Stop method You can set the stop method to the immediate stop input sig-
nal or limit input signal.
Re-execution of motion control instructions You can change the input variables for a motion control in-
struction during execution and execute the instruction again
to change the target values during operation.
Multi-execution of motion control instruc- You can specify when to start execution and how to connect
tions the velocities between operations when another motion con-
(Buffer Mode) trol instruction is executed during operation.
Monitoring Software limits The movement range of an axis is monitored.
functions Following error The error between the command current value and the actual
current value is monitored for an axis.
Velocity, acceleration rate, You can set and monitor warning values for each axis and
deceleration rate, torque, each axes group.
interpolation velocity, in-
terpolation acceleration
rate, and interpolation de-
celeration rate
Item Description
1-4 Specifications
Absolute encoder support You can use an OMRON 1S-series Servomotor or G5-series
Servomotor with an Absolute Encoder to eliminate the need
to perform homing at startup.*7
Input signal logic inversion*2 You can inverse the logic of immediate stop input signal, posi-
tive limit input signal, negative limit input signal, or home
proximity input signal.
External interface signals The Servo Drive input signals given below are used. 1
• Home signal, home proximity signal, positive limit signal,
negative limit signal, immediate stop signal, and interrupt
The PLC Function Module runs on top of the OS. The other Function Modules run on top of the PLC
Function Module.
A description of each Function Module is given in the following table.
Note Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on other Function
Modules.
This manual provides the specifications and operating procedures for the Motion Control Function
Module (sometimes abbreviated to “MC Function Module”).
Refer to the other NJ/NX-series user’s manuals as required when using the MC Function Module in an
application.
In a machine configuration that uses the MC Function Module, no feedback information is provided for
the commands from the user program in the CPU Unit. A feedback system is built into the Servo Drive. 2
• When motion control instructions are executed in the user program, the MC Function Module inter-
prets the resulting commands.
• The MC Function Module then performs motion control processing at a fixed period based on the
results of the command interpretation. It generates command values to send to the Servo Drive. The
following command values are generated: target position, target velocity, and target torque.
• The command values are sent by using PDO communications during each process data communi-
cations cycle of EtherCAT communications.
• The Servo Drive performs position loop control, velocity loop control, and torque loop control based
on the command values received during each process data communications cycle of EtherCAT
communications.
• The encoder's current value and the Servo Drive status are sent to the CPU Unit during each proc-
ess data communications cycle of EtherCAT communications.
Additional Information
• When motion control instructions are executed in the user program, the MC Function Module inter-
prets the resulting commands.
• The MC Function Module then performs motion control processing at a fixed period based on the
results of the command interpretation. It generates command values to send to the Position Inter-
face Unit (Pulse Output Unit). The following command values are generated: target position and tar-
get velocity.
• Generated command values are output to the Servo Drive as pulse trains.
• The Servo Drive performs position loop control and velocity loop control based on the command val-
ues which are output as pulse trains.
Additional Information
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information
on the configuration to use the NX-series Position Interface Units.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on programs,
tasks, and setting methods.
Number Priori-
Type of task Operation
of tasks ty
Primary periodic task 1 4 This task executes I/O refreshing, programs, and motion con-
trol in the specified task period.
This task has the highest execution priority of all tasks and
can be executed quickly and precisely. Therefore, this task is
best suited for situations when synchronized control or highly
responsive control is required.
Use the primary periodic task to execute all control with a sin-
gle task.
Number Priori-
Type of task Operation
of tasks ty
Periodic tasks 0 or 1 5*1 This task executes I/O refreshing, programs, and motion con-
trol in the specified task period.
The priority-5 periodic task has the second highest execution
priority after the primary periodic task and can be executed
quickly and precisely.
The priority-5 periodic task is used when you want to divide
functions configuring the device for separate control, those
functions that need high-speed control with the primary peri-
odic task and others with the priority-5 periodic task.
The primary periodic task and priority-5 periodic task are used
for the multi-task motion control. *2
16*3 This task executes programs and I/O refreshing in the speci-
fied task period.
The execution period for the priority-16 periodic task is longer
than the execution period of the primary periodic task and pri-
ority-5 periodic task. Therefore, this periodic task is used to
execute programs.
In the priority-16 periodic task, you can write the user pro-
gram for some slaves and Units that refresh I/O in the primary
periodic task.
For example, synchronized control and control requiring a fast
response time are placed in the primary periodic task or prior-
ity-5 periodic task. Overall device control is separately placed
in a priority-16 periodic task.
*1. You can use the priority-5 periodic task only with NX701 CPU Units.
*2. The multi-motion performs the motion controls in parallel using both the primary periodic task and the priori-
ty-5 periodic task.
*3. You cannot use the priority-16 periodic task on NX102 CPU Units and NX1P2 CPU Units.
Note The CPU Unit has priority-17 and -18 periodic tasks. However, you cannot use motion control instructions in
these tasks. These tasks also do not perform I/O refreshing.
Motion control instructions can be used in the primary periodic task and in a priority-5 or a prior-
ity-16 periodic task.
If motion control instructions are used in any other tasks, an error will occur when the user pro-
gram is built on the Sysmac Studio.
Additional Information
The NX701 CPU Unit allows you to execute the motion control in the primary periodic task and
in the priority-5 periodic task. If these two motion controls need to be identified, the motion con-
trol in the primary periodic task is called motion control 1, while the motion control in the priori-
ty-5 periodic task is called motion control 2.
Task Assignment
• Axes and axes groups can be assigned to either of the primary periodic task and the priority-5 peri-
odic task. The I/O device task that is assigned to an axis must be the same type of task that is as-
signed to the axis.
Axis 2: Primary periodic task CH2 Axis 2: Priority-5 periodic task CH2
• You can execute motion control instructions from the user program that is operated in the priority-16
periodic task for the axes and axes groups that are assigned to the primary periodic task.
Additional Information
Refer to Section 3 Configuring Axes and Axes Groups on page 3-1 for details on axes and
axes groups.
Primary
MC
MC
MC
MC
MC
IO UPG IO UPG IO UPG IO UPG IO UPG
periodic task
Priority-5
IO UPG MC IO UPG MC IO UPG
periodic task
(A) (C)
Task period (t×4)
Priority-16
IO UPG UPG UPG IO UPG
periodic task
(B)
Symbol Description
IO I/O refreshing
UPG User program execution
MC Motion control
(A) A dotted line represents a transition to another task.
(B) A dashed-dotted line means that processing for that task has been interrupted.
(C) A double line means that all processing for that task has been completed.
Motion control
Motion control
Task period
System common
Input data processing
System common
User program
User program
processing 2
processing 1
executed.
execution
execution
Refresh
*1. The CPU Unit will temporarily interrupt the execution of a task in order to execute a task with a higher
execution priority.
Task Period
For a single task, the primary period, which is the task period for the primary periodic task, is the
standard period for execution.
In this case, the primary period is automatically used as the motion control period. (It is also the same
as the process data communications cycle for EtherCAT communications.)
The NX102 CPU Unit, NX1P2 CPU Unit, and NJ-series CPU Unit support only the single task control.
For multi-motion, two kinds of period, the primary period and the task period of priority-5 periodic task
are the standard periods for execution.
In this case, the motion control takes two kinds of period, while the process data communications cy-
cle for EtherCAT communications automatically takes each of the task periods.
Periodic task execution is synchronized with the primary period. Set the task period of a periodic task
as an integer multiple of the primary period.
For example, if the primary period is 1 ms, then you can set the task period of a priority-5 periodic task
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on the task
period.
Additional Information
If two process data communications cycles need to be identified, the communications cycle for 2
the primary periodic task is called process data communications cycle 1, while the communica-
tions cycle for the priority-5 periodic task is called process data communications cycle 2.
Note The setting conditions of task periods of the primary periodic task and the periodic tasks.
The task periods for periodic tasks must be set to integer multiples of the task period of the primary peri-
odic task.
Set the task period so that the least common multiple of task periods of each task must be less than or
equal to 600 ms.
Primary peri-
Valid task periods for periodic tasks
od
500 μs*1 1 ms, 2 ms, 3 ms, 4 ms, 5 ms, 8 ms, 10 ms, 15 ms, 20 ms, 25 ms, 30 ms, 40 ms, 50 ms,
60 ms, 75 ms, or 100 ms
1 ms 1 ms, 2 ms, 3 ms, 4 ms, 5 ms, 8 ms, 10 ms, 15 ms, 20 ms, 25 ms, 30 ms, 40 ms, 50 ms,
60 ms, 75 ms, or 100 ms
2 ms 2 ms, 4 ms, 8 ms, 10 ms, 20 ms, 30 ms, 40 ms, 50 ms, 60 ms, or 100 ms
Primary peri-
Valid task periods for periodic tasks
od
4 ms 4 ms, 8 ms, 20 ms, 40 ms, 60 ms, or 100 ms
*1. Unit version 1.03 or later is required to use this setting on the NJ301 CPU Unit.
You cannot use this setting on the NJ101-10££.
Slave A Servo
IN Execution command
Primary period Primary period
1 Loading Data
The input data from the EtherCAT slaves (slave A) is loaded during the I/O refresh (IO).
2 Instruction Execution
The motion control instructions (FB) are executed based on the data that was loaded during
user program execution (UPG).
The output variables of the motion control instructions are refreshed at this point.
3 Command Generation
Motion processing according to the motion control instructions (FB) that were executed is per-
formed during motion control (MC) immediately after user program execution in the primary pe-
riodic task. During this processing, execution commands for the Servo Drives and other devi-
ces are generated.
4 Sending Commands
The execution commands that were generated are sent to the Servo Drive or other device dur-
ing the I/O refresh (IO) in the next period.
Additional Information
Timing of Processing
1 Loading Data
The input data from the EtherCAT slaves (slave A) is loaded during the I/O refresh (IO).
2 Instruction Execution
The motion control instructions (FB) are executed based on the data that was loaded during
user program execution (UPG).
The output variables of the motion control instructions are refreshed at this point.
3 Command Generation
Motion processing according to the motion control instructions (FB) that were executed is per-
formed during motion control (MC) immediately after user program execution in the primary pe-
riodic task. During this processing, execution commands for the Servo Drives and other devi-
ces are generated.
4 Sending Commands
The execution commands that were generated are sent to the Servo Drive or other device dur-
ing the I/O refresh (IO) in the next period.
Additional Information
• You can use the priority-5 periodic task only with NX701 CPU Units.
• The priority-5 periodic task is used when you want to divide functions configuring the device
for separate control, those functions that need high-speed control with the primary periodic
task and others with the priority-5 periodic task.
Additional Information
• Refer to 3-1-4 Synchronizing Axis Variables on page 3-8 for details on synchronization of
axis variables.
• The user program for the priority-16 periodic task can access the values of an Axis Variable
of an axis that is controlled in the primary periodic task. Refer to Using Motion Control In-
structions in a Priority-16 Periodic Task on page 2-15 and 3-1-4 Synchronizing Axis Varia-
bles on page 3-8 for details.
The values of an Axis Variable are updated synchronizing to the task period of accessing task.
The values of an Axis Variable that is accessed are not overwritten during the user program execu-
tion for the task that accesses the values of an Axis Variable.
The timing that the values of an Axis Variable in the primary periodic task update to the priority-5
periodic task is shown below.
Servo
Primary period (t) Execution command
Primary
MC
MC
MC
MC
MC
IO UPG IO UPG IO UPG IO UPG IO UPG
periodic task
Priority-5
IO UPG MC IO UPG MC IO UPG
periodic task (A)
(B)
Sym
Description
bol
(A) Axis Variable updated.
Regardless of where the user program execution for the priority-5 periodic task starts, the Axis Varia-
ble is updated with the execution result of the primary periodic task immediately before the start of
the task periods matched.
(B) The values of an Axis Variable are not overwritten during the user program execution.
The update timing is similar if two task periods are the same.
Servo
Primary period (t) Execution command
Primary
MC
MC
MC
MC
MC
Priority-5
MC
MC
MC
MC
MC
Additional Information
Primary
MC
MC
IO UPG IO IO IO UPG
periodic task
MC
Task period (t×2)
Priority-5
periodic task IO UPG MC IO UPG MC 2
(A)
(B)
The timing that the values of an Axis Variable in the priority-5 periodic task update to the primary
periodic task is shown below.
Servo
Primrary period (t) (B) Execution command
Primary
MC
MC
MC
MC
MC
IO UPG IO UPG IO UPG IO UPG IO UPG
periodic task
(A)
Task period (t×2)
Priority-5
IO UPG MC IO UPG MC IO UPG
periodic task
Sym
Description
bol
(A) Axis Variable updated.
The Axis Variable is updated with the execution result of the priority-5 periodic task immediately be-
fore the start of the task periods matched.
(B) The values of an Axis Variable are not overwritten during the user program execution.
Timing of Processing
Motion control processing (MC) for the motion control instructions (FB) that are executed in the
same task period as the priority-16 periodic task are performed at the same time.
Slave A Servo
IN Execution command
Primary period
Priority-16 UPG
periodic task FB
Slave A Servo
IN Execution command
Primary period
Priority-16 UPG
periodic task FB
1 Loading Data
The input data from the EtherCAT slaves (slave A) is loaded during the I/O refresh (IO).
2 Instruction Execution
The motion control instructions (FB) are executed based on the data that was loaded during
user program execution (UPG) in the priority-16 periodic task.
The output variables of the motion control instructions are refreshed at this point.
3 Command Generation
Motion control instructions (FB) are executed in the task period of the priority-16 periodic task
according to the motion control instructions (FB) that were executed.
Motion processing is performed during motion control processing (MC) in the next primary peri-
odic task after the periodic task. During this processing, execution commands for the Servo
Drives or other devices are generated.
4 Sending Commands
The execution commands that were generated are sent to the Servo Drive or other device dur-
ing the I/O refresh (IO) in the next period.
I/O Servo 2
OUT Execution
Primary period command
Values of
Priority-16 Axis UPG UPG
periodic task Variable FB
are read *1
Execution of motion control instructions *2
Task period (primary period × 3)
*1. The values of an Axis Variable of the primary periodic task are read at the start of user program execution
for the priority-16 periodic task.
*2. The values of an Axis Variable are not written when a motion control instruction (FB) is executed in the
priority-16 periodic task.
*3. The values are written during this motion control processing (MC).
• When motion control instructions are placed in a priority-16 periodic task, the response time
of the Servo Drive or other device will increase if the task period of the priority-16 periodic
task is lengthened.
• Make sure that all axes can be stopped safely for emergency stops, including emergency
stops commanded from external devices.
• The execution timing of motion control instructions in a priority-16 periodic task is not the
same as the execution timing for I/O control. Design the user program to allow for this.
• You cannot use the priority-16 periodic task on NX102 CPU Units and NX1P2 CPU Units.
Additional Information
For information on Axis Variables, refer to 3-1-3 Introduction to Axis Variables on page 3-6.
If motion control instructions (FB) are executed in both tasks within the period of the priority-16 period-
ic task, the MC Function Module will perform motion processing for instructions in the primary periodic
task first.
For example, the MC_MoveAbsolute instruction is executed in the priority-16 periodic task. Then, the
MC_MoveRelative is executed for the same axis in the primary periodic task. The operation for this is
shown below.
• The MC Function Module will execute MC_MoveRelative first. MC_MoveAbsolute is executed with
multi-execution of instructions.
Servo
Execution command for MC_MoveRelative
Primary period
FB2: MC_MoveRelative
Priority-16 UPG The instruction is buffered for
periodic task FB1 multi-execution of instructions.
FB1: MC_MoveAbsolute
The values of output variables for a motion control instruction and the values of system-defined varia-
bles for motion control will change during the I/O refresh of the task that executed the instruction.
Therefore, you may notice different behavior depending on the task if you use motion control instruc-
tions for the same axis in different tasks.
Make sure that you thoroughly understand the processes of each task before you start to develop your
user program.
• If you include motion control instructions for the same axis in both the primary periodic task
and the priority-16 periodic task, pay close attention to the following when you develop your
user program: the execution order of the motion control instructions, the timing of updates for
system-defined variables for motion control, and the output timing of command values.
• If you use system-defined variables for motion control for the same axis in multiple tasks, pay
close attention to the differences in timing for updating system-defined variables for motion
control when you develop your user program.
• You cannot use the priority-16 periodic task on NX102 CPU Units and NX1P2 CPU Units.
Additional Information
Control
This section describes EtherCAT communications and other items related to the MC Function Module.
The MC Function Module uses PDO communications for commands to refresh I/O data, such as data
for Servomotor position control, on a fixed control period.
It uses SDO communications for commands to read and write data at specified times, such as for pa-
rameter transfers.
Controller
(communications master) EtherCAT Slaves
communications lines
SDO communications
Write data
Read data
Sequence Control
• I/O ports for configuration slaves are automatically created when you create the EtherCAT Configu-
ration in EtherCAT Tab Page in the Sysmac Studio.
• You use the I/O Map Tab Page in the Sysmac Studio to assign device variables.
• Perform sequence control through instructions other than motion control instructions.
Motion Control
• I/O ports for configuration slaves are automatically created when you create the EtherCAT Configu-
ration in EtherCAT Tab Page in the Sysmac Studio.
• Create Axis Variables in Motion Control Setup View and assign the EtherCAT slaves for which mo-
tion control is performed.
• Perform motion control through motion control instructions.
The following devices can be assigned to Axis Variables: EtherCAT slave Servo Drives, Encoder Input
Terminals, and NX-series Position Interface Units.
Additional Information
• Commands are not sent directly through PDO communications to an EtherCAT slave or NX-
series Position Interface Unit that is assigned to an Axis Variable for instructions other than
motion control instructions. However, the status of such an EtherCAT slave can be accessed
indirectly through the Axis Variables.
• You can use SDO communications to read and write the objects of EtherCAT slaves and NX-
series Position Interface Units that are assigned to Axis Variables.
However, do not use SDO communications to write objects that are mapped to PDO commu-
nications. If you do, the operation of the slaves will depend on slave specifications. For OM-
RON slaves, SDO communications will result in errors.
• If EtherCAT slave Servo Drives, Encoder Input Terminals, and NX-series Position Interface
Units are not assigned to Axis Variables, you must execute sequence control for them in the
same way as for general-purpose EtherCAT slaves.
Version Information
With the Sysmac Studio version 1.09 or higher, you can assign device variables to the I/O ports
of slaves and Units that are assigned to the Axis Variables.
The following are the conditions of I/O ports to which you can assign device variables.
• I/O ports with Read/Write attribute set to Read (R: Read only).
• I/O ports with Read/Write attribute set to Write (W: Write only). Also, for these I/O ports, <Not
assigned> must be set for the process data field under Detailed Settings on the Axis Basic
Settings Display in the Sysmac Studio.
If you used the Sysmac Studio version 1.09 or higher to create a project and assign device vari-
ables to the Axis Variables, and open the project with the Sysmac Studio version 1.08 or lower,
the assignment of the device variables will be cleared.
Device variables
Instructions Executed. EtherCAT
other than EtherCAT
Sequence slaves
motion control
control instructions
EtherCAT
Control
Master
Function EtherCAT EtherCAT
MC Function Module Task period
variables
Axis
Motion control Module
instructions slaves,
•Profile processing
•Synchronization Servo Drives,
encoder input
Motion control
Executed.
processing
Other processing
terminals, 2
Position
Interface Units
2-4-2 Relationship between EtherCAT Master Function Module and MC Function Module
NX102 CPU Unit
I/O ports
Device variables
Instructions
other than NX Bus NX Units
motion control Function
Sequence instructions
control Module
EtherCAT EtherCAT
slaves
Motion control
Motion control instructions slaves,
Servo Drives,
encoder input
terminals,
Position
Interface Units
I/O ports
other than Built-in I/O
Device variables
motion control Option Boards
instructions
Sequence NX Bus NX Units
control Function
Module
EtherCAT EtherCAT
slaves
This type of data exchange is updated as shown in the following processing period.
CPU Unit
Control
Slaves
Execution of user Motion control processing
program in PLC by MC Function Module
Function Module EtherCAT Processing in slave
2-4-3 Relationship between Process Data Communications Cycle and Motion Control Period
Sequence control period *1 Motion control period Communications cycle Data refresh
period in slave
(depends on the slave)
*1. If the sequence control period is primary period, the motion control period and the communications cycle
are primary period.
If the sequence control period is the task period of the priority-5 periodic task, the motion control period
and the communications cycle are the task period of the priority-5 periodic task.
NX102 CPU Unit, NX1P2 CPU Unit, and NJ-series CPU Unit
• Primary period = Motion control period = Process data communications cycle for EtherCAT com-
munications
Execution of user
program in PLC
Function Module
Slaves
Sequence control period Motion control period Communications cycle Data refresh
(primary periodic task) = Primary periodic (EtherCAT data communi- period in slave
task period cations cycle = Primary (depends on
periodic task period) the slave)
3-1 Axes
This section describes the axes that are used in a MC Function Module.
Although all axes of NX701 and NJ-series CPU Units are motion control axes, NX102 CPU Units and
NX1P2 CPU Units allow the use of single-axis position control axes in addition to motion control axes.
You can set each axis to Single-axis Position Control Axis in Control Function in the Axis Basic Set-
tings.
Refer to Control Function on page 5-11 for details on the control function.
The MC Function Module supports the axis types that are given in the following table.
The following elements are related to the axes of the MC Function Module.
The number of elements provided is the same as the maximum number of controlled axes for each
model. The maximum number of controlled axes varies depending on the model.
Refer to 1-4-2 Performance Specifications on page 1-7 for details.
Configuration ele-
Description Page
ment
Axis parameters The axis parameters set the maximum velocity, jogging, homing, and oth- page 3-3
er items for the axes operations controlled by the MC Function Module.
Use the Sysmac Studio to set the axis parameters.
Configuration ele-
Description Page
ment
Axis Variables Axis Variables are system-defined variables for the actual position, error page 3-6
information, and other monitor information for axes controlled by the MC
Function Module.
Axis Variables are created when you add an axis from the Multiview Ex-
plorer of the Sysmac Studio. The names of the Axis Variables (called the
Axis Variable names) are set here.
Specifying axes in In the user program, motion control is implemented with motion control page 3-9
the user program instructions. Motion control instructions that perform single-axis control
are used to create axis commands.
3-1 Axes
To control an axis with axis commands, specify the Axis Variable name of
the system-defined variable or the Axis Variable name that was set with
the Sysmac Studio for the Axis in-out variable of the instruction.
3
3-1-2 Introduction to Axis Parameters
Refer to 5-2 Axis Parameters on page 5-5 for details on axis parameters.
3-1 Axes
Input Device/ Specify the node address of the EtherCAT slave de-
Output Device vice that is assigned to the axis.
The Node Address parameter cannot be selected if
the Axis Type parameter is set to use a virtual axis.
*1. Set this parameter when using the NX701 CPU Unit.
3
*2. Set this parameter when using the NX102 CPU Unit and NX1P2 CPU Unit.
*3. To use the axis as a motion control axis, select All. To use the axis as a single-axis position control axis,
Required Settings to Perform a Servo Drive Test Run from the Sysmac
Studio
Make the following settings to operate an EtherCAT-connected Servo Drive or other device using
the MC Test Run function of the Sysmac Studio.
• Select the appropriate values based on the machine's operating conditions for parameters
such as the maximum velocity, maximum acceleration/deceleration, or stop settings when the
motor is actually operated.
• OMRON 1S-series Servo Drives and G5-series Servo Drives can be set to specific node ad-
dresses by using the rotary switches on the front panels.
If the rotary switches are set to 00, the node address will be determined by the settings made
in the EtherCAT Editor of the Sysmac Studio.
If the rotary switches are set to 00 for all connected Servo Drives, errors will not occur even if
the Servo Drive's connection position is changed. Set the node addresses on the rotary
switches to assign specific Servo Drives for each machine control.
3-1 Axes
*1. An error will occur if you change the names in the AT column in the global variable table on the Sysmac
Studio.
Additional Information
• _MC_AX[0-255] or _MC1_AX[0-255], and _MC2_AX[0-255] are available for the NX701 CPU
3
Unit.
Only _MC_AX[0-14] is available for the NX102 CPU Unit.
Example:
If MC_Axis000 is changed to MyAxis1, then either MyAxis1.Act.Pos or _MC_AX[0].Act.Pos can be
used as the variable that indicates the actual current position.
Axis Variable for motion control 1 Axis Variable for motion control 2
Task type
User defined*1 System defined*2 User defined*1 System defined*3
Primary periodic task ¡ ¡ ¡*4 Í
Priority-5 periodic task ¡*5 Í ¡ ¡
Priority-16 periodic task ¡*5 ¡*6 ¡*4 Í
Priority-17 or priority-18 periodic
¡*5 ¡*7 ¡*4 ¡*8
task
Priority-8 or priority-48 event task ¡*5 ¡*7 ¡*4 ¡*8
*1. The user-defined Axis Variables, such as MC_Axis000 and Loader1, that are automatically generated when
you create the axes on the Sysmac Studio. We recommend that you use the user-defined Axis Variables.
*2. _MC_AX[*] or _MC1_AX[*]
*3. _MC2_AX[*]
*4. The Axis Variable for axis 1 is processed every task period of the priority-5 periodic task.
*5. The Axis Variable for axis 1 is processed every primary task period.
*6. The Axis Variables for the maximum number of axes are processed every primary task period. It is not rec-
ommended because the task execution time of the primary periodic task is increased.
*7. The Axis Variables for the maximum number of axes are processed every primary task period.
*8. The Axis Variables for the maximum number of axes are processed every task period of the priority-5 peri-
odic task.
Specify an Axis
MC_Power_instance
Variable name. MC_Power
3-1 Axes
MyAxis1 Axis Axis MyAxis1
Enable Status MyAxis1OnStatus
ServoOn Busy MyAxis1OnBusy
Error MyAxis1OnError
ErrorID MyAxis1OnErrorID 3
Refer to 6-2 Motion Control Instructions on page 6-5 for details on motion control instructions.
Refer to the instruction descriptions in the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508) for details on motion control instructions.
Create a project.
Add axes.
END
1 Start the Sysmac Studio and click the New Project Button.
2 Set the project properties, select the device, and click the Create Button.
Online Method
2 Select Online from the Controller Menu. The Sysmac Studio goes online with the Controller.
3 Right-click the Master Icon in the EtherCAT Tab Page and select Compare and Merge with
Actual Network Configuration from the menu.
When obtaining the information is completed, the physical slave configuration of the EtherCAT
slaves is displayed.
Right-click the displayed physical configuration and select Apply actual network configuration.
Offline Method
Adding Axes
1 Right-click Axis Settings in the Multiview Explorer and select Motion Control Axis or Single-
axis Position Control Axis from the Add Menu.
• Single-axis Position Control Axis is displayed for the NX102 CPU Unit and NX1P2 CPU
Unit.
• Refer to Control Function on page 5-11 for details on the differences between Motion
Control Axis and Single-axis Position Control Axis.
Additional Information
Copying an Axis
You can also add an axis by copying the axis settings for an existing axis.
Assigning an Axis
1 Right-click an axis in the Multiview Explorer and select Edit from the menu.
The Axis Basic Settings are displayed in the Axis Parameter Settings Tab Page.
Additional Information
Control Function is displayed for the NX102 CPU Unit and NX1P2 CPU Unit.
2 Select Primary periodic task or Priority-5 periodic task from Motion control.
Additional Information
• You can select this parameter for the NX102 CPU Unit and NX1P2 CPU Unit.
• To use the axis as a motion control axis, select All. To use the axis as a single-axis position
control axis, select Single-axis position control only.
Right-click Axis Settings in the Multiview Explorer and select Axis Setting Table to enable setting the
axis parameters for all axes at the same time.
When making operation settings such as the display unit, electronic gear (unit conversion for-
mula), maximum velocity, or maximum acceleration/deceleration, be sure to use appropriate
values for the operating conditions of the device.
Additional Information
1 Select Online from the Controller Menu. The Sysmac Studio goes online with the Controller.
2 Select Synchronization from the Controller Menu and then click the Transfer to Controller
Button.
Additional Information
The MC Function Module connects to OMRON 1S-series Servo Drives with built-in EtherCAT
communications, G5-series Servo Drives with built-in EtherCAT communications, or NX-series
Pulse Output Units.
Connectable Servo Drive Models
• You can connect the R88D-1SN£££-ECT, R88D-1SAN£££-ECT, R88D-KN£££-ECT,
and R88D-KN£££-ECT-L Servo Drives.
• The R88D-KN£££-ECT-R Servo Drives support only Position Control Mode (Cyclic Syn-
chronous Position Control Mode). Therefore, any functions that use Velocity Control Mode
(Cyclic Synchronous Velocity Control Mode) or Torque Control Mode (Cyclic Synchronous
Torque Control Mode) cannot be used.
Servo Drive Settings
• The MC Function Module uses some of the input signals and functions of the Servo Drives.
Servo Drive signal wiring and object setting are required to use the MC Function Module
properly.
Refer to A-1 Connecting the 1S-series Servo Drive on page A-2 or A-2 Connecting the G5-
series Servo Drive on page A-11 for specific settings.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the settings
to use NX-series Pulse Output Units.
The following elements are related to the axes groups of the MC Function Module.
Configuration ele-
Description Page
ment
Axes group parameters The axes group parameters set the maximum interpolation velocity, page 3-21
maximum interpolation acceleration/deceleration, and other items for the
axes groups controlled by the MC Function Module.
Use the Sysmac Studio to set the axes group parameters.
Axes Group Variables Axes Group Variables are system-defined variables that include a por- page 3-22
tion of the axes group parameters as well as the command interpolation
velocity, error information, and other monitor information for the axes
groups controlled by the MC Function Module.
Axes Group Variables are created when you add an axes group from the
Multiview Explorer of the Sysmac Studio. The names of the Axes Group
Variables (called the Axes Group Variable names) are set here.
Specifying axes groups In the user program, motion control is implemented with motion control page 3-24
in the user program instructions. Motion control instructions that perform multi-axes coordi-
nated control are called axes group commands.
To control an axes group with axes group commands, specify the axes
group variable name of the system-defined variable or the axes group
variable name that was set with the Sysmac Studio for the AxesGroup
in-out variable of the instruction.
Do not configure an axes group with axes on the EtherCAT network and axes on the CPU Unit.
The timing of commands may not be synchronized because the synchronization between the
networks is not performed. This may result in unintended operation.
Refer to 5-3 Axes Group Parameters on page 5-34 for details on axes group parameters.
• Set appropriate values for the maximum interpolation velocity, stop method, and other items
based on the operating conditions.
• An axis for which Control Function is set to Single-axis position control only cannot be
allocated as an axis in an axes group.
Additional Information
• _MC_GRP[0-63], _MC1_GRP[0-63], and _MC2_GRP[0-63] are available for the NX701 CPU
Unit.
Only _MC_GRP[0-7] is available for the NX102 CPU Unit and NX1P2 CPU Unit.
Only _MC_GRP[0-31] is available for the NJ-series CPU Unit.
• For the NX701 CPU Unit, you can access the same values of _MC_GRP[0-63] and
_MC1_GRP[0-63] if the axes group numbers of them are the same. You can use either of the
Axes Group Variables, or both of them at the same time.
• The Axes Group Variable assigned to primary periodic task is _MC_GRP[0-63] or
_MC1_GRP[0-63].
The Axes Group Variable assigned to priority-5 periodic task is _MC2_GRP[0-63].
Example:
If MC_Group000 is changed to MyGroup1, then either MyGroup1.Cmd.Vel or
_MC_GRP[0].Cmd.Vel can be used as the variable that indicates the command interpolation veloci-
ty.
Refer to Axes Group Variables on page 6-33 for details on Axes Group Variables.
MC_MoveLinear_instance
Specify an Axes
Group Variable MC_MoveLinear
name. MyGroup1 AxesGroup AxesGroup MyGroup1
Execute Done MyGroup1OnDone
MovLStart Position Busy MyGroup1OnBusy
Velocity Active MyGroup1OnActive
Acceleration CommandAborted MyGroup1OnCA
Deceleration Error MyGroup1OnError
Jerk ErrorID MyGroup1OnErrorID
CoordSystem
BufferMode
TransitionMode
MoveMode
You can also use the _MC_GRP[0] system-defined variable in place of MyGroup1.
Refer to 6-2 Motion Control Instructions on page 6-5 for details on motion control instructions.
Refer to the instruction descriptions in the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508) for details on motion control instructions.
END
1 Right-click an axes group in the Multiview Explorer and select Edit from the menu.
The Axes Group Basic Settings are displayed in the Axes Group Parameter Settings Tab
Page.
2 Select Primary periodic task or Priority-5 periodic task from Motion Control.
Additional Information
6 Click the bottom icon. The Axes Group Operation Settings Display is displayed.
Set appropriate values for the settings based on the operating conditions of the device.
Additional Information
1 Select Online from the Controller Menu. The Sysmac Studio goes online with the Controller.
2 Select Synchronization from the Controller Menu and then click the Transfer to Controller
Button.
You can use the MC Test Run function for OMRON 1S-series Servo Drives, G5-series Servo
Drives, or NX-series Pulse Output Units. Do not use it with servo drives from any other manu-
facturer.
Additional Information
• Refer to A-1 Connecting the 1S-series Servo Drive on page A-2 for the procedure to con-
nect to the OMRON 1S-series Servo Drive.
• Refer to A-2 Connecting the G5-series Servo Drive on page A-11 for the procedure to con-
nect to the OMRON G5-series Servo Drive.
Catego-
Function Description Setting/monitor item
ry
Axis op- Servo ON/OFF The Servo is turned ON and OFF. ---
eration
Jogging Jogging is performed in the positive or Target Velocity
negative direction. Acceleration/Deceleration
Homing Homing is performed using the homing Homing Parameters
parameter settings.
Absolute positioning Absolute positioning is performed. *1 Target Position
Target Velocity
Acceleration/Deceleration
Jerk
Relative positioning Relative positioning is performed. Travel Distance
Target Velocity
Acceleration/Deceleration
Jerk
Deceleration stop A deceleration stop is performed during ---
the MC Test Run.
Resetting errors The errors in the MC Function Module ---
are reset.
Monitor- Servo Drive status The status of the Servo Drive is moni- Servo ON/OFF
ing tored. Servo Ready
Main Power
Catego-
Function Description Setting/monitor item
ry
Input signals The status of the input signals are Positive Limit Input/Negative Limit
monitored. Input
Immediate Stop Input
Home Proximity Input
Home Input
External Latch Inputs 1 to 2
Actual position The actual position is monitored. Command and Actual Current Posi-
After you have confirmed these two items, perform the following operations as instructed.
START
Checking motor
operation Use jogging to check the direction of the motor.
Checking electronic
gear settings Perform relative positioning to check the travel distance.
*1. Refer to Section 3 Configuring Axes and Axes Groups on page 3-1.
*2. Refer to 4-1-4 Starting the MC Test Run Function on page 4-5.
• When one of the following operations is performed for a command from the Sysmac Studio,
the Servomotor will operate at the set velocity: Servo ON, jogging, relative positioning, abso-
lute positioning, or homing.
Always confirm that it is safe for the Servomotor to operate before executing any of these op-
erations.
• When you operate the Controller from the Sysmac Studio, always install external emergency
circuits so that the Servomotor can be stopped safely whenever necessary. The Sysmac Stu-
dio may not be able to send commands under some circumstances, e.g., if an error occurs in
the computer.
• Set the EtherCAT communications and establish communications before you attempt to per-
form operation from the Sysmac Studio.
• Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the proce-
dures for the NX-series Position Interface Units.
Additional Information
You can perform the following operations to end the MC Test Run function at any time.
• Select MC Test Run − Stop from the Controller Menu of the Sysmac Studio.
• Right-click the axis in the Multiview Explorer of the Sysmac Studio and select Stop MC Test
Run from the menu.
• Close the MC Test Run Tab Page on the Sysmac Studio.
• Exit the Sysmac Studio.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Servomotor
Encoder resolution: 20 bits/rotation
1 rotation
10mm Ball screw
Ball screw pitch: 10 mm
1 Start the Sysmac Studio and open a project in which the axis settings are completed.
2 Select Online from the Controller Menu. The Sysmac Studio goes online with the Controller.
When the following caution dialog box appears, read the message carefully. After you confirm
safety, click the OK Button.
2 Check to see if the signals turn ON and OFF properly on the monitor screen by turning ON and
OFF the sensor connected to each input signal.
• When one of the following operations is performed for a command from the Sysmac Studio,
the Servomotor will operate at the set velocity: Servo ON, jogging, relative positioning, abso-
lute positioning, or homing.
Always confirm that it is safe for the Servomotor to operate before executing any of these op-
erations.
• When you operate the Controller from the Sysmac Studio, always install external emergency
circuits so that the Servomotor can be stopped safely whenever necessary. The Sysmac Stu-
dio may not be able to send commands under some circumstances, e.g., if an error occurs in
the computer.
• Set the EtherCAT communications and establish communications before you attempt to per-
form operation from the Sysmac Studio.
• If you use an NX-series Pulse Output Unit, you must provide a separate means to turn the
power supply to the motor drive ON and OFF. Refer to the NX-series Position Interface Units
User’s Manual (Cat. No. W524) for details.
4-3-2 Jogging
1 Select the axis to jog on the Jogging Tab Page of the MC Test Run Tab Page.
3 Enter the target velocity, acceleration rate, and deceleration rate, and then press the Apply
The motor will operate in either the positive or negative direction while one of these buttons is
clicked.
Check to see if the motor operates in the set direction.
4
4-3-3 Homing
4-3-2 Jogging
To perform homing with the MC Test Run function, you must make the Homing Settings for axis pa-
rameters.
For details on homing, refer to Section 8 Homing on page 8-1 and 5-2-9 Homing Settings on page
5-29.
1 Set the homing parameters in the Homing Settings on the Axis Parameter Settings Tab Page.
Additional Information
• When you click the Homing Settings Button, the Homing Settings are displayed on the
Axis Parameter Settings Tab Page. Set the homing parameters.
• If the homing parameters were set in advance, click the Apply homing parameters Button
to apply those settings.
1 Click the Absolute positioning Tab on the MC Test Run Tab Page.
The following dialog box will appear.
4 Enter the target position, target velocity, acceleration rate, deceleration rate, and jerk, and then
click the Apply Button.
1 Click the Relative positioning Tab on the MC Test Run Tab Page.
The following dialog box will appear.
4 Enter the target travel distance, target velocity, acceleration rate, deceleration rate, and jerk,
and then click the Apply Button.
5-1 Introduction
You can use motion control instructions to perform single-axis operations and multi-axes operations on
axes groups with the NJ/NX-series CPU Unit’s MC Function Module.
Axis and axes group parameters are used to set these operations.
Axis parameters must be set, but axes group parameters are not required if you do not use multi-axes
operations for axes groups.
These parameters are called motion control parameter settings (MC parameter settings).
Sysmac Studio
CPU Unit
ID211
AD042
RUN
ERC
ERH
B1 A1
0
1
2
3 MACH 78
9 01
456
No.
4 x10 1
23
5
78
6 9 01
456
0
x10
23
7
8
9
10
11
12
13
14
15
COM
DC24V
7mA
Downloaded.*1
Non-volatile memory • After the setting Main memory Temporary User program
are downloaded changes to some
parameters MC_Write instruction
• When power is or other instructions
MC common parameter settings*2 MC common parameter settings*2
turned ON
Axis parameter settings Axis parameter settings MC_WriteAxisP
Temporarily arameter/MC_R
Axes group parameter settings Axes group parameter settings changes/reads to
eadAxisParame
Uploaded.*1 some axis ter instruction*3
parameter settings
Data movement or
Accessing some other instructions
parameters as
variables
*1. Use the Synchronization menu command of the Sysmac Studio to upload and download the project.
*2. There are no MC Common Parameter Settings for the current version of the MC Function Module.
*3. A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required to use the
MC_WriteAxisParameter (Write Axis Parameters) and MC_ReadAxisParameter (Read Axis Parameters) in-
structions.
Version Information
If a CPU Unit with unit version 1.13 or later and Sysmac Studio version 1.17 or higher are com-
bined, commands to the I/O devices can continuously be sent even when the download process
is in progress.
For the CPU Unit with unit version 1.12 or earlier, sending commands to the I/O devices is stop-
ped when the download process is executed.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for how to set to
stop or continue sending commands to the I/O devices when the download process starts.
Stopping sending commands to I/O devices
Servo is turned OFF during the download, and the axis status will be Disable (Axis Disa-
bled).
Continuing sending commands to I/O devices
The following status immediately before downloading is maintained during the download: the
Servo ON state for the MC_Power instruction and the output torque limit for the MC_SetTor-
queLimit instruction.
The Servo ON state and torque limit are maintained even if the MC_Power and MC_SetTor-
5-1 Introduction
queLimit instructions are deleted from the user program after the program is updated by
downloading.
• Changes to the MC Parameter Settings that are made with the MC_Write (Write MC Setting)
instruction are saved in the main memory in the CPU Unit. They are not saved in the built-in
non-volatile memory in the CPU Unit.
Therefore, if you cycle the power supply or download the settings from the Sysmac Studio,
the parameter settings in the non-volatile memory are restored. Also, you cannot upload the
data in the main memory from the Sysmac Studio.
If you need to save settings to the non-volatile memory, use the Sysmac Studio to change the
parameter settings and then download those settings to the CPU Unit .
• To maintain the MC_Power (Power Servo) and MC_SetTorqueLimit instructions after down-
loading, set Retain attribute of the input bits for the instructions to Retain.
• You can use the following instructions to change the settings of the MC parameters.
MC_Write (Write MC Setting) instruction
MC_ChangeAxesInGroup (Change Axes in Group) instruction
MC_ChangeAxisUse (Change Axis Use) instruction
MC_WriteAxisParameter (Write Axis Parameters) instruction
• Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information
on using the NX-series Position Interface Units.
Temporary changes*1
Reading
Classification Parameter name Sup- Page
Applicable instruction variables*2
port
Axis Basic Axis Number OK page 5-8
Settings
5
Motion Control*3 OK*4
Axis Use OK*5 MC_ChangeAxisUse OK
Temporary changes*1
Reading
Classification Parameter name Sup- Page
Applicable instruction variables*2
port
Operation Set- Maximum Velocity OK*7 MC_WriteAxisParameter*8 page 5-21
tings Start Velocity*10
Maximum Jog Velocity
Maximum Acceleration
Maximum Deceleration
Acceleration/Deceleration Over
Operation Selection at Reversing
Velocity Warning Value OK MC_Write
Acceleration Warning Value MC_WriteAxisParameter*8
Deceleration Warning Value
Positive Torque Warning Value*11
Negative Torque Warning Value*11
In-position Range OK
*12
Temporary changes*1
Reading
Classification Parameter name Sup- Page
Applicable instruction variables*2
port
Servo Drive Modulo Maximum Position Setting page 5-28
Settings Value
Modulo Minimum Position Setting
Value
PDS State Control Method*4
Homing Set- Homing Method OK*7 MC_WriteAxisParameter*8 page 5-29
tings Home Input Signal
Homing Start Direction
Home Input Detection Direction
Operation Selection at Positive Lim-
Refer to 3-2 Axis Setting Procedure on page 3-10 for details on how to set axis parameters.
Refer to 6-6 System-defined Variables for Motion Control on page 6-21 for information on system-
defined variables for motion control.
For details on instructions including the MC_Write (Write MC Setting) instruction, refer to the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
Setting De-
Parameter name Function
range fault
Axis Number Set the logical number of the axis. This number indicates the axis --- ---
number of the corresponding system-defined variable,
_MC_AX[0-255], _MC1_AX[0-255], and _MC2_AX[0-255].
Motion Control*1 Assign to either of the primary periodic task or priority-5 periodic task. 1 to 2 1
1: Primary periodic task
2 Priority-5 periodic task
Axis Use Set whether to enable or disable the axis. *2 0 to 2 0
0: Undefined axis
1: Unused axis*3
2: Used axis
Axis Type Set the axis type. 0 to 3 2
I/O wiring is not required for virtual axes.
0: Servo axis
1: Encoder axis
2: Virtual servo axis
3: Virtual encoder axis
Control Function*4 Select the function of axis to control. *5 0, 1 0
0: All
1: Single-axis position control only
Input Device/Out- Specify the node address of the EtherCAT slave device that is as- 0 to ---
put Device signed to the axis. *6 65535
The Node Address parameter cannot be selected if the Axis Type pa-
rameter is set to use a virtual axis.
*1. Set this parameter when using the NX701 CPU Unit.
*2. Busy (Executing) changes to TRUE if you execute a motion control instruction for an undefined or unused
axis.
Busy changes to FALSE when Execute or Enable changes to FALSE.
You can set axes as unused axes to enable using the same user program for different axis configurations
without the need to delete programming for axes that are not used.
*3. With a CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher, Unused axis
(changeable to used axis) and Unused axis (unchangeable to used axis) are displayed by the Sysmac
Studio.
If you set Unused axis (changeable to used axis), you can set the axis parameters and use the
MC_ChangeAxisUse (Change Axis Use) instruction to temporarily change the setting of the Axis Use axis
parameter.
Refer to 9-8-10 Changing Axis Use on page 9-84 for details.
*4. Set this parameter when using the NX102 CPU Unit and NX1P2 CPU Unit.
*5. To use the axis as a motion control axis, select All. To use the axis as a single-axis position control axis,
select Single-axis position control only.
*6. For an NX-series Position Interface Unit, select the node address of the EtherCAT Coupler Unit and the NX
Unit number of the Position Interface Unit.
Axis Numbers
You can set the number for axis numbers up to the maximum number of controlled axes. You can
change the number of real axes to used axes up to the maximum number of used real axes.
Motion Control
For the NX701 CPU Unit, the axes to use are assigned to either of the primary periodic task or priori-
ty-5 periodic task.
Additional Information
The Motion control setting is not available for the NX102 CPU Unit, NX1P2 CPU Unit, and NJ-
series CPU Unit, which support only the primary periodic task.
Axis Types
The following table describes the different axis types that you can select in the Axis Type parameter.
• Errors do not occur for immediate stop inputs or positive/negative limit inputs because the input
signals do not exist.
You cannot set the axis type of a single-axis position control axis to Encoder axis or Virtual en-
coder axis.
Control Function
Axis type
All Single-axis position control only
Servo axis ¡ ¡
Virtual servo axis ¡ ¡
Encoder axis ¡ Í
Virtual encoder axis ¡ Í
Control Function
Motion control function
All Single-axis position control only
Single-axis position control ¡ ¡
Single-axis synchronized control ¡ Í
Single-axis velocity control ¡ ¡*1
Single-axis torque control ¡ Í
Multi-axes coordinated control ¡ Í
*1. You can use only the MC_MoveVelocity (Velocity Control) instruction.
Refer to Section 9 Motion Control Functions on page 9-1 for details on motion control functions.
Additional Information
Select Single-axis position control only when you use NX102-90££ or NX1P2-9£££££.
• OMRON 1S-series Servo Drives and G5-series Servo Drives can be set to specific node ad-
dresses by using the node address switches on the front panels.
If the node address switches are set to 00, the node address will be determined by the set-
tings made in the EtherCAT Editor of the Sysmac Studio.
If the node address switches are set to 00 for all connected Servo Drives, errors will not occur
even if the Servo Drive's connection position is changed. Set the node addresses on the
node address switches to assign specific Servo Drives for each machine control.
• The value set on the Servo Drive's node address switches is loaded only once when the Ser-
vo Drive's control power is turned ON.
Such changes are enabled only after the power supply is turned ON again.
Do not change the setting on the node address switches after the power supply has been
turned ON.
• An error occurs if the same node address is used more than once.
Additional Information
• The following example shows the EtherCAT device’s node address setting for an OMRON
1S-series Servo Drive with built-in EtherCAT communications.
ID
01 2 01
EF EF
23
23345
CD
CD
ID switch
45
45
AB
AB
67 67
89 89
x16 x1
Status indicators
Motor Gear Ratio*4 *6 Set the gear ratio of the motor. 1 to 4,294,967,295 1
*1. This is the numerator of the electronic gear ratio (unit conversion formula).
*2. For example, if the encoder resolution is 10,000 pulses/rotation, set 10,000.
*3. This is the denominator of the electronic gear ratio (unit conversion formula) when you set not to use the
reducer.
This parameter is disabled when you set to use the reducer.
*4. A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use this
parameter.
*5. When you set to use the reducer, some conditions must be met to make the unit conversion settings.
Refer to Conditions to Use Reducers on page 5-15 for the conditions.
*6. This parameter is enabled when you set to use the reducer.
*7. The setting is possible only when the Count Mode is Linear Mode. When the Count Mode is Rotary Mode,
the parameter value is calculated from the modulo maximum position setting value and modulo minimum
position setting value.
• Set to use the reducer if you use the Count Mode to Rotary Mode.
When you set not to use the reducer, the number of pulses for one cycle of the ring counter
may not be an expected integer because of a calculation error for one cycle of the ring coun-
ter when converted to pulses. The unexpected integer may cause the position offset.
• When you make a change in the unit conversion settings, except for a change in the unit of
display conversion, there are some differences between the physical position of the machine
and the command current position of the MC Function Module. Therefore, if you made a
change in the unit conversion settings, execute the Home instruction to define the home
again.
Positions are generally given in pulses between the MC Function Module and Servo Drives or encoder
input terminals.
Use a display unit of millimeters or degrees for motion control instructions so that you can easily un-
derstand the operation.
MC Pulses Servo
User Position Motion
program control Function Drive
increment Module
instructions
Encoder
Input
Terminal
Pulses
You can use the Unit of Display parameter and electronic gear (unit conversion formula) settings to
change from a pulse unit to millimeters or degrees.
Additional Information
For a virtual servo axis, the command current value is converted to pulses and then that value
is converted to the unit of display. The resulting value is used as the actual current value.
Actual
position
Unit of Display
Unit Description
pulse Use this unit to express values in pulses.
mm Use this unit for comparatively long-distance direct operation.
5
μm Use this unit for precise direct operation.
nm Use this unit for more precise direct operation than μm.
When the Count Mode is Rotary Mode, the following condition must also be met.
• The result of the following calculation must be equal to or less than 1,099,511,627,775: Command
pulse count per motor rotation × Motor gear ratio.
The work gear ratio and the motor gear ratio in the above calculations are determined from the divi-
sion by the highest common factor of the two.
Therefore, even if the condition is not met by the calculation with the set values, the condition may be
met in actual operation.
Example
When the work gear ratio is 4 and the motor gear ratio is 6, you assume the work gear ratio to be 2
and the motor gear ratio to be 3 in the calculation.
MC Function Servo
Command position Module Drive Y pulses
(X units) Electronic
gear
Actual position
(X units)
X units
Command position value (pulses) = Command position (X units) × Electronic gear ratio
*1. For an encoder axis, this is the number of pulses per encoder rotation.
*2. For an encoder axis, this is the travel distance per encoder rotation.
The electronic gear converts units to the values that are used for positioning by the MC Func-
tion Module and motion control instructions.
Motion control instructions specify the target position as LREAL data. However, an instruction
error will occur if the command position after conversion to pulses by the electronic gear ex-
ceeds 40 bits.
In this example, an OMRON 1S-series Servomotor with a 23-bit absolute encoder is used.
Mechanically, the reduction ratio of the reducer is 1/5 and the workpiece moves 10 mm for every
rotation of the ball screw.
Workpiece
Servomotor encoder
resolution: 23 bits/rotation
(8,388,608 pulses per rotation) Reduction ratio: 1/5 Ball screw pitch: 10 mm
The Unit of Display parameter is set to millimeters. The Command Pulse Count Per Motor Rotation
is set to the resolution of the encoder on the Servomotor.
A reducer with a reduction ratio of 1/5 is used, so the ball screw turns once for every five rotations
of the Servomotor. The workpiece moves 2 mm (10 mm × 1/5), so the Work Travel Distance Per
Motor Rotation is set to 2.
With these settings, the command unit for positions in the user program is 1 mm.
For example, to move to an absolute position of 100.5 mm, the Position (Target Position) input vari-
able to the MC_MoveAbsolute (Absolute Positioning) instruction is set to 100.5.
Additional Information
The electronic gear converts units to the values that are used for positioning by the MC Func-
tion Module and motion control instructions.
Motion control instructions specify the target position as LREAL data. However, an instruction
error will occur if the command position after conversion to pulses by the electronic gear ex-
ceeds 40 bits.
In this example, an OMRON 1S-series Servomotor with a 23-bit absolute encoder is used.
Mechanically, the reduction ratio of the reducer is 3/5 and the workpiece moves 10 mm for every
rotation of the ball screw.
Workpiece
Servomotor encoder
resolution: 23 bits/rotation
(8,388,608 pulses per rotation) Reduction ratio: 3/5 Ball screw pitch: 10 mm
The Unit of Display parameter is set to millimeters. The Command Pulse Count Per Motor Rotation
is set to the resolution of the encoder on the Servomotor.
The Work Travel Distance Per Rotation is set to 10 mm, which equals to the ball screw pitch.
A reducer with a reduction ratio of 3/5 is used, so the ball screw turns three times for every five
rotations of the Servomotor. For this reduction ratio setting, the work gear ratio is set to 3 and the
motor gear ratio is set to 5.
With these settings, the command unit for positions in the user program is 1 mm.
For example, to move to an absolute position of 100.5 mm, the Position (Target Position) input vari-
able to the MC_MoveAbsolute (Absolute Positioning) instruction is set to 100.5.
The electronic gear converts units to the values that are used for positioning by the MC Func-
tion Module and motion control instructions.
Motion control instructions specify the target position as LREAL data. However, an instruction
error will occur if the command position after conversion to pulses by the electronic gear ex-
ceeds 40 bits.
In this example 1, an OMRON 1S-series Servomotor with a 23-bit absolute encoder is used.
Mechanically, the reduction ratio of the reducer is 3/5 and the workpiece moves 360 degree for ev-
ery rotation of the turntable.
Turntable
360 degree/rotation
The Unit of Display parameter is set to degree. The Command Pulse Count Per Motor Rotation is
set to the resolution of the encoder on the Servomotor. 5
The Work Travel Distance Per Rotation is automatically determined and set by the result of “Modu-
lo maximum position - Modulo minimum position”.
With these settings, the command unit for positions in the user program is 1 degree.
For example, to move to an absolute position of 100.5 degree, the Position (Target Position) input
variable to the MC_MoveAbsolute (Absolute Positioning) instruction is set to 100.5.
In this example 2, an OMRON 1S-series Servomotor with a 23-bit absolute encoder is used.
Mechanically, the reduction ratio of the reducer is 3/5 and the conveyor moves 80 mm for every
rotation of the pulley. The travel distance per conveyor rotation is 360 mm.
Servomotor
Reducer
Reduction Mechanical
ratio: 3/5 ratio: 80/360
Final ratio:
3 × 80 Work Gear Ratio
= 5 × 360
= Motor Gear Ratio
The Unit of Display parameter is set to millimeters. The Command Pulse Count Per Motor Rotation
is set to the resolution of the encoder on the Servomotor.
The travel distance per conveyor rotation is automatically set by the result of “Modulo maximum po-
sition - Modulo minimum position”.
A reducer with a reduction ratio of 3/5 is used, so the pulley turns three times for every five rota-
tions of the Servomotor. The conveyor travel distance per pulley rotation is 80 mm and the travel
distance per conveyor rotation is 360. For this reduction ratio setting, the work gear ratio is set to
240 (3 × 80) and the motor gear ratio is set to 1,800 (5 × 360).
Additional Information
• If the travel distance per pulley rotation is not an integer (e.g. 80.1 mm), use a ratio multiplied
by the coefficient of 10, which converts values to integers, to calculate the work gear ratio
and the motor gear ratio. When the above example is used, the work gear ratio is set to 2,403
(3 × 80.1 × 10), and the motor gear ratio is set to 18,000 (5 × 360 × 10).
• In the same way as the above example 2, when a multi-step reducer is used, multiply several
ratios together and use a final ratio to set the work gear ratio and the motor gear ratio.
Maximum Velocity
This section provides a setting example for the maximum velocity.
Workpiece
Servomotor encoder
resolution: 23 bits/rotation
The Maximum Velocity is set to 200 based on a calculation for the conditions (maximum speed:
6,000 r/min, reduction ratio: 1/5, ball screw pitch: 10 mm; 6,000 r/min × 1/5 × 10 mm = 12,000
mm/min = 200 mm/s).
The default setting of 400,000,000 would exceed the maximum speed of the motor, so you must
change the setting.
5
Parameter name Setting
Unit of Display mm
Start Velocity
Set the start velocity to 0 when you use a servomotor.
If you use a stepper motor, use 10% to 50% of the maximum self-start frequency to prevent loosing
the sync at startup. However, this depends on the load, so refer to the manual for the stepper motor.
Velocity Velocity
0 Time 0 Time
Acceleration Deceleration Acceleration Deceleration
If the target velocity is less than or equal to the start velocity, acceleration/deceleration are not per-
formed and the axis moves at the target velocity.
Velocity
Start velocity
Target velocity
0 Time
If the target velocity changes as the result of re-executing the motion control command or as the result
of performing multi-execution of instructions for it during motion, the start velocity is used. If the target
velocity is greater than the start velocity, acceleration/deceleration are performed at the specified ac-
celeration/deceleration rates. If the target velocity is less than or equal to the start velocity, accelera-
tion/deceleration are not performed and the axis moves.
Start velocity
0 Time
The start velocity is also used if the velocity is changed by the MC_SetOverride instruction. If the tar-
get velocity is greater than the start velocity, acceleration/deceleration are performed at the specified
acceleration/deceleration rates. If the target velocity is less than or equal to the start velocity, accelera-
tion/deceleration are not performed and the axis moves.
Velocity
100%→180% 180%→50% Override factor
180%
Start velocity
100%
50%
0 Time
Count Modes
The Count Mode is the feed mode for the axis.
Select the count mode for the command positions for each axis.
There are two Count Modes: Linear Mode, which has a finite axis feed range and Rotary Mode,
which has an infinite axis feed range.
0x8000000000 0 0x7FFFFFFFFF
Count value
0x7FFFFFFFFF
Modulo maximum
position
Modulo minimum
position
0x8000000000
• The number of pulses for one cycle of the ring counter may not be an expected integer because
of a calculation error for one cycle of the ring counter when converted to pulses. The unexpected
integer may cause the position offset.
Version Information
Set to use the reducer to cancel the cause of the above position offset when you use a CPU
Unit with unit version 1.11 or later.
Refer to 5-2-3 Unit Conversion Settings on page 5-13 on use of reducers.
• If 0 is not included between the upper and lower limits of the ring counter, an error occurs
when the MC_MoveZeroPosition (High-speed Home) instruction is executed.
• When you perform absolute positioning with a MC_MoveAbsolute or MC_Move instruction,
make sure that the target position is within the range of the ring counter. An error occurs if the
target position is not within the range of the ring counter.
If the Direction input variable to the instruction is set to No direction specified, you can set a
target position that is not within the range of the ring counter. If that occurs, relative position-
ing is performed using the difference between the target position and the command current
position as the target distance.
• When you make a change in the position count settings, there are some differences between
the physical position of the machine and the command current position of the MC Function
Module. Therefore, if you made a change in the position count settings, execute the Home
instruction to define the home again.
Encoder Type
Set the type of encoder to use for feedback input.
Set the encoder type to 1 (absolute encoder (ABS)) when you use any of the following.
• When an OMRON 1S-series Servomotor/Servo Drive is used
• When an OMRON G5-series Servomotor with an absolute encoder is used
• When an OMRON G5-series Servomotor/Servo Drive with an absolute external scale for fully-closed
control is used
• When an OMRON G5-series Linear Motor Type Servomotor/Servo Drive with built-in EtherCAT
communications is used with an absolute external scale
5-2-9 5
Homing Settings
Set the motor operation to use to determine home.
Single-axis Positioning
The following example is for a device that performs single-axis positioning separately for each of two
axes.
MC Function Module
Command position
Command position
Gear Axis 2
Axis 2 Servo Servo- Axis 2: Servo axis
ratio
Drive motor
Actual position 5
Encoder
*5. Set a positioning that is within the movable range of the device.
The positive software limit is set to 50 cm = 500,000 μm.
MC Function Module
Command position
Gear Axis 1
Axis 1 Servo- Axis 1: Servo axis (slave axis)
ratio Servo
motor
Drive
Actual position
Encoder
Axis 2
Gear ratio Axis 2: Encoder axis (master axis)
Actual position
Encoder
Settings
Parameter name
Axis 1 Axis 2
Axis Variable Name Axis1 Axis2
Axis Number 1 2
Enabled Axes Used axis Used axis
Axis Type Servo axis Encoder axis
Input Device/Output Device 1 2
Unit of Display μm*1 μm*1
Command Pulse Count Per Motor 1,048,576 1,048,576
Rotation
Work Travel Distance Per Motor 10,000 10,000
Rotation
Maximum Velocity 500,000*2 ---
Maximum Jog Velocity 50,000*3 ---
Maximum Acceleration 5,000,000*4 ---
Maximum Deceleration 5,000,000*4 ---
Software Limits Immediate stop for command posi- Disabled.
tion
Positive Software Limit 500,000*5 ---
Negative Software Limit 0*5 ---
Count Mode Linear Mode Rotary Mode
Modulo Maximum Position --- 1,000,000*6
Modulo Minimum Position --- 0*6
*1. The position command unit will be 1 μm.
*2. The maximum velocity will be 3,000 r/min = 30 m/min = 0.5 m/s = 500,000 μm/s.
*3. The maximum jog velocity will be 10% of the maximum velocity, i.e., 0.05 m/s = 50,000 μm/s.
*4. The maximum acceleration and the maximum deceleration are 5 m/s2. The acceleration time to the maxi-
mum velocity (3,000 r/min) is 0.1 s.
*5. Set a positioning that is within the movable range of the device.
The positive software limit is set to 50 cm = 500,000 μm.
*6. The periodic range of the position is 0 to 1 m (1,000,000 μm).
Additional Information
You can select the axis type for the master axis according to the configuration of the device.
There are four axis types: servo axes, virtual servo axes, encoder axes, and virtual encoder ax-
es.
In this example, the axis type of the master axis is an encoder axis. Specify the actual position
for the motion control instruction input variable ReferenceType (Position Type Selection).
*5. A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required to use this
instruction.
Refer to 3-4 Setting Procedures for Axes Groups on page 3-26 for details on how to set axes group
parameters.
For details on the MC_Write (Write MC Setting) and MC_ChangeAxesInGroup instructions, refer to the
NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Refer to 6-6 System-defined Variables for Motion Control on page 6-21 for information on system-
defined variables for motion control.
Setting
Parameter name Function Default
range
Axes Group Set the logical number of the axes group. --- ---
Number This number indicates the axes group number of the corresponding
system-defined variable _MC_GRP[0-63], _MC1_GRP[0-63], or
_MC2_GRP[0-63].
5
Motion Control*1 Assign to either of the primary periodic task or priority-5 periodic 1 or 2 1
task.
Composition
The following table lists the axis compositions you can use with the MC Function Module.
Use the Sysmac Studio to set the axis composition according to the actual devices.
Composition Description
2 axes A two-axis configuration is used. For example, a machine with a two-axis Cartesian coordinate
system is used.
Composition Description
3 axes A three-axis configuration is used. For example, a machine with a three-axis Cartesian coordi-
nate system is used.
4 axes A four-axis configuration is used. For example, a machine with a three-axis Cartesian coordi-
nate system is used with a rotary axis at the end tool.
Composition Axes
The axes that are in an axes group are called composition axes.
To make it easier to reuse programming with interpolation instructions for axes groups commands, log-
ical axes (axis A0 to axis A3) are used instead of axis numbers (axis 0 to axis 255).
For the Composition Axes parameter, set the axis numbers and logical axis numbers for the axes in
the axes group.
Servo axes or virtual servo axes can be selected for logical axes.
Use the Sysmac Studio to assign axes from axis A0 for the number of axes you selected in the axis
composition.
Set axis numbers from axis A0 for each axes group if you create more than one axes group.
You can also set the same axis number in more than one axes group.
Version Information
With a CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher, you
can set any servo axis or virtual servo axis that is set to a Used axis or an Unused axis
(changeable to used axis) in an axes group.
• Example 2: Assigning Three Axes with Axis Numbers 1, 8, and 2 to an Axes Group
If you want to operate the same axis in different axes groups for each work process, create multiple
axes groups that include that axis. You can then use the MC_GroupEnable (Enable Axes Group) and
MC_GroupDisable (Disable Axes Group) instructions to enable and disable these axes groups as you
need to use them.
If you execute the MC_GroupDisable (Disable Axes Group) instruction during multi-axes operation,
the axes in the group will decelerate to a stop.
6-1 Introduction
The NJ/NX-series CPU Unit can perform both sequence control and motion control.
Write motion control instructions into the user program to perform motion control with EtherCAT slave
Servo Drives, NX-series Position Interface Units, and other devices.
Programs that contain motion control instructions are called motion control programs.
You must assign Axis Variables to EtherCAT slave Servo Drives and NX-series Position Interface
Units. If you do not assign Axis Variables, assign I/O device variables in the same way as for a gener-
al-purpose slave.
Motion control instructions can be used in the primary periodic task, in a priority-5 periodic task, and in
a priority-16 periodic task.
Version Information
With the Sysmac Studio version 1.09 or higher, you can assign device variables to the I/O ports
of slaves and Units that are assigned to the Axis Variables.
Refer to 2-4-2 Relationship between EtherCAT Master Function Module and MC Function Mod-
ule on page 2-19 for details.
I/O ports
Device variables
Instructions
other than NX Bus NX Units
motion control Function
Sequence instructions
control Module
EtherCAT EtherCAT
slaves
Motion control
Motion control instructions slaves,
Servo Drives,
encoder input
terminals,
Position
Interface Units
6-1 Introduction
NX1P2 CPU Unit
CPU Unit
User program in PLC
Function Module 6
Instructions Executed.
other than Built-in I/O
I/O ports
Device variables
I/O ports
Device variables
motion control Basic I/O Units,
instructions Special Units
Sequence
control EtherCAT EtherCAT
slaves
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for basic information on
the NJ/NX-series CPU Unit function blocks (FBs).
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are re-
quired to use NX-series Position Interface Units.
Additional Information
PLCopen®
PLCopen® is an association that promotes IEC 61131-3. It has its headquarters in Europe and
a world-wide membership.
IEC 61131-3 is an international standard for PLC programming.
• The website of headquarters of PLCopen® in Europe is http://www.plcopen.org/.
Type Outline
Common commands Common instructions for the MC Function Module
Axis commands Instructions for MC Function Module to perform single-axis control
Axes group commands Instructions for MC Function Module to perform multi-axes coordinated control
For a list of the instructions that you can use with the MC Function Module, refer to the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).
Saving Cam Table File*3 This state exists while the system performs save or wait processing for a
cam table file.
Generating Cam Table*4 This state exists while the system is generating the came table. *5
*1. This state can be monitored with the MC Common Variable _MC_COM.Status.RunMode.
*2. This state can be monitored with the MC Common Variable _MC_COM.Status.TestMode.
6
*3. This state can be monitored with the MC Common Variable _MC_COM.Status.CamTableBusy.
*4. This state can be monitored with the MC Common Variable _MC_COM.Status.GenerateCamBusy.
Deceleration Stopping
Stopping MC_ImmediateStop
Error Deceleration Stopping *1
*6 ErrorStop
MC_Home *4
MC_HomeWithParameter *3
Coordinated Motion
Coordinated *7: MC_ResetFollowingError
*1. Transition into this state occurs when there is an axis error in any state except for Coordinated Motion state.
*2. Transition into this state occurs when there are no axis errors and the Status output to the MC_Power instruc-
tion is FALSE. (The Servo is OFF.)
*3. Transition into this state occurs if an error is reset with the MC_Reset or ResetMCError instruction when the
Servo is OFF.
*4. Transition into this state occurs if an error is reset with the MC_Reset or ResetMCError instruction when the
Servo is ON.
*5. Transition into this state occurs when the Enable input to the MC_Power instruction changes to TRUE and the
Status (Servo ON) output from the MC_Power instruction changes to TRUE. (The Servo is ON.)
*6. Transition into this state occurs when the Done output from the MC_Stop instruction is TRUE and the Execute
input to the MC_Stop instruction changes to FALSE.
*7. Transition into the Deceleration Stopping state occurs when the MC_ResetFollowingError instruction is exe-
cuted.
*8. The Continuous Motion state exists from when 2: _mcVelocity (velocity control) is set for the MoveMode in-
put variable of the MC_MoveFeed instruction until a trigger input is detected.
Version Information
For the NX701 CPU Unit, the variable names that start with _MC_AX[*] may apply to those with
_MC1_AX[*] and _MC2_AX[*].
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on us-
ing the NX-series Position Interface Units.
Moving
Moving MC_GroupStop
Deceleration Stopping
Stopping
*1
MC_GroupImmediateStop
*6 Error Deceleration Stopping *2
ErrorStop
*3
MC_GroupEnable
Axes Group Disabled Standby *7
Disabled Standby
MC_GroupDisable *4
*5
*1. The axes group enters the Moving state whenever any axes group motion control instruction is executed.
*2. The axes group can move to the ErrorStop state from any other states. When an error occurs, the axes group
enters this state even if it is disabled.
*3. The axes group moves to the Standby state if the MC_GroupReset or ResetMCError instruction is executed
while it is enabled.
*4. The axes group moves to the Disabled state if the MC_GroupReset or ResetMCError instruction is executed
while it is disabled.
*5. If the MC_GroupDisable instruction is executed while the axes group is in the ErrorStop state, the axes group
will remain in the same state.
*6. The axes group moves from the Stopping state to the Standby state when the MC_GroupStop instruction has
the output variable Done set to TRUE and the input variable Execute set to FALSE.
*7. The axes group is ready to execute if the following conditions are all met while it is in the Standby state.
The Servo is ON for all composition axes.
Execution of the MC_Stop instruction is not in progress for any composition axis.
Home is defined for all composition axes.
Note You can monitor the axes group status in the member variables of the Axes Group Variables
_MC_GRP[0-63].Status, _MC1_GRP[0-63].Status, and _MC2_GRP[0-63].Status.
Item Rule
Exclusiveness of outputs The following output variables are mutually exclusive, and only one of them can be TRUE at
one time: Busy, Done, Error, and CommandAborted.
Similarly, only one of the following output variables can be TRUE at the same time: Active,
Done, Error, and CommandAborted.
Busy and Active may be TRUE at the same time in some cases.
Output status The output variables Done, InGear (Gear Ratio Achieved), InSync, InVelocity (Target Velocity
Reached), and CommandAborted change to FALSE when the input variable Execute
changes to FALSE.
The actual execution of a motion control instruction is not stopped when Execute changes to
FALSE.
Even if Execute changes to FALSE before the instruction finishes execution, the correspond-
ing output variable will be TRUE for at least one period if the status of the instruction instance
changes.
The output variable Error will not reset to FALSE and the output variable ErrorID (Error Code)
will not reset to 0 until you execute one of the following instructions: MC_Reset, MC_Group-
Reset, or ResetMCError. *1
If the Execute variable of the same instruction instance changes to TRUE again (i.e., if the
instruction is restarted) during the execution of a motion control instruction, the
CommandAborted variable will not change to TRUE.
Input parameters For motion control instructions that are started with the input variable Execute, the values of
the input parameters when Execute changes to TRUE are used.
For motion control instructions that start for the input variable Enable, the current values of
the input parameters during each period when Enable is TRUE are used.
Omitting input parameters The default value applies if you omit an input parameter for an instruction instance. *2
Position (Target Position) The input variable Position is defined as a value in the coordinate system.
and Distance (Travel The input variable Distance is the relative length, i.e., it is the difference between two posi-
Distance) tions.
Sign rules The input variables Acceleration, Deceleration, and Jerk are non-negative values.
Position (Target Position), Distance (Travel Distance), and Velocity (Target Velocity) can be
positive, negative, or 0.
Item Rule
Error processing There are two output variables that represent an error when a problem occurs during the exe-
cution of an instruction instance.
These outputs are defined as follows:
• Error: The output variable Error changes to TRUE to indicate that an error occurred during
the execution of the instruction instance.
• ErrorID (Error Code): This is an error code that represents the cause of the error.
The output variables Done, InVelocity (Target Velocity Reached), InGear (Gear Ratio Ach-
*2. When you program the instruction in a ladder diagram, insert an input between the input variable Execute or Enable
and the left bus bar. If the instruction is connected directly to the left bus bar without an input, an error occurs when the
program is built.
Set the initial value for or omit any input variable that is reserved.
*3. If the condition expressions or set values for ST Structure instructions do not match, the instructions in that statement
are not executed. For details, refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No.
W508).
*4. Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for an output variable timing
chart.
• Confirm that EtherCAT process data communications are active and normal before you exe-
cute motion control instructions.
Refer to 10-2-1 Monitoring EtherCAT Communications and Turning ON Servos on page
10-3 for details.
• Write the user program so that Execute is FALSE during the first period in which the instruc-
tion is executed.
Execution
Description
condition
Execute-type These motion control instructions are executed when the input variable Execute to the instruc-
instructions tion changes to TRUE.
These instructions will continue execution until one of the following status occurs.
• The specified operation is completed.
• Another motion control instruction is executed and interrupts operation.
• The instruction is restarted when Execute changes from FALSE to TRUE again.
Values for the other input variables are input when Execute changes to TRUE.
Enable-type These motion control instructions are executed every period while the input variable Enable to
instructions the motion control instruction is TRUE.
As long as Enable is TRUE, the other input variables are also input every period.
However, MC_MoveJog input variables Velocity, Acceleration, and Deceleration are an excep-
tion to this rule. The values when PositiveEnable or NegativeEnable changes to TRUE are
used for these input variables.
The timing in the timing charts that are given in this manual may not necessarily be the same as
the timing displayed for data traces on the Sysmac Studio.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on da-
ta tracing.
Busy
Done
CommandAborted
Error
• The following timing chart shows an example where an error occurs while the input variable Execute
is TRUE.
The output variable Error remains TRUE even after Execute changes to FALSE.
Execute
Busy
Done 6
CommandAborted
• The following timing chart shows an example where the instruction is interrupted during execution
while the input variable Execute is true.
Execute
Busy
Done
CommandAborted
Error
• The following timing chart shows an example where the input variable Execute is TRUE for only one
period and an error does not occur for the instruction.
The output variable Done changes to TRUE for only one period after the instruction operation is
completed.
Execute
Busy
Done
CommandAborted
Error
• The following timing chart shows an example where the input variable Execute is TRUE for only one
period and an error occurs for the instruction.
The output variable Error remains TRUE.
Execute
Busy
Done
CommandAborted
Error
Enable
Enabled
Busy
Error
• The following timing chart shows an example where the input variable Enable changes to TRUE and
an error occurs for the instruction.
Enable
Enabled
Busy
Error
Additional Information
Enable and Enabled change at the same time for instructions such as MC_ZoneSwitch (Zone
Monitor) and MC_AxesObserve (Monitor Axis Following Error). For details on the timing of indi-
vidual instructions, refer to the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508).
The following timing chart shows an example where the velocity is changed for MC_MoveAbsolute
(Absolute Positioning) instruction.
Busy
Active
Done
Error
Velocity
Target
velocity 2
Target
velocity 1
Time
6
For details on re-executing instructions for the MC Function Module, refer to 9-5-6 Re-executing Mo-
tion Control Instructions on page 9-43 and 9-7-4 Re-executing Motion Control Instructions for Multi-
The following figure shows an example in which BufferMode (Buffer Mode Selection) is set to aborting
when MC_MoveAbsolute (Absolute Positioning) instructions are executed with multi-execution of in-
structions.
“FB1” and “FB2” in the following figure are the instance names of the instructions.
FB1
Execute
Busy
Active
Done
CommandAborted
Error
ErrorID 16#0000
FB2
Execute
Busy
Active
Done
CommandAborted
Error
ErrorID 16#0000
Velocity
FB2 target velocity
FB2 travel
FB1 target velocity distance
FB1 travel
distance
Time
For details on multi-execution of instructions for the MC Function Module, refer to 9-5-7 Multi-execu-
tion of Motion Control Instructions (Buffer Mode) on page 9-48 and 9-7-5 Multi-execution of Motion
Control Instructions (Buffer Mode) for Multi-axes Coordinated Control on page 9-67.
6-5 Positions
This section describes the positions that are used in motion control programming.
The following figure shows the relationship between the command position and the actual position for
an EtherCAT slave Servo Drive.
6-5 Positions
(pulses)
Actual position Electronic
(command units) gear
Feedback E
counter
Remainder
The command position and actual position share the following items.
Additional Information
• For a virtual servo axis, the command current value is converted to pulses and then that value
is converted to the unit of display. The resulting value is used as the actual current value.
• Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information
on the NX-series Position Interface Units.
Types of positions
Axis type
Command position Actual position
Servo axis Applicable Applicable
Virtual servo axis Applicable Applicable*1
Encoder axis Cannot be used. Applicable
Virtual encoder axis Cannot be used. Applicable*2
*1. For a virtual servo axis, the actual position is the same as the command position.
However, there is sometimes calculation error because processing is performed with long reals in the MC
Function Module.
*2. This is used when there is no actual encoder.
MC Common Variable
You can monitor the overall status of the MC Function Module with the MC Common Variable. The
variable name is _MC_COM.
Axis Variables
Use these variables to handle EtherCAT slaves, Servo Drives, encoder input terminals, NX-series
Position Interface Units, virtual Servo Drives, and virtual encoder input terminals.
You can use either the system-defined variables or the variables that are set on the Sysmac Studio
to specify the Axis Variables in the user program.
You can change any of the Axis Variables that you create on the Sysmac Studio.
a. Axis Variables in the system-defined variables
• _MC_AX[0] to _MC_AX[255]
• _MC1_AX[0] to _MC1_AX[255]
• _MC2_AX[0] to _MC2_AX[255]
b. Default Axes Group Variables when axes groups are created on the Sysmac Studio
• MC_Axis000 to MC_Axis255 (default)
You can change any of the Axes Group Variables that you create on the Sysmac Studio.
a. Axes Group Variables in the system-defined variables
• _MC_GRP[0] to _MC_GRP[63]
• _MC1_GRP[0] to _MC1_GRP[63]
• _MC2_GRP[0] to _MC2_GRP[63]
b. Default Axes Group Variables when axes groups are created on the Sysmac Studio
• MC_Group000 to MC_Group063 (default)
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on the var-
iables that are used by an NJ/NX-series CPU Unit.
Type Description
Structure data type This data type consists of multiple data types placed together into a single layered
structure.
Variables with this data type start with “_s.”
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on the oth-
er data types that are used by an NJ/NX-series CPU Unit.
Sysmac Studio
CPU Unit
ID211
0 1 2 3 4 5 6 7
AD042
RUN
8 9 10 11 12 13 14 15 ERC
ERH
B1 A1
0
1
2
3 MACH 78
9 01
456
No.
4 x10 1
23
5
78
6
9 01
456
x10 0
23
7
EtherCAT
8
9
10
11
12
14
13
15
COM
communi-
DC24V
7mA
cations Servo Drives
etc. and other devices
Main memory
System-defined
User program variables for
motion control
Accessed. MC Function
Data movement instructions MC Common Variable Module processing Status
Axis Variables
Axes Group Variables
Monitor display
• Only the task area that is assigned to the primary periodic task and the basic setting area of the
priority-5 periodic task are updated every primary task period.
• The other area of the priority-5 periodic task is not updated from the default settings and will be
updated in the task period of priority-5 periodic task.
NX102 CPU Unit, NX1P2 CPU Unit, and NJ-series CPU Unit
The system-defined variables for motion control are updated every primary task period.
MC Common Variable
The variable name _MC_COM is used for the MC Common Variable. The data type is _sCOM-
MON_REF, which is a structure variable.
This section describes the configuration of the MC Common Variable and provides details on the
members.
Axis Variables
ImdStop BOOL Immediate Stop Input TRUE when the immediate stop input is
enabled.
Latch1 BOOL External Latch Input 1 TRUE when latch input 1 is enabled.
Latch2 BOOL External Latch Input 2 TRUE when latch input 2 is enabled.
DrvAlarm BOOL Drive Error Input TRUE while there is a Servo Drive error.
DrvWarning BOOL Drive Warning Input TRUE while there is a Servo Drive warn-
ing.
ILA BOOL Drive Internal Limiting TRUE when the Servo Drive limiting
function actually limits the axis. *7
CSP BOOL Cyclic Synchronous TRUE when the Servo is ON at the Ser-
Position (CSP) Con- vo Drive and the current mode is CSP
trol Mode Mode. *8
CSV BOOL Cyclic Synchronous TRUE when the Servo is ON at the Ser-
Velocity (CSV) Con- vo Drive and the current mode is CSV
trol Mode Mode. *8
CST BOOL Cyclic Synchronous TRUE when the Servo is ON at the Ser-
Torque (CST) Control vo Drive and the current mode is CST
Mode Mode. *8
For a CPU Unit with unit version 1.10 or later, they are TRUE when the status of the Statusword (6041 hex) that was
mapped to a PDO is Operation Enabled.
For a CPU Unit with unit version 1.09 or earlier, they are always FALSE.
*9. If the process data communications between the CPU Unit and an EtherCAT slave or NX Unit that is assigned to an
axis changed to a non-established state, the variables contain different values as follows depending on the unit version
of the CPU Unit.
For a CPU Unit with unit version 1.10 or later, the actual current position and the command current position axis varia-
bles will contain the actual current position output that is just before process data communications change to a non-
established state.
For a CPU Unit with unit version 1.09 or earlier, the actual current position and the command current position axis vari-
Time
Changes in the display of the command current torque
are delayed in respect to the actual current torque.
*11. A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are required to use this variable. 6
*12. For an NX-series Position Interface Unit, this is the node address of the EtherCAT Coupler Unit under which the Posi-
tion Interface Unit is mounted.
Virtual Virtual
Servo Encod-
Variable name Data type Meaning servo encoder
axis er axis
axis axis
_MC_AX[0-255] _sAXIS_REF Axis Variable
Status _sAXIS_REF_STA Axis Status
Ready BOOL Axis Ready-to-execute ¡ ¡ --- ---
Virtual Virtual
Servo Encod-
Variable name Data type Meaning servo encoder
axis er axis
axis axis
Disabled BOOL Axis Disabled ¡ ¡ ¡ ¡
Standstill BOOL Standstill ¡ ¡ --- ---
Discrete BOOL Discrete Motion ¡ ¡ --- ---
Continuous BOOL Continuous Motion ¡ ¡ --- ---
Synchronized BOOL Synchronized Motion ¡ ¡ --- ---
Homing BOOL Homing ¡ ¡ --- ---
Stopping BOOL Deceleration Stopping ¡ ¡ --- ---
ErrorStop BOOL Error Deceleration Stop- ¡ ¡ --- ---
ping
Coordinated BOOL Coordinated Motion ¡ ¡ --- ---
Details _sAXIS_REF_DET Axis Control Status
Idle BOOL Idle ¡ ¡ ¡ ¡
InPosWaiting BOOL In-position Waiting ¡ ¡ --- ---
Homed BOOL Home Defined ¡ ¡ --- ---
InHome BOOL In Home Position ¡ ¡ --- ---
VelLimit BOOL Command Velocity Satu- ¡ ¡ --- ---
ration
Dir _sAXIS_REF_DIR Command Direction
Posi BOOL Positive Direction ¡ ¡ --- ---
Nega BOOL Negative Direction ¡ ¡ --- ---
DrvStatus _sAXIS_REF_STA_DRV Servo Drive Status
ServoOn BOOL Servo ON ¡ --- --- ---
Ready BOOL Servo Ready ¡ --- --- ---
MainPower BOOL Main Power ¡ --- --- ---
P_OT BOOL Positive Limit Input ¡ --- --- ---
N_OT BOOL Negative Limit Input ¡ --- --- ---
HomeSw BOOL Home Proximity Input ¡ --- --- ---
Home BOOL Home Input ¡ --- --- ---
ImdStop BOOL Immediate Stop Input ¡ --- --- ---
Latch1 BOOL External Latch Input 1 ¡ --- --- ---
Latch2 BOOL External Latch Input 2 ¡ --- --- ---
DrvAlarm BOOL Drive Error Input ¡ --- --- ---
DrvWarning BOOL Drive Warning Input ¡ --- --- ---
ILA BOOL Drive Internal Limiting ¡ --- --- ---
CSP BOOL Cyclic Synchronous Posi- ¡ --- --- ---
tion (CSP) Control Mode
CSV BOOL Cyclic Synchronous Ve- ¡ --- --- ---
locity (CSV) Control
Mode
CST BOOL Cyclic Synchronous Tor- ¡ --- --- ---
que (CST) Control Mode
Cmd _sAXIS_REF_CMD_DA- Axis Command Values
TA
Pos LREAL Command Current Posi- ¡ ¡ --- ---
tion
Virtual Virtual
Servo Encod-
Variable name Data type Meaning servo encoder
axis er axis
axis axis
Vel LREAL Command Current Veloci- ¡ ¡ --- ---
ty
AccDec LREAL Command Current Accel- ¡ ¡ --- ---
eration/Deceleration
Jerk LREAL Command Current Jerk ¡ ¡ --- ---
Trq LREAL Command Current Tor- ¡ ¡ --- ---
This section describes the configuration of the Axes Group Variables and provides details on the mem-
bers using _MC_GRP[0-63] as an example.
The same information applies to _MC1_GRP[0-63] and _MC2_GRP[0-63].
Also, in the descriptions of functions, _MC_AX[*] is used as an example, but the same information ap-
plies to _MC1_AX[*] and _MC2_AX[*].
CPU Unit
AD042
RUN
ERC
ERH
B1 A1
0
1
2
3 MACH 78
9 01
456
No.
4 x10 1
23
5
78
6
9 01
456
x10 0
23
7
8
9
10
11
12
13
14
15
COM
Downloaded.*1 DC24V
7mA
*1. Use the Synchronization menu command of the Sysmac Studio to upload and download the project.
*2. The cam data variables that are uploaded cannot be changed on the Cam Editor. Refer to the Editing a Cam
Data Variable on the Computer after Editing It from the User Program on page 6-38 for the procedure to edit
a cam data variable on the computer after editing it from the user program.
Also, if the project is rebuilt or the cam profile curve is changed from the Sysmac Studio, the cam data varia-
ble that was uploaded is overwritten with the cam profile curve data.
*3. A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required to use the
MC_GenerateCamTable (Generate Cam Table) instruction.
*4. “Cam definition variable” is the generic term for cam property variables and cam node variables.
• The motion control instruction MC_SaveCamTable saves the cam data variables in the main
memory to non-volatile memory.
• You can upload the cam definition variable that were created in the Cam Data Settings of the
Sysmac Studio even after the variable is changed in the user program. If the cam definition varia-
ble was created as a user-defined variable, you cannot upload it after it is changed in the user
program.
• Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information on cre-
ating and transferring the cam definition variable in the Sysmac Studio.
• For details on the MC_GenerateCamTable (Generate Cam Table) instruction and MC_Save-
CamTable instruction, refer to the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508).
• You can upload and download cam tables regardless of the operating mode of the NJ/NX-series
CPU Unit mode or the status of the MC Function Module. You cannot upload cam data, down-
load cam data, start online operation, perform online editing, or start data traces during a cam
table save operation. The MC_SaveCamTable instruction is not executed during online editing.
• All axes in motion will decelerate at the maximum deceleration rate when you start the download
process.
If you change any cam data in the user program, those changes are lost and the cam table in
non-volatile memory is restored if you restart the power or download cam data from the Sysmac
Studio. Also, you cannot upload the data in the main memory from the Sysmac Studio.
Version Information
If a CPU Unit with unit version 1.13 or later and Sysmac Studio version 1.17 or higher are com-
bined, commands to the I/O devices can continuously be sent even when the download process
is in progress.
For the CPU Unit with unit version 1.12 or earlier, sending commands to the I/O devices is stop-
ped when the download process is executed.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for how to set to
stop or continue sending commands to the I/O devices when the download process starts.
Stopping sending commands to I/O devices
Servo is turned OFF during the download, and the axis status will be Disable (Axis Disa-
bled).
Continuing sending commands to I/O devices
The MC_Power (Power Servo) and MC_SetTorqueLimit instructions can run even when the
download process is in progress.
The following status immediately before downloading is maintained during the download: the
Servo ON state for the MC_Power instruction and the output torque limit for the MC_SetTor-
queLimit instruction.
The Servo ON state and torque limit are maintained even if the MC_Power and MC_SetTor-
queLimit instructions are deleted from the user program after the program is updated by
downloading.
Editor of the Sysmac Studio. This section describes how to use spreadsheet software to edit the data
and then use it as a cam table.
Save/Export
Edit
Sysmac Studio Spreadsheet
Read/Import CSV file software
ID211
0 1 2 3 4 5 6 7
AD042
RUN
8 9 10 11 12 13 14 15 ERC
ERH
B1 A1
0
1
2
3 MACH 78
456
9 01
No.
4 x10 1
23
5
78
6
9 01
456
x10 0
23
7
8
9
10
11
12
13
14
15
COM
DC24V
7mA
*1. Use the Synchronization menu command of the Sysmac Studio to upload and download the project.
• Synchronize the data with the Controller before executing Transfer Cam Table [File to
Controller].
• If you transfer the Cam Data Settings to the Controller through the synchronization after exe-
cuting Transfer Cam Table [File to Controller], the cam table in the Controller is replaced
with the data in the Cam Data Settings.
In this case, you need to execute Transfer Cam Table [File to Controller] again, or do not
include the Cam Data Settings in the synchronization data.
You can also export the Cam Data Settings that were entered from the Cam Editor to a CSV file.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information on the
Cam Data Settings and the export procedure.
The cam profile names that are set on the Sysmac Studio are used as the cam table names.
MCCI1
Specify a variable name. MC_CamIn
MC_Axis000 Master Master MC_Axis000
MC_Axis001 Slave Slave MC_Axis001
CamTable1 CamProfile0 CamTable CamTable CamProfile0 MCCI1_InCam
Execute InCam
MCCI1_Pd Periodic InSync MCCI1_InSync
MCCI1_StMode StartMode EndOfProfile MCCI1_EOP
MCCI1_StPos StartPosition Index MCCI1_Index
MCCI1_MStDis MasterStartDistance Busy MCCI1_B
MCCI1_MSc MasterScaling Active MCCI1_A
MCCI1_SSc SlaveScaling Command Aborted MCCI1_CA
MCCI1_MO MasterOffset Error MCCI1_E
MCCI1_SO SlaveOffset ErrorID MCCI1_EID
MCCI1_RT ReferenceType
MCCI1_Dir Direction
MCCI1_CT CamTransition
MCCI1_BM BufferMode
• You can set and program up to 256 axes on the Sysmac Studio for any model of CPU Unit.
You cannot download a project to the CPU Unit if the project contains more than the maxi-
mum number of controlled axes for that CPU Unit.
• When you reuse a project, make sure that the maximum number of controlled axes for the
CPU Unit model is not exceeded.
• Even axes that are set as unused axes are included in the number of controlled axes.
This section gives the procedure to create a program in an existing project on the Sysmac Studio.
2 Adding a Program
Right-click Programs in the Multiview Explorer and select Multipart Ladder or Structured
6
Text from the Add Menu.
Select the required instructions from the Toolbox and enter the program.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on program-
ming.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on the Cam Edi-
tor.
A cam profile is added to the Multiview Explorer. You can change the name of the cam profile
as required from the default name of CamProfile0.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
7-1 Outline
This section describes how to combine the MC Function Module and OMRON 1S-series Servo Drives
together and use motion control instructions from the user program to perform manual operations.
The motion control instructions for manual operation are MC_Power and MC_MoveJog. MC_Power
changes the Servo Drive to the Servo ON state and MC_MoveJog performs jogging.
Additional Information
• Use the MC Test Run function of the Sysmac Studio if you perform manual operation without
programming.
Refer to 4-3 Checking Motor Operation on page 4-8 for information on how to use the Sys-
mac Studio to perform manual operation.
• Refer to Section 6 Motion Control Programming on page 6-1 for information on how to cre-
ate user programs.
• The same procedures and operations are applicable to an OMRON G5-series Servo Drive.
Instance name
Body name
In-out variable MC_Power_instance
Input parameter MC_Power
A Axis1 Axis Axis Status1
Enable Status
Input variable Busy Busy1
Error Error1
ErrorID ErrorID1
Output parameter
Output variables
• If you change Enable to FALSE while the axis is moving, the command stops immediately
and all motion control instructions for that axis are disabled.
• If you use an NX-series Pulse Output Unit, you must provide a separate means to turn the 7
power supply to the motor drive ON and OFF. Refer to the NX-series Position Interface Units
User’s Manual (Cat. No. W524) for details.
Version Information
For a CPU Unit with unit version 1.10 or later, if an OMRON 1S-series Servomotor or G5-series
Servomotor with an absolute encoder is used, or if an OMRON G5-series Linear Motor Type
Servomotor/Servo Drive with built-in EtherCAT communications is used with an absolute exter-
nal scale, home is also defined when EtherCAT process data communications change from a
non-established to an established state, in addition to the step shown in the above Additional
Information.
MC_Power_instance
MC_Power
A Axis1 Axis Axis
Enable Status
Busy
Error
ErrorID
For details on the MC_Power (Power Servo) instruction, refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No. W508).
7-3 Jogging
Use the motion control instruction MC_MoveJog for jogging.
Change either the PositiveEnable or NegativeEnable input variable for the MC_MoveJog in-
struction to TRUE to jog.
Servomotor
Encoder resolution: 23 bits/rotation 1 rotation
10 mm Ball screw
Ball screw pitch: 10 mm
7-3 Jogging
Input Device/Output Device 1*3
Command Pulse Count Per Motor Rotation 8,388,608*4
Work Travel Distance Per Motor Rotation 10,000*4
Software Limits Enabled for actual position
7
Unit of Display μm
Count Mode Linear Mode
• For example, set Velocity to 30,000 to jog at a velocity of 0.03 m/s (30,000 μm/s).
• Set Acceleration and Deceleration to 3,000,000 to accelerate and decelerate at 3 m/s2 (3,000,000
μm/s2).
MC_MoveJog_instance
MC_MoveJog
Axis1 Axis Axis
A
PositiveEnable Busy
B
NegativeEnable CommandAborted
Velo1 Velocity Error
Acce1 Acceleration ErrorID
Dece1 Deceleration
In this example, Velocity (Target Velocity) is Velo1, Acceleration is Acce1, and Deceleration is Dece1.
Set the values for each variable in the user program in advance to operate the axis with the example
input variable settings.
• Velo1 = 30,000
• Acce1 = 3,000,000
• Dece1 = 3,000,000
For details on the MC_MoveJog (Jog) instruction, refer to the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508).
For example, if you want to perform positioning to the position (axis 1, axis 2) = (100 mm, 200 mm) in
the XY plane shown below, you must define the position of home (0,0).
The process of defining home is called homing.
Axis 2
(100,200)
Axis 1
(0,0)
In the MC Function Module, use the motion control instruction MC_Home or MC_HomeWithParameter
to define home.
Name Description
Homing Home is defined by actually moving the motor and using the limit sensors, home proximity
sensor, and home input signal to determine the position of home.
Use a proximity sensor or the encoder's Z phase signal as the home input signal.
Additional Information
Version Information
For a CPU Unit with unit version 1.10 or later, if an OMRON 1S-series Servomotor or G5-series
Servomotor with an absolute encoder is used, or if an OMRON G5-series Linear Motor Type
Servomotor/Servo Drive with built-in EtherCAT communications is used with an absolute exter-
nal scale, home is also defined when EtherCAT process data communications change from a
non-established to an established state, in addition to the step shown in the above Additional
Information.
Name Description
High-speed Hom- The axis returns to home using an absolute position of 0 as the target position.
ing
The MC Function Module can operate the motor even when home is undefined (excluding MC_Move-
ZeroPosition).
Function Operation
Jogging and velocity control If home is not defined, the position at startup is defined as 0 to control
movement.
High-speed homing High-speed homing cannot be used.
If it is used, an instruction error will occur.
Additional Information
Changes in the home definition status for operations and events are listed in the following table.
• For a virtual axis, home is always defined with a zero position preset. The setting of the
Homing Method axis parameter is ignored.
• The positive drive prohibit input (POT), negative drive prohibit input (NOT), and home proxim-
ity input (DEC) of the Servo Drive are used by the MC Function Module as the positive limit
input, negative limit input, and home proximity input.
Make sure that the signal widths for all of these input signals are long enough for the Servo
Drive to detect them and longer than the control period of the MC Function Module.
If the input signal widths are shorter than the control period, the MC Function Module may not
be able to detect the input signals, resulting in incorrect operation.
• You must set the Servo Drive parameters for each Servo Drive input signal. Refer to the man-
ual for your Servo Drive and the appendices and make the proper settings.
Home proximity ON
input signal OFF
ON
Home input signal
OFF
Velocity
Homing velocity
Homing
compensation
Homing approach velocity velocity
Stops.
Start
Homing compensation
Absolute travel to position where value
home input signal was detected
Homing Method
You can select any of the ten operation modes to define home.
• Proximity reverse turn/home proximity input OFF
• Proximity reverse turn/home proximity input ON
• Home proximity input OFF
• Home proximity input ON
• Limit input OFF
• Proximity reverse turn/home input mask distance
• Limit inputs only
• Proximity reverse turn/holding time
• No home proximity input/holding home input
• Zero position preset
The following table shows the homing parameters that are used for each Homing Operation Mode.
Homing parameters
Homing Velocity
Homing Acceleration
Homing Deceleration
Homing Jerk
Home Offset
For details on the Homing Operation Modes, refer to the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508). 8
This parameter can be used to set a home input signal only when you are connected to an OM-
RON 1S-series Servo Drive or G5-series Servo Drive.
There are four Homing Operation Modes that include reversal operation for a proximity reverse turn.
These are listed below.
• 0: Proximity reverse turn/home proximity input OFF
• 1: Proximity reverse turn/home proximity input ON
• 9: Proximity reverse turn/home input mask distance
• 12: Proximity reverse turn/holding time
(1) and (3) : The home proximity signal is OFF, so the axis starts moving in the homing start direction.
(2) : The home proximity signal is ON, so the axis starts moving in the direction opposite to the home
input detection direction.
(2)
Operation command Start Start
Negative Positive
direction (1) Start (3) direction
(1) and (3) : The home proximity signal is OFF, so the axis starts moving in the homing start direction.
(2) : The home proximity signal is ON, so the axis starts moving in the direction opposite to the home
input detection direction.
ON
Home proximity input signal
OFF
Limit in direction opposite ON
to detection direction OFF
ON
Limit in detection direction
OFF
Home instruction Homing velocity
Homing approach velocity
Start Stops
• An error occurs and the axis stops if the axis is set to Reverse direction for the limit input operation
in both directions and home cannot be detected after moving from the limit input opposite to the
ON
Home proximity input signal
OFF
Limit in direction opposite ON
to detection direction OFF
ON
Limit in detection direction
OFF
Home instruction Homing velocity 8
Homing approach velocity
Homing Velocity
Set the homing velocity in command units per second (command units/s).
Homing Acceleration
Set the homing acceleration rate in command units per seconds squared (command units/s2).
If the homing acceleration is set to 0, the homing velocity or other target velocity is used without any
acceleration.
Homing Deceleration
Set the homing deceleration rate in command units per seconds squared (command units/s2).
If the homing deceleration is set to 0, the homing approach velocity or other target velocity is used
without any deceleration.
Homing Jerk
Set the homing jerk in command units per seconds cubed (command units/s3).
If the homing jerk is set to 0, acceleration and deceleration are performed without jerk.
Home proximity ON
input signal OFF
ON
Home input signal
OFF
Homing velocity
Homing approach velocity
Negative
Command direction Positive direction
output Start Stops.
After the proximity input, movement is according to
the home input mask distance.
Home Offset
After home is defined, the operation for the homing compensation value is completed if a homing com-
pensation value is set, and then the actual value is preset to the set value.
This means that you can set home to any specified value rather than to 0.
For systems with absolute encoders, also the absolute encoder home offset value is calculated and
saved in the CPU Unit.
This is a period of time which elapses from when deceleration is started as the home proximity input
signal changes from OFF to ON.
Home proximity ON
input signal OFF
Home is defined when the set time elapses.
Homing velocity
Homing approach velocity
Negative
Command Positive direction
direction Start
output Stops.
Homing velocity
Homing approach velocity
Negative
direction Positive direction
Start Stops.
Homing velocity
Torque limit
Torque limit is continued even
Command torque from previous operation after the set time elapses.
Data
Variable name Meaning Function
type
MC_AX[0-255].Status.Homing BOOL Homing TRUE when homing for the MC_Home or MC_Home-
WithParameter instruction.
_MC_AX[0-255].Dtails.Homed BOOL Home Defined TRUE when home is defined.
FALSE: Home not defined
TRUE: Home is defined
Data
Variable name Meaning Function
type
_MC_AX[0-255].Dtails.InHome BOOL In Home Posi- TRUE when the axis is in the range for home.
tion It gives an AND of the following conditions.
• Home defined.
• Actual current position is within the zero position
range with home as the center.
This variable is also TRUE when the zero position is
passed by while the axis is moving for a command.
_MC_AX[0-255].DrvStatus.P_OT BOOL Positive Limit TRUE when the positive limit input is enabled.
Input
_MC_AX[0-255].DrvStatus.N_OT BOOL Negative Limit TRUE when the negative limit input is enabled.
Input
_MC_AX[0-255].DrvSta- BOOL Home Proximi- TRUE when the home proximity input is enabled.
tus.HomeSw ty Input
_MC_AX[0-255].DrvStatus.Home BOOL Home Input TRUE when the home input is enabled.
Additional Information
• The most suitable mode depends on the configuration of the positioning system and the ap-
plication.
In Linear Mode (finite length), Proximity Reverse Turn and Home Proximity Input OFF is
normally used if there is a home proximity sensor, positive limit input, and negative limit input.
• The override factors are ignored for homing.
• The in-position check will follow the in-position check settings only for the completion of the
home definition and homing compensation motions.
• Buffering and blending are not performed if you use multi-execution of other motion control
instructions during homing.
For details on homing, refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat.
No. W508).
If you use an absolute encoder, the absolute data can be retained even when the power supply to the
CPU Unit is turned OFF.
When you execute the MC_Power (Power Servo) instruction, the position is determined by reading the
actual position from the absolute encoder.
Unlike when using an incremental encoder, after home is defined, you do not need to perform the
homing operation again.
Battery
• If you use an OMRON 1S-series Servo Drive with a CPU Unit which is not either NX102 or
NX1P2, connect the CPU Unit battery.
• If you use an absolute encoder for the OMRON G5-series Servo Drive with an NX102 or
NX1P2 CPU Unit, connect the absolute encoder backup battery of the Servo Drive.
• If you use an absolute encoder for the OMRON G5-series Servo Drive with a CPU Unit which
is not either NX102 or NX1P2, connect both the CPU Unit battery and the absolute encoder
backup battery of the Servo Drive.
• Always execute the MC_Home or MC_HomeWithParameter instruction to define home when
you use the absolute encoder for the first time, after you replace the motor, when you use an
OMRON G5-series Servo Drive, when the battery in the absolute encoder expires, or at any
other time when the absolute value data is lost.
After you complete these steps, home is defined when the Enable input variable to the
MC_Power instruction changes to TRUE.
For details on homing, refer to 8-1 Outline of Homing on page 8-2.
For a CPU Unit with unit version 1.10 or later, home is also defined when EtherCAT process
data communications change from a non-established to an established state, in addition to
the previously mentioned step.
• For an NX102 or NX1P2 CPU Unit, if an error occurs for the CPU Unit memory when the
power supply is turned OFF and then the absolute value data cannot be saved, an Absolute
8
Additional Information
If you use an OMRON G5-series Linear Motor Type Servomotor/Servo Drive with built-in Ether-
Home can also be defined by performing a homing operation in the same way as for an incremental
encoder.
After home is defined, the difference between the command position and the absolute value data read
from absolute encoder is saved in the CPU Unit as the absolute encoder home offset.
For details on homing, refer to 8-1 Outline of Homing on page 8-2.
The absolute encoder home offset is also set to the difference (i.e., the offset) between the com-
mand position after defining home and the absolute value when the MC_Home or MC_HomeWith-
Parameter instruction is executed.
The MC Function Module saves the absolute encoder home offset in the CPU Unit when the power
supply to the CPU Unit is turned OFF.
• When absolute encoders are used, the absolute encoder home offset for each axis is
saved to the CPU Unit along with the axis number. The saved offset is lost if the axis number
is changed. If you change the axis number, set the Homing Settings again.
• If you replace the CPU Unit or the Battery for the CPU Unit, make sure home is defined and
back up the absolute encoder home offset before you start the replacement procedure.
• You can restore the backed up data after finishing the replacement procedure to use the
home that was previously defined.
• Use the Sysmac Studio to back up and restore the data.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific proce-
dures.
Applicable Servomotors
The following table lists the Servomotors that use the absolute encoder home setting.
You cannot use this absolute encoder for an NX-series Pulse Output Unit.
Additional Information
• Refer to A-1 Connecting the 1S-series Servo Drive on page A-2 for setting examples for
connection to an OMRON 1S-series Servo Drive.
• Refer to A-2 Connecting the G5-series Servo Drive on page A-11 for setting examples for
connection to an OMRON G5-series Servo Drive.
3 Execute Homing
Execute homing.
Set the Homing Method in the Homing Settings axis parameters of the MC Function Module.
After home is defined, the difference between the command position and the absolute value
data read from the absolute encoder is saved to the CPU Unit in the CPU Unit as the absolute
encoder home offset.
After the absolute encoder is set up, the power supply to the OMRON 1S-series Servo Drive or
G5-series Servo Drive must be cycled.
When setup processing for the absolute encoder is completed, an Absolute Value Clear Error
(A27.1) will occur in the Servo Drive. Cycle the control power supply to the Servo Drive to clear
this error and complete the absolute encoder setup procedure.
When using an absolute encoder in Rotary Mode, the absolute encoder home offset is automatical-
ly calculated and updated in the MC Function Module each motion control period.
The updated absolute encoder home offset is saved in the CPU Unit when the power supply to the
CPU Unit is turned OFF.
This enables recovering the actual position of a rotating axis from the absolute encoder the next time
power is turned ON even if the power to the CPU Unit or Servo Drive is turned OFF.
Velocity
Target velocity
Acceleration Deceleration
Time
Command current position 0
Additional Information
For details on the MC_MoveZeroPosition (High-speed Homing) instruction, refer to the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
Some of the functions of the MC Function Module are different when NX-series Pulse Output Units are
used. Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for details.
EtherCAT EtherCAT
Velocity processing
Command
velocity
Torque processing
Command
torque
Note You can use the command position or actual position as the input to the synchronization processing.
For details on resetting axis errors, refer to the MC_Reset (Reset Axis Error) instruction in the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
Velocity
Target
velocity
Deceleration
Acceleration
Time
0 Command Target position
current position
For details, refer to the MC_MoveAbsolute (Absolute Positioning) and MC_Move (Positioning) instruc-
tions in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Velocity
Target
velocity
Deceleration
Acceleration
Time
0 Command current position
Target distance
For details, refer to the MC_MoveRelative (Relative Positioning) and MC_Move (Positioning) instruc-
tions in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
Command position
Relative positioning,
absolute positioning,
or velocity control
Velocity
Interrupt input
Actual Position
Relative positioning, The figure on the left shows that there is a follow
absolute positioning, delay in relation to the command position.
or velocity control
Specified travel
distance
9
9-1-4 Interrupt Feeding
If decelerating to a stop after a reverse turn is specified for the Operation Selection at Reversing
axis parameter, an acceleration/deceleration curve is used when reversing.
Time
Task period
For details, refer to the MC_SyncMoveAbsolute (Cyclic Synchronous Absolute Positioning) instruction
in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Version Information
A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are re-
quired to use cyclic synchronous positioning.
9-1-6 Stopping
Functions to stop axis operation include immediate stop input signal and limit input signals connected
to the Servo Drive, stop functions of motion control instructions in the user program, and stopping due
to errors.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
The immediate stop input for the OMRON 1S-series Servo Drive or G5-series Servo Drive also
causes an error and executes stop processes in the Servo Drive itself.
• If a limit input signal turns ON, do not execute an instruction for an axis command of the axis
in the same direction as the limit input signal.
• If a limit input signal is ON for any axis in an axes group, do not execute an instruction for an
axes group command for that axes group.
• If the signal to decelerate to a stop is input during execution of a synchronous movement in-
struction that has a Deceleration input variable, the axis decelerates to a stop at the decelera-
tion rate given by Deceleration.
• If the signal to decelerate to a stop is input during execution of a synchronous movement in-
struction that does not have a Deceleration input variable, the axis decelerates to a stop at
the maximum deceleration rate that is set in the axis parameters.
Additional Information
• You must set up the Servo Drive in order to use the input signals from the Servo Drive. An
Additional Information
When the input variable Enable to the MC_Power (Servo ON) instruction changes to FALSE,
the MC Function Module immediately stops the command value and turns OFF the Servo.
When the Servo is turned OFF, the Servo Drive will operate according to the settings in the Ser-
vo Drive.
MC_Stop Instruction
You can specify the deceleration rate and jerk for single-axis control and synchronized control to
decelerate to a stop.
Specify a deceleration rate of 0 to send a command that immediately stops the Servo Drive.
Other operation commands are not acknowledged while decelerating to a stop for this instruction
and while the input variable Execute is TRUE.
MC_ImmediateStop Instruction
You can perform an immediate stop for single-axis control or synchronized control functions.
You can also execute this instruction on axes that are enabled in an axes group.
Refer to 9-8-5 Software Limits on page 9-78 for details on software limits.
When you use an NX701 CPU Unit and operate in the multi-motion, all axes in both tasks will
stop immediately if a Motion Control Period Exceeded occurs in either of the tasks.
Refer to A-6-2 Motion Control on page A-31 for multi-motion.
• Click the Stop MC Test Run Button on the MC Test Run Tab Page of the Sysmac Studio.
• Close the MC Test Run Tab Page on the Sysmac Studio.
• Exit the Sysmac Studio.
Additional Information
• When RUN mode changes to PROGRAM mode, any motion control instructions for current
motions are aborted. The CommandAborted output variable from the instructions remains
FALSE. The Servo ON/OFF status remains the same even after changing to PROGRAM
mode.
• If the operating mode returns to RUN mode while a deceleration stop is in progress after the
operating mode changes from RUN to PROGRAM mode, the output variables from motion
Stop Method
Deceleration Stop
Velocity
9
9-1-6 Stopping
Time
Immediate Stop
Velocity
Time
Time
Time
Stop Priorities
The priorities for each stop method are listed in the following table. If a stop with a higher priority stop
method occurs while stopping, the stop method will switch to the higher priority method.
Priority
Stop method
(higher numbers mean higher priority)
Immediate stop and Servo OFF 4
Immediate stop and error reset 3
Immediate stop 2
Deceleration stop 1
Example:
The following figure is an example of an immediate stop when the limit input signal is ON and the
immediate stop input changes to ON during a deceleration to a stop.
Limit input
Command velocity
The set override factor is read as long as the overrides are enabled.
If the overrides are disabled, the override factors return to 100%.
If the maximum velocity is exceeded when an override factor is changed, the maximum velocity for the
axis is used.
9
9-1-7 Override Factors
Execute
Busy
Active
Done
CommandAborted
Current Instruction
Enable
Enabled
Busy
Velocity
Override factor: 200%
Time
For details, refer to the MC_SetOverride (Set Override Factors) instruction in the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).
• You cannot specify an encoder axis, virtual encoder axis or single-axis position control axis
for the slave axis.
• When you use an NX701 CPU Unit and operate in the multi-motion, assign the master axis
and slave axis to the same task.
If you specify the master axis in a different task from the slave axis by executing the
synchronized control instructions such as the MC_GearIn (Start Gear Operation) instruction
or the MC_Camin (Start Cam Operation) instruction, an Illegal Master Axis Specification
Specify with
Master_Reference.
Gear Operation 9
Numerator
Actual position Command position
Denominator
9-2-1 Overview of Synchronized Control
Remainder
Command position
You can set the gear ratio numerator, gear ratio denominator, position type, acceleration rate, and de-
celeration rate for the slave axis to operate. For the master axis, you can specify the command posi-
tion, actual position, or most recent command position.
After operation starts, the slave axis uses the velocity of the master axis times the gear ratio for its
target velocity, and accelerates/decelerates accordingly.
The catching phase exists until the target velocity is reached. The InGear phase exists after that.
If the gear ratio is positive, the slave axis and master axis move in the same direction. If the gear ratio
is negative, the slave axis and master axis move in the opposite directions.
For details on gear operation, refer to the MC_GearIn (Start Gear Operation), MC_GearOut (End Gear
Operation), and MC_Stop instructions in the NJ/NX-series Motion Control Instructions Reference
Manual (Cat. No. W508).
Specify with
ReferenceType.
Gear Operation
Numerator
Actual position Command position
Denominator
Remainder
Command position
You can set the gear ratio numerator, gear ratio denominator, position type, acceleration rate, and de-
celeration rate for the slave axis to operate. For the master axis, you can specify the command posi-
tion, actual position, or most recent command position.
After operation starts, the slave axis uses the velocity of the master axis times the gear ratio for its
target velocity, and accelerates/decelerates accordingly.
The slave axis is in the catching phase until it reaches the slave sync position. The slave axis enters
the InSync phase after it reaches the slave sync position. For either, the position of the slave axis is
synchronized with the master axis.
If the gear ratio is positive, the slave axis and master axis move in the same direction. If the gear ratio
is negative, the slave axis and master axis move in the opposite directions. The following figure shows
the operation when the gear ratio is positive.
Position
Catching Phase InSync phase
Master
Slave
Execute Time
For details on positioning gear operation, refer to the MC_GearInPos (Positioning Gear Operation),
MC_GearOut (End Gear Operation), and MC_Stop instructions in the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No. W508).
Cam
Actual position processing Command position
Command position
Cam Operation
Master axis
Phase
Displacement
Slave
axis
Cam table
Phase Displacement
0.0 0.0 Cam
start point
Displacement 0.1 10.0
Cam Profile Curve 0.2 50.0
359.8 100.0
359.9 50.0 Maximum number
360.0 0.0 Cam of cam data
end point
0.0 0.0
0.0 0.0
Phase
One period 0.0 0.0
In a combination of a CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or high-
er, the following operation is possible: if another MC_CamIn (Start Cam Operation) instruction is exe-
cuted by using multi-execution with the Buffer Mode set for blending while the current MC_CamIn
(Start Cam Operation) instruction is executed, the operation can continue using the switched cam ta-
ble and the slave axis does not stop.
For details on cam operation, refer to the MC_CamIn (Start Cam Operation), MC_CamOut (End Cam
Operation), and MC_Stop instructions in the NJ/NX-series Motion Control Instructions Reference
Manual (Cat. No. W508).
For details on the Cam Editor, refer to the Sysmac Studio Version 1 Operation Manual (Cat. No.
W504).
Term Description
cam profile curve A curve that shows the relationship between phases and displacements in a cam
operation.
The cam profile curve is created on the Cam Editor of the Sysmac Studio. You can
use the cam profile curve with a cam data variable after the cam profile curve is
downloaded to the CPU Unit.
Use the Synchronization menu command of the Sysmac Studio to download the
project to the CPU Unit.
cam block You can select a cam curve in this block.
It represents the area between the end point of the previous cam block and the
end point of the current cam block.
cam curve A curve that represents the cam characteristics. You can select a cam curve for
each cam block.
The Sysmac Studio calculates the phase widths and displacement widths from the
specified points and creates the actual cam profile curve.
You can choose from different curves, such as straight line, parabolic, and trape-
cloid.
cam data Data made up of phases (master axis) and displacements (slave axis) for cam op-
eration.
cam data variable A variable that represents the cam data as a structure array.
cam table A data table that contains cam data.
If phase data is not in ascending order the cam table is treated as an illegal cam
table.
Term Description
cam table start position The absolute position of the master axis that corresponds to the cam start point
(phase = 0).
master following distance The master start distance where the slave axis starts cam operation represented
as either an absolute position or relative position.
The relative position is based on the cam start point position.
start mode A specification of whether to represent the master following distance as an abso-
lute position or relative position.
null cam data Cam data that can be set after the end point where the phase and displacement
are 0.
connecting velocity The connecting velocity that is used to connect cam profile curves. The connecting
velocity cannot be specified for some curves.
connecting acceleration The acceleration rate that is used to connect cam profile curves. The connecting
acceleration cannot be specified for some curves.
phase pitch The width when dividing the cam profile curve by phases (horizontal axis). The
points after dividing the curve into the phase pitch correspond to the cam data in
the cam table. You must specify the phase pitch for each cam block.
Displacement
Block 1 Block 2
End point
Cam start point displacement
Cam end point for block 2
(block start point)
(block start point)
Cam Tables
The MC Function Module defines a single element of data consisting of the phase of the master axis
and the displacement of the slave axis as one cam data. A cam table is defined as the combination of
multiple sets of cam data.
The cam table is created with the Cam Editor in the Sysmac Studio. You can modify cam data in the
cam table from the user program.
The phases and displacements in the cam data that makes up the cam table are represented as rela-
tive distances from the start point 0.0.
During cam operation, the command position sent to the slave axis is the displacement determined by
interpolating linearly between the two cam data elements adjacent to the phase of the master axis.
The more cam data there is in the cam table, the more accurate the trajectory and the smoother the
cam profile curve will be.
• Make sure that the cam data is arranged in the cam table so that the phases are in ascending
order. An instruction error occurs if a cam operation instruction is executed when the phases
are not in ascending order.
• Cam data variables are global variables. You can therefore access or change the values of
cam data variables from more than one task. If you change the values of cam data variables
from more than one task, program the changes so that there is no competition in writing the
value from more than one task.
• If you use exclusive control of global variables between tasks for a cam data variable, do not
Cam data can be overwritten with the Generate Cam Table instruc-
tion.*3
Saving cam data Cam data can be saved to non-volatile memory by using the Save
Cam Table instruction.
Information attached to the cam data Information can be downloaded or uploaded for display in the Cam
Editor*4
Timing to load cam data to main memory • When the data is downloaded from the Sysmac Studio
• When power is turned ON
*1. If 65,535 points are used for each cam table, there will be a maximum of 16 cams. A resolution of 0.1° al-
lows for a maximum of 3,600 points per cam table for a maximum of 291 cams.
*2. The total size is 10 MB max.
*3. A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required to use the
Generate Cam Table instruction.
*4. Use the Synchronization menu command of the Sysmac Studio to upload and download the project.
TYPE
(*Cam data structure*)
_sMC_CAM_REF :
STRUCT
Phase : REAL; (*Phase*)
Distance : REAL; (*Displacement*)
END_STRUCT;
END_TYPE
You must create the cam data with the Cam Editor in the Sysmac Studio and then specify the name of
the cam table and the number of cam data (i.e., the size of the array).
For example, to make a cam table called MyCam1 with 1,000 points use the following declaration.
VAR
(*Cam table*)
MyCam1 : ARRAY [0..999] OF _sMC_CAM_REF;
END_VAR
The following notation is used to specify MyCam1 for a cam operation instruction. In this example, the
master axis is Axis1 and the slave axis is Axis2.
MC_CamIn_instance
MC_CamIn
Axis1 Master Master Axis1
Axis2 Slave Slave Axis2
MyCam1 CamTable CamTable MyCam1
An error will occur if the specified cam table does not exist in the Controller. You can also specify the
same cam table for more than one axis.
• The cam table you want to switch to must be saved to non-volatile memory before it can be
used.
• Switching cam tables during cam operation will cause discontinuous velocities. Adjust the
timing for switching the cam table to avoid excessive velocity discontinuity.
• Overwritten cam data will be lost if the CPU Unit is turned OFF or the cam data is download-
ed from the Sysmac Studio before the Save Cam Table instruction is executed or if the in-
struction fails to save the data for any reason.
• Be careful not to lose the overwritten data when overwriting cam data from the user program
in the CPU Unit. 9
• Cam data saved to non-volatile memory can be loaded by using the upload function of the
Sysmac Studio. 9-2-5 Cam Tables
• Use the Synchronization menu command of the Sysmac Studio to upload and download the
project.
For details on arrays, refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501).
For details on the Save Cam Table instruction, refer to the MC_SaveCamTable instruction in the
NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
The cam end point is the data located one cam data before the first cam data with a phase of 0 after
the start point in the cam table. All cam data after phase 0 is detected will be invalid.
For example, refer to the following cam table. The EndPointIndex (End Point Index) output variable is
999 and the MaxDataNumber (Maximum Number of Cam Data) output variable is 5,000 from the
MC_SetCamTableProperty instruction.
• You cannot change the maximum number of cam data from the user program.
• Execute this instruction after overwriting the cam data in any way that changes the number of
valid cam data.
If the number of valid cam data is not updated, the cam operation and the operation of the
EndOfProfile (End of Cam Cycle) of the MC_CamIn instruction may not be as expected.
For details on the Set Cam Table Properties instruction, refer to the MC_SetCamTableProperty (Set
Cam Table Properties) instruction in the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508).
The MC_GenerateCamTable instruction calculates the cam data using the values specified for Cam-
Property (Cam Properties) and CamNodes (Cam Nodes), and rewrites the cam data variable specified
for the CamTable (Cam Table) in-out variable.
When rewriting is completed, the MC_GenerateCamTable instruction updates the end point index of
the cam table and outputs the element number of the cam end point to EndPointIndex (End Point In-
dex).
It is not necessary to execute the MC_SetCamTableProperty (Set Cam Table Properties) instruction
after the MC_GenerateCamTable instruction is completed.
MC_GenerateCamTable_instance
MC_GenerateCamTable
CamTable CamTable
Cam table property CamProperty CamProperty
Cam node (defining curves) CamNodes CamNodes
Execute Done
EndPointIndex Outputs "180" after instruction execution.
Busy
CommandAborted
Error
ErrorID
ErrorParameterCode
ErrorNodePointIndex
If the cam definition variable is created as a user-defined variable, the default of its Retain attribute is
Non-retain. You must set the Retain attribute of variable to Retain, if you want to reuse the variable
after changing its value and switching the operating mode to PROGRAM mode or cycling the power
supply. If you set the variable each time of use from the HMI, etc., the attribute can be left Non-retain.
If the cam definition variable is created with the cam data settings on the Sysmac Studio, the Retain
attribute of variable will be fixed to Retain.
By using the HMI, etc., to set the values for the MC_GenerateCamTable instruction, you can create
the cam data variable and adjust the cam operation without using the Sysmac Studio.
The following is the procedure used to adjust the cam operation.
• Displaying the cam variable that is created by the Generate Cam Table instruction graphical-
ly on the HMI.
• Displaying the value of EndPointIndex (End Point Index) on the HMI.
2 Set the value of the cam definition variable from the HMI.
4 Verify the curve shape of the generated cam table and the value of the end point index dis-
played on the HMI.
5 If there is no problem with the curve shape of the cam table and the number of the cam data,
then execute the cam operation.
6 Verify the result of the cam operation and consider changing the value of the cam definition
variable.
7 Repeat steps 2 to 6.
For details on the cam definition variable and the Generate Cam Table instruction, refer to the MC_-
GenerateCamTable instruction in the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508).
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information on creating
and transferring the cam definition variables using the Sysmac Studio.
The velocity and position of the slave axis are determined by the ratio of the travel distances of the
master axis and the slave axis as shown in the following figure.
The sync start position shown in the following figure represents the position where the sync start con-
dition is met.
MasterDistanceInDEC
MasterDistance
Master
Following MasterDistanceInACC
Distance
Time
Slave axis position
SlaveDistance
Time
Slave axis velocity
Time
The following figure is an example where the command position for the slave axis is determined based 9
on the operation of subtraction. 9-2-7 Combining Axes
Slave (Slave Axis) command current position = Master (Master Axis) command current position − Aux-
iliary (Auxiliary Axis) command current position
Master
(master axis)
Velocity Execute of MC_CombineAxes
changes to TRUE
Slave
(slave axis) Execute of MC_CombineAxes
Time Velocity changes to TRUE
Position: 200 Position: 600
-
Auxiliary
(auxiliary axis)
Velocity Execute of MC_CombineAxes Time
changes to TRUE Position: 0 Position: 390
Time
Position: 100 Position: 110
For details on combining axes, refer to the MC_CombineAxes and MC_Stop instructions in the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
You can specify the phase shift amount, target velocity, acceleration rate, deceleration rate, and jerk
for the MC_Phasing (Shift Master Axis Phase) instruction.
Execute
Busy
Active
Done
CommandAborted
Error
ErrorID 16#0000
Time
For details on the shift master axis phase function and the synchronized control instructions for which
a master axis phase shift can be applied, refer to the MC_Phasing (Shift Master Axis Phase) instruc-
tion in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
For details on slave axis position compensation, refer to the MC_SyncOffsetPosition (Cyclic Synchro-
nous Position Offset Compensation) instruction and MC_OffsetPosition (Position Offset Compensa-
tion) instruction in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
The cam operation and gear operation synchronized with the master axis and slave axis are available
for the following combinations.
Axis 1
1:2 2:3
Axis 2 Axis 3
Axis 1
Master axis
1:2
Axis 2
Slave axis Primary periodic task
MC_PeriodicSyncVariables instruction Priority-5 periodic task
Target position
Calculations given to virtual Axis 4 2:3
Master axis position axis. Virtual axis
Master axis velocity
:
Programming is placed in both the primary periodic task and priority-5 periodic task to achieve the
operation for the above application.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for de-
tails on the MC_PeriodicSyncVariables (Periodic Axis Variable Synchronization between Tasks) in-
struction.
9
9-2-10 Achieving Synchronized Control in Multi-motion
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
Execute
Busy
Active
InVelocity
CommandAborted
Error
ErrorID 16#0000
Decelerates to a stop
Velocity when another instruction
causes an error.
Target velocity
Time
The MC Function Module uses Position Control Mode of the Servo Drive or other device and sends
target position commands to achieve the specified target velocity.
The position control loop is enabled in the Servo Drive or other device. Therefore, as the command
velocity slows down, e.g., due to disturbance, and the following error increases, the velocity will
change to eliminate this following error.
For details, refer to the MC_MoveVelocity (Velocity Control) instruction in the NJ/NX-series Motion
Control Instructions Reference Manual (Cat. No. W508).
You cannot use cyclic synchronous velocity control for an NX-series Pulse Output Unit.
To stop an axis, use the MC_Stop instruction or execute another motion instruction.
If you specify a target velocity of 0, the axis will not move but the axis status will indicate that it is mov-
ing.
MC_SyncMoveVelocity Instruction
Execute
InVelocity
Busy
Active
CommandAborted
Error
ErrorID 16#0000
MC_Stop Instruction
Execute
Busy
Active
9
Time
Target velocity is changed Target velocity is not
9-3-2 Cyclic Synchronous Velocity Control
Control Mode
CSP CSV CSP CSV
The Servo Drive will receive commands in the velocity control loop. Therefore, if any disturbance caus-
es the velocity to decrease below the command velocity, no change in velocity will occur to remove the
following error.
For details, refer to the MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control) instruction in the
NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
The MC Function Module uses the Torque Control Mode of the Servo Drive.
The Servo Drive receives the torque command value from the MC Function Module in the torque con-
trol loop and to control the torque.
You can specify the velocity limit value for the Servo Drive in the Velocity (Velocity Limit) input variable
to the motion control instruction. You can use this to limit high-speed revolution of the motor when the
load on the motor is low in Torque Control Mode.
For details, refer to the MC_TorqueControl instruction in the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508).
To stop an axis, use the MC_Stop instruction or execute another motion instruction.
If you specify a Torque (Target Torque) of 0, the axis will not move but the axis status will indicate that
it is moving.
Torque
TorqueRamp
Time
Time
TorqueRamp
Torque
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
9-5-1 Positions
Types of Positions
The MC Function Module uses the following two types of positions.
The following figure shows the relationship between the command position and the actual position for
an EtherCAT slave Servo Drive.
The command position and actual position share the following items.
Software limits You can set the range of operation of the soft- The range is the same as the range
ware. for the command position.
Changing the current You can change the actual position to any de- This value will be set to the same po-
position sired position. sition as the command position. *1
Defining home Home is either defined or undefined. The status of home is the same as
the command position.
*1. If there is any following error before the change, the following error value is maintained in the actual posi-
tion.
Additional Information
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information
on the NX-series Position Interface Units.
Monitoring Positions
You can read Axis Variables in the user program to monitor positions.
In the descriptions, a variable name _MC_AX[*] is used as an example, but the same information ap-
plies to _MC1_AX[*] and _MC2_AX[*].
Data
Variable name Meaning Function
type
_MC_AX[0-255].Cmd.Pos LREAL Command Cur- This is the current value of the command position.
rent Position When the Servo is OFF and the mode is not the
position control mode, the actual current position is
output.
_MC_AX[0-255].Act.Pos LREAL Actual Current This is the actual current position.
Position
9-5-2 Velocity
Types of Velocities
The following two types of axis velocities are used in the MC Function Module.
Velocity Unit
A velocity is given in command units/s.
The command unit is the value obtained from unit conversion of the position display unit and the elec-
tronic gear.
Monitoring Velocities
You can read Axis Variables in the user program to monitor velocities.
In the descriptions, a variable name _MC_AX[*] is used as an example, but the same information ap-
plies to _MC1_AX[*] and _MC2_AX[*].
Data
Variable name Meaning Function
type
_MC_AX[0-255].Cmd.Vel LREAL Command Cur- This is the current value of the command velocity.
rent Velocity A plus sign is added during travel in the positive
direction, and a minus sign is added during travel
in the negative direction.
_MC_AX[0-255].Act.Vel LREAL Actual Current This is the actual current velocity.
Velocity A plus sign is added during travel in the positive
direction, and a minus sign is added during travel
in the negative direction.
Setting
Parameter name Function Default
range
Acceleration/ Set the operation for when the maximum acceleration/ 0 to 2 0
Deceleration Over deceleration rate would be exceeded after excessive ac-
celeration/deceleration during acceleration/deceleration
control of the axis because stopping at the target position
is given priority.
0: Use rapid acceleration/deceleration. (Blending is
changed to Buffered.)*1
1: Use rapid acceleration/deceleration.
2: Minor fault stop*2
Acceleration Set the percentage of the maximum acceleration rate at 0 to 100 0
Warning Value which to output an acceleration warning for the axis.
No acceleration warning is output if 0 is set. (Unit: %)
Deceleration Set the percentage of the maximum deceleration rate at 0 to 100 0
Warning Value which to output a deceleration warning for the axis.
No deceleration warning is output if 0 is set. (Unit: %)
*1. For a CPU Unit with unit version 1.10 or later, Blending is not changed to Buffered. Refer to 9-5-7 Multi-
execution of Motion Control Instructions (Buffer Mode) on page 9-48 for details.
*2. For a CPU Unit with unit version 1.10 or later, the axis does not stop with an error when Blending is used for
A D
Time
A
Ta1 Ta2 Td
If you specify a short travel distance or a low acceleration/deceleration rate, the target velocity may not
be reached.
If the target position is exceeded after re-execution of the motion control instruction with the newly up-
dated acceleration or deceleration rate, positioning is performed at an acceleration or deceleration rate
that will enable stopping at the target position.
9-5-4 Jerk
The jerk specifies the rate of change in the acceleration rate or deceleration rate. If the jerk is speci-
fied, the velocity waveform during acceleration will be an S-curve, which will reduce the shock and vi-
bration on the machine.
Additional Information
Jerk Unit
Jerk is given in command units/s3.
The command unit is the value obtained from unit conversion of the position display unit and the elec-
tronic gear.
Use the following formula to calculate the value to set for the jerk.
Jerk = Acceleration rate/(Time of acceleration × Ratio of time to apply jerk during acceleration/2)
Jerk is applied in two sections: at the start of acceleration and at the end of acceleration. The time that
jerk is applied is therefore divided by 2.
Example: Acceleration of 25,000 mm/s2, Acceleration Time of 0.1 s, and a Jerk Application Rate of
50%
Jerk = 25,000/(0.1 × 0.5/2) = 1,000,000 (mm/s3)
Velocity
Target velocity
at startup
Time
Jerk
Jerk
at startup
Time
25% 25%
Monitoring Jerk
9
You can read Axis Variables in the user program to monitor jerk.
In the descriptions, a variable name _MC_AX[*] is used as an example, but the same information ap- 9-5-5 Specifying the Operation Direction
Data
Variable name Meaning Function
type
_MC_AX[0-255].Cmd.Jerk LREAL Command Current This is the current value of the command jerk.
Jerk
If you set the direction to the shortest way, positive direction, negative direction, or current
direction, you can specify a position that is greater than or equal to the modulo minimum position and
less than the modulo maximum position within one turn of the ring counter.
The Direction input variable will be ignored when the Count Mode is set to Linear Mode. Positioning
will be performed to the target position.
The following table lists the different directions you can specify in the MC Function Module.
Direction Operation
Shortest way Motion starts in the direction where the command current position and the target position
are closer to each other.
Positive direction Motion starts in the positive direction.
Negative direction Motion starts in the negative direction.
Current direction Motion starts in the same direction as the previous operation.
No direction Motion starts in the direction that does not pass through the upper and lower limits of the
specified ring counter.
With this direction specification, you can specify a target position that exceeds the upper or
lower limits of the ring counter. If that occurs, relative positioning is performed using the dif-
ference between the target position and the command current position as the target dis-
tance. This enables you to perform multi-turn positioning on the ring counter.
Modulo maximum
position setting
value: 100
Command current position:
50
Modulo minimum
position setting
value: −70 Moves in negative direction.
Additional Information
Moves in the same direction as the Current Direction specification if the travel distance is the
same in the positive and negative directions.
Modulo maximum
position setting
value: 100
Command current position:
50
Modulo minimum
position setting
value: −70
Moves in positive direction.
Modulo minimum
position setting
value: −70
Moves in negative direction.
9
Example for Current Direction
The following example illustrates when positioning is performed towards a target position of −20 when
9-5-5 Specifying the Operation Direction
Modulo maximum
position setting
value: 100
Command current position:
50
Modulo minimum
position setting
value: −70 If the previous operation was If the previous operation was in
in the negative direction, the positive direction, motion is in
motion is in the negative the positive direction.
direction.
The direction of the previous operation is given in the Command Direction in the Axis Variable.
Modulo maximum
position setting
value: 100
Command current position:
50
Modulo minimum
position setting
value: −70 Moves towards the
ring counter range.
Similarly, the following example illustrates when the ring counter upper limit is 100, the lower limit is
−70, the command current position is −20, and positioning is performed towards a target position of
290.
Modulo maximum
position setting
value: 100
Modulo minimum
position setting
value: −70
190
Performs relative positioning with target distance of (290
(target position) − 100 (upper limit)) = 190.
For details on input variables that can be changed, refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No. W508). 9
9-5-6 Re-executing Motion Control Instructions
When a Reverse Turn Does Not Occur for the New Command Value
Re-executing Instruction during Re-executing Instruction during
Constant-velocity Motion Acceleration/deceleration
Velocity Velocity
↓Command re-executed. ↓Command re-executed.
If the instruction is re-executed If the travel distance upon reversal If the instruction is re-executed during
during acceleration, the axis is small, triangular control is acceleration or deceleration, the axis
starts deceleration as soon as performed as it was for the first stops immediately upon re-execution.
the instruction is re-executed. execution of the instruction. This also occurs during deceleration.
No Reverse Turn
Velocity
↓Command re-executed.
• If There Is No Reverse Turn and the Target Position Would Be Exceeded at the Specified Decel-
eration Rate
No Reverse Turn
Velocity
↓Command re-executed.
• If There Is a Reverse Turn and Decelerating to a Stop Would Result in an Excess over the Soft-
ware Limit
No Reverse Turn
Velocity
↓Command re-executed.
↑Executed. Reverse
operation
↑Software limit
No Reverse Turn
Velocity
↓Command re-executed.
↑Executed. Reverse
operation
↑Counter upper limit
9
Changing the Travel Distance 9-5-6 Re-executing Motion Control Instructions
Even if you change the travel distance and re-execute the MC_MoveRelative (Relative Positioning) in-
struction, positioning is performed for the new travel distance in reference to the position where the
motion first started.
However, if the instruction is executed again just before positioning is completed, it may be executed
as a new instruction rather than as a re-execution of the same instruction.
Do not change the travel distance and re-execute the instruction just before the end of position-
ing.
Axis1PosSet1
Move Axis1pos 1000
Axis1PosSet2
Move Axis1pos 2000
Axis1MoveAbsolute
MC_MoveAbsolute
Axis1Execute _MC_AX[0] Axis Axis _MC_AX[0]
Execute Done Axis1Done
Axis1Pos Position Busy Axis1Busy
Axis1Velo Velocity Active Axis1Active
Axis1Acc Acceleration CommandAborted Axis1CA
Axis1Dec Deceleration Error Axis1Error
Axis1Jerk Jerk ErrorID Axis1ErrorID
0 Direction
0 BufferMode
Timing Charts
Variables
Axis1PosSet1
Axis1PosSet2
Input Parameter
Axis1Execute
Output Parameters
Axis1Done
Axis1Busy
Axis1Active
For input variables that are not changed, always use the same values as before re-execution of
the instruction.
The following terms are used in relation to multi-execution of instructions in the MC Function Module.
Term
Meaning
This manual PLCopen®
Current instruction Previous function The motion control instruction that is in execution just before multi-ex-
block ecution is triggered.
Buffered instruc- Next function A motion control instruction that is triggered while the axis is in mo-
tion block tion, and is waiting to be executed.
Transit velocity Blending When blending is specified, it specifies the command velocity for the
current instruction to move to the specified target position.
You can set the BufferMode (Buffer Mode Selection) input variable to motion control instruction to se-
lect one of the following Buffer Modes.
The main difference between these modes is the timing at which the buffered instructions are execut-
ed and the transit velocity.
If Buffered or Blending Mode is specified, the next instruction is buffered in the MC Function Module, 9
and executed at the specified BufferMode timing and transit velocity.
There is one buffer for each axis.
Mode)
9-5-7 Multi-execution of Motion Control Instructions (Buffer
• Only one instruction can be buffered for each axis. If multi-execution is performed for two or
more instructions, an instruction error will occur.
• Multi-execution of multi-axes coordinated control instructions (axes group instructions) is not
possible for axes operating as a single axis. Similarly, multi-execution of single-axis control
instructions is not possible for axes operating under multi-axes coordinated control (axes
group instructions). An instruction error will occur if these rules are broken.
Aborting
This is the default mode. No buffering is performed in this mode.
When a Reverse Turn Does Not Occur for the Command Position of the
Next Instruction for Multi-execution
Multi-execution during Constant-velocity Motion Multi-execution during Acceleration/Deceleration
When a Reverse Turn Occurs for the Command Position of the Next In-
struction for Multi-execution
Decelerating to a Stop after Reverse Turn Stopping Immediately after Reverse Turn
Velocity Velocity
¯Multi-execution timing ¯Multi-execution timing
If the travel distance
upon reverse turn is
small, triangular control
is performed as it was
for the first execution of
¯Initial command position the instruction.
Executed. Buffered Executed. Initial New
command command command
position position position
If an instruction is executed with If the travel distance upon If the instruction is executed with multi-execu-
multi-execution of instructions reverse turn is small, triangular tion of instructions during acceleration or
during acceleration, the axis control is performed as it was for deceleration, the axis stops immediately
starts deceleration according to the first execution of the according to the multi-execution timing.
the multi-execution timing. instruction.
Buffered
The next instruction remains in the buffer until the operation of the current instruction is finished.
The buffered instruction is executed after the operation for the current instruction is normally ended.
Time
Blending
The buffered instruction remains in the buffer until the target position of the current instruction is
reached.
The buffered instruction is executed after the current instruction's target position is reached. However,
motion does not stop at this time. Operation transitions to the next instruction at the velocity specified
with the BufferMode (Buffer Mode Selection) input variable.
For relative travel, the final position will be the total of the values for both instructions.
For absolute travel, the final position will be the target position of the second instruction.
The Acceleration/Deceleration Over axis parameter is used to select one of the following operations
for when the target position would be exceeded with the values that are set in the Maximum
Acceleration and Maximum Deceleration axis parameters.
• Use rapid acceleration/deceleration. (Blending is changed to Buffered.)
• Use rapid acceleration/deceleration.
• Minor fault stop
For a CPU Unit with unit version 1.10 or later, Blending is not changed to Buffered even if you
select Use rapid acceleration/deceleration (Blending is changed to Buffered). In this case,
the maximum acceleration/deceleration rate is used and the blending operation is continued.
Also, the axis does not stop with an error even if you select Minor fault stop. Similar to the
previous case, the maximum acceleration/deceleration rate is used and the blending operation
is continued.
Multi-execution of Time
instructions
Time
Multi-execution of instructions
Current instruction
Time
Multi-execution of instructions
Time
Cases Resulting in Deceleration
Multi-execution
of instruction
Velocity
Time
9
Buffered instruction
Mode)
9-5-7 Multi-execution of Motion Control Instructions (Buffer
Current instruction
Buffered instruction
Time
Cases Resulting in Deceleration
Multi-execution of instruction
Velocity
Time
Coordinate conversion
EtherCAT Feedback Commands EtherCAT
slave slave
Actual Command
Input 2 Output 2
position 2 position 2
Input 3
Actual
position 3
Command
position 3 Output 3 9
9-6-1 Outline of Operation
Additional Information
For devices that require you to modify the grouping of axes in motion to perform interpolation
control, you must create multiple axes groups that include the axes to modify from the Sysmac
Studio beforehand. After completing this step, you can execute by specifying the enabled axes
groups from the user program during operation.
With a CPU Unit with unit version of 1.01 or later and Sysmac Studio version 1.02 or higher,
you can use the MC_ChangeAxesInGroup (Change Axes in Group) instruction to change the
composition axes for an axes group that is disabled.
For details on axes groups, refer to 3-3 Axes Groups on page 3-21.
For details on enabling and disabling axes groups, refer to the MC_GroupEnable (Enable Axes Group)
and MC_GroupDisable (Disable Axes Group) instructions in the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No. W508).
Changes made using the MC_ChangeAxesInGroup (Change Axes in Group) instruction will not
be saved to non-volatile memory in the CPU Unit. If you cycle the power supply or download
the settings from the Sysmac Studio, the parameter settings in the non-volatile memory are re-
stored.
For details on changing the composition axes of an axes group, refer to the MC_ChangeAxesInGroup
(Change Axes in Group) instruction in the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508).
For details on reading the axis positions for an axes group, refer to the MC_GroupReadPosition (Read
Axes Group Position) instruction in the NJ/NX-series Motion Control Instructions Reference Manual
(Cat. No. W508).
For details on resetting axes group errors, refer to the MC_GroupReset (Group Reset) instruction in
the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
9
9-6-2 Linear Interpolation 9-6-2 Linear Interpolation
Linear interpolation is used to move 2 to 4 of the logical axes A0 to A3 in a straight line between a
start point and an end point.
Either absolute or relative positioning is possible. You can specify the interpolation velocity, interpola-
tion acceleration, interpolation deceleration, and jerk.
The MC Function Module uses the following three kinds of linear interpolation instructions.
• MC_MoveLinear (Linear Interpolation)
You can specify the MoveMode input variable to select between linear interpolation to an absolute
value or linear interpolation to a relative value. This instruction is unique to the MC Function Module.
• MC_MoveLinearAbsolute (Absolute Linear Interpolation)
This instruction performs linear interpolation to an absolute value. This instruction is defined in the
PLCopen® technical specifications.
• MC_MoveLinearRelative (Relative Linear Interpolation)
This instruction performs linear interpolation to a relative value. This instruction is defined in the
PLCopen® technical specifications.
The following figure shows linear interpolation of 2 axes from point A to point B.
La1
Td
L
Fa1 F
Ta
A
La0
X
Axis A0 motion
Ta Td
For details on linear interpolation, refer to the MC_MoveLinear (Linear Interpolation), MC_MoveLinear-
Absolute (Absolute Linear Interpolation), and MC_MoveLinearRelative (Relative Linear Interpolation)
instructions in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Y coordinate
CCW
CW
CW : Clockwise rotation
CCW : Counterclockwise rotation
X coordinate
With the MC Function Module, you can specify the following three kinds of circular interpolation meth-
ods with the input variable CircMode (Circular Interpolation Mode).
• Border point
• Center
• Radius
For details, refer to the MC_GroupStop and MC_GroupImmediateStop instructions in the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).
MC_GroupStop Instruction
For linear interpolation or circular interpolation performed on an axes group, you can decelerate to
a stop along the control path. You specify the deceleration rate and jerk.
Specify a deceleration rate of 0 to send a command that immediately stops the Servo Drive or oth-
er devices.
Other operation commands are not acknowledged while decelerating to a stop for this instruction
and while the input variable Execute is TRUE.
MC_GroupImmediateStop Instruction
You can perform an immediate stop for all axes in the axes group. The immediate stopping method
is determined by the setting of the Immediate Stop Input Stop Method axis parameter for each
axis.
The MC_GroupImmediateStop instruction can also be executed for an axes group that is decelerat-
ing to a stop for an MC_GroupStop instruction.
You can select one of the following stop methods for axes groups.
• Immediate stop
• Decelerate axes to a stop at maximum deceleration rate of the axes.
• Immediate stop and Servo OFF
When you use an NX701 CPU Unit and operate in the multi-motion, all axes in both tasks will
stop immediately if a Motion Control Period Exceeded occurs in either of the tasks.
Refer to A-6-2 Motion Control on page A-31 for multi-motion.
Additional Information
• If you execute the MC_GroupDisable (Disable Axes Group) instruction during axes group op-
eration, the axes in the group will decelerate to a stop at their maximum deceleration rates.
• If you execute the MC_Stop instruction while an axes group is in operation, an error will occur
for the axes and axes group and the axes group operation will decelerate to a stop with inter-
polation. The interpolation deceleration rate is determined by the deceleration rate that is
specified for the controlling instruction.
• When the input variable Enable to the MC_Power (Servo ON) instruction changes to FALSE
during axes group motion, the MC Function Module immediately stops the command value
for that axis and turns OFF the Servo.
When the Servo is turned OFF, the Servo Drive or other device will operate according to the
settings in the Servo Drive or other device.
Other axes in that axes group will stop with the stop method that is set in the Axes Group
Stop Method axes group parameter. An error will occur for the axes group if this happens.
• When RUN mode changes to PROGRAM mode, any motion control instructions for current
motions are aborted. The CommandAborted output variable from the instructions remains
FALSE. The Servo ON/OFF status remains the same even after changing to PROGRAM
mode.
• If the operating mode returns to RUN mode while a deceleration stop is in progress after the
operating mode changes from RUN to PROGRAM mode, the output variable
CommandAborted from the current motion control instructions changes to TRUE.
• The save process will continue during a save for the MC_SaveCamTable instruction.
• The generation process will continue when generation of the cam table is in progress for the
MC_GenerateCamTable (Generate Cam Table) instruction.
The set override factor is read as long as the overrides are enabled. If the overrides are disabled, the
override factors return to 100%. 9
If the maximum interpolation velocity is exceeded when an override factor is changed, the maximum
interpolation velocity for the axes group is used.
9-6-6 Overrides for Multi-axes Coordinated Control
Busy
Active
Done
CommandAborted
Current Instruction
Enable
Enabled
Busy
Time
For details, refer to the MC_GroupSetOverride (Set Group Overrides) instruction in the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
Types of Velocities
The following is the only type of interpolation velocity for axes groups supported by the MC Function
Monitoring Velocities
You can read Axes Group Variables from the user program to monitor the interpolation velocity.
In the descriptions, a variable name _MC_GRP[*] is used as an example, but the same information
applies to _MC1_GRP[*] and _MC2_GRP[*].
Data
Variable name Meaning Function
type
_MC_GRP[0-63].Cmd.Vel LREAL Command Inter- This is the current value of the command interpo-
polation Velocity lation velocity.
A plus sign is added during travel in the positive
direction, and a minus sign is added during travel
in the negative direction.
Interpolation
velocity
Vt
Time
Acceleration
rate At
Time
Deceleration
rate -Dt
Jt
Jerk
Time
-Jt
Vt: Specified interpolation velocity, At: Specified acceleration rate, Dt: Specified deceleration rate, Jt: Specified jerk
Vt: Specified interpolation velocity, At: Specified acceleration rate, Dt: Specified deceleration rate, Jt:
Specified jerk
Execute
Busy
Active
Done
CommandAborted
Error
Interpolation velocity
Time
You can change the deceleration rate if you re-execute the MC_GroupStop instruction, but you cannot
change the jerk in this way.
If you re-execute the MC_GroupReset instruction, the re-execution command will be ignored and error
reset processing will continue.
For details on re-executing motion control instructions, refer to each instruction in the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).
(3) (4)
(2) Linear interpolation: (1), (3), (5), and (7)
(6) (7)
(1) Point B
Point A
You can set the BufferMode input variable to motion control instruction to select one of the same Buf-
fer Modes as are supported for single-axis operations.
There are a total of eight instruction buffers for axes groups. Each axes group has one buffer for the
instruction currently in operation and seven buffers for multi-execution of instructions.
Multi-execution of instruction cannot be used from an axis motion instruction to an axes group motion
instruction and vice-versa.
• Up to seven instructions can be buffered at the same time for a single axes group. If multi-
execution is performed for eight or more instructions, an instruction error will occur.
9
• Multi-execution of multi-axes coordinated control instructions (axes group instructions) is not
possible for axes operating as a single axis. Similarly, multi-execution of single-axis control
Mode) for Multi-axes Coordinated Control
9-7-5 Multi-execution of Motion Control Instructions (Buffer
instructions is not possible for axes operating under multi-axes coordinated control (axes
group instructions). An instruction error will occur if these rules are broken.
Aborting
This is the default mode. No buffering is performed in this mode.
The current command is aborted and the new instruction is executed.
Multi-execution of motion control instructions that have no BufferMode input variable will operate in
Aborting Mode.
Operation of the new instruction starts at the current interpolation velocity when the instruction is trig-
gered.
With Aborting Mode you cannot combine single-axis control, including synchronized single-axis con-
trol, and axes group control.
An instruction error will occur at the time of multi-execution if you execute an axes group operation on
an axis currently in a single-axis motion.
This will stop both the axes group and the single axis.
Executed. Initial command position Buffered command Executed. Initial command position Buffered command
position position
Multi-execution for axes groups is done so that the interpolation velocity remains continuous between
instructions. If continuous operation is performed with an instruction with a travel distance of 0, the ve-
locity changes for the axes will not be continuous.
Y coordinate
Fy F
X coordinate
Y-axis motion
Fx
X-axis motion
Ta Td
Buffered
The next instruction remains in the buffer until the current operation is finished.
The buffered instruction is executed after the operation for the current instruction is normally ended.
Time
Blending
Blending for axes groups works in the same way as blending for single-axis operations.
The buffered instruction remains in the buffer until the target position of the current instruction is
reached.
The buffered instruction is executed after the target position of the current instruction is reached. The
Version Information
• For a CPU Unit with unit version 1.10 or later, Blending is not changed to Buffered even if you
select Use rapid acceleration/deceleration (Blending is changed to Buffered). In this
case, the maximum acceleration/deceleration rate is used and the blending operation is con-
tinued.
Also, the axis does not stop with an error even if you select Minor fault stop. Similar to the
previous case, the maximum acceleration/deceleration rate is used and the blending opera-
tion is continued.
• Note that the following restriction applies to CPU Units with unit version 1.09 or earlier. 9
For blending in multi-axes coordinated control, buffered operation is used if the results of pro-
file processing show that the execution time of the current instruction is less than four control
Mode) for Multi-axes Coordinated Control
9-7-5 Multi-execution of Motion Control Instructions (Buffer
periods. A Notice of Insufficient Travel Distance to Achieve Blending Transit Velocity observa-
tion will occur.
The above restriction does not apply to CPU Units with unit version 1.10 or later.
Time
Cases Resulting in Deceleration
Multi-execution of instruction
Velocity
Time
Time
Cases Resulting in Deceleration
Multi-execution of instruction
Velocity
Time
Transition Modes
Multi-execution of instructions for axes groups may create some shock on the device and/or workpiece
due to changes in the direction of the interpolation path. You can specify the TransitionMode input vari-
able to the motion control instruction to select a transition method to use between instructions in order
to lessen this shock.
You can choose from the following transition modes in the MC Function Module.
• When BufferMode (Buffer Mode Selection) is 1: _mcBuffered, the axis moves to position End1,
stops, and then moves to position End2.
9
Mode) for Multi-axes Coordinated Control
9-7-5 Multi-execution of Motion Control Instructions (Buffer
Y coordinate
End2
Multi-execution of instruction
X coordinate
Velocity
Velocity
• When BufferMode (Buffer Mode Selection) is Blending, the axis moves to position End1, and
then moves to position End2.
Y coordinate
End2
Multi-execution of instruction
• When BufferMode (Buffer Mode Selection) is 0: _mcAborting, the axis moves from End1’ (mul-
ti-execution of instruction) to End2.
9
Mode) for Multi-axes Coordinated Control
9-7-5 Multi-execution of Motion Control Instructions (Buffer
Y coordinate
End2
Multi-execution of instruction
End1
Start1 End1’/ Start2
X coordinate
Velocity
Velocity
The output variable Done, which indicates the end of a motion control instruction, will change to
TRUE for _mcTMCornerSuperimposed when the area of superimposition is completed.
Additional Information
The path linear velocity is constant if the following two conditions are met.
• The target velocities of the current instruction and the buffered instruction are the same.
• The deceleration rate of the current instruction and the acceleration rate of the buffered in-
struction are the same.
Buffer Mode
Transition Mode Blending Blending Blending Blending
Aborting Buffered
Low Previous Next High
Transition Disabled
9
Mode) for Multi-axes Coordinated Control
9-7-5 Multi-execution of Motion Control Instructions (Buffer
You can change the actual position even while an axis is in motion.
If positioning to an absolute value is being executed, positioning will be performed to the target posi-
tion using the new absolute coordinates.
However, the travel distance will stay the same when you position to a relative value.
• When the Count Mode is Rotary Mode, an instruction error will occur if you specify a posi-
tion outside the ring counter range.
• After changing the current position the home will be undefined and you will not be able to use
the following functions and instructions.
Software limits
High-speed homing
Interpolation instructions (linear and circular interpolation)
Busy
Active
Done
Additional Information
You can change the actual position while home is defined by specifying a zero position preset
for the MC_Home or MC_HomeWithParameter instruction.
For details on the MC_SetPosition instruction, refer to the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508).
For details, refer to the MC_SetTorqueLimit instruction in the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508).
You cannot use the torque limit function for an NX-series Pulse Output Unit.
9-8-3 Latching
Latching is used to control positioning based on the position where a trigger signal occurs, such as a
signal from a sensor input. The position of the axis is recorded (i.e., latched) when the trigger signal
occurs.
You can set up to two trigger signals for each axis.
Use the MC_TouchProbe (Enable External Latch) instruction to specify the Trigger Input Condition var-
iable, Window Only variable, and Stopping Mode Selection variable for the axis you want to latch.
In addition to signals that connect to the Servo Drive, you can also specify variables in the user pro-
gram to use as a trigger.
Use the MC_AbortTrigger (Disable External Latch) instruction to abort latching.
You can use latching only with a Servo Drive that support latching (touch probe), such as the OMRON
1S-series Servo Drives, or a GX-EC0211/EC0241 Encoder Input Terminal.
For details on latching, refer to the MC_TouchProbe (Enable External Latch) and MC_AbortTrigger
(Disable External Latch) instructions in the NJ/NX-series Motion Control Instructions Reference
Manual (Cat. No. W508).
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences 9
when you use NX-series Pulse Output Units.
9-8-2 Torque Limit
Linear Mode
• The FirstPosition must be less than or equal to the LastPosition.
• An instruction error will occur if the FirstPosition is greater than the LastPosition.
• An instruction error will occur if a position beyond the position range of Linear Mode is specified.
FirstPosition LastPosition
0x8000000000 0 0x7FFFFFFFFF
Window
Latch enabled range
Rotary Mode
• The FirstPosition can be either equal to or less than the LastPosition, or greater than the LastPo-
sition.
If the FirstPosition is greater than the LastPosition, the setting will straddle the modulo minimum
position setting value.
• An instruction error will occur if a position beyond the upper and lower limits of the ring counter is
specified.
Count value
0x7FFFFFFFFF
Modulo maximum
position setting value
FirstPosition
LastPosition
Modulo minimum position
setting value (= 0)
0
Window
Latch enabled range Latch enabled range
For details on zone monitoring, refer to the MC_ZoneSwitch (Zone Monitor) instruction in the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
During normal positioning, motion is possible within the range of these software limits.
Set software limits to prevent potential damage to machinery caused by mistakes in the user program
or improper operation.
You can use the axis settings of the Sysmac Studio, the MC_Write (Write MC Setting) instruction, or
the MC_WriteAxisParameter (Write Axis Parameters) instruction to set the above axis parameters.
If any setting values are changed for an axis or axes group in operation, those settings are enabled
when the next operation begins.
Software limits function in the following two cases based on the axis operation state and the motion
control instruction that is used.
For details on the instruction to write the MC settings and the instruction to write the axis parameters,
refer to the MC_Write instruction and MC_WriteAxisParameter instruction in the NJ/NX-series Motion
Control Instructions Reference Manual (Cat. No. W508).
Do not execute an instruction for an axis command for a target position that is outside of the
software limit range.
Additional Information
Software limits can be enabled when the Count Mode is set to Linear Mode and home is de-
fined.
Software limits are disabled in the following situations no matter what axis parameters have
been set.
• When Count Mode is set to Rotary Mode.
• When home is not defined.
• During homing.
De-
Parameter name Function Setting range
fault
Following Error Over Set the excessive following error check value. Non-negative long re- 0
Value Set 0 to disable the excessive following error als
check. (Unit: command units)
De-
Parameter name Function Setting range
fault
Following Error Set the following error warning check value. Non-negative long re- 0
Warning Value Set 0 to disable the following error warning check. als
(Unit: command units) that are less than or
equal to the Following
Error Over Value
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
For details on resetting the following error counter, refer to the MC_ResetFollowingError instruction in
the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Axis Parameters That Are Related to Resetting the Following Error Coun-
ter
Setting De-
Parameter name Function
range fault
Immediate Stop In- Set the stopping method in the MC Function Module when the 0, 2, or 0 9
put Stop Method immediate stop input is enabled. 3
0: Immediate stop 9-8-7 Following Error Counter Reset
2: Immediate stop and error reset
3: Immediate stop and Servo OFF
Limit Input Stop Set the stopping method in the MC Function Module when the 0 to 3 0
Method positive limit input or negative limit input is enabled.
0: Immediate stop
1: Deceleration stop
2: Immediate stop and error reset
3: Immediate stop and Servo OFF
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
You can use this monitoring function to program the actions to take when the following error between
axes grows too large for gantry control and other devices where both axes perform the same opera-
tion.
Even if the permitted following error between axes is exceeded, no error will occur in the MC
Function Module.
Check the Invalid output variable to stop axis operation or to take some other action as appro-
priate in the user program.
For details on axis following error monitoring, refer to the MC_AxesObserve (Monitor Axis Following
Error) instruction in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
In-position Range
The following error (absolute
value) is monitored after
positioning finishes.
If the following error is within
the in-position range, Time
positioning is considered
finished.
Velocity
Command velocity
Actual velocity
Time
De-
Parameter name Function Setting range
You can use the axis settings of the Sysmac Studio, the MC_Write (Write MC Setting) instruction,
9
or the MC_WriteAxisParameter (Write Axis Parameters) instruction to set the above axis parame- 9-8-9 In-position Check
ters.
Additional Information
• The in-position check is processed by the MC Function Module. The function in the Servo
Drive is not used.
• Do not set an in-position check time if you want to start the next operation as quickly as pos-
sible without waiting for positioning to finish.
• The value set from the Sysmac Studio is restored if power to the CPU Unit is cycled or the
user program is downloaded with the Synchronization menu command of the Sysmac Studio.
Use the MC_Write (Write MC Setting) and MC_WriteAxisParameter (Write Axis Parameters)
instructions only when you need to temporarily change the in-position check time.
In the descriptions, a variable name _MC_AX[*] is used as an example, but the same information
applies to _MC1_AX[*] and _MC2_AX[*].
Data
Variable name Meaning Function
type
_MC_AX[0-255].Details.Idle BOOL Idle TRUE when processing is not currently
performed for the command value, ex-
cept when waiting for in-position state. *1
Idle and InPosWaiting are mutually exclu-
sive. They cannot both be TRUE at the
same time.
_MC_AX[0-255].Details.InPosWaiting BOOL In-position TRUE when waiting for in-position state.
Waiting The in-position check is performed when
positioning for the in-position check.
*1. This also includes states where processing is performed while in motion at velocity 0, during following
error counter resets, during synchronized control, and during coordinated motion.
You can read Axes Group Variables from the user program to monitor when positioning finishes for
the axes group.
In the descriptions, a variable name _MC_GRP[*] is used as an example, but the same information
applies to _MC1_GRP[*] and _MC2_GRP[*].
Data
Variable name Meaning Function
type
_MC_GRP[0-63].Details.Idle BOOL Idle TRUE when processing is not currently
performed for the command value, ex-
cept when waiting for in-position state. *1
Idle and InPosWaiting are mutually exclu-
sive. They cannot both be TRUE at the
same time.
_MC_GRP[0-63].Details.InposWaiting BOOL In-position TRUE when waiting for in-position state
Waiting for any composition axis. *2
The in-position check is performed when
positioning for the in-position check.
*1. This also includes states where processing is performed while in motion at a velocity of 0.
*2. This variable is FALSE when all composition axes in the axes group are within the in-position ranges set
in the axis parameters.
For details on the instruction to write the MC settings and the instruction to write the axis parame-
ters, refer to the MC_Write (Write MC Setting) and MC_WriteAxisParameter (Write Axis Parame-
ters) instruction in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No.
W508).
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for the differences
when you use NX-series Pulse Output Units.
If the Axis Use axis parameter is set to Unused axis (changeable to used axis) and the Axis Type
parameter is set to a servo axis or virtual servo axis, you can set the axis in an axes group.
A CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher are required.
• Do not attempt to change an axis that is set to Unused axis (unchangeable to used axis) to
a Used axis.
• You cannot set an axis in an axes group if the Axis Use axis parameter is set to Unused
axis (unchangeable to used axis).
For details, refer to the MC_ChangeAxisUse instruction in the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No. W508).
For an application example of the MC_ChangeAxisUse instruction, refer to the NJ/NX-series CPU Unit
Software User’s Manual (Cat. No. W501).
You can use this instruction for an axis that is assigned to an NX-series Position Interface Unit.
The NX Units that can be used are NX-EC0£££ and NX-ECS£££, also must be running the
time stamping.
9
Refer to the MC_DigitalCamSwitch (Enable Digital Cam Switch) instruction in the NJ/NX-series Motion 9-8-11 Enabling Digital Cam Switch
Control Instructions Reference Manual (Cat. No. W508) for details on enabling digital cam switch.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on NX_AryDOut-
TimeStamp instruction.
Refer to the NX-series Digital I/O Units User’s Manual (Cat. No. W521) for Digital Output Unit that sup-
ports time stamp refreshing.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for time stamping and
time stamps.
A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are required to
use this function.
_sMC_POSITION_REF
The followings are the members of _sMC_POSITION_REF type data.
Member Description
User-defined variable.CommandPosition[0] This is an X-axis component for the command current posi-
tion.
This member is assigned a user-defined variable that indi-
cates the X-axis position of the command current position
generated by a user program.
User-defined variable.CommandPosition[1] This is a Y-axis component for the command current posi-
tion.
This member is assigned a user-defined variable that indi-
cates the Y-axis position of the command current position
generated by a user program.
User-defined variable.CommandPosition[2] This is a Z-axis component for the command current posi-
tion.
This member is assigned a user-defined variable that indi-
cates the Z-axis position of the command current position
generated by a user program.
User-defined variable.CommandPosition[3] to Not used.
[5]
User-defined variable.ActualPosition[0] This is an X-axis component for the actual current position.
This member is assigned a user-defined variable that indi-
cates the X-axis position of the actual current position han-
dled in a user program.
User-defined variable.ActualPosition[1] This is a Y-axis component for the actual current position.
This member is assigned a user-defined variable that indi-
cates the Y-axis position of the actual current position han-
dled in a user program.
User-defined variable.ActualPosition[2] This is a Z-axis component for the actual current position.
This member is assigned a user-defined variable that indi-
cates the Z-axis position of the actual current position han-
dled in a user program.
User-defined variable.ActualPosition[3] to [5] Not used.
Each member is assigned a user-defined variable. The followings are the examples.
3D_position.CommandPosition[0] := MCS_Cmd_TransX;
3D_position.CommandPosition[1] := MCS_Cmd_TransY;
3D_position.CommandPosition[2] := MCS_Cmd_TransZ;
3D_position.ActualPosition[0] := MCS_Act_TransX;
3D_position.ActualPosition[1] := MCS_Act_TransY;
3D_position.ActualPosition[2] := MCS_Act_TransZ;
3 Select Specified coordinate in the Type Box in the 3D Machine Model List.
The _sMC_POSITION_REF data type is displayed in the 3D Machine Model Parameter Set-
tings section.
9
4 Set the created user-defined variable in the Value Column in the 3D Machine Model Parameter
System
9-8-12 Displaying 3D Motion Monitor for User Coordinate
Settings section.
6 Start tracing the data with the data trace to sample the data.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on 3D Motion
Monitor Display Mode.
Sample Programming
This section describes basic application methods for homing, error monitoring, and
other functions, and provides programming samples for absolute positioning, cam op-
eration, and other axis operations.
• The sample programming that is provided includes only programming that uses the MC Func-
tion Module.
• When programming actual applications, also program device interlocks, I/O with other devi-
ces, and other control procedures.
• Create a user program that will produce the intended device operation.
• Check the user program for proper execution before you use it for actual operation.
• Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for application
examples for the NX-series Position Interface Units.
10-1-1 Devices
The following devices are used in the sample programming.
Device Manual
CPU Unit and Power Supply Unit NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)
Servo Drive and Servomotor AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communi-
cations User’s Manual (Cat. No. I586)
Encoder Input Terminal GX-series EtherCAT Slave Units User's Manual (Cat. No. W488)
EtherCAT communications ca-
bles
10-1-3 Setup
Refer to the following manual for details on settings.
Setup Manual
Controller Setup NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501)
Motion Control Setup 3-2 Axis Setting Procedure on page 3-10, 5-2 Axis Parameters on page 5-5,
and A-1 Connecting the 1S-series Servo Drive on page A-2 in this man-
ual.
Servo parameters AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communica-
tions User’s Manual (Cat. No. I586)
ples
Precautions for Correct Use
• When you use these programming samples for reference, be sure to add programming for 10
suitable interlocks that suit the operating conditions of the devices.
• Enter the variables that are used in the programming samples from the Programming Layer
in the Edit Pane of the Sysmac Studio.
Ladder Diagram
Check if the Servo Drive is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
ST Programming
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
ples
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
Mc_On BOOL FALSE This variable enables and disables the MC in-
struction. 10
Control programming is not given in this sample.
In actual programming, program controls for the
Timing Chart
Mc_On
StartPg
Pwr_Bsy
Pwr_Status
Ladder Diagram
When Mc_On is TRUE, master control is started.
Mc_On MC
In
0 MCNo
MCR
In
0 MCNo
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
Ladder Diagram
Check if the Servo Drive is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
ples
Error Pwr_Err
ErrorID Pwr_ErrID
10
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
10-2-3 Error Monitoring and Error Resetting for Single-axis Operation and Synchronized Operation
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
If ResetON is TRUE (i.e., when the external button is ON) and the command current velocity is zero, the error is reset.
RESET
MC_Reset
MC_Axis000.Status.ErrorStop MC_Axis000 Reset_D
Axis Axis
Execute Done
ResetON Busy Reset_Bsy
MC_Axis000.Details.Idle
Failure Reset_Fail
Error Reset_Err
ErrorID Reset_ErrID
ST Programming
// Check that the Servo Drive is ready when StartPg is TRUE and turn ON the Servo f
or axis 0.
// If the Servo Drive is not ready, turn OFF the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If ResetON is TRUE (i.e., when the external button is ON) and the command curren
t velocity is zero, the error is reset.
IF (ResetOn=TRUE)
AND (MC_Axis000.Status.ErrorStop=TRUE)
AND (MC_Axis000.Details.Idle=TRUE) THEN
Reset_Ex := TRUE; // Minor fault is reset.
END_IF;
// MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
// MC_Reset
RESET(
Axis := MC_Axis000,
Execute := Reset_Ex,
Done => Reset_D,
Busy => Reset_Bsy,
Failure => Reset_Fai,
Error => Reset_Err,
ErrorID => Reset_ErrID
);
ples
MC_Axis001.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 1.
MC_Axis001.Details.Homed BOOL FALSE TRUE when home is defined for axis 1. 10
Pwr1_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR1 instance of the
10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation
MC_Power instruction.
It is TRUE when the Servo is ON.
Pwr2_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR2 instance of the
MC_Power instruction.
It is TRUE when the Servo is ON.
StartPg BOOL FALSE When this variable is TRUE, the Servo is
turned ON if EtherCAT process data communi-
cations are active and normal.
ResetON BOOL FALSE This variable gives the status of the external
button that is used to reset errors.
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
Check if the Servo Drive for axis 1 is ready when StartPg is TRUE.
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR1
MC_Power
Lock1 MC_Axis000 Axis Axis Pwr1_Status
Enable Status
Busy Pwr1_Bsy
Error Pwr1_Err
ErrorID Pwr1_ErrID
If the Servo Drive for axis 1 is ready, turn ON the Servo for axis 1.
PWR2
MC_Power
Lock2 MC_Axis001 Axis Axis Pwr2_Status
Enable Status
Busy Pwr2_Bsy
Error Pwr2_Err
ErrorID Pwr2_ErrID
If a minor fault level error occurs for any of the composition axes in the axes group, the error handler for the
device (FaultHandler) is executed. Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
MC_Axis001.MFaultLvl.Active
MC_Group000.MFaultLvl.Active
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM1
MC_Home
Pwr1_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm1_D
Execute Done
Busy Hm1_Bsy
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed.
HM2
MC_Home
Pwr2_Status MC_Axis001.Details.Homed MC_Axis001 Axis Axis Hm2_D
Execute Done
Busy Hm2_Bsy
CommandAborted Hm2_Ca
Error Hm2_Err
ErrorID Hm2_ErrID
The status of the axes group and the status of home for axis 0 and axis 1 are checked.
ples
Busy Grp_En_Bsy
CommandAborted Grp_En_Ca
Error Grp_En_Err
ErrorID Grp_En_ErrID 10
10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation
If there is a minor fault level error for the axes group, the axes group is disabled.
GRP_DIS
MC_GroupDisable
MC_Group000.MFaultLvl.Active MC_Group000 AxesGroup AxesGroup Grp_Dis_D
Execute Done
Busy Grp_Dis_Bsy
CommandAborted Grp_Dis_Ca
Error Grp_Dis_Err
ErrorID Grp_Dis_ErrID
If the external button is ON, the status of ResetON and the status of axes group motion is checked.
If ResetON is TRUE and the axes group is stopped, the error is reset.
GRP_RESET
MC_GroupReset
Lock4 MC_Group000 AxesGroup AxesGroup Grp_Reset_D
Execute Done
Busy Grp_Reset_Bsy
Failure Grp_Reset_Failure
Error Grp_Reset_Err
ErrorID Grp_Reset_ErrID
ST Programming
// Check that the Servo Drive is ready when StartPg is TRUE and turn ON the Servo f
or axis 0.
// If the Servo Drive is not ready, turn OFF the Servo for axis 0.
IF (StartPg =TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr1_En :=TRUE; // Turn ON the Servo for axis 0.
ELSE
Pwr1_En :=FALSE;// Turn OFF the Servo for axis 0.
END_IF;
// Check that the Servo Drive is ready when StartPg is TRUE and turn ON the Servo f
or axis 1.
// If the Servo Drive is not ready, turn OFF the Servo for axis 1.
IF (StartPg =TRUE)
AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN
Pwr2_En :=TRUE; // Turn ON the Servo for axis 1.
ELSE
Pwr2_En :=FALSE; // Turn OFF the Servo for axis 1.
END_IF;
// If there is a minor fault level error for a composition axis in the axes group,
execute the error handler (FaultHandler).
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Group000.MFaultLvl.Active=TRUE) THEN
FaultHandler(); // Program the FaultHandler according to the device.
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex := TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex := TRUE;
END_IF;
// If the axes group is disabled and home is defined for axis 0 and axis 1, the axe
s group is enabled.
IF (MC_Group000.Status.Disabled=TRUE) AND (Hm1_D=TRUE) AND (Hm2_D=TRUE) THEN
Grp_En_Ex := TRUE;
END_IF;
// If there is a minor fault level error for the axes group, the axes group is disa
bled.
IF MC_Group000.MFaultLvl.Active=TRUE THEN
Grp_Dis_Ex :=TRUE;
END_IF;
// If ResetON is TRUE (i.e., if the external button is ON) and the axes group is st
opped, the error is reset.
IF (ResetON=TRUE)
AND (MC_Group000.Status.ErrorStop=TRUE)
AND (MC_Group000.Details.Idle=TRUE) THEN
Grp_Reset_Ex := TRUE;
//MC_Power1
PWR1(
Axis := MC_Axis000,
ples
Enable := Pwr1_En,
Status => Pwr1_Status,
Busy => Pwr1_Bsy, 10
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation
);
//MC_Power2
PWR2(
Axis := MC_Axis001,
Enable := Pwr2_En,
Status => Pwr2_Status,
Busy => Pwr2_Bsy,
Error => Pwr2_Err,
ErrorID => Pwr2_ErrID
);
// MC_Home1
HM1(
Axis := MC_Axis000,
Execute := Hm1_Ex,
Done => Hm1_D,
Busy => Hm1_Bsy,
CommandAborted => Hm1_Ca,
Error => Hm1_Err,
ErrorID => Hm1_ErrID
);
// MC_Home2
HM2(
Axis := MC_Axis001,
Execute := Hm2_Ex,
Done => Hm2_D,
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca,
Error => Hm2_Err,
ErrorID => Hm2_ErrID
);
//MC_GroupEnable
GRP_EN(
AxesGroup := MC_Group000,
Execute := Grp_En_Ex,
Done => Grp_En_D,
Busy => Grp_En_Bsy,
CommandAborted => Grp_En_Ca,
Error => Grp_En_Err,
ErrorID => Grp_En_ErrID
);
//MC_GroupDisable
GRP_DIS(
AxesGroup := MC_Group000,
Execute := Grp_Dis_Ex,
Done => Grp_Dis_D,
Busy => Grp_Dis_Bsy,
CommandAborted => Grp_Dis_Ca,
Error => Grp_Dis_Err,
ErrorID => Grp_Dis_ErrID
);
//MC_GroupReset
GRP_RESET(
AxesGroup := MC_Group000,
Execute := Grp_Reset_Ex,
Done => Grp_Reset_D,
Busy => Grp_Reset_Bsy,
Failure => Grp_Reset_Fai,
Error => Grp_Reset_Err,
ErrorID => Grp_Reset_ErrID
);
Ladder Diagram
ples
Check if the Servo Drive is ready when StartPg is TRUE.
Lock0
StartPg MC_Axis000.DrvStatus.Ready
10
A check is made to see if any errors occurred when MC_Power was executed before execution of further processing.
Pwr_Status UpgOn
Pwr_Bsy
ST Programming
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
// If the Servo Drive is not ready, turn OFF the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En :=TRUE;
ELSE
Pwr_En :=FALSE;
END_IF;
// MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Ladder Diagram
In this sample, the MC_Reset (Reset Axis Error) instruction is executed if an external button turns ON
(i.e., if ResetOn changes to TRUE) while there is a minor fault level error.
RESET
MC_Reset
ResetOn MC_Axis000.MFaultLvl.Active MC_Axis000 Axis Axis Reset_D
Execute Done
Busy Reset_Bsy
Failure Reset_Fail
Error Reset_Err
ErrorID Reset_ErrID
ples
If a minor fault level error did not occur or was reset, normal device processing (RegularProcess) is performed.
Program GetFaultFactor according to the device. 10
MC_Axis000.MFaultLvl.Active RegularProcess
ST Programming
// If the external button is ON (i.e., if ResetOn changes to TRUE) while there is a
minor fault level error, the MC_Reset (Reset Axis Error) instruction is executed.
IF (MC_Axis000.MFaultLvl.Active=TRUE) AND (ResetOn=TRUE) THEN
Reset_Ex := TRUE; // Minor fault is reset.
ELSE
Reset_Ex := FALSE;
END_IF;
// If the Failure output variable from the MC_Reset instruction changes to TRUE, pr
ocessing is performed to read the cause of the error with GetFaultFactor.
// Program GetFaultFactor according to the device.
IF (MC_Axis000.MFaultLvl.Active=TRUE) AND (Reset_Fail=TRUE) THEN
GetFaultFactor();
END_IF;
// If a minor fault level error did not occur or was reset, normal device processin
g (RegularProcess) is performed.
// Program RegularProcess according to the device.
IF MC_Axis000.MFaultLvl.Active=FALSE THEN
RegularProcess();
END_IF;
// MC_Reset
RESET(
Axis := MC_Axis000,
Execute := Reset_Ex,
Done => Reset_D,
Busy => Reset_Bsy,
Failure => Reset_Fail,
Error => Reset_Err,
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
ples
Error Pwr_Err
ErrorID Pwr_ErrID
10
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed for axis 0.
HM
MC_Home
Pwr_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm_D
Execute Done
Busy Hm_Bsy
CommandAborted Hm_Ca
Error Hm_Err
ErrorID Hm_ErrID
After homing is completed for axis 0, the MC_MoveAbsolute (Absolute Positioning) instruction is executed.
MV_ABS
MC_MoveAbsolute
Hm_D MC_Axis000 Axis Axis Mv_Abs_D
Execute Done
LREAL#10000.0 Position Busy Mv_Abs_Bsy
LREAL#500.0 Velocity Active Mv_Abs_Act
LREAL#500.0 Acceleration CommandAborted Mv_Abs_Ca
LREAL#500.0 Deceleration Error Mv_Abs_Err
Jerk ErrorID Mv_Abs_ErrID
_eMC_DIRECTION#_mcPositiveDirection Direction
BufferMode
If the Error or CommandAborted output variable from the MC_Stop instruction changes to TRUE,
the MC_ImmediateStop instruction is executed to stop immediately.
IMD_STP
MC_ImmediateStop
Stp_Err MC_Axis000 Axis Axis Imd_Stp_D
Execute Done
_eMC_STOP_MODE#_mcFreeRunStop StopMode Busy Imd_Stp_Bsy
Stp_Ca
CommandAborted Imd_Stp_Ca
Error Imd_Stp_Err
ErrorID Imd_Stp_ErrID
ST Programming
// If the input parameters for absolute positioning and stopping are not set, the t
arget values and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveAbsolute (Absolute Positioning) instructio
n are set.
Mv_Abs_Pos := LREAL#10000.0;
Mv_Abs_Vel := LREAL#500.0;
Mv_Abs_Acc := LREAL#500.0;
Mv_Abs_Dec := LREAL#500.0;
Mv_Abs_Dir := _eMC_DIRECTION#_mcPositiveDirection;
// The input parameters for the MC_Stop instruction are set.
Stp_Dec:=LREAL#5000.0;
// The input parameters for the MC_Immediate Stop instruction are set.
Imd_Stp_SM :=_eMC_STOP_MODE#_mcFreeRunStop;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En :=TRUE;
ELSE
Pwr_En :=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
ples
// If homing is completed, absolute positioning is executed.
IF Hm_D=TRUE THEN
Mv_Abs_Ex := TRUE; 10
END_IF;
// If the Error or CommandAborted output variable from the MC_Stop instruction chan
ges to TRUE, the MC_ImmediateStop instruction is executed to stop immediately.
IF (Stp_Err=TRUE) OR (Stp_Ca=TRUE) THEN
Imd_Stp_Ex :=TRUE;
END_IF;
//MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
//MC_Home
HM(
Axis := MC_Axis000,
Execute := Hm_Ex,
Done => Hm_D,
Busy => Hm_Bsy,
CommandAborted => Hm_Ca,
Error => Hm_Err,
ErrorID => Hm_ErrID
);
//MC_MoveAbsolute
MV_ABS(
Axis := MC_Axis000,
Execute := Mv_Abs_Ex,
Position := Mv_Abs_Pos,
Velocity := Mv_Abs_Vel,
Acceleration := Mv_Abs_Acc,
Deceleration := Mv_Abs_Dec,
Direction := Mv_Abs_Dir,
Done => Mv_Abs_D,
Busy => Mv_Abs_Bsy,
Active => Mv_Abs_Act,
CommandAborted => Mv_Abs_Ca,
Error => Mv_Abs_Err,
ErrorID => Mv_Abs_ErrID
);
//MC_Stop
STP(
Axis := MC_Axis000,
Execute := Stp_Ex,
Deceleration := Stp_Dec,
Done => Stp_D,
Busy => Stp_Bsy,
Active => Stp_Act,
CommandAborted => Stp_Ca,
Error => Stp_Err,
ErrorID => Stp_ErrID
);
//MC_ImmediateStop
IMD_STP(
Axis := MC_Axis000,
Execute := Imd_Stp_Ex,
StopMode := Imd_Stp_SM,
Done => Imd_Stp_D,
Busy => Imd_Stp_Bsy,
CommandAborted => Imd_Stp_Ca,
Error => Imd_Stp_Err,
ErrorID => Imd_Stp_ErrID
);
ples
EF 0.
MC_Group000.Status.Disabled BOOL FALSE TRUE when axes group 0 is disabled.
MC_Group000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axes group 0. 10
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
Check if the Servo Drive for axis 1 is ready when StartPg is TRUE.
StartPg MC_Axis001.DrvStatus.Ready Lock1
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR1
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr1_Status
Enable Status
Busy Pwr1_Bsy
Error Pwr1_Err
ErrorID Pwr1_ErrID
If the Servo Drive for axis 1 is ready, turn ON the Servo for axis 1.
PWR2
MC_Power
Lock1 MC_Axis001 Axis Axis Pwr2_Status
Enable Status
Busy Pwr2_Bsy
Error Pwr2_Err
ErrorID Pwr2_ErrID
If a minor fault level error occurs for the axes group, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
MC_Axis001.MFaultLvl.Active
MC_Group000.MFaultLvl.Active
ples
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
10
After home is defined for axis 0 and axis 1, the axes group is enabled.
GRP_EN
MC_GroupEnable
Hm1_D Hm2_D MC_Group000 AxesGroup AxesGroup Grp_En_D
Execute Done
MC_Group000.Status.Disabled Busy Grp_En_Bsy
CommandAborted Grp_En_Ca
Error Grp_En_Err
ErrorID Grp_En_ErrID
The input parameters for the MC_MoveLinearAbsolute and MC_GroupStop instructions are set.
InitFlag 1 // Parameters for MC_MoveLinearAbsolute
2 Mv_Lin_Abs_Pos [0] := LREAL#3000
3 Mv_Lin_Abs_Pos [1] := LREAL#3000
4 Mv_Lin_Vel := LREAL#1000
5 Mv_Lin_Abs_Acc := LREAL#1000
6 Mv_Lin_Abs_Dec := LREAL#1000.0;
7 Mv_Lin_Abs_Jrk := LREAL#1000.0;
8 // Parameters for MC_GroupStop
9 Grp_Stp_Dec := LREAL#1000.0;
10 Grp_Stp_Jrk := LREAL#1000.0;
11 InitFlag:=TRUE; // InitFlag is made TRUE.
If the external button turns ON (i.e., StopOn changes to TRUE) during execution of linear interpolation,
the MC_GroupStop instruction is executed to decelerate the axes to a stop.
GRP_STP
MC_GroupStop
StopOn MC_Group000.Status.Moving MC_Group000 AxesGroup AxesGroup Grp_Stp_D
Execute Done
Grp_Stp_Dec Deceleration Busy Grp_Stp_Bsy
Jerk Active Grp_Stp_Act
BufferMode CommandAborted Grp_Stp_Ca
Error Grp_Stp_Err
ErrorID Grp_Stp_ErrID
ST Programming
// If the input parameters for absolute linear interpolation and stopping the axes
group are not set, the target values and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveLinearAbsolute (Absolute Linear Interpolat
ion) instruction are set.
Mv_Lin_Abs_Pos[0] := LREAL#3000.0;
Mv_Lin_Abs_Pos[1] := LREAL#3000.0;
Mv_Lin_Abs_Vel := LREAL#1000.0;
Mv_Lin_Abs_Acc := LREAL#1000.0;
Mv_Lin_Abs_Dec := LREAL#1000.0;
Mv_Lin_Abs_Jrk := LREAL#1000.0;
// The input parameters for the MC_GroupStop instruction are set.
ples
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
// If the Servo Drive is not ready, turn OFF the Servo for axis 0. 10
IF (StartPg =TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 1.
// If the Servo Drive is not ready, turn OFF the Servo for axis 1.
IF (StartPg =TRUE)
AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN
Pwr2_En :=TRUE; // Turn ON the Servo for axis 1.
ELSE
Pwr2_En :=FALSE; // Turn OFF the Servo for axis 1.
END_IF;
// If a minor fault level error occurs, the error handler for the device (FaultHand
ler) is executed.
// Program the FaultHandler according to the device.
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Group000.MFaultLvl.Active=TRUE) THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed for axis 0.
IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex :=TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction i
s executed for axis 1.
IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex := TRUE;
END_IF;
// If home is defined for axis 0 and axis 1 and the axes group is disabled, the axe
s group is enabled.
// If the external button turns ON (i.e., StopOn changes to TRUE) during execution
of absolute linear interpolation, the axes group is stopped.
IF (MC_Group000.Status.Moving=TRUE) AND (StopOn=TRUE) THEN
Grp_Stp_Ex := TRUE;
END_IF;
// If the CommandAborted or Error output variable from the Group Stop instruction a
re TRUE, the axes group is stopped immediately.
IF (Grp_Stp_Ca=TRUE) OR (Grp_Stp_Err=TRUE) THEN
Grp_Imd_Stp_Ex :=TRUE;
END_IF;
//MC_Power
PWR1(
Axis := MC_Axis000,
Enable := Pwr1_En,
Status => Pwr1_Status,
Busy => Pwr1_Bsy,
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
);
PWR2(
Axis := MC_Axis001,
Enable := Pwr2_En,
Status => Pwr2_Status,
Busy => Pwr2_Bsy,
Error => Pwr2_Err,
ErrorID => Pwr2_ErrID
);
//MC_Home
HM1(
Axis := MC_Axis000,
Execute := Hm1_Ex,
Done => Hm1_D,
Busy => Hm1_Bsy,
CommandAborted => Hm1_Ca,
HM2(
ples
Axis := MC_Axis001,
Execute := Hm2_Ex,
Done => Hm2_D, 10
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca,
//MC_GroupEnable
GRP_EN(
AxesGroup := MC_Group000,
Execute := Grp_En_Ex,
Done => Grp_En_D,
Busy => Grp_En_Bsy,
CommandAborted => Grp_En_Ca,
Error => Grp_En_Err,
ErrorID => Grp_En_ErrID
);
//MC_MoveLinearAbsolute
MV_LIN_ABS(
AxesGroup := MC_Group000,
Execute := Mv_Lin_Abs_Ex,
Position := Mv_Lin_Abs_Pos,
Velocity := Mv_Lin_Abs_Vel,
Acceleration := Mv_Lin_Abs_Acc,
Deceleration := Mv_Lin_Abs_Dec,
Jerk := Mv_Lin_Abs_Jrk,
Done => Mv_Lin_Abs_D,
Busy => Mv_Lin_Abs_Bsy,
Active => Mv_Lin_Abs_Act,
CommandAborted => Mv_Lin_Abs_Ca,
Error => Mv_Lin_Abs_Err,
ErrorID => Mv_Lin_Abs_ErrID
);
//MC_GroupStop
GRP_STP(
AxesGroup := MC_Group000,
Execute := Grp_Stp_Ex,
Deceleration := Grp_Stp_Dec,
//MC_GroupImmediateStop
GRP_IMD_STP(
AxesGroup := MC_Group000,
Execute := Grp_Imd_Stp_Ex,
Done => Grp_Imd_Stp_D,
Busy => Grp_Imd_Stp_Bsy,
CommandAborted => Grp_Imd_Stp_Ca,
Error => Grp_Imd_Stp_Err,
ErrorID => Grp_Imd_Stp_ErrID
);
ON
Negative limit input signal
OFF
ON
Home proximity input signal
OFF
ON
Home input signal
OFF
ples
Main Variables Used in the Programming Samples 10
Variable name Data type Default Comment
Timing Chart
Ladder Diagram
Pwr_Status
HM.Execute
Hm_D
Hm_Bsy
MV_ABS.Execute
Mv_Abs_D
Mv_Abs_Bsy
Mv_Abs_Act
MC_Axis000.Status.Standstill
MC_Axis000.Dtails.Homed
ST Programming
Pwr_Status
Hm_Ex
Hm_D
Hm_Bsy
Mv_Abs_Ex
Mv_Abs_D
Mv_Abs_Bsy
Mv_Abs_Act
MC_Axis000.Status.Standstill
MC_Axis000.Dtails.Homed
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr_Status
Enable Status
Busy Pwr_Bsy
Error Pwr_Err
ErrorID Pwr_ErrID
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
ples
Busy Hm_Bsy
CommandAborted Hm_Ca
Error Hm_Err
ErrorID Hm_ErrID
10
ST Programming
// If the input parameters for absolute positioning are not set, the target values
and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveAbsolute (Absolute Positioning) instructio
n are set.
Mv_Abs_Pos := LREAL#50000.0;
Mv_Abs_Vel := LREAL#10000.0;
Mv_Abs_Acc := LREAL#1000.0;
Mv_Abs_Dec := LREAL#1000.0;
Mv_Abs_Dir := _eMC_DIRECTION#_mcShortestWay;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex :=TRUE;
ELSE
Hm_Ex :=FALSE;
END_IF;
//MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
//MC_Home
HM(
Axis := MC_Axis000,
Execute := Hm_Ex,
Done => Hm_D,
Busy => Hm_Bsy,
CommandAborted => Hm_Ca,
Error => Hm_Err,
ErrorID => Hm_ErrID
);
//MC_MoveAbsolute
MV_ABS(
Axis := MC_Axis000,
Execute := Mv_Abs_Ex,
Position := Mv_Abs_Pos,
Velocity := Mv_Abs_Vel,
Acceleration := Mv_Abs_Acc,
ples
CommandAborted => Mv_Abs_Ca,
Error => Mv_Abs_Err,
ErrorID => Mv_Abs_ErrID 10
);
Timing Chart
Ladder Diagram
Pwr_Status
Hm_D
Hm_Bsy
Mv_Abs_Ex
Mv_Abs_D
Mv_Abs_Bsy
Mv_Abs_Act
ReExeSw
Command position
Time
Command velocity
Time
Hm_Ex
ples
Hm_D
Hm_Bsy
10
Mv_Abs_Ex
Mv_Abs_Bsy
Mv_Abs_Act
ReExeSw
Command position
Time
Command velocity
Time
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr_Status
Enable Status
Busy Pwr_Bsy
Error Pwr_Err
ErrorID Pwr_ErrID
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM
MC_Home
Pwr_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm_D
Execute Done
Busy Hm_Bsy
CommandAborted Hm_Ca
Error Hm_Err
ErrorID Hm_ErrID
After home is defined for axis 0, absolute positioning is executed if it is not already in progress.
When ReExeSw changes to TRUE, the absolute positioning instruction is re-executed to change the target position to 2000.
Restart_Ex
ST Programming
// If the input parameters for absolute positioning are not set, the target values
and other parameters are set.
IF InitFlag = FALSE THEN
// Parameters for MC_MoveAbsolute
Mv_Abs_Pos := LREAL#1000.0;
ples
InitFlag := TRUE;
END_IF;
10
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
// If a minor fault level error occurs for axis 0, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex :=TRUE;
END_IF;
//MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
//MC_Home
HM(
Axis := MC_Axis000,
Execute := Hm_Ex,
Done => Hm_D,
Busy => Hm_Bsy,
CommandAborted => Hm_Ca,
Error => Hm_Err,
ErrorID => Hm_ErrID
);
//MC_MoveAbsolute
MV_ABS(
Axis := MC_Axis000,
Execute := Mv_Abs_Ex,
Position := Mv_Abs_Pos,
Velocity := Mv_Abs_Vel,
Acceleration := Mv_Abs_Acc,
Deceleration := Mv_Abs_Dec,
Direction := Mv_Abs_Dir,
Done => Mv_Abs_D,
Busy => Mv_Abs_Bsy,
Active => Mv_Abs_Act,
CommandAborted => Mv_Abs_Ca,
Error => Mv_Abs_Err,
ErrorID => Mv_Abs_ErrID
);
ples
Velocity control Interrupt feeding
Velocity
10
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr_Status
Enable Status
Busy Pwr_Bsy
Error Pwr_Err
ErrorID Pwr_ErrID
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM
MC_Home
Pwr_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm_D
Execute Done
Busy Hm_Bsy
CommandAborted Hm_Ca
Error Hm_Err
ErrorID Hm_ErrID
MV_FEED
MC_MoveFeed
MC_Axis000 Axis Axis
MvFeed_TrigRef TriggerInput TriggerInput
ples
Hm_D Mv_Feed_TrigVar TriggerVariable TriggerVariable Mv_Feed_D
Execute Done
WindowOnly InFeed Mv_Feed_InFeed
FirstPosition Busy Mv_Feed_Bsy 10
LastPosition Active Mv_Feed_Act
ReferenceType CommandAborted Mv_Feed_Ca
ST Programming
// If the input parameters for interrupt feeding are not set, the target values and
other parameters are set.
IF InitFlag=FALSE THEN
// Parameters for MC_MoveFeed
Mv_Feed_TrigRef.Mode := _eMC_TRIGGER_MODE#_mcDrive;
Mv_Feed_TrigRef.LatchID := _eMC_TRIGGER_LATCH_ID#_mcLatch1;
Mv_Feed_TrigRef.InputDrive := _eMC_TRIGGER_INPUT_DRIVE#_mcEncoderMark;
Mv_Feed_TrigVar := FALSE;
Mv_Feed_Pos := LREAL#2000.0;
Mv_Feed_Vel := LREAL#1000.0;
Mv_Feed_Acc := LREAL#10000.0;
Mv_Feed_Dec := LREAL#10000.0;
Mv_Feed_Dir := _eMC_DIRECTION#_mcCurrentDirection;
Mv_Feed_Mm := _eMC_MOVE_MODE#_mcVelocity;
Mv_Feed_FeedDis := LREAL#500.0;
Mv_Feed_FeedVel := LREAL#500.0;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex :=TRUE;
END_IF;
// MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
// MC_Home
HM(
Axis := MC_Axis000,
Execute := Hm_Ex,
Done => Hm_D,
Busy => Hm_Bsy,
CommandAborted => Hm_Ca,
Error => Hm_Err,
ErrorID => Hm_ErrID
);
//MC_MoveFeed
MV_FEED(
Axis := MC_Axis000,
TriggerInput := Mv_Feed_TrigRef,
TriggerVariable := Mv_Feed_TrigVar,
ples
Direction := Mv_Feed_Dir,
MoveMode := Mv_Feed_Mm,
FeedDistance := Mv_Feed_FeedDis, 10
FeedVelocity := Mv_Feed_FeedVel,
Done => Mv_Feed_D,
Timing Chart
Ladder Diagram
CamTable0
CamTable1
MV_ABS Mv_Abs_Act
CAMIN CAMIN.Execute
Camin_Bsy
Camin_Act
Camin_InCam0
Camin_InCam1
Camin_InSync
CamProfile0 CamProfile1
ples
CamTable0
10
CamTable1
CAMIN Camin_Ex
Camin_Bsy
Camin_Act
Camin_InCam0
Camin_InCam1
Camin_InSync
CamProfile0 CamProfile1
Ladder Diagram
To change from one cam table to another, two instances of the MC_CamIn (Start Cam Operation) in-
struction with the same instance name are used.
A different output parameter is assigned to the InCam (Cam Motion) output variable from each in-
stance. An error will occur if you assign the same output parameter.
In this sample, a JMP (Jump) instruction is used so that both instances are not executed at the same
time.
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
Check if the Servo Drive for axis 1 is ready when StartPg is TRUE.
StartPg MC_Axis001.DrvStatus.Ready Lock1
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR1
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr1_Status
Enable Status
Busy Pwr1_Bsy
Error Pwr1_Err
ErrorID Pwr1_ErrID
If the Servo Drive for axis 1 is ready, turn ON the Servo for axis 1.
PWR2
MC_Power
Lock1 MC_Axis001 Axis Axis Pwr2_Status
Enable Status
Busy Pwr2_Bsy
Error Pwr2_Err
ErrorID Pwr2_ErrID
If a minor fault level error occurs for axis 0 or axis 1, the error handler for the device (FaultHandler) is
executed. Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
MC_Axis001.MFaultLvl.Active
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM1
MC_Home
Pwr1_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm1_D
Execute Done
Busy Hm1_Bsy
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed.
HM2
MC_Home
Pwr2_Status MC_Axis001.Details.Homed MC_Axis001 Axis Axis Hm2_D
Execute Done
Busy Hm2_Bsy
CommandAborted Hm2_Ca
Error Hm2_Err
ErrorID Hm2_ErrID
ples
LREAL#10000.0 Position Busy Mv_Abs_Bsy
LREAL#2000.0 Velocity Active Mv_Abs_Act
LREAL#2000.0 Acceleration CommandAborted Mv_Abs_Ca
LREAL#2000.0 Deceleration Error Mv_Abs_Err 10
Jerk ErrorID Mv_Abs_ErrID
_eMC_DIRECTION#_mcPositiveDirection Direction
If the command position for axis 0 is 5000 or less, CamTable0 is changed to TRUE and CamTable1 is changed to
FALSE. If it is over 5000, CamTable0 is changed to FALSE and CamTable1 is changed to TRUE.
1 IF MC_Axis000.Cmd.Pos<=LREAL#5000.0 THEN
2 CamTable0:=BOOL#TRUE;
3 CamTable1:=BOOL#FALSE;
4 ELSE
5 CamTable0:=BOOL#FALSE;
6 CamTable1:=BOOL#TRUE;
7 END_IF;
If CamTable0 is TRUE during absolute positioning, then the instance that uses CamProfile0
for the cam table is executed.
If InCam is TRUE, then Execute is changed to FALSE.
CamTable0 SkipCamTable0
CAMIN
MC_CamIn
MC_Axis000 Master Master
MC_Axis001 Slave Slave
Lock3 CamProfile0 CamTable CamTable CamIn_InCam0
Execute InCam
BOOL#TRUE Periodic InSync CamIn_InSync
_eMC_START_MODE#_mcAbsolutePosition StartMode EndOfProfile CamIn_Eop
LREAL#1.0 StartPosition Index CamIn_Index
LREAL#1.0 MasterStartDistance Busy CamIn_Bsy
LREAL#1.0 MasterScaling Active CamIn_Act
LREAL#1.0 SlaveScaling CommandAborted CamIn_Ca
LREAL#0.0 MasterOffset Error CamIn_Err
LREAL#0.0 SlaveOffset ErrorID CamIn_ErrID
_eMC_REFERENCE_TYPE#_mcCommand ReferenceType
_eMC_DIRECTION#_mcNoDirection Direction
CamTransition
BufferMode
If CamTable1 is TRUE during absolute positioning, then the instance that uses CamProfile1
for the cam table is executed.
SkipCamTable0
CamTable1 SkipCamTable1
CAMIN
MC_CamIn
MC_Axis000 Master Master
MC_Axis001 Slave Slave
Mv_Abs_Act CamTable1 CamProfile1 CamTable CamTable CamIn_InCam1
Execute InCam
BOOL#TRUE Periodic InSync CamIn_InSync
_eMC_START_MODE#_mcAbsolutePosition StartMode EndOfProfile CamIn_Eop
LREAL#1.0 StartPosition Index CamIn_Index
LREAL#1.0 MasterStartDistance Busy CamIn_Bsy
LREAL#1.0 MasterScaling Active CamIn_Act
LREAL#1.0 SlaveScaling CommandAborted CamIn_Ca
LREAL#0.0 MasterOffset Error CamIn_Err
LREAL#0.0 SlaveOffset ErrorID CamIn_ErrID
_eMC_REFERENCE_TYPE#_mcCommand ReferenceType
_eMC_DIRECTION#_mcNoDirection Direction
CamTransition
BufferMode
SkipCamTable1
End
EN ENO
ples
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveAbsolute (Absolute Positioning) instructio
n are set.
Mv_Abs_Pos := LREAL#10000.0;
10
Mv_Abs_Vel := LREAL#2000.0;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr1_En:=TRUE;
ELSE
Pwr1_En:=FALSE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 1.
IF (StartPg=TRUE)
AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN
Pwr2_En :=TRUE;
ELSE
Pwr2_En :=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0 or axis 1, the error handler for
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr1_S=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex :=TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction i
s executed.
IF (Pwr2_S=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex :=TRUE;
END_IF;
// If the command position for axis 0 is 5000 or less, CamTable0 is changed to TRUE
and CamTable1 is changed to FALSE.
// If it exceeds 5000, CamTable0 is changed to FALSE and CamTable1 is changed to TR
UE.
IF MC_Axis000.Cmd.Pos<=LREAL#5000.0 THEN
CamTable0 :=BOOL#TRUE;
CamTable1 :=BOOL#FALSE;
ELSE
CamTable0 :=BOOL#FALSE;
CamTable1 :=BOOL#TRUE;
END_IF;
// If CamTable0 is TRUE during absolute positioning, use CamProfile0 for the cam ta
ble.
// Execute the instance.
// If InCam is TRUE, Execute is changed to FALSE.
IF (Mv_Abs_Act=TRUE)
AND (CamTable0=TRUE)
AND (Camin_InCam0=FALSE) THEN
Camin_Ex := TRUE;
ELSE
Camin_Ex := FALSE;
END_IF;
ples
END_IF;
//MC_Camin 10
IF CamTable0=TRUE THEN
CAMIN(
IF CamTable1=TRUE THEN
CAMIN(
Master := MC_Axis000,
Slave := MC_Axis001,
CamTable := CamProfile1,
Execute := Camin_Ex,
Periodic := Camin_EM,
StartMode := Camin_StMode,
StartPosition := Camin_StPos,
MasterStartDistance := Camin_MStDis,
MasterScaling := Camin_MSc,
SlaveScaling := Camin_SSc,
MasterOffset := Camin_MO,
SlaveOffset := Camin_SO,
ReferenceType := Camin_RT,
Direction := Camin_Dir,
InCam => Camin_InCam1,
InSync => Camin_InSync,
EndOfProfile => Camin_EOP,
Index => Camin_Index,
Busy => Camin_Bsy,
Active => Camin_Act,
CommandAborted => Camin_Ca,
Error => Camin_Err,
ErrorID => Camin_ErrID
);
END_IF;
ples
Done => Hm2_D,
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca, 10
Error => Hm2_Err,
ErrorID => Hm2_ErrID
//MC_MoveAbsolute
MV_ABS(
Axis := MC_Axis000,
Execute := Mv_Abs_Ex,
Position := Mv_Abs_Pos,
Velocity := Mv_Abs_Vel,
Acceleration := Mv_Abs_Acc,
Deceleration := Mv_Abs_Dec,
Direction := Mv_Abs_Dir,
Done => Mv_Abs_D,
Busy => Mv_Abs_Bsy,
Active => Mv_Abs_Act,
CommandAborted => Mv_Abs_Ca,
Error => Mv_Abs_Err,
ErrorID => Mv_Abs_ErrID
);
Synchronized motion with gear operation instructions Synchronized motion with cam operation instructions
Master axis: MC_Axis000 Master axis: MC_Axis000
Slave axis: MC_Axis001 Slave axis: MC_Axis002
Setting
Parameter name
Axis 1 Axis 2 Axis 3 Axis 4
Axes variable name MC_Axis000 MC_Axis001 MC_Axis002 MC_Axis003
Axis type Servo axis Virtual servo axis Virtual servo axis Servo axis
Ladder Diagram
ples
VEL Vel_InVel
GEARIN GEARIN.Execute
10
Gearin_InGear
Gearin_Bsy
CAMIN CAMIN.Execute
Camin_InCam
Camin_InSync
Camin_Bsy
Camin_Act
COMBINE COMBINE.Execute
Combine_Bsy
Combine_Act
Position
MC_Axis000
MC_Axis001
MC_Axis002
MC_Axis003
Time
ST Programming
VEL Vel_InVel
GEARIN Gearin_Ex
Gearin_InGear
Gearin_Bsy
Gearin_Act
CAMIN Camin_Ex
Camin_InCam
Camin_InSync
Camin_Bsy
Camin_Act
COMBINE Combine_Ex
Combine_Bsy
Combine_Act
Position
MC_Axis000
MC_Axis001
MC_Axis002
MC_Axis003
Time
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
ples
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR1
MC_Power 10
Lock0 MC_Axis000 Axis Axis Pwr1_Status
Enable Status
If the Servo Drive for axis 3 is ready, turn ON the Servo for axis 3.
PWR4
MC_Power
Lock3 MC_Axis003 Axis Axis Pwr4_Status
Enable Status
Busy Pwr4_Bsy
Error Pwr4_Err
ErrorID Pwr4_ErrID
If a minor fault level error occurs for any of the composition axes in the axes group, the error handler for the
device (FaultHandler) is executed. Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
MC_Axis001.MFaultLvl.Active
MC_Axis002.MFaultLvl.Active
MC_Axis003.MFaultLvl.Active
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM1
MC_Home
Pwr1_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm1_D
Execute Done
Busy Hm1_Bsy
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
If the Servo is ON for axis 3 and home is not defined, the MC_Home instruction is executed.
HM4
MC_Home
Pwr4_Status MC_Axis003.Details.Homed MC_Axis003 Axis Axis Hm4_D
Execute Done
Busy Hm4_Bsy
CommandAborted Hm4_Ca
Error Hm4_Err
ErrorID Hm4_ErrID
CAMIN
MC_CamIn
MC_Axis000 Master Master
MC_Axis002 Slave Slave
ples
Vel_InVel CamProfile0 CamTable CamTable CamIn_InCam
Execute InCam
BOOL#TRUE Periodic InSync CamIn_InSync
_eMC_START_MODE#_mcRelativePosition StartMode EndOfProfile CamIn_Eop 10
LREAL#20.0 StartPosition Index CamIn_Index
LREAL#40.0 MasterStartDistance Busy CamIn_Bsy
If both gear and cam operation are in progress, the Combine Axes instruction is executed.
COMBINE
MC_CombineAxes
MC_Axis001 Master Master
MC_Axis002 Auxiliary Auxiliary
Gearin_Act Camin_Act Combine_InComb
MC_Axis003 Slave Slave
Execute InCombination
_eMC_COMBINE_MODE#_mcAddAxes CombineMode Busy Combine_Bsy
RatioNumeratorMaster Active Combine_Act
RatioDenominatorMaster CommandAborted Combine_Ca
RatioNumeratorAuxiliary Error Combine_Err
RatioDenominatorAuxiliary ErrorID Combine_ErrID
_eMC_REFERENCE_TYPE#_mcLatestCommand ReferenceTypeMaster
_eMC_REFERENCE_TYPE#_mcLatestCommand ReferenceTypeAuxiliary
BufferMode
ST Programming
// If the input parameters for the motion instructions are not set, the target valu
es and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction ar
e set.
Vel_Vel := LREAL#100.0;
Vel_Acc := LREAL#0.0;
Vel_Dec := LREAL#0.0;
Vel_Dir := _eMC_DIRECTION#_mcPositiveDirection;
// The input parameters for the MC_CamIn (Start Cam Operation) instruction are se
t.
Camin_Em := TRUE;
Camin_Sm := _eMC_START_MODE#_mcRelativePosition;
Camin_Sp := LREAL#20.0;
Camin_Msd := LREAL#40.0;
Camin_Ms := LREAL#1.0;
Camin_Ss := LREAL#1.0;
Camin_Mo := LREAL#0.0;
Camin_So := LREAL#0.0;
Camin_Rt := _eMC_REFERENCE_TYPE#_mcCommand;
Camin_Dir := _eMC_DIRECTION#_mcNoDirection;
// The input parameters for the MC_GearIn (Start Gear Operation) instruction are
set.
Gearin_RatN := UINT#1;
Gearin_RatD := UINT#1;
Gearin_RefTyp := _eMC_REFERENCE_TYPE#_mcCommand;
Gearin_Acc := LREAL#0.0;
Gearin_Dec := LREAL#0.0;
// The input parameters for the MC_CombineAxes (Combine Axes) instruction are set
.
Combine_Cm := _eMC_COMBINE_MODE#_mcAddAxes;
Combine_RefMas :=_eMC_REFERENCE_TYPE#_mcLatestCommand;
Combine_RefAux :=_eMC_REFERENCE_TYPE#_mcLatestCommand;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr1_En:=TRUE;
ELSE
Pwr1_En:=FALSE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 3.
IF (StartPg=TRUE)
AND (MC_Axis003.DrvStatus.Ready=TRUE) THEN
Pwr4_En :=TRUE;
ELSE
Pwr4_En :=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0 to axis 3, the error handler for
the device (FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Axis002.MFaultLvl.Active=TRUE)
OR (MC_Axis003.MFaultLvl.Active=TRUE) THEN
FaultHandler();
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed for axis 0.
IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
ples
Hm1_Ex :=TRUE;
END_IF;
10
// If the Servo is ON for axis 3 and home is not defined, the MC_Home instruction i
s executed for axis 3.
// If both gear and cam operation are in progress, the Combine Axes instruction is
executed.
IF (Gearin_Act=TRUE) AND (Camin_Act=TRUE) THEN
Combine_Ex :=TRUE;
END_IF;
Axis := MC_Axis003,
Enable := Pwr4_En,
Status => Pwr4_Status,
Busy => Pwr4_Bsy,
Error => Pwr4_Err,
ErrorID => Pwr4_ErrID
);
//MC_MoveVelocity
VEL(
Axis := MC_Axis000,
Execute := Vel_Ex,
Velocity := Vel_Vel,
Acceleration := Vel_Acc,
Deceleration := Vel_Dec,
Direction := Vel_Dir,
InVelocity => Vel_InVel,
Busy => Vel_Bsy,
Active => Vel_Act,
CommandAborted => Vel_Ca,
Error => Vel_Err,
ErrorID => Vel_ErrID
);
//MC_CamIn
ples
Periodic := Camin_Em,
StartMode := Camin_Sm,
StartPosition := Camin_Sp, 10
MasterStartDistance := Camin_Msd,
MasterScaling := Camin_Ms,
//MC_GearIn
GEARIN(
Master := MC_Axis000,
Slave := MC_Axis001,
Execute := Gearin_Ex,
RatioNumerator := Gearin_RatN,
RatioDenominator := Gearin_RatD,
ReferenceType := Gearin_RefTyp,
Acceleration := Gearin_Acc,
Deceleration := Gearin_Dec,
InGear => Gearin_InGear,
Busy => Gearin_Bsy,
Active => Gearin_Act,
CommandAborted => Gearin_Ca,
Error => Gearin_Err,
ErrorID => Gearin_ErrID
);
//MC_CombineAxes
COMBINE(
Master := MC_Axis001,
Auxiliary := MC_Axis002,
Slave := MC_Axis003,
Execute := Combine_Ex,
CombineMode := Combine_CM,
ReferenceTypeMaster := Combine_RefMas,
ReferenceTypeAuxiliary := Combine_RefAux,
InCombination => Combine_InComb,
Busy => Combine_Bsy,
Active => Combine_Act,
CommandAborted => Combine_Ca,
Error => Combine_Err,
ErrorID => Combine_ErrID
);
ples
(Shift Master Axis Phase) instruction.
It is used in ST programming.
*1. The array elements ARRAY[0..N] are set with the Cam Editor in the Sysmac Studio. The range of the array is 0 to 360
in this sample.
10
Ladder Diagram
StartOn
MC_Phasing
PHASING.Execute
Phasing_Bsy
Phasing_Act
Phasing_D
MC_MoveVelocity
VEL.Execute
Vel_InVel
MC_CamIn
CAMIN.Execute
Camin_InCam
Camin_InSync
Camin_Bsy
Command velocity
MC_Axis000
MC_Axis001
Time
ST Programming
StartOn
MC_Phasing
Phasing_Ex
Phasing_Bsy
Phasing_Act
Phasing_D
MC_MoveVelocity
Vel_Ex
Vel_InVel
MC_CamIn
Camin_Ex
Camin_InCam
Camin_InSync
Camin_Bsy
Command velocity
MC_Axis000
MC_Axis001
Time
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
Check if the Servo Drive for axis 1 is ready when StartPg is TRUE.
StartPg MC_Axis001.DrvStatus.Ready Lock1
ples
Error Pwr1_Err
ErrorID Pwr1_ErrID
10
If the Servo Drive for axis 1 is ready, turn ON the Servo for axis 1.
PWR2
If a minor fault level error occurs for any of the composition axes in the axes group, the error handler for the
device (FaultHandler) is executed. Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
MC_Axis001.MFaultLvl.Active
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM1
MC_Home
Pwr1_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm1_D
Execute Done
Busy Hm1_Bsy
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed.
HM2
MC_Home
Pwr1_Status MC_Axis001.Details.Homed MC_Axis001 Axis Axis Hm2_D
Execute Done
Busy Hm2_Bsy
CommandAborted Hm2_Ca
Error Hm2_Err
ErrorID Hm2_ErrID
CAMIN
MC_CamIn
MC_Axis000 Master Master
MC_Axis001 Slave Slave
Vel_InVel MC_Axis001.Details.Homed CamProfile0 CamTable CamTable CamIn_InCam
Execute InCam
BOOL#True Periodic InSync CamIn_InSync
_eMC_START_MODE#_mcRelativePosition StartMode EndOfProfile CamIn_Eop
LREAL#20.0 StartPosition Index CamIn_Index
LREAL#40.0 MasterStartDistance Busy CamIn_Bsy
LREAL#1.0 MasterScaling Active CamIn_Act
LREAL#1.0 SlaveScaling CommandAborted CamIn_Ca
LREAL#0.0 MasterOffset Error CamIn_Err
LREAL#0.0 SlaveOffset ErrorID CamIn_ErrID
_eMC_REFERENCE_TYPE#_mcCommand ReferenceType
_eMC_DIRECTION#_mcNoDirection Direction
CamTransition
BufferMode
If StartOn is TRUE and cam motion is in sync, shifting the phase of the master axis is started.
PHASING
MC_Phasing
MC_Axis000 Master Master
StartOn Camin_InSync MC_Axis001 Slave Slave Phasing_D
Execute Done
LREAL#500.0 PhaseShift Busy Phasing_Bsy
LREAL#1000.0 Velocity Active Phasing_Act
LREAL#0.0 Acceleration CommandAborted Phasing_Ca
LREAL#0.0 Deceleration Error Phasing_Err
Jerk ErrorID Phasing_ErrID
BufferMode
ST Programming
// If the input parameters for the motion instructions are not set, the target valu
es and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction ar
ples
// The input parameters for the MC_Phasing (Shift Master Axis Phase) instruction
are set.
Phasing_Ps := LREAL#500.0; 10
Phasing_Vel := LREAL#1000.0;
Phasing_Acc := LREAL#0.0;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr1_En:=TRUE;
ELSE
Pwr1_En:=FALSE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 1.
IF (StartPg=TRUE)
AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN
Pwr2_En:=TRUE;
ELSE
Pwr2_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0 or axis 1, the error handler for
the device (FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF (MC_Axis000.MFaultLvl.Active=TRUE) OR (MC_Axis001.MFaultLvl.Active=TRUE) THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i
s executed for axis 0.
IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex:=TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction i
s executed for axis 1.
IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;
END_IF;
// When axis 0 reaches the target velocity and the home is defined for axis 1, cam
operation is executed.
IF (Vel_InVel=TRUE) AND (MC_Axis001.Details.Homed=TRUE) THEN
Camin_Ex := TRUE;
END_IF;
// If StartOn is TRUE and cam motion is in sync, shifting the phase of the master a
xis is started.
IF (StartOn=TRUE) AND (Camin_InSync=TRUE) THEN
Phasing_Ex :=TRUE;
END_IF;
ples
// MC_Home for axis 0
HM1(
Axis := MC_Axis000, 10
Execute := Hm1_Ex,
Done => Hm1_D,
//MC_MoveVelocity
VEL(
Axis := MC_Axis000,
Execute := Vel_Ex,
Velocity := Vel_Vel,
Acceleration := Vel_Acc,
Deceleration := Vel_Dec,
Direction := Vel_Dir,
InVelocity => Vel_InVel,
Busy => Vel_Bsy,
Active => Vel_Act,
CommandAborted => Vel_Ca,
Error => Vel_Err,
ErrorID => Vel_ErrID
);
//MC_Phasing
PHASING(
Master := MC_Axis000,
Slave := MC_Axis001,
Execute := Phasing_Ex,
PhaseShift := Phasing_Ps,
Velocity := Phasing_Vel,
Acceleration := Phasing_Acc,
Deceleration := Phasing_Dec,
Done => Phasing_D,
Busy => Phasing_Bsy,
Active => Phasing_Act,
CommandAborted => Phasing_Ca,
Error => Phasing_Err,
ErrorID => Phasing_ErrID
);
//MC_CamIn
CAMIN(
Master := MC_Axis000,
Slave := MC_Axis001,
CamTable := CamProfile0,
Execute := Camin_Ex,
Periodic := Camin_Em,
StartMode := Camin_Sm,
StartPosition := Camin_Sp,
MasterStartDistance := Camin_Msd,
MasterScaling := Camin_Ms,
SlaveScaling := Camin_Ss,
MasterOffset := Camin_Mo,
SlaveOffset := Camin_So,
ReferenceType := Camin_Rt,
Direction := Camin_Dir,
InCam => Camin_InCam,
InSync => Camin_InSync,
EndOfProfile => Camin_Eop,
Index => Camin_Index,
Busy => Camin_Bsy,
Active => Camin_Act,
CommandAborted => Camin_Ca,
Error => Camin_Err,
ErrorID => Camin_ErrID
);
• When you use the MC_SetPosition instruction for an axis in motion, the travel distance be-
tween execution of the instruction and changing the actual position will remain as error.
• Home will become undefined when the MC_Set Position instruction is executed.
ples
Axis Parameter Settings 10
Parameter name Setting Description
Timing Chart
Ladder Diagram
MC_Power
Pwr_Status
MC_MoveVelocity
VEL.Execute
Ve_InVel
Vel_Bsy
MC_SetPosition
SET_POS.Execute
Set_Pos_D
Set_Pos_Bsy
MC_Axis000
Time
ples
Ve_InVel
Vel_Bsy
10
MC_SetPosition
Set_Pos_Ex
Set_Pos_Bsy
MC_Axis000
Time
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr_Status
Enable Status
Busy Pwr_Bsy
Error Pwr_Err
ErrorID Pwr_ErrID
If a minor fault level error occurs for axis 0, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
If StartSetPos is TRUE while the Servo is ON, the Set Position instruction is executed.
SET_POS
MC_SetPosition
Pwr_Status StartSetPos Set_PosD
MC_Axis000 Axis Axis
Execute Done
LREAL#0.0 Position Busy Set_Pos_Bsy
ReferenceType CommandAborted Set_Pos_Ca
Relative Error Set_Pos_Err
ExecutionMode ErrorID Set_Pos_ErrID
ST Programming
// If the input parameters for the instructions are not set, the target values and
other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction ar
e set.
Vel_Vel := LREAL#36.0;
Vel_Acc := LREAL#1000.0;
Vel_Dec := LREAL#1000.0;
Vel_Jrk := LREAL#100.0;
// The input parameters for the MC_SetPosition instruction are set.
Set_Pos_Pos := LREAL#0.0;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
// If the Servo Drive is not ready, turn OFF the Servo.
ples
END_IF;
// If a minor fault level error occurs for axis 0, the error handler for the device 10
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
// If StartSetPos is TRUE while the Servo is ON, the Set Position instruction is ex
ecuted.
IF (Pwr_Status=TRUE) AND (StartSetPos=TRUE) THEN
Set_Pos_Ex :=TRUE;
END_IF;
//MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
//MC_MC_MoveVelocity
VEL(
Axis := MC_Axis000,
Execute := Vel_Ex,
Velocity := Vel_Vel,
Acceleration := Vel_Acc,
Deceleration := Vel_Dec,
Jerk := Vel_Jrk,
InVelocity => Vel_InVel,
Busy => Vel_Bsy,
Active => Vel_Act,
CommandAborted => Vel_Ca,
//MC_SetPosition
SET_POS(
Axis := MC_Axis000,
Execute := Set_Pos_Ex,
Position := Set_Pos_Pos,
Done => Set_Pos_D,
Busy => Set_Pos_Bsy,
CommandAborted => Set_Pos_Ca,
Error => Set_Pos_Err,
ErrorID => Set_Pos_ErrID
);
10-2-16 Changing a Cam Data Variable and Saving the Cam Table
This sample uses the user program to change a cam data variable that was created on Cam Editor of
the Sysmac Studio.
The displacements for phases of 0° to 180° are multiplied by 2 and the displacements for phases of
181° to 360° are multiplied by 0.5.
If the changes to the cam data are completed, the motion control instruction MC_SaveCamTable is
used to save the cam data variable to non-volatile memory in the CPU Unit.
When saving the data is completed, the MC_CamIn (Start Cam Operation) instruction is executed to
start cam motion.
• If the phases are not in ascending order, an error occurs when the MC_CamIn (Start Cam
Operation) instruction is executed.
The order of the phases are not checked in this sample. To check the order of the phases,
execute the MC_SetCamTableProperty (Set Cam Table Properties) instruction.
• There is a limit to the number of times that you can write non-volatile memory in the CPU
Unit.
Save cam table data only when necessary.
• If the power supply to the Controller is turned OFF before the data is saved with the MC_Sa-
veCamTable instruction, the cam data variable will revert to the contents from before it was
changed by the user program.
ples
PWR2 instance of the MC_Power instruction.
It is TRUE when the Servo is ON.
StartPg BOOL FALSE When this variable is TRUE, the Servo is turned ON if EtherCAT
process data communications are active and normal.
10
WriteCamdata BOOL FALSE This variable is used to start changing the cam data.
10-2-16 Changing a Cam Data Variable and Saving the Cam Table
It is changed to TRUE to start editing.
WriteDone BOOL FALSE This variable is used to indicate that the changes to the cam data
are completed.
It is changed to TRUE when the changes to the cam data are
completed.
SaveCamtable BOOL FALSE This variable is used to execute the Save Cam Table instruction.
_MC_COM.Sta- BOOL FALSE This system-defined variable is TRUE while cam table data is be-
tus.CamTableBusy ing saved.
Sv_Cam_Ex BOOL FALSE This variable is used to execute the MC_SaveCamTable instruc-
tion.
Camin_Ex BOOL FALSE This variable is used to execute the MC_CamIn (Start Cam Oper-
ation) instruction.
It is used in ST programming.
*1. The array elements ARRAY[0..N] are set with the Cam Editor in the Sysmac Studio. The range of the array is 0 to 360
in this sample.
Timing Chart
Ladder Diagram
Write_Camdata
WriteDone
SaveCamtable
_MC_COM.Status.CamTableBusy
SV_CAM Sv_Cam_Ex
Sv_Cam_Bsy
Sv_Cam_D
CAMIN Camin_Ex
Camin_Bsy
Camin_Act
Camin_InCam
Camin_InSync
ST Programming
Write_Camdata
WriteDone
SaveCamtable
_MC_COM.Status.CamTableBusy
SV_CAM Sv_Cam_Ex
Sv_Cam_Bsy
Sv_Cam_D
CAMIN Camin_Ex
Camin_Bsy
Camin_Act
Camin_InCam
Camin_InSync
Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0
Check if the Servo Drive for axis 1 is ready when StartPg is TRUE.
StartPg MC_Axis001.DrvStatus.Ready Lock1
If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR1
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr1_Status
Enable Status
Busy Pwr1_Bsy
Error Pwr1_Err
ErrorID Pwr1_ErrID
ples
Error Pwr2_Err
ErrorID Pwr2_ErrID
10
If a minor fault level error occurs in the MC Common Error Status variable or for any of the axes, the error
handler for the device (FaultHandler) is executed. Program the FaultHandler according to the device.
10-2-16 Changing a Cam Data Variable and Saving the Cam Table
MC_Axis000.MFaultLvl.Active FaultHandler
EN FaultHandler
MC_Axis001.MFaultLvl.Active
_MC_COM.MFaultLvl.Active
If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
HM1
MC_Home
Pwr1_Status MC_Axis000.Details.Homed MC_Axis000 Axis Axis Hm1_D
Execute Done
Busy Hm1_Bsy
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed.
HM2
MC_Home
Pwr1_Status MC_Axis001.Details.Homed MC_Axis001 Axis Axis Hm2_D
Execute Done
Busy Hm2_Bsy
CommandAborted Hm2_Ca
Error Hm2_Err
ErrorID Hm2_ErrID
If WriteCamData is TRUE and a cam table file is not being saved, the values in the cam data variable are
changed.
The displacements for phases from 0° to 180° are multiplied by 2 and the displacements for phases from 181°
to 360° are multiplied by 0.5. When the changes to the displacements are completed, WriteDone is changed
to TRUE.
WriteCamdata _MC_COM.Status.CamTableBusy
1 FOR Index := UINT#0 TO UINT#360 DO
2 IF Index<UINT#180 THEN
3 CamProfile0[INDEX].Distance:=CamProfile0[Index].Distance*REAL#2.0;
4 ELSE
5 CamProfile0[INDEX].Distance:=CamProfile0[Index].Distance*REAL#0.5;
6 END_IF;
7 END_FOR;
8 WriteDone:=TRUE;
9 WriteCamData:=FALSE;
If the changes to the cam data variable are completed, SaveCamtable is TRUE, and a cam table file save
operation is not in progress, Sv_Cam_Ex is changed to TRUE.
If Sv_Ca_CountUp is FALSE, a Cannot Execute Save Cam Table error occurs and Sv_Cam_Disable is
changed to TRUE.
Sv_Ca_CountUp Sv_Cam_Ca Sv_Cam_Disable
One second after a Cannot Execute Save Cam Table error occurs, Sv_Ca_TimeUp is changed to TRUE.
When Sv_Ca_TimeUp changes to TRUE, Sv_Cam_Ex changes to FALSE.
Sv_Ca_TON
Sv_Cam_Disable TON Sv_Ca_TimeUp
In Q
T#1s PT ET
Sv_Ca_CountLoad
SaveCamTable
ples
If a Cannot Execute Save Cam Table error occurs three times, Sv_Ca_CountUp is changed to TRUE. 10
When Sv_Ca_CountUp changes to TRUE, Sv_Cam_Disable is changed to FALSE.
Retry processing for the MC_SaveCamTable instruction is completed.
10-2-16 Changing a Cam Data Variable and Saving the Cam Table
Sv_Ca_CTD
Sv_Cam_Disable CTD Sv_Ca_CountUP
CD Q
Sv_Ca_CountLoad Load CV
INT#3 PV
If the changes to the cam data variable and saving the cam table are completed and axis 0 is at the target velocity,
the cam operation is executed.
CAMIN
MC_CamIn
MC_Axis000 Master Master
MC_Axis001 Slave Slave
WriteDone Vel_InVel Sv_Cam_D CamProfile0 CamTable CamTable CamIn_InCam
Execute InCam
BOOL#True Periodic InSync CamIn_InSync
_eMC_START_MODE#_mcRelativePosition StartMode EndOfProfile CamIn_Eop
LREAL#0.0 StartPosition Index CamIn_Index
LREAL#0.0 MasterStartDistance Busy CamIn_Bsy
LREAL#1.0 MasterScaling Active CamIn_Act
LREAL#1.0 SlaveScaling CommandAborted CamIn_Ca
LREAL#0.0 MasterOffset Error CamIn_Err
LREAL#0.0 SlaveOffset ErrorID CamIn_ErrID
_eMC_REFERENCE_TYPE#_mcCommand ReferenceType
_eMC_DIRECTION#_mcNoDirection Direction
CamTransition
BufferMode
ST Programming
// If the input parameters for the instructions are not set, the target values and
other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction ar
e set.
Vel_Vel := LREAL#1000.0;
Vel_Acc := LREAL#0.0;
Vel_Dec := LREAL#0.0;
Vel_Dir := _eMC_DIRECTION#_mcPositiveDirection;
// The input parameters for the MC_CamIn (Start Cam Operation) instruction are se
t.
Camin_Em := TRUE;
Camin_Sm := _eMC_START_MODE#_mcRelativePosition;
Camin_Sp := LREAL#0.0;
Camin_Msd := LREAL#0.0;
Camin_Ms := LREAL#1.0;
Camin_Ss := LREAL#1.0;
Camin_Mo := LREAL#0.0;
Camin_So := LREAL#0.0;
Camin_Rt := _eMC_REFERENCE_TYPE#_mcCommand;
Camin_Dir := _eMC_DIRECTION#_mcNoDirection;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
// If the Servo Drive is not ready, turn OFF the Servo.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr1_En :=TRUE;
ELSE
Pwr1_En :=FALSE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 1.
// If the Servo Drive is not ready, turn OFF the Servo.
IF (StartPg=TRUE)
AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN
Pwr2_En :=TRUE;
ELSE
Pwr2_En :=FALSE;
END_IF;
// If a minor fault level error occurs in the MC Common Error Status variable or fo
r any of the axes, the error handler for the device (FaultHandler) is executed.
ples
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction i 10
s executed for axis 0.
IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
10-2-16 Changing a Cam Data Variable and Saving the Cam Table
Hm1_Ex :=TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction i
s executed for axis 1.
IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex :=TRUE;
END_IF;
// If WriteCamData is TRUE and a cam table file is not being saved, the values in t
he cam data variable are changed.
// The displacements for phases of 0° to 180° are multiplied by 2 and the displacem
ents for phases of 181° to 360° are multiplied by 0.5.
// When the changes are completed, WriteDone is changed to TRUE.
IF (WriteCamdata=TRUE) AND (_MC_COM.Status.CamTableBusy=FALSE) THEN
FOR Index := UINT#0 TO UINT#360 DO
IF Index<UINT#180 THEN
CamProfile0[Index].Distance:=CamProfile0[Index].Distance*REAL#2.0;
ELSE
CamProfile0[Index].Distance:=CamProfile0[Index].Distance*REAL#0.5;
END_IF;
END_FOR;
WriteDone :=TRUE;
WriteCamdata :=FALSE;
END_IF;
// If the changes to the cam data variable are completed, SaveCamtable is TRUE, and
a cam table file save operation is not in progress, Sv_Cam_Ex is changed to TRUE.
// If Sv_Cam_Ex is TRUE, the MC_SaveCamTable instruction is executed.
IF (WriteDone=TRUE)
AND (SaveCamtable=TRUE)
AND (_MC_COM.Status.CamTableBusy=FALSE) THEN
Sv_Cam_Ex := TRUE;
END_IF;
// If Sv_Ca_CountUp is FALSE and a Cannot Execute Save Cam Table error occurs, Sv_C
am_Disable is changed to TRUE.
IF (Sv_Ca_CountUP=FALSE) AND (Sv_Cam_Ca=TRUE) THEN
Sv_Cam_Disable := TRUE;
ELSE
Sv_Cam_Disable := FALSE;
END_IF;
// One second after the Cannot Execute Save Cam Table error occurs, Sv_Ca_TimeUp is
changed to TRUE.
// If Sv_Ca_TimeUp changes to TRUE, Sv_Cam_Ex is changed to FALSE.
Sv_Ca_TON(
In := Sv_Cam_Disable,
PT := T#1s,
Q => Sv_Ca_TimeUp
);
// Sv_Ca_CountLoad is changed to TRUE for one period when the cam table is saved.
// If Sv_Ca_CountLoad changes to TRUE, the retry counter is reset.
R_TRIG1(SaveCamtable, Sv_Ca_CountLoad);
// If a Cannot Execute Save Cam Table error occurs three times, Sv_Ca_CountUP is ch
anged to TRUE.
// If Sv_Ca_CountUP changes to TRUE, Sv_Cam_Disable is changed to FALSE.
// Retry processing for the MC_SaveCamTable instruction is completed.
Sv_Ca_CTD(
CD := Sv_Cam_Disable,
LOAD := Sv_Ca_CountLoad,
PV := INT#3,
Q => Sv_Ca_CountUP
);
// If the changes to the cam data variable and saving the cam table are completed a
nd axis 0 is at the target velocity, the cam operation is executed.
ples
//MC_SaveCamTable
SV_CAM( 10
CamTable :=CamProfile0,
Execute := Sv_Cam_Ex,
10-2-16 Changing a Cam Data Variable and Saving the Cam Table
Done => Sv_Cam_D,
Busy => Sv_Cam_Bsy,
CommandAborted => Sv_Cam_Ca,
Error => Sv_Cam_Err,
ErrorID => Sv_Cam_ErrID
);
CAMIN(
Master := MC_Axis000,
Slave := MC_Axis001,
CamTable := CamProfile0,
Execute := Camin_Ex,
Periodic := Camin_Em,
StartMode := Camin_Sm,
StartPosition := Camin_Sp,
MasterStartDistance := Camin_Msd,
MasterScaling := Camin_Ms,
SlaveScaling := Camin_Ss,
MasterOffset := Camin_Mo,
SlaveOffset := Camin_So,
ReferenceType := Camin_Rt,
Direction := Camin_Dir,
InCam => Camin_InCam,
InSync => Camin_InSync,
EndOfProfile => Camin_Eop,
Index => Camin_Index,
Busy => Camin_Bsy,
Active => Camin_Act,
CommandAborted => Camin_Ca,
Error => Camin_Err,
ErrorID => Camin_ErrID
);
//MC_MoveVelocity
VEL(
Axis := MC_Axis000,
Execute := Vel_Ex,
Velocity := Vel_Vel,
Acceleration := Vel_Acc,
Deceleration := Vel_Dec,
Direction := Vel_Dir,
InVelocity => Vel_InVel,
ples
);
10
10-2-17 Temporarily Changing Axis Parameters
This sample uses the MC_Write (Write MC Setting) instruction to change the settings of the In-Position
Ladder Diagram
The axis parameters are set. When setting the parameters is completed, InitFlag is changed to TRUE.
InitFlag
1 // In-position Check Time
2 Write1_Sv := UINT#10;
3 Write1_Pn := _eMC_PARAMETER_NUMBER#_mcInPosTime;
4 // Positive Software Limit
5 Write2_Sv := LREAL#10000.0;
6 Write2_Pn := _eMC_PARAMETER_NUMBER#_mcPosiSwLmt;
7 // Negative Software Limit
8 Write3_Sv := LREAL#-10000.0;
9 Write3_Pn := _eMC_PARAMETER_NUMBER#_mcNegaSwLmt;
10 // The Initialization Completed Flag is changed to TRUE.
11 InitFlag := TRUE;
If changing the setting of the Positive Software Limit is completed, the setting of the Negative Software Limit is changed.
WRITE3
MC_Write
MC_Axis000 Target Target
Write2_D Write3_Sv SettingValue SettingValue Write3_D
Execute Done
Write3_Pn ParameterNumber Busy Write3_Bsy
CommandAborted Write3_Ca
Error Write3_Err
ErrorID Write3_ErrID
ST Programming
// The axis parameters are set. When setting the parameters is completed, InitFlag
is changed to TRUE.
IF InitFlag=FALSE THEN
// In-position Check Time
Write1_Sv := UINT#10;
Write1_Pn := _eMC_PARAMETER_NUMBER#_mcInPosTime;
// Positive Software Limit
Write2_Sv := LREAL#10000.0;
Write2_Pn := _eMC_PARAMETER_NUMBER#_mcPosiSwLmt;
// Negative Software Limit
Write3_Sv := LREAL#-10000.0;
Write3_Pn := _eMC_PARAMETER_NUMBER#_mcNegaSwLmt;
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If changing the setting of the In-Position Check Time is completed, the setting
of the Positive Software Limit is changed.
IF Write1_D = TRUE THEN
// If changing the setting of the Positive Software Limit is completed, the setting
of the Negative Software Limit is changed.
ples
IF Write2_D = TRUE THEN
Write3_Ex := TRUE;
END_IF; 10
// MC_Write
WRITE2(
Target := MC_Axis000,
SettingValue := Write2_Sv,
Execute := Write2_Ex,
ParameterNumber := Write2_Pn,
Done => Write2_D,
Busy => Write2_Bsy,
CommandAborted => Write2_Ca,
Error => Write2_Err,
ErrorID => Write2_ErrID
);
WRITE3(
Target := MC_Axis000,
SettingValue := Write3_Sv,
Execute := Write3_Ex,
ParameterNumber := Write3_Pn,
Done => Write3_D,
Busy => Write3_Bsy,
CommandAborted => Write3_Ca,
Error => Write3_Err,
ErrorID => Write3_ErrID
);
Ladder Diagram
The axis parameters are set. When setting the parameters is completed, InitFlag is changed to TRUE.
InitFlag
1 // The phases and displacements for null cam data are set.
2 PhaseData:=REAL#99.0;
3 DistanceData:=REAL#250.0;
4 // The Initialization Completed Flag is changed to TRUE.
5 InitFlag := TRUE;
If a minor fault level error occurs in the MC Common Error Status variable, the error handler for the device
(FaultHandler) is executed. Program the FaultHandler according to the device.
_MC_COM.MFaultLvl.Active FaultHandler
EN FaultHandler
If StartPg and WriteCamData are TRUE, the values in the cam data variable are changed.
Phases and displacements are set for CamProfile[100] to CamProfile[109].
When the changes to the cam data variable are completed, WriteDone is changed to TRUE.
StartPg WriteCamData
1 FOR Index := UINT#100 TO UINT#109 DO
2 PhaseData:=PhaseData+REAL#1.0;
3 DistanceData:=DistanceData+REAL#3.0;
4 CamProfile0[Index].Phase:=PhaseData;
5 CamProfile0[Index].Distance:=DistanceData;
6 END_FOR;
7 WriteDone:=TRUE;
ples
EndPointIndex Set_Cam_Epi
MaxDataNumber Set_Cam_Mdn
Busy Set_Cam_B
CommandAborted
Error
Set_Cam_Ca
Set_Cam_Err
10
ErrorID Set_Cam_ErrID
// If a minor fault level error occurs in the MC Common Error Status variable, the
error handler for the device is executed.
// Program the FaultHandler according to the device.
IF _MC_COM.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If StartPg and WriteCamData are TRUE, the values in the cam data variable are ch
anged.
// The phases and displacements are set in CamProfile[100] to CamProfile[109].
// When the changes to the cam data variable are completed, WriteDone is changed to
TRUE.
IF StartPg=TRUE
AND WriteCamData=TRUE THEN
FOR Index := UINT#100 TO UINT#109 DO
PhaseData :=PhaseData+REAL#1.0;
DistanceData :=DistanceData+REAL#3.0;
CamProfile0[Index].Phase :=PhaseData;
CamProfile0[Index].Distance :=DistanceData;
END_FOR;
WriteDone :=TRUE;
END_IF;
// If the changes to the cam data variable are completed, the Set Cam Table Propert
ies instruction is executed.
IF WriteDone=TRUE THEN
Set_Cam_Ex := TRUE;
END_IF;
//MC_SetCamTableProperty
SET_CAM(
CamTable := CamProfile0,
Execute := Set_Cam_Ex,
Done => Set_Cam_D,
EndPointIndex => Set_Cam_Epi,
MaxDataNumber => Set_Cam_Mdn,
Busy => Set_Cam_B,
CommandAborted => Set_Cam_Ca,
Error => Set_Cam_Err,
ErrorID => Set_Cam_ErrID
);
EtherNet/IP
Troubleshooter
Network Configurator
Built-in
EtherNet/IP CJ-series Units and
NJ/NX-series
Port NX Units
CPU Unit
Troubleshooting
Sysmac Studio
EtherCAT
EtherCAT
slaves
You can use the troubleshooting functions of the Sysmac Studio or the Troubleshooter on an HMI to
quickly check for errors that have occurred and find corrections for them.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503-E1-19 or later) for error types and
details, specific corrections when errors occur, and troubleshooting information on the entire NJ/NX-
series Controllers.
Assigning Positive Limit Inputs, Negative Limit Inputs, and Home Proximi-
ty Input
The default settings of the input signals of an OMRON 1S-series Servo Drive are listed in the fol-
lowing table.
Backlash Compensation
The MC Function Module does not perform backlash compensation.
If you require backlash compensation, use the compensation function on the Servo Drive.
The objects that must be set on the Servo Drive are listed in the following table.
Subin-
Index Name Description
dex
3001 hex --- Machine ---
02 hex Backlash Compensation Selects whether to enable or disable backlash com-
Selection pensation in the position control, and the operation di-
rection for the compensation.*1
0: Backlash compensation disabled
1: Compensate at the first positive operation after ser-
vo ON
2: Compensate at the first negative operation after ser-
vo ON
03 hex Backlash Compensation Sets the backlash compensation amount in the posi-
Amount tion control.
04 hex Backlash Compensation Sets the backlash compensation time constant in the
Time Constant position control.
*1. The default setting is 0: Backlash compensation disabled.
For details on the backlash function, refer to the AC Servomotors/Servo Drives 1S-series with Built-in
EtherCAT Communications User’s Manual (Cat. No. I586) or AC Servomotors/Servo Drives 1S-series
with Built-in EtherCAT Communications and Safety Functionality User’s Manual (Cat. No. I621).
PDO Mapping
This section describes mapping PDOs to control servo axes from the MC Function Module.
To use motion control functions, you must map the objects that are required for those functions to
PDOs.
The PDO map is a list of required objects that is prepared in advance.
You select the PDOs to use in the Edit PDO Map Settings Window of the EtherCAT Tab Page in the
Sysmac Studio.
RxPDO: 261th Controlword (6040 hex), Target Position (607A hex), Target Velocity (60FF hex), Target
Receive PDO Torque (6071 hex), Modes of Operation (6060 hex), Touch Probe Function (60B8 hex),
Mapping (1704 Max Profile Velocity (607F hex), Positive Torque Limit Value (60E0 hex), and Negative Tor-
hex) que Limit Value (60E1 hex)
TxPDO: 259th Error Code(603F hex), Statusword (6041 hex), Position Actual Value (6064 hex), Torque
Transmit PDO Actual Value (6077 hex), Modes of Operation Display (6061 hex), Touch Probe Status
Mapping (1B02 (60B9 hex), Touch Probe Pos1 Pos Value (60BA hex), Touch Probe Pos2 Pos Value (60BC
hex) hex), and Digital Inputs (60FD hex)
Additional Information
To access the settings, click the Detailed Settings Button on the Axis Basic Settings Display in the
• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
• If you are not using an OMRON 1S-series Servo Drive with built-in EtherCAT communica-
tions, always set the Modes of Operation (6060 hex).
• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
• If you are not using an OMRON 1S-series Servo Drive with built-in EtherCAT communica-
tions, always set the Modes of Operation Display (6061 hex).
• To use the MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control) instruction to
change the control mode of an OMRON 1S-series Servo Drive, you need to map Reference
Position for CSP.
If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
Version Information
• If you are using a CPU Unit with unit version 1.09 or earlier and you are not using an OM-
RON 1S-series Servo Drive with built-in EtherCAT communications for the servo axis, Modes
of Operation (6060 hex) and Modes of Operation Display (6061 hex) are required.
Object Settings
The OMRON 1S-series Servo Drive settings required to use the control functions of the MC Function
Module are listed in the following table.
Consult the manual for your Servo Drive and set all related objects for the Servo Drive functions that
you are going to use.
Recom-
Subin-
Index Name mended Description
dex
setting
3001 hex --- Machine --- The gear ratio on the Servo is 1:1. Set the user
05 hex Electronic Gear Ratio Numer- 1 unit on the Controller. *1
ator
06 hex Electronic Gear Ratio Denom- 1
inator
3330 hex --- Torque Limit --- Use 60E0 hex and 60E1 hex as the torque lim-
01 hex Switch Selection 2 it values when PCL and NCL are OFF.
3A00 hex --- Homing --- Use 0 as the offset value on the Servo.
06 hex Encoder Home Offset 0
3B10 hex --- Drive Prohibit --- Disable the drive prohibit input at the Servo. It
01 hex Enable 0 is processed by the Controller.
Recom-
Subin-
Index Name mended Description
dex
setting
3B11 hex --- Software Limits --- Disable both the positive and negative software
01 hex Enable Selection 0 limits.
3B30 hex --- Touch Probe Function 1 --- Set this as follows: Touch probe1 = External
01 hex Latch 1 Trigger Selection 1 latch signal 1, Touch probe2 = External latch
3B31 hex --- Touch Probe Function 2 --- signal 2.
4631 hex --- Negative Drive Prohibit --- Assign the Negative Drive Prohibit to the gen-
01 hex Port Selection 3 eral-purpose input 3 (IN3) as a negative logic
02 hex Logic Selection 1 (NC input).
4632 hex --- External Latch Input 1 --- Assign the External Latch Input 1 to the gener-
01 hex Port Selection 7 al-purpose input 7 (IN7) as a positive logic (NO
02 hex Logic Selection 0 input).
4633 hex --- External Latch Input 2 --- Assign the External Latch Input 2 to the gener-
01 hex Port Selection 8 al-purpose input 8 (IN8) as a positive logic (NO
02 hex Logic Selection 0 input).
4634 hex --- Home Proximity Input --- Assign the Home Proximity Input to the gener-
01 hex Port Selection 4 al-purpose input 4 (IN4) as a positive logic (NO
02 hex Logic Selection 0 input).
*1. With a CPU Unit of unit version 1.10 or earlier, you cannot operate OMRON 1S-series Servomotors in the maximum
rotation speed. To operate the 1S-series Servomotors in the maximum rotation speed, set the electronic gear ratio to
2:1 or greater.
Additional Information
• You can also use unit versions of the OMRON G5-series Servo Drives with built-in EtherCAT
communications other than the recommended unit versions. The functions that you can use
depend on the specifications of the Servo Drive. Set the functions to use and the object dic-
tionary on Sysmac Studio.
• The R88D-KN£££-ECT-R (unit version 1.0) of the OMRON G5-series Servo Drives support
only position control (Cyclic Synchronous Position Control Mode).
You can use them for applications that do not require velocity control (Cyclic Synchronous
Velocity Control Mode) or torque control (Cyclic Synchronous Torque Control Mode).
Refer to the AC Servomotors/Servo Drives G5-series with Built-in EtherCAT Communications
User’s Manual (Cat. No. I573) for details on functions.
• When you use unit version 2.0 or earlier of an OMRON G5-series Cylinder-type Servomotor/
Servo Drive, do not set the node address switches to 00. If you set them to 00, a network
configuration error occurs.
• Refer to the AC Servomotors/Servo Drives G5-series with Built-in EtherCAT Communications
User’s Manual (Cat. No. I576) for details on the differences between the unit versions of the
OMRON G5-series Servo Drives.
Assigning Positive Limit Inputs, Negative Limit Inputs, and Home Proximi-
ty Input
The default settings of the input signals of an OMRON G5-series Servo Drive are listed in the fol-
lowing table.
Backlash Compensation
The MC Function Module does not perform backlash compensation.
If you require backlash compensation, use the compensation function of the Servo Drive.
The objects that must be set on the Servo Drive are listed in the following table.
For details on the backlash function, refer to the AC Servomotors/Servo Drives G5-series with Built-in
EtherCAT Communications User’s Manual (Cat. No. I576) or the AC Servomotors/Servo Drives G5-
series with Built-in EtherCAT Communications Linear Motor Type User’s Manual (Cat. No. I577).
A
PDO Mapping
To use motion control functions, you must map the objects that are required for those functions to
PDOs.
The PDO map is a list of required objects that is prepared in advance.
You select the PDOs to use in the Edit PDO Map Settings Window of the EtherCAT Tab Page in the
Sysmac Studio.
RxPDO: 261th Controlword (6040 hex), Target Position (607A hex), Target Velocity (60FF hex), Target
Receive PDO Torque (6071 hex), Modes of Operation (6060 hex), Touch Probe Function (60B8 hex),
Mapping (1704 Max Profile Velocity (607F hex), Positive Torque Limit Value (60E0 hex), and Negative Tor-
hex) que Limit Value (60E1 hex)
TxPDO: 259th Error Code(603F hex), Status Word (6041 hex), Position Actual Value (6064 hex), Torque
Transmit PDO Actual Value (6077 hex), Modes of Operation Display (6061 hex), Touch Probe Status
Mapping (1B02 (60B9 hex), Touch Probe Pos1 Pos Value (60BA hex), Touch Probe Pos2 Pos Value (60BC
hex) hex), and Digital Inputs (60FD hex)
Additional Information
• If you use the recommended OMRON Servo Drives (R88D-KN£££-ECT, unit version 2.1 or
later, or R88D-KN£££-ECT-L, unit version 1.1 or later), then it is not necessary to change
the default PDO map on the Sysmac Studio.
• To perform fully-closed control with OMRON R88D-KN£££-ECT, select 1701 hex or 1600
hex for RxPDO. For 1600 hex, the total size of objects must be set to 12 bytes or less (for
unit version 2.1 or later).
To access the settings, click the Detailed Settings Button on the Axis Basic Settings Display in the
Sysmac Studio.
Additional Information
• Some functions may not be supported if you connect a unit version of the OMRON G5-series
Servo Drives with built-in EtherCAT communications other than the recommended unit ver-
sions.
Refer to the manual for the connected servo drive for details.
• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
• If you are not using an OMRON G5-series Servo Drive with built-in EtherCAT communica-
tions, always set the Modes of Operation (6060 hex).
• To perform fully-closed control with OMRON G5-series Servomotors/Servo Drives with built-in
EtherCAT communications, make settings so that the size of objects totals 12 bytes or less.
• Some functions may not be supported if you connect a unit version of the OMRON G5-series
Servo Drives with built-in EtherCAT communications other than the recommended unit ver-
sions. Refer to the manual for the connected servo drive for details.
• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
• If you are not using an OMRON G5-series Servo Drive with built-in EtherCAT communica-
tions, always set the Modes of Operation Display (6061 hex).
• To use the MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control) instruction to
change the control mode of an OMRON G5-series Servo Drive, you need to map Reference
Position for CSP.
• Set the primary period to 1 ms or greater when you use Reference Position for CSP for an
OMRON G5-series Servo Drive. Also, set the electronic gear ratio to 1:1 for the G5-series
Servo Drive.
For details, refer to the AC Servomotors/Servo Drives G5-series with Built-in EtherCAT
Communications User’s Manual (Cat. No. I576) or the AC Servomotors/Servo Drives G5-
series with Built-in EtherCAT Communications Linear Motor Type User’s Manual (Cat. No.
I577).
Version Information
• If you are using a CPU Unit with unit version 1.10 or later, operation is as described in the
following table depending on whether Modes of Operation (6060 hex) and Modes of Opera-
tion Display (6061 hex) are mapped.
• If you are using a CPU Unit with unit version 1.09 or earlier and you are not using an OM-
RON G5-series Servo Drive with built-in EtherCAT communications for the servo axis, Modes
of Operation (6060 hex) and Modes of Operation Display (6061 hex) are required.
Object Settings
The OMRON G5-series Servo Drive settings required to use the control functions of the MC Function
Module are listed in the following table.
Consult the manual for your Servo Drive and set all related objects for the Servo Drive functions that
you are going to use.
Subin- Recommended
Index Name Description
dex setting
3013 hex 00 hex No. 1 External Torque Limit*1 1388 hex Default setting = 500.0%
3015 hex*2 00 hex Operation Switch for Using 0002 hex Use absolute values and ignore multi-rota-
Absolute Encoder tion counter overflow.
Subin- Recommended
Index Name Description
dex setting
3317 hex 00 hex Speed Limit Selection 0001 hex The velocity limit method used during tor-
que control is either 607F hex: Max profile
velocity or 3321 hex: Velocity limit value
setting, whichever value is smaller.
3323 hex 00 hex External Feedback Pulse Type 0000, 0001, or Set the type of external scale to use.
Selection 0002 hex*3 The default value is 0000 hex (90° Phase
Difference Output).
3324 hex*2 00 hex External Feedback Pulse Di- 00000000 hex Set the encoder resolution per motor rota-
viding Numerator tion [pulses]. Set to 0 for automatic setting.
3401 hex 00 hex Input Signal Selection 2 00818181 hex Positive Drive Prohibit Input (NC)
3402 hex 00 hex Input Signal Selection 3 00828282 hex Negative Drive Prohibit Input (NC)
3403 hex 00 hex Input Signal Selection 4 00222222 hex Home proximity input (NO)
3404 hex 00 hex Input Signal Selection 5 002B2B2B hex External Latch Signal 3 (NO)
3405 hex 00 hex Input Signal Selection 6 00212121 hex External Latch Signal 2 (NO)
3406 hex 00 hex Input Signal Selection 7 00202020 hex External Latch Signal 1 (NO)
3504 hex 00 hex Drive Prohibit Input Selection 0001 hex The drive prohibit input is disabled at the
Servo.
This is performed by the MC Function
Module instead.
3508 hex 00 hex Undervoltage Error Selection 0001 hex Operation is stopped for an insufficient
main power voltage.
3521 hex 00 hex Torque Limit Selection*1 0006 hex There are two limit values, one for positive
and one for negative. Switch between them
by using PCL and NCL.
3522 hex 00 hex No. 2 External Torque Limit*1 1388 hex Default setting = 500.0%
3703 hex 00 hex Torque Limit Output Setting*1 0001 hex Output turns ON for the torque limit value
excluding the torque command value.
3801 hex 00 hex Software Limit Function 0003 hex Disable the software limits in both direc-
tions.
3758 hex 00 hex Latch Trigger Selection 0100 hex Touch probe1 = External latch signal 1,
Touch probe2 = External latch signal 2
3759 hex 00 hex Warning Hold Selection 0000 hex The warnings are automatically cleared
when the cause of the warning is eliminat-
ed.
607C hex 00 hex Encoder Home Offset 00000000 hex An offset value of 0 is used by the Servo
Drive.
6091 hex 01 hex Electronic Gear Ratio Numer- 00000001 hex The gear ratio on the Servo Drive is 1:1. A
ator similar function is set in the MC Function
02 hex Electronic Gear Ratio Denomi- 00000001 hex Module.
nator
*1. For OMRON G5-series Linear Motor Type Servo Drives with built-in EtherCAT communications, “force” applies instead
of “torque.”
*2. OMRON G5-series Linear Motor Type Servo Drives with built-in EtherCAT communications do not support this object.
*3. Select a value according to the type of external scale to use when you use fully-closed control with an OMRON G5-
series Servomotor/Servo Drive, or when you use an OMRON G5-series Linear Motor Type Servomotor/Servo Drive
with built-in EtherCAT communications.
Refer to the NJ/NX-series CPU Unit Built-in EtherCAT Port User’s Manual (Cat. No. W505) for infor-
mation on the connection methods.
A
A-3-2 Settings for Encoder Input Terminals
Refer to the GX-series EtherCAT Slave Units User’s Manual (Cat. No. W488) for detailed information
on the Encoder Input Terminals.
Additional Information
• Only the OMRON GX-EC0211/EC0241 can be used for encoder axes of EtherCAT slaves.
• Unit version 1.0 of the OMRON GX-EC0211/EC0241 can also be used for encoder axes, but
they are not Sysmac devices.
When you use unit version 1.0, do not set the node address switches to 00. If you set them to
00, a network configuration error occurs.
Refer to the GXseries EtherCAT Slave Units User’s Manual (Cat. No. W488) for detailed in-
formation on functions.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on
Sysmac devices.
• Counter B phase
• Counter Z phase
• Latch Inputs (A/B)
There are two counter channels, and there are two external latches for each channel. Wire the input
signals that are required for your application.
Refer to the GX-series EtherCAT Slave Units User’s Manual (Cat. No. W488) for input signal wiring
methods.
PDO Mapping
This section describes mapping PDOs to control encoder axes from the MC Function Module.
You must map the objects that are required for the motion control functions that you will use to process
data communications.
The PDO map is a list of required objects that is prepared in advance.
You select the PDOs to use in the Edit PDO Map Settings Window of the EtherCAT Tab Page in the
Sysmac Studio.
Channel 1 Instruction Bits (4020 hex-01 hex) and Channel 2 Instruction Bits (4020
RxPDO (1700 hex)
hex-02 hex)
Channel 1 Preset Value (4011 hex-01 hex) and Channel 2 Preset Value (4011 hex-02
RxPDO (1701 hex)
hex)
Channel 1 Position Value (4010 hex-01 hex) and Channel 2 Position Value (4010 hex-02
TxPDO (1B00 hex)
hex)
Channel 1 Latch Value A (4012 hex-01 hex) and Channel 2 Latch Value A (4012 hex-02
TxPDO (1B01 hex)
hex)
Channel 1 Latch Value B (4013 hex-01 hex) and Channel 2 Latch Value B (4013 hex-02
TxPDO (1B02 hex)
hex)
TxPDO (1B03 hex) Channel 1 Status Bits (4030 hex-01 hex) and Channel 2 Status Bits (4030 hex-02 hex)
TxPDO (1BFF hex) Sysmac Error Status (2002 hex-01 hex)
Additional Information
To access the settings, click the Detailed Settings Button on the Axis Basic Settings Display in the
Sysmac Studio.
A
Additional Information
If you use the recommended Encoder Input Terminals (GX-EC0211/EC0241, version 1.1 or lat-
er), then it is not necessary to change the default relationships between the functions and proc-
ess data on the Sysmac Studio.
Process data
Function name Description
Channel 1 Channel 2
¡ Software Switch of 4020 hex-01.0 4020 hex-02.0 Set the instruction bits.
Encoder's Input Slave (Instruction Bits) (Instruction Bits) Set the objects given at the left for
each channel.
If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
Process data
Function name Description
Channel 1 Channel 2
¡ Position actual val- 4010 hex-01.0 4010 hex-02.0 Store the current values from the
ue (Position Value) (Position Value) counters.
Set the objects given at the left for
each channel.
Touch probe posi- 4012 hex-01.0 4012 hex-02.0 The latched position for touch probe
tion 1 position value (Latch Value A) (Latch Value A) 1. Store the values of latch positions
A.
You must map these objects to use
the touch probe function, i.e., to use
the MC_TouchProbe (Enable Exter-
nal Latch) instruction.
Set the objects given at the left for
each channel.
Touch probe posi- 4013 hex-01.0 4013 hex-02.0 The latched position for touch probe
tion 2 position value (Latch Value B) (Latch Value B) 2. Store the values of latch positions
B.
You must map these objects to use
the touch probe function, i.e., to use
the MC_TouchProbe (Enable Exter-
nal Latch) instruction.
Set the objects given at the left for
each channel.
Status of Encoder's 4030 hex-01.0 4030 hex-02.0 Store the status bits.
Input Slave (Status Bits) (Status Bits) You must map these objects to use
the touch probe function, i.e., to use
the MC_TouchProbe (Enable Exter-
nal Latch) instruction.
Set the objects given at the left for
each channel.
If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
The maximum value of the ring counter for the Encoder Input Terminal is set on the EtherCAT Tab
Page in the Sysmac Studio.
The setting is as follows:
The following diagram shows the state transition defined in CiA402 drive profile.
Each box indicates a state, while numbers indicate the state control commands.
Ready to
12 switch on
Switch on: 3
6: Shutdown
14: Error response
operation is completed
Switched on
Disable Voltage: 10
• After communications with the Servo Drive is established, MC Function Module automatically
changes the PDS state to Servo Ready (Switched on).
• If Enable of the MC_Power (Power Servo) instruction changes to TRUE in the Servo Ready
(Switched on) state, the PDS state changes to Servo ON (Operation enabled). This operation
corresponds to 4: Enable operation in the state transition diagram.
• If Enable of the MC_Power (Power Servo) instruction changes to FALSE in the Servo ON (Oper-
Version Information
• For a CPU Unit with unit version 1.10 or later, PDS State Control Method is selectable. PDS
State Control Method is set to 0 by default.
• For a CPU Unit with unit version 1.09 or earlier, PDS State Control Method is set to 0.
You cannot select the Do not detect option when you use an OMRON 1S-series Servo Drive or
G5-series Servo Drive.
A Servo Main Circuit Power OFF error will occur if you select the Do not detect option and turn
off the main power supply to Servo Drive when the Servo is ON.
Version Information
• For a CPU Unit with unit version 1.10 or later, Main circuit power supply OFF detection is
selectable. Main circuit power supply OFF detection is set to Detect by default.
• For a CPU Unit with unit version 1.09 or earlier, Main circuit power supply OFF detection
is set to Detect.
A-6 Terminology
This appendix provides definitions of terms related to motion control.
A-6 Terminology
It performs motion control based on commands from the motion control instruc-
tions that are executed in the user program. (Abbreviation: MC Function Mod-
ule)
motion control instruction An instruction that is defined as a function block to execute a motion control
function.
The MC Function Module supports instructions that are based on function
blocks for PLCopen® motion control as well as instructions developed specifi- A
cally for the MC Function Module.
motion control axes Axes for which all motion control functions can be used.
Term Description
homing The process of defining home.
Homing is also called home positioning, home searching, calibration, and da-
tum.
home The zero position of the mechanical system.
Home is determined by the home input signal during the homing operation.
zero position The position that is based on home and is treated as the zero position in the
user program.
This is the same position as home if the home position is not changed.
following error The difference between the command current position and actual current posi-
tion.
There is a following error only in position control mode. (Other modes do not
have a command current position.)
The following error is also called the following error counter value and the re-
maining pulses.
following error reset Setting the following error to zero.
cam profile curve A curve that shows the relationship between phases and displacements in a
cam operation.
The cam profile curve is created on the Sysmac Studio.
cam data Data made up of phases (master axis) and displacements (slave axis) for cam
operation.
cam data variable A structure array variable for cam data.
It contains phases and displacements and is defined as a structure array.
cam table A data table that contains cam data.
Use the Sysmac Studio to download the cam profile curves that you created
with the Cam Editor to the CPU Unit to save them as cam tables in the non-
volatile memory in the CPU Unit.
override A function that allows the operator to temporarily change programmed values
during operation.
jerk The rate of change in the acceleration or deceleration rate.
If you specify the jerk, the velocity graph will form an S-curve for acceleration
and deceleration.
Jerk is also called jolt, surge, and lurch.
Multi-motion Performing the motion controls in parallel using both of the primary periodic
task and the priority-5 periodic task.
Term Description
Process Data Object A process data (I/O data) object that exchanges data at regular periods with
CoE.
Service Data Object CoE asynchronous mailbox communications where all objects in the object dic-
tionary can be read and written.
Receive PDO A process data object received by an EtherCAT slave.
Transmit PDO A process data object sent from an EtherCAT slave.
Device Profile A collection of device dependent information and functionality providing consis-
A-6 Terminology
tency between similar devices of the same device type.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for the relationship be-
tween the unit versions of CPU Units and the Sysmac Studio versions.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for version
information on the motion control instructions.
Motion Control Functions That Were Added for Unit Version 1.01
Version 1.02 or higher of the Sysmac Studio is required to use the functions that were added for unit
version 1.01 of the CPU Unit.
Function Overview
Changing the axes in an axes You can use the MC_ChangeAxesInGroup (Change Axes in Group) in-
group struction to temporarily change the Composition Axes axes group pa-
rameter for an axes group.
Reading axes group positions You can use the MC_GroupReadPosition (Read Axes Group Position) in-
struction to read the command current positions and the actual current
positions of an axes group.
Axes group cyclic synchronous ab- You can use the MC_GroupSyncMoveAboslute (Axes Group Cyclic Syn-
solute positioning chronous Absolute Positioning) instruction to cyclically output the speci-
fied target positions for the axes.
Controllable Servo Drives Support was added for OMRON G5-series Linear Motor Type Servomo-
tors/Servo Drives with built-in EtherCAT communications.
Motion Control Functions That Were Added for Unit Version 1.02
Version 1.03 or higher of the Sysmac Studio is required to use the functions that were added for unit
version 1.02 of the CPU Unit.
No motion control functions were added for unit version 1.02, but the specifications of some instruc-
tions were improved. Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat.
No. W508) for version information on the motion control instructions.
Motion Control Functions That Were Added for Unit Version 1.03
Version 1.04 or higher of the Sysmac Studio is required to use the functions that were added for unit
version 1.03 of the CPU Unit.
Function Overview
Cyclic synchronous absolute posi- The MC_SyncMoveAbsolute (Cyclic Synchronous Absolute Positioning)
tioning instruction can be used to output a command position each control period
in Position Control Mode.
Function Overview
Homing with parameters The MC_HomeWithParameter (Home with Parameters) instruction can be
used to specify the homing parameters and operate the motor to deter-
mine home. It uses the limit signals, home proximity signal, and home
signal.
Function Overview
Changing axis use You can use the MC_ChangeAxisUse (Change Axis Use) instruction to
temporarily change the setting of the Axis Use axis parameter.
A
Motion Control Functions That Were Added for Unit Version 1.05
Version 1.06 or higher of the Sysmac Studio is required to use the functions that were added for unit
version 1.05 of the CPU Unit.
Function Overview
Start velocity You can set the initial velocity when axis motion starts.
Input signal logic inversion You can inverse the logic of immediate stop input signal, positive limit in-
put signal, negative limit input signal, or home proximity input signal.
Note With a CPU Unit with unit version 1.05 or later, you can perform motion control by assigning axes to NX-
series Position Interface Units.
Function Overview
Maximum number of controlled ax- The maximum number of controlled axes for NJ301-££££ was in-
es creased to 15 axes.
(No change in maximum number of used real axes.)
Maximum number of axes for sin- The maximum number of axes for single-axis control for NJ301-££££
gle-axis control was increased to 15 axes.
(No change in maximum number of used real axes.)
Enable digital cam switch You can use the MC_DigitalCamSwitch (Enable Digital Cam Switch) in-
struction to turn the digital outputs ON or OFF according to the axis posi-
tion.
Time stamp to axis position calcula- You can use the MC_TimeStampToPos (Time Stamp to Axis Position Cal-
tion culation) instruction to calculate the position of the axis for the specified
time stamp.
Adding blending options to Start The blending options were added to Buffer Mode Selection for the
Cam Operation MC_CamIn (Start Cam Operation) instruction.
_sMC_POSITION_REF You can use this data type to display the path of user coordinate systems
in 3D Motion Monitor Display Mode.
Function Overview
Generating cam tables You can use the MC_GenerateCamTable (Generate Cam Table) instruc-
tion and generate the cam table according to the cam property and cam
node specified for the input parameters.
Changing axis parameters You can access and change the axis parameters from the MC_WriteAxis-
Parameter (Write Axis Parameters) instruction and the MC_ReadAxis-
Parameter (Read Axis Parameters) instruction in the user program.
Assigning device variables You can assign the device variables to the I/O ports of slaves and Units
that are assigned to the Axis Variables. *1
Refer to 2-4-2 Relationship between EtherCAT Master Function Module
and MC Function Module on page 2-19 for details.
*1. This function is independent of the version of the CPU Unit. Using the Sysmac Studio version 1.09 or higher
allows you use this assignment function.
No motion control functions were added for unit version 1.09, but the specifications of some instruc-
tions were improved. Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat.
No. W508) for version information on the motion control instructions.
Function Overview
Slave axis position compensation This function compensates the position of the slave axis currently in
synchronized control.
Change in the blending operation The maximum acceleration/deceleration rate is used and the blending op-
eration is continued even if you set the Acceleration/Deceleration Over
parameter to Use rapid acceleration/deceleration (Blending is
changed to Buffered) or Minor fault stop.
Home definition timing for absolute In addition to the existing home definition timing, home is also defined
encoders when EtherCAT slave process data communications change from a non-
established to an established state.
Current position when process data The actual current position and the command current position axis varia-
communications are in a non-es- bles will contain the actual current position output that is just before proc-
tablished state ess data communications change to a non-established state.
Function Overview
With or without Modes of Operation The operation depends on whether Modes of Operation (6060 hex) and
(6060 hex) and Modes of Operation Modes of Operation Display (6061 hex) are mapped.
Display (6061 hex) mapping
PDS state control method You can set the state to which PDS state changes when Servo is turned
OFF by the MC_Power instruction.
Version 1.13 or higher of the Sysmac Studio is required to use the following functions that were added
for unit version 1.10 of the CPU Unit.
Function Overview
Synchronized control in multi-mo- You can execute the synchronized control instructions between axes as-
tion signed to different tasks in the multi-motion.
A
Function Overview
Adding the parameters for the unit The following parameters were added: Reducer Use, Work Travel
conversion settings Distance Per Rotation, Work Gear Ratio, and Motor Gear Ratio.
Version 1.16 or higher of the Sysmac Studio is required to use the following functions that were added
for unit version 1.11 of the CPU Unit.
Function Overview
Controllable Servo Drives Support was added for OMRON 1S-series Servo Drives with built-in
EtherCAT communications.
Function Overview
Control Function Select the function of axis to control.
Commands to I/O devices during The MC Function Module operation differs depending on the setting that
the download process specifies to stop or continue sending commands to the I/O devices when
the download process starts.
Motion Control Functions That Were Added for Unit Version 1.21 or
1.32
The specified unit version of the CPU Unit and version 1.28 or higher of the Sysmac Studio are re-
quired to use the functions described below.
Function Overview
Cam Monitor You can use the MC_CamMonitor (Cam Monitor) instruction to monitor
the phase and displacement of the cam table based on the current mas-
ter axis position and the position and displacement of the current slave
axis.
Slave axis position compensation You can use the MC_OffsetPosition (Position Offset Compensation) to
add the specified position offset with the acceleration/deceleration curve
to the slave axis currently in synchronized control and compensates the
command position.
Controllable Servo Drives Support was added for OMRON 1S-series Servo Drives with built-in
EtherCAT Communications and Safety Functionality.
Index
A axis parameters................................................................. 3-2
Axis Ready-to-execute.................................................... 6-25
aborting.................................................................. 9-49, 9-67 axis states
absolute encoder Axis Disabled................................................................. 6-8
applicable Servomotors............................................... 8-16 Continuous Motion......................................................... 6-9
Home Offset................................................................. 8-16 Coordinated Motion........................................................6-9
Rotary Mode................................................................ 8-17 Deceleration Stopping....................................................6-9
setup............................................................................ 8-17 Discrete Motion.............................................................. 6-8
absolute positioning...........................................................9-4 Error Deceleration Stopping...........................................6-8
acceleration and deceleration..........................................9-36 Homing...........................................................................6-9
Acceleration Warning Value................................... 5-21, 9-37 Stopped..........................................................................6-8
Acceleration/Deceleration Over..............................5-21, 9-37 Synchronized Motion..................................................... 6-9
Actual Current Position....................................................6-28 Axis Status.......................................................................6-25
Actual Current Torque......................................................6-29 Axis Type..................................................................5-8, 6-29
Actual Current Velocity.................................................... 6-29 axis types.........................................................................5-10
actual position........................................................ 6-19, 9-33 Axis Use................................................................... 5-8, 6-29
actual velocity.................................................................. 9-35 Axis Variable names.......................................................... 3-6
Actual Velocity Filter Time Constant.......................5-22, 9-35 Axis Variables........................................................... 3-3, 6-25
Axes Group Basic Settings..............................................6-35
Axes Group Command Values........................................ 6-35 B
Axes Group Control Status..............................................6-34
Axes Group Disabled.......................................................6-34 basic data types...............................................................6-22
Axes Group Minor Fault...................................................6-35 blending..................................................................9-51, 9-69
Axes Group Minor Fault Code......................................... 6-35 Buffer Mode............................................................ 9-48, 9-67
Axes Group Minor Fault Occurrence............................... 6-35 buffered.................................................................. 9-50, 9-68
Axes Group Number...............................................5-35, 6-35
Axes Group Observation................................................. 6-35 C
Axes Group Observation Code........................................6-35
Axes Group Observation Occurrence..............................6-35 cam block........................................................................ 9-17
axes group parameters....................................................3-21 cam block end point.........................................................9-17
axes group states cam block start point........................................................9-17
Deceleration Stopping..................................................6-10 cam curves...................................................................... 9-17
Error Deceleration Stopping.........................................6-10 cam data..........................................................................9-17
Moving......................................................................... 6-10 cam data index................................................................ 9-17
Standby........................................................................6-10 cam data variables.......................................................... 9-17
Axes Group Status.......................................................... 6-34 cam end point.................................................................. 9-17
Axes Group Stop Method................................................ 5-38 cam operation.........................................................9-15, 9-16
Axes Group Use..................................................... 5-35, 6-36 cam profile curves.................................................. 6-37, 9-17
Axes Group Variable names............................................ 3-23 names.......................................................................... 6-40
Axes Group Variables.............................................3-21, 6-33 cam start point................................................................. 9-17
Axis Basic Settings.......................................................... 6-29 cam table................................................................9-17, 9-18
Axis Command Values.....................................................6-28 Cam Table File Save Busy.............................................. 6-24
axis composition of axes group....................................... 5-35 cam table start position....................................................9-18
Axis Control Status.......................................................... 6-26 cam tables
Axis Current Value........................................................... 6-28 cam table names..........................................................6-40
Axis Disabled...................................................................6-25 cam table specifications...............................................9-19
axis following error monitoring.........................................9-82 data type of cam tables................................................9-20
Axis Minor Fault...............................................................6-29 generating cam tables..................................................9-22
Axis Minor Fault Code..................................................... 6-29 saving cam tables........................................................ 9-21
Axis Minor Fault Occurrence........................................... 6-29 specifying in the user program.....................................6-40
Axis Number.............................................................5-8, 6-29 switching cam tables....................................................9-20
axis numbers..................................................................... 5-9 updating properties...................................................... 9-21
Axis Observation............................................................. 6-29 changing acceleration rate.............................................. 9-46
Axis Observation Code....................................................6-29 changing axes in Axes Groups........................................9-56
Axis Observation Occurrence..........................................6-29 changing axis use............................................................9-84
changing deceleration rate.............................................. 9-46
_MC_AX[*].Scale.Den (Work Travel Distance Per Motor Ro- _MC_GRP[*].MFaultLvl.Code (Axes Group Minor Fault
tation)........................................................................... 6-30 Code)........................................................................... 6-35
_MC_AX[*].Scale.MaxPos (Maximum Current Position). 6-30 _MC_GRP[*].Obsr.Active (Axes Group Observation Occur-
_MC_AX[*].Scale.MinPos (Minimum Current Position)... 6-30 rence)...........................................................................6-35
_MC_AX[*].Scale.Num (Command Pulse Count Per Motor _MC_GRP[*].Obsr.Code (Axes Group Observation Code)....
Rotation)...................................................................... 6-30 ..................................................................................... 6-35
_MC_AX[*].Scale.Units (Unit of Display)......................... 6-30 _MC_GRP[*].Status.Disabled (Axes Group Disabled).... 6-34
_MC_AX[*].Status.Continuous (Continuous Motion)....... 6-26 _MC_GRP[*].Status.ErrorStop (Error Deceleration Stopping)
_MC_AX[*].Status.Coordinated (Coordinated Motion).... 6-26 ..................................................................................... 6-34
_MC_AX[*].Status.Disabled (Axis Disabled)................... 6-25 _MC_GRP[*].Status.Moving (Moving)............................. 6-34
_MC_AX[*].Status.Discrete (Discrete Motion)................. 6-26 _MC_GRP[*].Status.Ready (Ready-to-execute)............. 6-34
_MC_AX[*].Status.ErrorStop (Error Deceleration Stopping)... _MC_GRP[*].Status.Standby (Standby)..........................6-34
..................................................................................... 6-26 _MC_GRP[*].Status.Stopping (Deceleration Stopping)...6-34
_MC_AX[*].Status.Homing (Homing).............................. 6-26 Minimum Current Position............................................... 6-30
_MC_AX[*].Status.Ready (Axis Ready-to-execute).........6-25 Modulo Maximum Position Setting Value............... 5-26, 5-28
_MC_AX[*].Status.Standstill (Standstill).......................... 6-25 Modulo Minimum Position Setting Value................ 5-26, 5-28
_MC_AX[*].Status.Stopping (Deceleration Stopping)......6-26 Motion Control...................................................5-8, 5-9, 5-35
_MC_AX[*].Status.Synchronized (Synchronized Motion)6-26 Motion Control Function Module........................................2-2
_MC_COM (MC Common Variable)................................ 6-24 motion control instructions
_MC_COM.MFaultLvl.Active (MC Common Minor Fault Oc- Enable-type instructions...............................................6-14
currence)......................................................................6-25 exclusiveness of outputs..............................................6-12 I
_MC_COM.MFaultLvl.Code (MC Common Minor Fault Execute-type instructions.............................................6-14
Code)........................................................................... 6-25 input parameters.......................................................... 6-12
_MC_COM.Obsr.Active (MC Common Observation Occur- operation of output variable Busy................................ 6-13
rence)...........................................................................6-25 operation of output variable CommandAborted........... 6-13
_MC_COM.Obsr.Code (MC Common Observation Code)..... operation of output variable Done................................6-13
..................................................................................... 6-25 output status................................................................ 6-12
_MC_COM.PFaultLvl.Active (MC Common Partial Fault Oc- output variable Active...................................................6-13
currence)......................................................................6-25 timing charts for enable-type instructions.................... 6-16
_MC_COM.PFaultLvl.Code (MC Common Partial Fault timing charts for execute-type instructions...................6-15
Code)........................................................................... 6-25 motion control parameter settings..................................... 5-2
_MC_COM.Status.CamTableBusy (Cam Table File Save motion control period....................................................... 2-22
Busy)............................................................................6-24 motion control programs....................................................6-2
_MC_COM.Status.GenerateCamBusy (Generating Cam Ta- Moving............................................................................. 6-34
ble)............................................................................... 6-24 multi-axes coordinated control.........................................9-55
_MC_COM.Status.RunMode (MC Run).......................... 6-24 multi-execution....................................................... 9-48, 9-67
_MC_COM.Status.TestMode (MC Test Run)...................6-24
_MC_GRP[*] (Axes Group Variable)................................6-34 N
_MC_GRP[*].Cfg.ExecID (Execution ID).........................6-36
_MC_GRP[*].Cfg.GrpEnable (Axes Group Use)............. 6-36 Negative Direction.................................................. 6-27, 9-40
_MC_GRP[*].Cfg.GrpNo (Axes Group Number)............. 6-35 Negative Limit Input.........................................................6-27
_MC_GRP[*].Cmd.AccDec (Command Interpolation Accel- Negative Limit Input Logic Inversion................................5-25
eration/Deceleration)....................................................6-35 Negative Software Limit...................................................5-26
_MC_GRP[*].Cmd.Vel (Command Interpolation Velocity)...... Negative Torque Warning Value...................................... 5-22
..................................................................................... 6-35 no direction specified.......................................................9-40
_MC_GRP[*].Details.Idle (Idle)........................................6-35 Node Address..................................................................6-29
_MC_GRP[*].Details.InPosWaiting (In-position Waiting). 6-35 null cam data................................................................... 9-18
_MC_GRP[*].Kinematics.Axis[0] (Composition Axis for Axis number of valid cam data................................................ 9-17
A0)............................................................................... 6-36
_MC_GRP[*].Kinematics.Axis[1] (Composition Axis for Axis O
A1)............................................................................... 6-36
_MC_GRP[*].Kinematics.Axis[2] (Composition Axis for Axis object dictionary...............................................................2-19
A2)............................................................................... 6-36 Operation Selection at Negative Limit Input............. 5-30, 8-9
_MC_GRP[*].Kinematics.Axis[3] (Composition Axis for Axis Operation Selection at Positive Limit Input...............5-29, 8-9
A3)............................................................................... 6-36 Operation Selection at Reversing....................................5-21
_MC_GRP[*].Kinematics.GrpType (Composition)........... 6-36 original cam data............................................................. 9-17
_MC_GRP[*].MFaultLvl.Active (Axes Group Minor Fault Oc- Output Device...........................................................5-8, 5-12
currence)......................................................................6-35 overrides................................................................. 9-11, 9-61
P MC_ImmediateStop instruction......................................9-8
MC_Stop instruction.......................................................9-7
periodic tasks.....................................................................2-6 Servo Drive input signals............................................... 9-6
phase...............................................................................9-17 stop method................................................................... 9-9
phase pitch...................................................................... 9-18 deceleration stop........................................................ 9-9
PLC Function Module........................................................ 2-2 immediate stop......................................................... 9-10
PLCopen............................................................................1-2 immediate stop and error reset................................ 9-10
positioning gear operation............................................... 9-14 immediate stop and Servo OFF............................... 9-10
positions.......................................................................... 9-33 stopping due to errors or other problems.....................9-60
Positive Direction....................................................6-27, 9-40 stopping under multi-axes coordinated control................9-59
Positive Limit Input.......................................................... 6-27 structure data types......................................................... 6-23
Positive Limit Input Logic Inversion................................. 5-25 superimpose corners..............................................9-71, 9-74
Positive Software Limit.................................................... 5-26 synchronized control........................................................9-13
Positive Torque Warning Value........................................5-22 Synchronized Motion....................................................... 6-26
primary period.......................................................... 2-7, 2-23 synchronous positioning.................................................. 9-24
Primary periodic task......................................................... 2-5 system-defined variables.................................................6-21
process data communications cycle................................2-22 system-defined variables for motion control
process data objects (PDOs)...........................................2-19 attributes...................................................................... 6-23
Production Information........................................................26
program-modified cam data.............................................9-17 T
OMRON (CHINA) CO., LTD. © OMRON Corporation 2011-2020 All Rights Reserved.
OMRON ASIA PACIFIC PTE. LTD.
Room 2211, Bank of China Tower, In the interest of product improvement,
No. 438A Alexandra Road # 05-05/08 (Lobby 2),
200 Yin Cheng Zhong Road, specifications are subject to change without notice.
Alexandra Technopark,
Singapore 119967 PuDong New Area, Shanghai, 200120, China
Tel: (65) 6835-3011/Fax: (65) 6835-2711 Tel: (86) 21-5037-2222/Fax: (86) 21-5037-2200 Cat. No. W507-E1-23 0820