Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
36 views502 pages

Manuale Motion Control Omron

This document is the Motion Control User's Manual for NJ/NX-series CPU Unit. It contains information necessary for using the Motion Control Function Module of NJ/NX-series CPU Units. The manual is intended for personnel introducing, designing, installing or maintaining factory automation systems and those responsible for programming in languages like IEC 61131-3 or JIS B 3503. It covers NX-series and NJ-series CPU Units, and relevant manuals include the hardware manuals, software manuals, instructions references manual, and motion control instructions reference manual for those CPU Units.

Uploaded by

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

Manuale Motion Control Omron

This document is the Motion Control User's Manual for NJ/NX-series CPU Unit. It contains information necessary for using the Motion Control Function Module of NJ/NX-series CPU Units. The manual is intended for personnel introducing, designing, installing or maintaining factory automation systems and those responsible for programming in languages like IEC 61131-3 or JIS B 3503. It covers NX-series and NJ-series CPU Units, and relevant manuals include the hardware manuals, software manuals, instructions references manual, and motion control instructions reference manual for those CPU Units.

Uploaded by

thiago.prata.mrv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 502

Machine Automation Controller

NJ/NX-series
CPU Unit

Motion Control
User’s Manual
NX701-17
NX701-16
NX1P2-11
NX1P2-10
NX1P2-90
NJ501-5
NJ501-4
NJ501-3
NJ301-12
NJ301-11
NJ101-10
CPU Unit

W507-E1-15
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, Windows Vista, Excel, and Visual Basic are either registered trademarks or trademarks of
Microsoft Corporation 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.

• The SD and SDHC logos are trademarks of SD-3C, LLC.

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.
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
• NX1P2-11
• NX1P2-111
• NX1P2-10
• NX1P2-101
• NX1P2-90
• NX1P2-901

• NJ-series CPU Units


• NJ501-5
• NJ501-4
• NJ501-3
• NJ301-12
• NJ301-11
• NJ101-10

Part of the specifications and restrictions for the CPU Units are given in other manuals. Refer to Rele-
vant Manuals on page 2 and Related Manuals on page 24.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1


Relevant Manuals

Relevant Manuals
The following provides the relevant manuals for the NJ/NX-series CPU Units.
Read all of the manuals that are relevant to your system configuration and application before you use
the NJ/NX-series CPU Unit.
Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac Stu-
dio Version 1 Operation Manual (Cat. No. W504) for information on the Sysmac Studio.

Manual
Basic information
Hardware User’s Manual
NX-series CPU Unit
Hardware User's Manual
NX-series NX1P2 CPU Unit
Hardware User’s Manual
NJ-series CPU Unit
Software User’s Manual
NJ/NX-series CPU Unit
Built-in I/O and Option Board User's Manual
NX-series NX1P2 CPU Unit
Instructions Reference Manual
NJ/NX-series
Motion Control User’s Manual
NJ/NX-series CPU Unit
Motion Control Instructions Reference Manual
NJ/NX-series
Built-in EtherCAT Port User’s Manual
NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual
NJ/NX-series CPU Unit
User’s Manual
NJ-series Database Connection CPU Units
User’s Manual
NJ-series SECS/GEM CPU Units
CPU Unit User’s Manual
NJ-series NJ Robotics
Troubleshooting Manual
NJ/NX-series
Purpose of use

Introduction to NX701 CPU Units 


Introduction to NX1P2 CPU Units 
Introduction to NJ-series Controllers 
Setting devices and hardware   
Using motion control 
Using EtherCAT 
Using EtherNet/IP 
Software settings 
Using motion control 
Using EtherCAT 
Using EtherNet/IP 
Using the database connection service 
Using the GEM Services 
Using robot control 
Using the NX1P2 CPU Unit functions 
Writing the user program  
Using motion control  
Using EtherCAT 
Using EtherNet/IP 
Using the database connection service 
Using the GEM Services 
Using robot control 
Programming error processing 
Using the NX1P2 CPU Unit functions 

2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Relevant Manuals

Manual
Basic information

Hardware User’s Manual


NX-series CPU Unit
Hardware User's Manual
NX-series NX1P2 CPU Unit
Hardware User’s Manual
NJ-series CPU Unit
Software User’s Manual
NJ/NX-series CPU Unit
Built-in I/O and Option Board User's Manual
NX-series NX1P2 CPU Unit
Instructions Reference Manual
NJ/NX-series
Motion Control User’s Manual
NJ/NX-series CPU Unit
Motion Control Instructions Reference Manual
NJ/NX-series
Built-in EtherCAT Port User’s Manual
NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual
NJ/NX-series CPU Unit
User’s Manual
NJ-series Database Connection CPU Units
User’s Manual
NJ-series SECS/GEM CPU Units
CPU Unit User’s Manual
NJ-series NJ Robotics
Troubleshooting Manual
NJ/NX-series
Purpose of use

Testing operation and debugging 


Using motion control 
Using EtherCAT 
Using EtherNet/IP 
Using the database connection service 
Using the GEM Services 
Using robot control 
Using the NX1P2 CPU Unit functions 
Learning about error management
           
and corrections *1
Maintenance
Using motion control 
  
Using EtherCAT 
Using EtherNet/IP 

*1 Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the error management concepts and an overview of the error
items. Refer to the manuals that are indicated with triangles for details on errors for the corresponding Units.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3


Manual Structure

Manual Structure

Page Structure
The following page structure is used in this manual.

4 Installation and Wiring Level 1 heading


Level 2 heading
Level 2 heading 4-3 Mounting Units Level 3 heading
Gives the current
Level 3 heading 4-3-1 Connecting Controller Components headings.
The Units that make up an NJ-series Controller can be connected simply by pressing the Units together
and locking the sliders by moving them toward the back of the Units. The End Cover is connected in the
same way to the Unit on the far right side of the Controller.

A step in a procedure 1 Join the Units so that the connectors fit exactly.

Hook
Indicates a procedure. Connector
Hook holes

4-3 Mounting Units


4 Page tab
2 Gives the number

4-3-1 Connecting Controller Components


The yellow sliders at the top and bottom of each Unit lock the Units together. Move the sliders
toward the back of the Units as shown below until they click into place. of the main section.
Move the sliders toward the back
until they lock into place.

Lock

Release

Slider

Precautions for Correct Use


Special information The sliders on the tops and bottoms of the Power Supply Unit, CPU Unit, I/O Units, Special I/O
Units, and CPU Bus Units must be completely locked (until they click into place) after connecting
Icons indicate the adjacent Unit connectors.
precautions, additional
information, or reference
information.

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.

4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Manual Structure

Special Information
Special information in this manual is classified as follows:

Precautions for Safe Use


Precautions on what to do and what not to do to ensure safe usage of the product.

Precautions for Correct Use


Precautions on what to do and what not to do to ensure proper operation and performance.

Additional Information
Additional information to read as required.
This information is provided to increase understanding or make operation easier.

Note References are provided to more detailed or related information.

Version Information
Information on differences in specifications and functionality for CPU Units with different unit versions
and for different versions of the Sysmac Studio are given.

Precaution on Terminology
In this manual, “download” refers to transferring data from the Sysmac Studio to the physical Controller
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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5


Manual Structure

6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Sections in this Manual

Sections in this Manual

1 10

Introduction to the 2 11
Motion Control
1 Function Module 10 Sample Programming
3 A
Motion Control
Configuration and
2 Principles
11 Troubleshooting
4 I
Configuring Axes
3 and Axes Groups A Appendices
5

Checking Wiring from


4 the Sysmac Studio I Index 6

7
5 Motion Control Parameters

8
6 Motion Control Programming

9
7 Manual Operation

8 Homing

9 Motion Control Functions

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 7


CONTENTS

CONTENTS
Introduction ............................................................................................................... 1

Relevant Manuals ...................................................................................................... 2

Manual Structure ....................................................................................................... 4

Sections in this Manual ............................................................................................ 7

Terms and Conditions Agreement......................................................................... 13

Safety Precautions .................................................................................................. 15

Precautions for Safe Use........................................................................................ 16

Precautions for Correct Use................................................................................... 17

Regulations and Standards.................................................................................... 18

Versions ................................................................................................................... 20

Related Manuals ...................................................................................................... 24

Revision History ...................................................................................................... 27

Section 1 Introduction to the Motion Control Function Module


1-1 Features.................................................................................................................................... 1-2
1-2 System Configuration ............................................................................................................. 1-3
1-3 Basic Flow of Operation.......................................................................................................... 1-5
1-4 Specifications .......................................................................................................................... 1-7
1-4-1 General Specifications ................................................................................................................ 1-7
1-4-2 Performance Specifications......................................................................................................... 1-7
1-4-3 Function Specifications ............................................................................................................. 1-10

Section 2 Motion Control Configuration and Principles


2-1 Internal Configuration of the CPU Unit.................................................................................. 2-2
2-2 Motion Control Configuration................................................................................................. 2-3
2-3 Motion Control Principles ....................................................................................................... 2-5
2-3-1 CPU Unit Tasks ........................................................................................................................... 2-5
2-3-2 Example of Task Operations for Motion Control........................................................................ 2-12
2-4 EtherCAT Communications and Motion Control ................................................................ 2-19
2-4-1 CAN Application Protocol over EtherCAT (CoE) ....................................................................... 2-19
2-4-2 Relationship between EtherCAT Master Function Module and MC Function Module............... 2-20
2-4-3 Relationship between Process Data Communications Cycle and Motion Control Period......... 2-22

Section 3 Configuring Axes and Axes Groups


3-1 Axes .......................................................................................................................................... 3-2
3-1-1 Introduction to Axes .................................................................................................................... 3-2

8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


CONTENTS

3-1-2 Introduction to Axis Parameters.................................................................................................. 3-3


3-1-3 Introduction to Axis Variables ..................................................................................................... 3-7
3-1-4 Synchronizing Axis Variables...................................................................................................... 3-9
3-1-5 Specifying an Axis in the User Program ..................................................................................... 3-9
3-2 Axis Setting Procedure ......................................................................................................... 3-10
3-2-1 Axis Configuration Procedure ................................................................................................... 3-10
3-2-2 Setting Procedure ..................................................................................................................... 3-10
3-3 Axes Groups .......................................................................................................................... 3-20
3-3-1 Introduction to Axes Groups ..................................................................................................... 3-20
3-3-2 Introduction to Axes Group Parameters.................................................................................... 3-21
3-3-3 Introduction to Axes Group Variables ....................................................................................... 3-22
3-3-4 Specifying an Axes Group in the User Program ....................................................................... 3-24
3-4 Setting Procedures for Axes Groups................................................................................... 3-25
3-4-1 Setting Procedure for an Axes Group ....................................................................................... 3-25
3-4-2 Setting Procedure ..................................................................................................................... 3-25

Section 4 Checking Wiring from the Sysmac Studio


4-1 Functions of the Sysmac Studio............................................................................................ 4-2
4-1-1 MC Test Run Function ................................................................................................................ 4-2
4-1-2 Application Procedure................................................................................................................. 4-4
4-1-3 Axis Parameter Setting Example ................................................................................................ 4-5
4-1-4 Starting the MC Test Run Function............................................................................................. 4-6
4-2 Monitoring Sensor Signals ..................................................................................................... 4-7
4-3 Checking Motor Operation...................................................................................................... 4-8
4-3-1 Turning ON the Servo ................................................................................................................. 4-8
4-3-2 Jogging ....................................................................................................................................... 4-8
4-3-3 Homing ....................................................................................................................................... 4-9
4-3-4 Absolute Positioning ................................................................................................................. 4-10
4-3-5 Relative Positioning .................................................................................................................. 4-11

Section 5 Motion Control Parameters


5-1 Introduction.............................................................................................................................. 5-2
5-2 Axis Parameters....................................................................................................................... 5-5
5-2-1 Axis Parameters ......................................................................................................................... 5-5
5-2-2 Axis Basic Settings ..................................................................................................................... 5-7
5-2-3 Unit Conversion Settings .......................................................................................................... 5-13
5-2-4 Operation Settings .................................................................................................................... 5-20
5-2-5 Other Operation Settings .......................................................................................................... 5-24
5-2-6 Limit Settings ............................................................................................................................ 5-25
5-2-7 Position Count Settings ............................................................................................................ 5-25
5-2-8 Servo Drive Settings ................................................................................................................. 5-27
5-2-9 Homing Settings ....................................................................................................................... 5-28
5-2-10 Axis Parameter Setting Example .............................................................................................. 5-29
5-3 Axes Group Parameters ........................................................................................................ 5-32
5-3-1 Axes Group Parameters ........................................................................................................... 5-32
5-3-2 Axes Group Basic Settings ....................................................................................................... 5-33
5-3-3 Axes Group Operation Settings ................................................................................................ 5-35
5-3-4 Enabling an Axes Group ........................................................................................................... 5-37

Section 6 Motion Control Programming


6-1 Introduction.............................................................................................................................. 6-2
6-2 Motion Control Instructions.................................................................................................... 6-4
6-2-1 Function Blocks for PLCopen® Motion Control .......................................................................... 6-4

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9


CONTENTS

6-2-2 Motion Control Instructions of the MC Function Module ............................................................. 6-4


6-3 State Transitions...................................................................................................................... 6-5
6-3-1 Status of the Motion Control Function Module ............................................................................ 6-5
6-3-2 Axis States .................................................................................................................................. 6-6
6-3-3 Axes Group States ...................................................................................................................... 6-8
6-4 Execution and Status of Motion Control Instructions........................................................ 6-10
6-4-1 Basic Rules for Execution of Instructions .................................................................................. 6-10
6-4-2 Execution Timing Charts ........................................................................................................... 6-12
6-4-3 Timing Chart for Re-execution of Motion Control Instructions .................................................. 6-15
6-4-4 Timing Chart for Multi-execution of Motion Control Instructions ............................................... 6-16
6-5 Positions................................................................................................................................. 6-17
6-5-1 Types of Positions ..................................................................................................................... 6-17
6-5-2 Valid Positions for Each Axis Type ............................................................................................ 6-18
6-6 System-defined Variables for Motion Control ..................................................................... 6-19
6-6-1 Overview of System-defined Variables for Motion Control ........................................................ 6-19
6-6-2 System for System-defined Variables for Motion Control.......................................................... 6-22
6-6-3 Tables of System-defined Variables for Motion Control............................................................. 6-24
6-7 Cam Tables and Cam Data Variables ................................................................................... 6-35
6-8 Programming Motion Controls ............................................................................................. 6-39
6-9 Creating Cam Tables ............................................................................................................. 6-41

Section 7 Manual Operation


7-1 Outline ...................................................................................................................................... 7-2
7-2 Turning ON the Servo .............................................................................................................. 7-3
7-2-1 Turning ON the Servo ................................................................................................................. 7-3
7-2-2 Setting Axis Parameters.............................................................................................................. 7-4
7-2-3 Programming Example................................................................................................................ 7-4
7-3 Jogging..................................................................................................................................... 7-5
7-3-1 Jogging Procedure ...................................................................................................................... 7-5
7-3-2 Setting Axis Parameters.............................................................................................................. 7-6
7-3-3 Setting Example for Input Variables ............................................................................................ 7-6
7-3-4 Programming Example................................................................................................................ 7-7

Section 8 Homing
8-1 Outline ...................................................................................................................................... 8-2
8-2 Homing Procedure................................................................................................................... 8-5
8-2-1 Setting Homing Parameters ........................................................................................................ 8-5
8-2-2 Monitoring the Homing Operation ............................................................................................. 8-12
8-3 Homing Operation ................................................................................................................. 8-13
8-4 Homing with an Absolute Encoder ...................................................................................... 8-14
8-4-1 Outline of Function .................................................................................................................... 8-15
8-4-2 Setting Procedure ..................................................................................................................... 8-16
8-5 High-speed Homing............................................................................................................... 8-18

Section 9 Motion Control Functions


9-1 Single-axis Position Control ................................................................................................... 9-3
9-1-1 Outline of Operation .................................................................................................................... 9-3
9-1-2 Absolute Positioning.................................................................................................................... 9-4
9-1-3 Relative Positioning..................................................................................................................... 9-4
9-1-4 Interrupt Feeding......................................................................................................................... 9-5

10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


CONTENTS

9-1-5 Cyclic Synchronous Positioning.................................................................................................. 9-6


9-1-6 Stopping ..................................................................................................................................... 9-7
9-1-7 Override Factors ....................................................................................................................... 9-12
9-2 Single-axis Synchronized Control ....................................................................................... 9-13
9-2-1 Overview of Synchronized Control ........................................................................................... 9-13
9-2-2 Gear Operation ......................................................................................................................... 9-13
9-2-3 Positioning Gear Operation....................................................................................................... 9-14
9-2-4 Cam Operation ......................................................................................................................... 9-15
9-2-5 Cam Tables............................................................................................................................... 9-16
9-2-6 Synchronous Positioning .......................................................................................................... 9-24
9-2-7 Combining Axes........................................................................................................................ 9-25
9-2-8 Master Axis Phase Shift............................................................................................................ 9-26
9-2-9 Slave Axis Position Compensation ........................................................................................... 9-26
9-2-10 Achieving Synchronized Control in Multi-motion ...................................................................... 9-27
9-3 Single-axis Velocity Control ................................................................................................. 9-29
9-3-1 Velocity Control......................................................................................................................... 9-29
9-3-2 Cyclic Synchronous Velocity Control ........................................................................................ 9-30
9-4 Single-axis Torque Control ................................................................................................... 9-31
9-5 Common Functions for Single-axis Control ....................................................................... 9-32
9-5-1 Positions ................................................................................................................................... 9-32
9-5-2 Velocity ..................................................................................................................................... 9-34
9-5-3 Acceleration and Deceleration.................................................................................................. 9-35
9-5-4 Jerk........................................................................................................................................... 9-37
9-5-5 Specifying the Operation Direction ........................................................................................... 9-38
9-5-6 Re-executing Motion Control Instructions ................................................................................. 9-42
9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode) ................................................... 9-47
9-6 Multi-axes Coordinated Control ........................................................................................... 9-53
9-6-1 Outline of Operation.................................................................................................................. 9-53
9-6-2 Linear Interpolation................................................................................................................... 9-56
9-6-3 Circular Interpolation ................................................................................................................ 9-57
9-6-4 Axes Group Cyclic Synchronous Positioning............................................................................ 9-57
9-6-5 Stopping Under Multi-axes Coordinated Control ...................................................................... 9-58
9-6-6 Overrides for Multi-axes Coordinated Control........................................................................... 9-59
9-7 Common Functions for Multi-axes Coordinated Control................................................... 9-61
9-7-1 Velocity Under Multi-axes Coordinated Control ........................................................................ 9-61
9-7-2 Acceleration and Deceleration Under Multi-axes Coordinated Control..................................... 9-62
9-7-3 Jerk for Multi-axes Coordinated Control ................................................................................... 9-63
9-7-4 Re-executing Motion Control Instructions for Multi-axes Coordinated Control ......................... 9-64
9-7-5 Multi-execution (Buffer Mode) of Motion Control Instructions for Multi-axes Coordinated Control 9-
65
9-8 Other Functions ..................................................................................................................... 9-73
9-8-1 Changing the Current Position.................................................................................................. 9-73
9-8-2 Torque Limit .............................................................................................................................. 9-74
9-8-3 Latching .................................................................................................................................... 9-74
9-8-4 Zone Monitoring........................................................................................................................ 9-75
9-8-5 Software Limits ......................................................................................................................... 9-76
9-8-6 Following Error Monitoring........................................................................................................ 9-77
9-8-7 Following Error Counter Reset ................................................................................................. 9-78
9-8-8 Axis Following Error Monitoring ................................................................................................ 9-78
9-8-9 In-position Check ...................................................................................................................... 9-79
9-8-10 Changing Axis Use ................................................................................................................... 9-81
9-8-11 Enabling Digital Cam Switch..................................................................................................... 9-81
9-8-12 Displaying 3D Motion Monitor for User Coordinate System...................................................... 9-82

Section 10 Sample Programming


10-1 Overview of Sample Programming ...................................................................................... 10-2
10-1-1 Devices ..................................................................................................................................... 10-2
10-1-2 Installation and Wiring .............................................................................................................. 10-2

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11


CONTENTS

10-1-3 Setup......................................................................................................................................... 10-2


10-2 Basic Programming Samples ............................................................................................... 10-3
10-2-1 Monitoring EtherCAT Communications and Turning ON Servos............................................... 10-3
10-2-2 Interlocking Axis Operation with Master Control Instructions.................................................... 10-5
10-2-3 Error Monitoring and Error Resetting for Single-axis Operation and Synchronized Operation . 10-7
10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation ............................ 10-9
10-2-5 Monitoring for Instruction Errors.............................................................................................. 10-15
10-2-6 Checking to See If Errors Are Reset ....................................................................................... 10-17
10-2-7 Stopping Axes during Single-axis Operation........................................................................... 10-19
10-2-8 Stopping an Axes Group in Coordinated Motion..................................................................... 10-23
10-2-9 Homing and Absolute Positioning ........................................................................................... 10-29
10-2-10 Changing the Target Position by Re-execution of an Instruction............................................. 10-34
10-2-11 Interrupt Feeding..................................................................................................................... 10-40
10-2-12 Changing the Cam Table by Re-execution of an Instruction ................................................... 10-44
10-2-13 Using a Cam Profile Curve to Correct the Sync Position ........................................................ 10-53
10-2-14 Shifting the Phase of a Master Axis in Cam Motion ................................................................ 10-63
10-2-15 Changing the Actual Position during Velocity Control ............................................................. 10-71
10-2-16 Changing a Cam Data Variable and Saving the Cam Table.................................................... 10-77
10-2-17 Temporarily Changing Axis Parameters .................................................................................. 10-86
10-2-18 Updating the Cam Table End Point Index................................................................................ 10-89

Section 11 Troubleshooting
11-1 Overview of Errors................................................................................................................. 11-2
11-1-1 How to Check for Errors ............................................................................................................ 11-3
11-1-2 Errors Related to the Motion Control Function Module ............................................................. 11-6
11-2 Troubleshooting................................................................................................................... 11-12
11-2-1 Error Table............................................................................................................................... 11-12
11-2-2 Error Descriptions ................................................................................................................... 11-21
11-2-3 Error Causes and Remedies................................................................................................... 11-56

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-22
A-3-1 Wiring to Encoder Input Terminals ............................................................................................A-22
A-3-2 Settings for Encoder Input Terminals ........................................................................................A-22
A-4 Connecting to NX Units.........................................................................................................A-28
A-5 PDS State Transition .............................................................................................................A-29
A-5-1 PDS State Control Method........................................................................................................A-30
A-5-2 Main Circuit Power Supply OFF Detection................................................................................A-31
A-6 Terminology ...........................................................................................................................A-32
A-6-1 NJ/NX-series Controller ............................................................................................................A-32
A-6-2 Motion Control...........................................................................................................................A-33
A-6-3 EtherCAT Communications .......................................................................................................A-35
A-7 Version Information ...............................................................................................................A-36

Index

12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Terms and Conditions Agreement

Terms and Conditions Agreement

Warranty, Limitations of Liability

Warranties
 Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and workman-
ship for a period of twelve months from the date of sale by Omron (or such other period expressed 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
responsible 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 Companies
shall not be liable for the suitability or unsuitability or the results from the use of Products in combi-
nation with any electrical or electronic components, circuits, system assemblies or any other materi-
als 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.

See http://www.omron.com/global/ or contact your Omron representative for published information.

Limitation on Liability; Etc


OMRON COMPANIES SHALL NOT BE LIABLE FOR SPECIAL, INDIRECT, INCIDENTAL, OR CON-
SEQUENTIAL DAMAGES, LOSS OF PROFITS OR PRODUCTION OR COMMERCIAL LOSS IN ANY
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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 13


Terms and Conditions Agreement

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
Buyer’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 com-
plete determination of the suitability of the Product in combination with the end product, machine, sys-
tem, or other application or use. Buyer shall be solely responsible for determining appropriateness of
the particular Product with respect to Buyer’s application, product or system. Buyer shall take applica-
tion responsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY 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 EQUIPMENT 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 perfor-
mance 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 other
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 establish
key specifications for your application. Please consult with your Omron’s representative at any time to
confirm actual specifications of purchased Product.

Errors and Omissions


Information presented by Omron Companies has been checked and is believed to be accurate; how-
ever, no responsibility is assumed for clerical, typographical or proofreading errors or omissions.

14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Safety Precautions

Safety Precautions

Definition of Precautionary Information


Refer to the following manuals for safety precautions.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User’s Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 15


Precautions for Safe Use

Precautions for Safe Use


Refer to the following manuals for precautions for safe use.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User’s Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)

16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Precautions for Correct Use

Precautions for Correct Use


Refer to the following manuals for precautions for correct use.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User’s Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 17


Regulations and Standards

Regulations and Standards

Conformance to EU Directives

Applicable Directives
• EMC Directives
• Low Voltage Directive

Concepts
 EMC Directive
OMRON devices that comply with EU Directives also conform to the related EMC standards so that
they can be more easily built into other devices or the overall machine. The actual products have
been checked for conformity to EMC standards.*
Whether the products conform to the standards in the system used by the customer, however, must
be checked by the customer. EMC-related performance of the OMRON devices that comply with EU
Directives will vary depending on the configuration, wiring, and other conditions of the equipment or
control panel on which the OMRON devices are installed. The customer must, therefore, perform
the final check to confirm that devices and the overall machine conform to EMC standards.
* Applicable EMC (Electromagnetic Compatibility) standards are as follows:
EMS (Electromagnetic Susceptibility): EN 61131-2
EMI (Electromagnetic Interference): EN 61131-2 (Radiated emission: 10-m regulations)

 Low Voltage Directive


Always ensure that devices operating at voltages of 50 to 1,000 VAC and 75 to 1,500 VDC meet the
required safety standards. The applicable directive is EN61010-2-201.

 Conformance to EU Directives
The NJ/NX-series Controllers comply with EU Directives. To ensure that the machine or device in
which the NJ/NX-series Controller is used complies with EU Directives, the Controller must be
installed as follows:
• The NJ/NX-series Controller must be installed within a control panel.
• You must use the power supply in SELV specifications for the DC power supplies connected to
DC Power Supply Units and I/O Units.
• NJ/NX-series Controllers that comply with EU Directives also conform to the Common Emission
Standard (EN 61000-6-4). Radiated emission characteristics (10-m regulations) may vary
depending on the configuration of the control panel used, other devices connected to the control
panel, wiring, and other conditions.
You must therefore confirm that the overall machine or equipment complies with EU Directives.

18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Regulations and Standards

Conformance to KC Standards
Observe the following precaution if you use NJ/NX-series Units in Korea.

Class A Device (Broadcasting Communications Device for Office Use)


This device obtained EMC registration for office use (Class A), and it is intended to be used in places
other than homes.
Sellers and/or users need to take note of this.

Conformance to Shipbuilding Standards


The NJ/NX-series Controllers comply with the following shipbuilding standards. Applicability to the
shipbuilding standards is based on certain usage conditions. It may not be possible to use the prod-
uct in some locations. Contact your OMRON representative before attempting to use a Controller on
a ship.

Usage Conditions for NK and LR Shipbuilding Standards


• The NJ/NX-series Controller must be installed within a control panel.
• Gaps in the door to the control panel must be completely filled or covered with gaskets or other
material.
• The following noise filter must be connected to the power supply line.

Noise Filter

Manufacturer Model
Cosel Co., Ltd. TAH-06-683

Software Licenses and Copyrights


This product incorporates certain third party software. The license and copyright information associ-
ated with this software is available at http://www.fa.omron.co.jp/nj_info_e/.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 19


Versions

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.

Checking Unit Versions on ID Information Indications


The unit version is given on the ID information indication on the side of the product.
The ID information on an NX-series NX701- CPU Unit is shown below.

ID information indication

Lot number Serial number Unit version

LOT No. DDMYY xxxx Ver.1.


PORT1 :  HW Rev. 
PORT2 : 

MAC address Hardware revision

Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.

The ID information on an NX-series NX1P2- CPU Unit is shown below.

MAC address

PORT1 : 
PORT2 : 
Unit version Ver.1. HW Rev.  Hardware
revision
ID information indication
LOT No. DDMYY xxxx

Lot number Serial number

Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.

20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Versions

The ID information on an NJ-series NJ501- CPU Unit is shown below.

ID information indication

Unit model Unit version Hardware revision

NJ501 -  Ver.1. HW Rev. 


PORT1 MAC ADDRESS: 
PORT2 MAC ADDRESS: 
Lot No. DDMYY xxxx

Lot number Serial number MAC address


Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.

Checking Unit Versions with the Sysmac Studio


You can use the Sysmac Studio to check unit versions. The procedure is different for Units and for Eth-
erCAT slaves.

 Checking the Unit Version of an NX-series CPU Unit


You can use the Production Information while the Sysmac Studio is online to check the unit version
of a Unit. You can do this for the CPU Unit, NX Units on the CPU Rack, and Option Boards.

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.

 Checking the Unit Version of an NJ-series CPU Unit


You can use the Production Information while the Sysmac Studio is online to check the unit version
of a Unit. You can do this for the CPU Unit, CJ-series Special I/O Units, and CJ-series CPU Bus
Units. You cannot check the unit versions of CJ-series Basic I/O Units with the Sysmac Studio.
Use the following procedure to check the unit version.

1 Double-click CPU/Expansion Racks under Configurations and Setup in the Multiview


Explorer. Or, right-click CPU/Expansion Racks under Configurations and Setup 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 21


Versions

 Changing Information Displayed in Production Information Dialog Box

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.

Outline View Detail View

The information that is displayed is different for the Outline View and Detail View. The Detail View
displays the unit version, hardware version, and software versions. The Outline View displays 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.

 Checking the Unit Version of an EtherCAT Slave


You can use the Production Information while the Sysmac Studio is online to check the unit version
of an EtherCAT slave. Use the following procedure to check the unit version.

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

22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Versions

 Changing Information Displayed in Production Information Dialog Box


Click the Show Detail or Show Outline Button at the lower right of the Production Information Dia-
log Box.
The view will change between the production information details and outline.

Outline View Detail View

Unit Versions of CPU Units and Sysmac Studio Versions


The functions that are supported depend on the unit version of the NJ/NX-series CPU Unit. The version
of Sysmac Studio that supports the functions that were added for an upgrade is also required to use
those functions.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for the relationship
between the unit versions of CPU Units and the Sysmac Studio versions.
Refer to A-7 Version Information for the functions that are supported by each unit version.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 23


Related Manuals

Related Manuals
The following are the manuals related to this manual. Use these manuals for reference.

Manual name Cat. No. Model numbers Application Description


NX-series CPU Unit W535 NX701- Learning the basic specifi- An introduction to the entire NX701 system is pro-
Hardware User’s Manual cations of the NX701 CPU vided along with the following information on the
Units, including introductory CPU Unit.
information, designing, • Features and system configuration
installation, and mainte-
• Introduction
nance. Mainly hardware
information is provided. • Part names and functions
• General specifications
• Installation and wiring
• Maintenance and inspection
NX-series NX1P2 CPU W578 NX1P2- Learning the basic specifi- An introduction to the entire NX1P2 system is pro-
Unit Hardware User's cations of the NX1P2 CPU vided along with the following information on the
Manual Units, including introductory CPU Unit.
information, designing, • Features and system configuration
installation, and mainte-
• Introduction
nance.
• Part names and functions
Mainly hardware informa-
• General specifications
tion is provided.
• Installation and wiring
• Maintenance and inspection
NJ-series CPU Unit W500 NJ501- Learning the basic specifi- An introduction to the entire NJ-series system is
Hardware User’s Manual NJ301- cations of the NJ-series provided along with the following information on
NJ101- CPU Units, including intro- the CPU Unit.
ductory information, design- • Features and system configuration
ing, installation, and
• Introduction
maintenance. Mainly hard-
ware information is pro- • Part names and functions
vided. • General specifications
• Installation and wiring
• Maintenance and inspection
NJ/NX-series CPU Unit W501 NX701- Learning how to program The following information is provided on a Control-
Software User’s Manual NX1P2- and set up an NJ/NX-series ler built with an NJ/NX-series CPU Unit.
NJ501- CPU Unit. Mainly software • CPU Unit operation
NJ301- information is provided.
• CPU Unit features
NJ101-
• Initial settings
• Programming based on IEC 61131-3 language
specifications
NX-series NX1P2 CPU W579 NX1P2- Learning about the details Of the functions for an NX1P2 CPU Unit, the fol-
Unit Built-in I/O and of functions only for an NX- lowing information is provided.
Option Board User's series NX1P2 CPU Unit and • Built-in I/O
Manual an introduction of functions
• Serial Communications Option Boards
for an NJ/NX-series CPU
Unit. • Analog I/O Option Boards
An introduction of following functions for an NJ/NX-
series CPU Unit is also provided.
• Motion control functions
• EtherNet/IP communications functions
• EtherCAT communications functions
NJ/NX-series Instruc- W502 NX701- Learning detailed specifica- The instructions in the instruction set (IEC 61131-3
tions Reference Manual NX1P2- tions on the basic instruc- specifications) are described.
NJ501- tions of an NJ/NX-series
NJ301- CPU Unit.
NJ101-
NJ/NX-series CPU Unit W507 NX701- Learning about motion con- The settings and operation of the CPU Unit and
Motion Control User’s NX1P2- trol settings and program- programming concepts for motion control are
Manual NJ501- ming concepts. described.
NJ301-
NJ101-

24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Related Manuals

Manual name Cat. No. Model numbers Application Description


NJ/NX-series Motion W508 NX701- Learning about the specifi- The motion control instructions are described.
Control Instructions Ref- NX1P2- cations of the motion control
erence Manual NJ501- instructions that are pro-
NJ301- vided by OMRON.
NJ101-
NJ/NX-series CPU Unit W505 NX701- Using the built-in EtherCAT Information on the built-in EtherCAT port is pro-
Built-in EtherCAT® Port NX1P2- port on an NJ/NX-series vided. This manual provides an introduction and
User’s Manual NJ501- CPU Unit. provides information on the configuration, features,
NJ301- and setup.
NJ101-
NJ/NX-series CPU Unit W506 NX701- Using the built-in Ether- Information on the built-in EtherNet/IP port is pro-
Built-in EtherNet/IPTM NX1P2- Net/IP port on an NJ/NX- vided. Information is provided on the basic setup,
Port User’s Manual NJ501- series CPU Unit. tag data links, and other features.
NJ301-
NJ101-
NJ-series Database Con- W527 NJ501-120 Using the database connec- Describes the database connection service.
nection CPU Units User’s NJ101-20 tion service with NJ-series
Manual Controllers
NJ-series SECS/GEM W528 NJ501-1340 Using the GEM service with Describes the GEM service.
CPU Unit User’s Manual NJ-series Controllers.
NJ-series NJ Robotics W539 NJ501-4 Controlling robots with NJ- Describes the functionality to control robots.
CPU Unit User’s Manual series CPU Units.
NJ/NX-series Trouble- W503 NX701- Learning about the errors Concepts on managing errors that may be
shooting Manual NX1P2- that may be detected in an detected in an NJ/NX-series Controller and infor-
NJ501- NJ/NX-series Controller. mation on individual errors are described.
NJ301-
NJ101-
Sysmac Studio Version 1 W504 SYSMAC- Learning about the operat- Describes the operating procedures of the Sysmac
Operation Manual SE2 ing procedures and func- Studio.
tions of the Sysmac Studio.
NX-series EtherCAT® W519 NX-ECC Learning how to use an NX- The system and configuration of EtherCAT Slave
Coupler Unit User’s Man- series EtherCAT Coupler Terminals, which consist of an NX-series EtherCAT
ual Unit and EtherCAT Slave Coupler Unit and NX Units, are described along
Terminals with the hardware, setup, and functions of the Eth-
erCAT Coupler Unit that are required to configure,
control, and monitor NX Units through EtherCAT.
NX-series Data W525 NX- Referencing lists of the data Lists of the power consumptions, weights, and
Reference Manual that is required to configure other NX Unit data that is required to configure
systems with NX-series systems with NX-series Units are provided.
Units.
NX-series NX Units W521 NX-ID Learning how to use NX Describes the hardware, setup methods, and func-
User’s Manuals NX-IA Units tions of the NX Units.
NX-OC Manuals are available for the following Units.
NX-OD Digital I/O Units, Analog I/O Units, System Units,
NX-MD Position Interface Units, Communications Interface
W522 NX-AD Units, Load Cell Input Units, and IO-Link Master
NX-DA Units.
W566 NX-TS
NX-HB
W523 NX-PD1
NX-PF0
NX-PC0
NX-TBX01
W524 NX-EC0
NX-ECS
NX-PG0
W540 NX-CIF
W565 NX-RS
W567 NX-ILM

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 25


Related Manuals

Manual name Cat. No. Model numbers Application Description


GX-series EtherCAT W488 GX-ID Learning how to use the Describes the hardware, setup methods and func-
Slave Units User’s Man- GX-OD EtherCAT remote I/O tions of the EtherCAT remote I/O terminals.
ual GX-OC terminals.
GX-MD
GX-AD
GX-DA
GX-EC
XWT-ID
XWT-OD
AC Servomotors/Servo I586 R88M-1 Learning how to use the Describes the hardware, setup methods and func-
Drives 1S-series with R88D-1SN- Servomotors/Servo Drives tions of the Servomotors/Servo Drives with built-in
Built-in EtherCAT® Com- ECT with built-in EtherCAT Com- EtherCAT Communications.
munications User’s Man- munications.
ual
AC Servomotors/Servo I573 R88M-K Learning how to use the AC Describes the hardware, setup methods and func-
Drives G5-series with R88D-KN-ECT- Servomotors/Servo Drives tions of the AC Servomotors/Servo Drives with
Built-in EtherCAT® Com- R with built-in EtherCAT Com- built-in EtherCAT Communications.
munications User’s Man- I576 R88M-K munications. The linear motor type model and the model dedi-
ual R88D-KN-ECT cated for position controls are available in
I577 R88L-EC- G5-series.
R88D-KN-ECT-L

26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Revision History

Revision History
A manual revision code appears as a suffix to the catalog number on the front and back covers of the
manual.

Cat. No. W507-E1-15


Revision code

Revision code Date Revised content


01 July 2011 Original production
02 March 2012 Added information on the NJ301-.
Made changes accompanying the upgrade to unit version
1.01.
03 May 2012 Made changes accompanying the upgrade to unit version 1.02
and 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 and corrected mistakes.
07 June 2013 Made changes accompanying release of unit version 1.06 of
the CPU Unit and corrected mistakes.
08 December 2013 Made changes accompanying release of unit version 1.08 of
the CPU Unit and corrected mistakes.
09 July 2014 Made changes accompanying release of unit version 1.09 of
the CPU Unit and corrected mistakes.
10 January 2015 Made changes accompanying release of unit version 1.10 of
the CPU Unit and corrected mistakes.
11 April 2015 Made changes accompanying release of the NX-series
NX701- CPU Unit and the NJ-series NJ101-10
CPU Unit, and corrected mistakes.
12 April 2016 Made changes accompanying release of unit version 1.11 of
the CPU Unit and corrected mistakes.
13 July 2016 Made changes accompanying release of unit version 1.12 of
the CPU Unit and corrected mistakes.
14 October 2016 Made changes accompanying addition of NX-series NX1P2
CPU Unit and release of unit version 1.13 of the CPU Unit,
and corrected mistakes.
15 January 2017 Corrected mistakes.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 27


Revision History

28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1

Introduction to the Motion Control


Function Module
This section describes the features, system configuration, and application flow for the
Motion Control Function Module.

1-1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2


1-2 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1-3 Basic Flow of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1-4 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1-4-1 General Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1-4-2 Performance Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1-4-3 Function Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-1


1 Introduction to the Motion Control Function Module

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.

Motion Control Instructions Based on PLCopen®


The motion control instructions of the MC Function Module are based on motion control function blocks
that are standardized by PLCopen®. These instructions allow you to program single-axis PTP position-
ing, interpolation control, synchronized control (e.g., of electronic cams), velocity control, and torque
control. You can set the velocity, acceleration rate, deceleration rate, and jerk each time a motion con-
trol instruction is executed to flexibly control operation according to the application.

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.

Data Transmission Using EtherCAT Communications


The MC Function Module can be combined with OMRON 1S-series Servo Drives with built-in EtherCAT
communications or G5-series Servo Drives with built-in EtherCAT communications to enable exchange
of all control information with high-speed data communications. The various control commands are
transmitted via data communications. That means that the Servomotor’s operational performance is
maximized without being limited by interface specifications, such as the response frequency of the
encoder feedback pulses. You can use the Servo Drive’s various control parameters and monitor data
on a host controller to unify management of system information.

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 cycle time by transmitting Ethernet frames at high speed. A
mechanism that allows sharing clock information enables high-precision synchronized control
with low communications jitter.

1-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1 Introduction to the Motion Control Function Module

1-2 System Configuration


1-2 System Configuration
The MC Function Module receives sensor signal status from devices and control panels. It receives
commands from the motion control instructions that are executed in the user program. It uses both of
these to perform motion control with the Servo Drives, Encoder Input Terminals, and NX-series Position
Interface Units.
1
Motion Control Configuration on EtherCAT Network
The EtherCAT network configuration, the Slave Terminal configurations for EtherCAT Coupler Units,
and the Sysmac Studio are used for the MC Function Module.

 EtherCAT Network Configuration


The MC Function Module performs control for Servo Drives and Encoder Input Terminals through
the EtherCAT master port that is built into the CPU Unit. The EtherCAT network configuration is
used to perform precise motion control in a fixed period with very little deviation.

 Slave Terminal Configurations of EtherCAT Coupler Units


The MC Function Module uses the Position Interface Units that are mounted under an EtherCAT
Coupler Unit to output motor control pulses and read encoder inputs. You can also use this configu-
ration to perform precise motion control in a fixed period with very little deviation.

 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

Power Supply Unit CPU Unit

LAN USB
Or
EtherNet/IP

EtherCAT Network
Configuration
Built-in EtherNet/IP port EtherCAT
Built-in EtherCAT port

Positive limit input


Negative limit input
Immediate stop input
Home proximity input
Home input 1S-series Servo Drives with Built-in Encoder Input
Slave Terminal
External latch input, etc. EtherCAT Communications Terminal
G5-series Servo Drives with Built-in
EtherCAT Communications

Precautions for Correct Use


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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-3


1 Introduction to the Motion Control Function Module

Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required
to use the NX-series Position Interface Units.

Motion Control Configuration on CPU Unit


The Position Interface Unit and Sysmac Studio are used for the MC Function Module.

 Position Interface Unit


The MC Function Module uses the Position Interface Units to output motor control pulses and read
encoder inputs.

 Sysmac Studio
The Sysmac Studio is connected to the built-in EtherNet/IP port on the CPU Unit with an Ethernet
cable.
Sysmac Studio

Position Interface Units


NX1P2

LAN EtherNet/IP

Built-in EtherNet/IP port


Encoder

G5-series Servo Drives

Precautions for Correct Use


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.

1-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1 Introduction to the Motion Control Function Module

1-3 Basic Flow of Operation


1-3 Basic Flow of Operation
This section provides the basic procedure to perform motion control with the MC Function Module.

START
Sysmac Studio Version 1 Operation Manual 1
Setup Create a project. (Cat. No. W504)

NJ/NX-series CPU Unit Software User’s


Create the EtherCAT Network Configuration.*
Manual (Cat. No. W501)

Add axes. Section 3 Configuring Axes and Axes Groups

Assign the axes.

Set the axis parameters.

NJ/NX-series CPU Unit Software User’s


Set the Controller Setup.
Manual (Cat. No. W501)

Transferring Transfer the project to the Controller.

Section 4 Checking Wiring from the Sysmac


Checking Wiring Open the MC Test Run Tab Page. Studio

Checking Operation Monitor input signals to check the wiring.

Perform jogging.

Continues to A on next page.

* The EtherCAT Network Configuration can be set online if you are connected to the physical network.
The EtherCAT Network Configuration can be selected offline if the hardware is not available yet.

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-5


1 Introduction to the Motion Control Function Module

A
Section 6 Motion Control Pro-
Programming Write a program to perform jogging.
gramming

Manual operation Jog the axes with the user program. Section 7 Manual Operation

Section 8 Homing
Homing Define the homes of the Servomotor axes to
control.

Section 6 Motion Control Pro-


Programming Program the motion controls. gramming
Section 10 Sample Program-
ming
Yes
Debugging Error?
Section 11 Troubleshooting
Read the error code.
No

Remove the cause of the error and clear the error.

Section 9 Motion Control


Operation Operate the Controller and the machine. Functions

Maintenance Perform periodic maintenance.

END

1-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1 Introduction to the Motion Control Function Module

1-4 Specifications

1-4 Specifications
This section gives the specifications of the MC Function Module.

Precautions for Correct Use


The NJ101-90 Units do not provide the Motion Control Function Module.
1

1-4-1 General Specifications


1-4-1 General Specifications
General specifications conform to the general specifications of the CPU Unit.
Refer to the NX-series CPU Unit Hardware User’s Manual (Cat. No. W535) or NJ-series CPU Unit
Hardware User’s Manual (Cat. No. W500) for details.

1-4-2 Performance Specifications


The following table describes the performance specifications for each type of CPU Units.

NX701-
Item
17 16
Number of Maximum number of controlled axes *1 256 axes 128 axes
controlled Motion control axes *2 256 axes 128 axes
axes
Single-axis position con- ---
trol axes *3
Maximum number of used real axes *4 256 axes 128 axes
Used motion control servo 256 axes 128 axes
axes
Used single-axis position ---
control servo axes
Maximum number of axes for linear 4 axes per axes group
interpolation axis control
Number of axes for circular interpolation 2 axes per axes group
axis control
Maximum number of axes groups 64 axes groups
Override factors 0.00% or 0.01% to 500.00%
Motion control period The same control period as that is used for the process data
communications cycle for EtherCAT.
Multi-motion Supported.
Cams Number of Maximum points per cam 65,535 points
cam data table
points Maximum points for all 1,048,560 points
cam tables
Maximum number of cam tables 640 tables

*1 This is the total for all axis types. Refer to Axis Types on page 5-9 for details on axis types.
*2 This means the axes for which all motion control functions can be used.
*3 This means the axes for which only single-axis position control can be used among motion control functions. Refer to
Control Function on page 5-10 for details on a single-axis position control axis.
*4 This is the total number of axes whose axis type is set to Servo Axis or Encoder Axis and axis use is set to Used Axis.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-7


1 Introduction to the Motion Control Function Module

NX1P2-
Item
11 10 90
Number of Maximum number of controlled axes *1 12 axes 10 axes 4 axes
controlled
Motion control axes *2 8 axes 6 axes ---
axes
Single-axis position control 4 axes
axes *3
Maximum number of used real axes *4 8 axes 6 axes 4 axes
Used motion control servo 4 axes 2 axes ---
axes
Used single-axis position con- 4 axes
trol servo axes
Maximum number of axes for linear interpo- 4 axes per axes group
---
lation axis control
Number of axes for circular interpolation axis 2 axes per axes group
---
control
Maximum number of axes groups 8 axes groups ---
Override factors 0.00% or 0.01% to 500.00%
Motion control period Same as the period for primary periodic task
Multi-motion Not supported.
Cams Number of Maximum points per cam 65,535 points
---
cam data table
points Maximum points for all cam 262,140 points
---
tables
Maximum number of cam tables 80 tables ---

*1 This is the total for all axis types. Refer to Axis Types on page 5-9 for details on axis types.
*2 This means the axes for which all motion control functions can be used.
*3 This means the axes for which only single-axis position control can be used among motion control functions. Refer to
Control Function on page 5-10 for details on a single-axis position control axis.
*4 This is the total number of axes whose axis type is set to Servo Axis or Encoder Axis and axis use is set to Used Axis.

NJ501-
Item
5 4 3
Number of Maximum number of controlled axes *1 64 axes 32 axes 16 axes
controlled
Motion control axes *2 64 axes 32 axes 16 axes
axes
Single-axis position con- ---
trol axes *3
Maximum number of used real axes *4 64 axes 32 axes 16 axes
Used motion control servo 64 axes 32 axes 16 axes
axes
Used single-axis position ---
control servo axes
Maximum number of axes for linear inter- 4 axes per axes group
polation axis control
Number of axes for circular interpolation 2 axes per axes group
axis control
Maximum number of axes groups 32 axes groups
Override factors 0.00% or 0.01% to 500.00%
Motion control period The same control period as that is used for the process data
communications cycle for EtherCAT.
Multi-motion Not supported.

1-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1 Introduction to the Motion Control Function Module

NJ501-
Item

1-4 Specifications
5 4 3
Cams Number of Maximum points per cam 65,535 points
cam data table
points Maximum points for all 1,048,560 points
cam tables
Maximum number of cam tables 640 tables

*1 This is the total for all axis types. Refer to Axis Types on page 5-9 for details on axis types. 1
*2 This means the axes for which all motion control functions can be used.
*3 This means the axes for which only single-axis position control can be used among motion control functions. Refer to

1-4-2 Performance Specifications


Control Function on page 5-10 for details on a single-axis position control axis.
*4 This is the total number of axes whose axis type is set to Servo Axis or Encoder Axis and axis use is set to Used Axis.

NJ301- NJ101-
Item
12 11 10
Number of Maximum number of controlled axes *1 15 axes *2 *3 15 axes*2 *4 6 axes
controlled
Motion control axes *5 15 axes*2 *3 15 axes*2 *4 6 axes
axes
Single-axis position con- ---
trol axes *6
Maximum number of used real axes *7 8 axes 4 axes 2 axes
Used motion control servo 8 axes 4 axes 2 axes
axes
Used single-axis position ---
control servo axes
Maximum number of axes for linear inter- 4 axes per axes group
polation axis control
Number of axes for circular interpolation 2 axes per axes group
axis control
Maximum number of axes groups 32 axes groups
Override factors 0.00% or 0.01% to 500.00%
Motion control period The same control period as that is used for the process data
communications cycle for EtherCAT.
Multi-motion Not supported.
Cams Number of Maximum points per cam 65,535 points
cam data table
points Maximum points for all 262,140 points
cam tables
Maximum number of cam tables 160 tables

*1 This is the total for all axis types. Refer to Axis Types on page 5-9 for details on axis types.
*2 Functions with asterisks were added for an upgraded version of the CPU Unit. Refer to A-7 Version Information for infor-
mation on version upgrades.
*3 This number of axes is achieved in a combination of a CPU Unit with unit version 1.06 or later and Sysmac Studio version
1.07 or higher. In other combinations, this is 8 axes.
*4 This number of axes is achieved in a combination of a CPU Unit with unit version 1.06 or later and Sysmac Studio version
1.07 or higher. In other combinations, this is 4 axes.
*5 This means the axes for which all motion control functions can be used.
*6 This means the axes for which only single-axis position control can be used among motion control functions. Refer to
Control Function on page 5-10 for details on a single-axis position control axis.
*7 This is the total number of axes whose axis type is set to Servo Axis or Encoder Axis and axis use is set to Used Axis.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-9


1 Introduction to the Motion Control Function Module

1-4-3 Function Specifications


The following table describes the functions that are supported for connections to OMRON control
devices.

Item Description
Controllable Servo Drives OMRON 1S-series Servo Drives with built-in EtherCAT
communications or G5-series Servo Drives with built-in
EtherCAT communications *1 (*)
Controllable encoder input terminals OMRON GX-series GX-EC0211/EC0241 EtherCAT
Remote I/O Terminals *2
Controllable Position Interface Units *3 (*) 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 distance 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
encoder axes
Position command values Negative or positive long reals (LREAL) or 0 (command
units*4)
Velocity command values Negative or positive long reals (LREAL) or 0 (command
units/s)
Acceleration command values and deceleration command val- Positive long reals (LREAL) or 0 (command units/s2)
ues
Jerk command values Positive long reals (LREAL) or 0 (command units/s3)

1-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1 Introduction to the Motion Control Function Module

Item Description

1-4 Specifications
Single axes Single-axis posi- Absolute positioning Positioning is performed for a target position that is speci-
tion control fied 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 external input.
Cyclic synchronous abso- A command position is output each control period in Posi- 1
lute positioning (*) tion Control Mode.
Single-axis veloc- Velocity control Velocity control is performed in Position Control Mode.

1-4-3 Function Specifications


ity control Cyclic synchronous A velocity command is output each control period in Veloc-
velocity control ity Control Mode.
Single-axis torque Torque control The torque of the motor is controlled.
control
Single-axis syn- Starting cam operation A cam motion is performed using the specified cam table.
chronized control Ending cam operation The cam motion for the axis that is specified with the input
parameter is ended.
Starting gear operation A gear motion with the specified gear ratio is performed
between a master axis and slave axis.
Positioning gear opera- A gear motion with the specified gear ratio and sync posi-
tion tion 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.
Combining axes The command positions of two axes are added or sub-
tracted and the result is output as the command position.
Single-axis manual Powering the Servo The Servo in the Servo Drive is turned ON to enable axis
operation motion.
Jogging An axis is jogged at a specified target velocity.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-11


1 Introduction to the Motion Control Function Module

Item Description
Single axes Auxiliary functions Resetting axis errors Axes errors are cleared.
for single-axis con- Homing A motor is operated and the limit signals, home proximity
trol signal, and home signal are used to define home.
Homing with parameters The parameters are specified, the motor is operated, and
(*) the limit signals, home proximity signal, and home signal
are used to define home.
High-speed homing Positioning is performed for an absolute target position of
0 to return to home.
Stopping An axis is decelerated to a stop.
Immediately stopping An axis is stopped immediately.
Setting override factors The target velocity of an axis can be changed.
Changing the current The command current position or actual current position of
position an axis can be changed to any position.
Enabling external latches The position of an axis is recorded when a trigger occurs.
Disabling external latches The current latch is disabled.
Zone monitoring You can monitor the command position or actual position
of an axis to see when it is within a specified range (zone).
Enable Digital Cam The digital outputs are turned ON or turned OFF depend-
Switch (*) ing on the axis position.
Monitoring axis following You can monitor whether the difference between the com-
error mand positions or actual positions of two specified axes
exceeds a threshold value.
Resetting the following The error between the command current position and
error actual current position is set to 0.
Torque limit The torque control function of the Servo Drive can be
enabled or disabled and the torque limits can be set to
control the output torque.
Changing axis use (*) The Axis Use axis parameter can be temporarily changed.
Start velocity (*) You can set the initial velocity when axis motion starts.
Axes groups Multi-axes coordi- Absolute linear interpola- Linear interpolation is performed to a specified absolute
nated control tion position.
Relative linear interpola- Linear interpolation is performed to a specified relative
tion position.
Circular 2D interpolation Circular interpolation is performed for two axes.
Axes group cyclic syn- A positioning command is output each control period in
chronous absolute posi- Position Control Mode.
tioning (*)
Auxiliary functions Resetting axes group Axes group errors and axis errors are cleared.
for multi-axes coor- errors
dinated control 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
axes group (*) parameters can be overwritten temporarily.
Stopping axes groups All axes in interpolated motion are decelerated to a stop.
Immediately stopping All axes in interpolated motion are stopped immediately.
axes 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 posi-
tions (*) tions of an axes group can be read.

1-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


1 Introduction to the Motion Control Function Module

Item Description

1-4 Specifications
Common Cams*5 Setting cam table proper- The end point index of the cam table that is specified in
items ties the 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 (*) 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. 1
Changing axis parame- You can access and change the axis parameters from the
ters (*) user program.

1-4-3 Function Specifications


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/decel- Automatic accelera- Jerk is set for the acceleration/deceleration curve for an
eration control tion/deceleration control axis motion or axes group motion.
Changing the accelera- You can change the acceleration or deceleration rate even
tion and deceleration during acceleration or deceleration.
rates
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
signal or limit input signal.
Re-execution of motion control instructions You can change the input variables for a motion control
instruction during execution and execute the instruction
again to change the target values during operation.
Multi-execution of motion control instructions You can specify when to start execution and how to con-
(Buffer Mode) nect the velocities between operations when another
motion control instruction is executed during operation.
Continuous axes group motions (Transition You can specify the Transition Mode for multi-execution of
Mode) instructions for axes group operation.
Monitoring func- Software limits The movement range of an axis is monitored.
tions Following error The error between the command current value and the
actual current value is monitored for an axis.
Velocity, acceleration You can set and monitor warning values for each axis and
rate, deceleration rate, each axes group.
torque, interpolation
velocity, interpolation
acceleration rate, and
interpolation decelera-
tion rate
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.*6
Input signal logic inversion (*) You can inverse the logic of immediate stop input signal,
positive limit input signal, negative limit input signal, or
home proximity input signal.
External interface signals The Servo Drive input signals listed on the right are used.
Home signal, home proximity signal, positive limit signal,
negative limit signal, immediate stop signal, and interrupt
input signal

*1 Unit version 2.1 or later is recommended for G5-series Cylinder-type Servo Drives. Unit version 1.1 or later is
recommended for G5-series Linear Motor Types.
*2 The recommended unit version is 1.1 or later.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 1-13


1 Introduction to the Motion Control Function Module

*3 Some of the functions of the MC Function Module are different when NX-series Position Interface Units are
used. Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for details.
*4 Positions can be set within a 40-bit signed integer range when converted to pulses.
*5 You can create the cam table with the Cam Editor in the Sysmac Studio or with the Generate Cam Table
instruction in the user program. Specify the master axis phase and the slave axis displacement. You can
change the phase pitch for each range. Cam data can be overwritten from the user program.
*6 Application is possible when you use an absolute external scale for an OMRON G5-series Linear Motor Type
Servo Drive with built-in EtherCAT communications.

Note Functions with asterisks were added for an upgraded version of the CPU Unit. Refer to A-7 Version Informa-
tion for information on version upgrades.

1-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Motion Control Configuration and 2
Principles
This section outlines the internal structure of the CPU Unit and describes the configura-
tion and principles of the MC Function Module.

2-1 Internal Configuration of the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2


2-2 Motion Control Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2-3 Motion Control Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2-3-1 CPU Unit Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2-3-2 Example of Task Operations for Motion Control . . . . . . . . . . . . . . . . . . . . . . 2-12
2-4 EtherCAT Communications and Motion Control . . . . . . . . . . . . . . . . . . . . 2-19
2-4-1 CAN Application Protocol over EtherCAT (CoE) . . . . . . . . . . . . . . . . . . . . . . 2-19
2-4-2 Relationship between EtherCAT Master Function Module
and MC Function Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
2-4-3 Relationship between Process Data Communications Cycle
and Motion Control Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-1


2 Motion Control Configuration and Principles

2-1 Internal Configuration of the CPU


Unit
This section provides an overview of the internal mechanisms of the NJ/NX-series CPU Unit. The CPU
Unit has the following software configuration. The Motion Control Function Module is a software module
that performs motion control.

Motion Control Function EtherCAT Master Function Other Function


Module Module Modules*

PLC Function Module

OS
* Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on other Function Mod-
ules.

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.
Function Module name Abbreviation Description
PLC Function Module PLC This module manages overall scheduling, executes
the user program, sends commands to the Motion
Control Function Module, and provides interfaces to
USB and the SD Memory Card.
Motion Control Function Module MC This module performs motion control according to
the commands from motion control instructions that
are executed in the user program. It sends data to
the EtherCAT Master Function Module.
EtherCAT Master Function Module ECAT This module communicates with the EtherCAT
slaves as the EtherCAT master.

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 Mod-
ule (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.

2-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

2-2 Motion Control Configuration

2-2 Motion Control Configuration


A control system built with Servo Drives generally controls motor operation with a semi-closed loop.
The semi-closed loop uses an encoder attached to the motor to detect the amount of rotation that has
been performed by the motor in response to the command value. This is provided as feedback of the
machine’s travel distance. The following error between the command value and actual motor rotation is
calculated and control is performed to bring the following error to zero.
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.

 Configuration on EtherCAT Network 2


NX701/NJ-series CPU Unit Servo Drive
User program MC Function EtherCAT Master
Communica-
Module Function Module tions
processing
Motion Command
Command Communications interpretation
control interpretation
instruction Data processing
processing
Status Position
control
Velocity
EtherCAT control
communications
Torque
control M

A feedback system is not configured. A feedback system is configured.

• 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 communica-
tions 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 com-
munications.
• The encoder’s current value and the Servo Drive status are sent to the CPU Unit during each process
data communications cycle to use EtherCAT communications.

Additional Information

• Motion control processing and process data communications in EtherCAT communications are
performed during the same time period.
• The MC Function Module controls the Servo Drive, which contains the position control loop,
velocity control loop, and torque control loop.
• 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-3


2 Motion Control Configuration and Principles

 Configuration on CPU Unit


Position Interface
NX1P2 CPU Unit Unit Servo Drive
User MC Function NX bus function
program Module module
Motion Command
control interpretation Position
instructions Data processing
control
Pulse trains
Velocity
control
Torque
control M

A feedback system is not configured. A feedback system is configured.

• 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 Interface
Unit (Pulse Output Unit). The following command values are generated: target position and target
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.

2-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

2-3 Motion Control Principles

2-3 Motion Control Principles


This section provides information on the CPU Unit tasks and how they relate to motion control.

2-3-1 CPU Unit Tasks


Tasks are attributes of programs that determine the execution conditions and sequence of the pro-
grams. The NJ/NX-series CPU Units support the following tasks.
Type of task Task name
Tasks that execute programs at a fixed period Primary periodic task
2
Priority-5*1, -16*2, -17, and -18 periodic tasks

2-3-1 CPU Unit Tasks


Tasks that execute programs only once when the exe- Event task (execution priority: 8 and 48) *3
cution conditions for the tasks are met

*1 You can use the priority-5 periodic task only with NX701 CPU Units.
*2 You cannot use the priority-16 periodic task on NX1P2 CPU Units.
*3 A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are required to use event
tasks.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on programs,
tasks, and setting methods.

Types of Tasks and Task Priority


The NX701 CPU Unit can execute the primary periodic task and the priority-5 periodic task in parallel
with a multi-core processor.
The NX1P2 CPU Unit and NJ-series CPU Unit cannot execute more than one task in parallel.
Tasks have an execution priority. Tasks with the highest execution priority are executed first. If the exe-
cution conditions are met for another task with a higher execution priority while a task is under execu-
tion, the task with the higher execution priority is given priority in execution. The following table lists the
tasks in which you can use motion control instructions and the task priorities for the NJ/NX-series CPU
Unit. You cannot use motion control instructions in event tasks.

Number of
Type of task Priority Operation
tasks
Primary 1 4 This task executes I/O refreshing, programs, and motion
periodic task control 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
single task.
Periodic tasks 0 or 1 5*1 These tasks execute I/O refreshing, programs, and motion
control 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 deivce for separate control, those
functions that need high-speed control with the primary
periodic 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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-5


2 Motion Control Configuration and Principles

Number of
Type of task Priority Operation
tasks
Periodic tasks 0 or 1 16*3 These tasks execute programs and I/O refreshing in the
specified task period. The execution period for this priority-16
periodic task is longer than the execution period of the primary
periodic task and priority-5 periodic task. Therefore, periodic
tasks are used to execute programs.
In the priority-16 periodic task, you can write the user program
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
priority-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 priority-5
periodic task.
*3 You cannot use the priority-16 periodic task on 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.

Precautions for Correct Use


• Motion control instructions can be used in the primary periodic task and in a priority-5 or a pri-
ority-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
control in the primary periodic task is called motion control 1, while the motion control in the
priority-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
periodic task. The I/O device task that is assigned to an axis must be the same type of task that is
assigned to the axis.

Assignment possible I/O device Assignment NOT possible I/O device


(Primary (Primary
periodic task) periodic task)
Axis 1: Primray periodic task CH1 Axis 1: Primray periodic task CH1

Axis 2: Primray 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.

2-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

Precautions for Correct Use

2-3 Motion Control Principles


• Yon cannot execute motion control instructions from the user program that is operated in the
priority-5 periodic task for the axes and axes groups that are assigned to the primary
periodic task. If you perform the execution, an Execution ID Setting Out of Range (event
code: 57490000 hex) occurs.
Similarly, you cannot execute motion control instructions from the user program that is
operated in the primary periodic task for the axes and axes groups that are assigned to the
priority-5 periodic task.
• You cannot 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 priority-5
periodic task. If you perform the execution, an Execution ID Setting Out of Range (event
code: 57490000 hex) occurs. 2

2-3-1 CPU Unit Tasks


Additional Information

Refer to Section 3 Configuring Axes and Axes Groups for details on axes and axes groups.

Basic Operation of Tasks


 Overall Task Operation
The primary periodic task and periodic tasks operate based on the task period of the primary peri-
odic task (also known as the primary period). The primary periodic task and priority-5 periodic task
include operations such as system common processing and motion control in addition to I/O refresh-
ing and user program execution. Processing of motion control instructions in the programs is exe-
cuted during the next motion control (MC) period after the END instruction is executed in the task.

Primray period (t)

Primary
MC

MC

MC

MC

IO UPG IO UPG IO UPG IO UPG IO UPG MC


periodic task

Task period (t×2)

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-7


2 Motion Control Configuration and Principles

 Operation of the Primary Periodic Task


Task period (= primary period)
Task execution time

I/O refresh Control processing

System common processing 2


System common processing 1
Output data processing

Input data processing

Motion control
Refresh User program
executed. execution

Processing Processing Contents


Output data processing • Output refresh data is created for Output Units that execute I/O refreshing.
• If forced refreshing is set, the forced refreshing values are reflected in the
output refresh data.
Refresh execution • This process exchanges data with I/O.
Input data processing • Whether the condition expression for event task execution is met or not is
determined.
• Input refresh data is loaded from Input Units that execute I/O refreshing.
• If forced refreshing is set, the forced refreshing values are reflected in the
input refresh data that was read.
System common processing 1 • Processing for exclusive control of variables in tasks is performed when
accessing tasks are set.
• Motion input processing is performed.*1
• Data tracing processing (sampling and trigger checking) is performed.
User program execution • Programs assigned to tasks are executed in the order that they are
assigned.
Motion control 1*2 • The motion control commands from the motion control instructions in the
programs in the primary periodic task and priority-16 periodic task are exe-
cuted.
• Motion output processing is performed.*3
System common processing 2 • Processing for exclusive control of variables in tasks is performed when
refreshing tasks are set.
• Processing for variables accessed from outside of the Controller is per-
formed to maintain concurrency with task execution (executed for the vari-
able access time that is set in the Task Settings).
• If there is processing for EtherNet/IP tag data links and refreshing tasks are
set for the tags (i.e., variables with a Network Publish attribute), variable
access processing is performed.
*1 The Servo Drive status, axis current values, and other motion control system-defined variables are updated
according to data received from the Servo Drives.
*2 For the system-defined variables of the axes that are assigned to Motion control 1, _MC_AX[0-255] or
_MC1_AX[0-255] are used. Similarly, for the system-defined variables of the axes groups, _MC_GRP[0-63] or
_MC1_GRP[0-63] are used.
Refer to 3-1-3 Introduction to Axis Variables for the system-defined variables of axes and 3-3-3 Introduction to
Axes Group Variables for the system-defined variables of axes groups.
*3 Data is sent to the Servo Drives during I/O refreshing in the next primary periodic task.

2-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

 Operation of a Priority-5 Periodic Task

2-3 Motion Control Principles


Task period
Task execution time

I/O refresh Control processing

System common processing 2


System common processing 1
Output data processing

Input data processing

Motion control
Refresh User program
executed. execution

Processing Processing contents

2-3-1 CPU Unit Tasks


Output data processing • Output refresh data is created for Output Units that execute I/O refreshing.
• If forced refreshing is set, the forced refreshing values are reflected in the output
refresh data.
Refresh execution • This process exchanges data with I/O.
Input data processing • Input refresh data is loaded from Input Units that execute I/O refreshing.
• If forced refreshing is set, the forced refreshing values are reflected in the input
refresh data that was read.
System common • Processing for exclusive control of variables in tasks is performed when accessing
processing 1 tasks are set.
• Motion input processing is performed.*1
• Data tracing processing (sampling and trigger checking) is performed.
User program execution • Programs assigned to tasks are executed in the order that they are assigned.
Motion control 2*2 • The motion control commands from the motion control instructions in the programs
in the primary periodic task and priority-5 periodic task are executed.
• Motion output processing is performed.*3
System common • Processing for exclusive control of variables in tasks is performed when refreshing
processing 2 tasks are set.
• Processing for variables accessed from outside of the Controller is performed to
maintain concurrency with task execution (executed for the variable access time
that is set in the Task Settings).
*1 The Servo Drive status, axis current values, and other motion control system-defined variables are updated
according to data received from the Servo Drives.
*2 For the system-defined variables of the axes that are assigned to Motion control 2, _MC2_AX[0-255] are used.
Similarly, for the system-defined variables of the axes groups, _MC2_GRP[0-63] are used.
Refer to 3-1-3 Introduction to Axis Variables for the system-defined variables of axes and 3-3-3 Introduction to
Axes Group Variables for the system-defined variables of axes groups.
*3 Data is sent to the Servo Drives during I/O refreshing in the next priority-5 periodic task.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-9


2 Motion Control Configuration and Principles

 Operation of a Priority-16 Periodic Task


You can refresh I/O in the priority-16 periodic task.

Task period

Task execution time

Task processing time Task processing time


* *
I/O refresh Control Control
processing processing
Output data processing

System common
Input data processing
System common

User program
User program

processing 2
processing 1
executed.

execution
execution
Refresh

* 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 stan-
dard 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 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 cycle 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
to 2 ms and the task period of a priority-16 periodic task to 4 ms. In that case, the start of the period for
the primary periodic task and the priority-5 periodic task will match once every two primary periods.
Similarly, the start of the period for the primary periodic task and the priority-16 periodic task will match
once every four primary periods.
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
the primary periodic task is called process data communications cycle 1, while the
communications cycle for the priority-5 periodic task is called process data communications
cycle 2.

2-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

 Valid Task Periods for NX701 CPU Unit

2-3 Motion Control Principles


For the NX701 CPU Unit, valid task periods depend on the type of task as shown below.

Task Valid task periods


Primary periodic task 125 µs, 250 µs to 8 ms (specify in increments of 250 µs)
Priority-5 periodic task 125 µs, 250 µs to 100 ms (specify in increments of 250 µs)
Priority-16 periodic task 1 ms to 100 ms (specify in increments of 250 µs)
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
periodic 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.
2
 Valid Task Periods for NX1P2 CPU Unit

2-3-1 CPU Unit Tasks


Only the primary periodic task is valid for an NX1P2 CPU Unit. Valid task periods are as follows.

Task Valid task periods


Primary periodic task 2 ms to 8 ms (specify in increments of 250 µs)

 Valid Task Periods for NJ-series CPU Unit


The following table lists the possible combinations of primary periodic task and priority-16 periodic
task periods for the NJ-series CPU Unit.

Primary period Valid task periods for periodic tasks


500 μs * 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
4 ms 4 ms, 8 ms, 20 ms, 40 ms, 60 ms, or 100 ms

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-11


2 Motion Control Configuration and Principles

2-3-2 Example of Task Operations for Motion Control


Motion control instructions can be used in the primary periodic task, in a priority-5 periodic task, or in a
priority-16 periodic task. This section provides examples of task operations.

Using Motion Control Instructions in the Primary Periodic Task


If high-speed motion control is required, place the motion control instructions (FB) in the primary peri-
odic task.
Slave A Servo
IN Execution command
Primary period Primary period

Primary IO UPG MC IO UPG MC


periodic task FB FB

Execution of motion control instructions

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
periodic task. During this processing, execution commands for the Servo Drives and other
devices are generated.

4 Sending Commands
The execution commands that were generated are sent to the Servo Drive or other device
during the I/O refresh (IO) in the next period.

Additional Information

All instructions from inputs to execution command outputs to the Servo Drive or other device are
processed quickly in this task. We recommend placing all motion control instructions in the pri-
mary periodic task.

2-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

Using Motion Control Instructions in a Priority-5 Periodic Task

2-3 Motion Control Principles


If second high-speed motion control after the primary periodic task is required, place the motion control
instructions (FB) in a priority-5 periodic task.
The basic operation is the same as that of the primary periodic task.

 Timing of Processing

Slave A Servo
IN Execution command
Task period Task period
2
Priority-5 IO UPG MC IO UPG MC
periodic task FB FB

2-3-2 Example of Task Operations for Motion Control


Execution of motion control instructions

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
periodic task. During this processing, execution commands for the Servo Drives and other
devices are generated.

4 Sending Commands
The execution commands that were generated are sent to the Servo Drive or other device
during 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 deivce
for separate control, those functions that need high-speed control with the primary periodic
task and others with the priority-5 periodic task.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-13


2 Motion Control Configuration and Principles

 Axis Variable Update Timing in Multi-motion


The multi-motion refers to execution of parallel control using the primary periodic task and the
priority-5 periodic task.
In the multi-motion, the user program for the priority-5 periodic task can access the values of an Axis
Variable of an axis that is controlled in the primary periodic task. The reverse is possible: the user
program for the primary periodic task can access the values of an Axis Variable of an axis that is
controlled in the priority-5 periodic task.

Additional Information

• Refer to 3-1-4 Synchronizing Axis Variables 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
Instructions in a Priority-16 Periodic Task on page 2-16 and 3-1-4 Synchronizing Axis Vari-
ables 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 written during the user program execution 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
Primray period (t) Execution command

Primray
MC

MC

MC

MC

MC
IO UPG IO UPG IO UPG IO UPG IO UPG
periodic task

Task period (t×2)

Priority-5
IO UPG MC IO UPG MC IO UPG
periodic task (A)
(B)

Symbol Description
(A) Axis Variable updated.
Regardless of where the user program execution for the priority-5 periodic task starts, the execution
results from the primary periodic task immediately before the start of the task periods matched are
updated.
(B) The values of an Axis Variable are not written during the user program execution.

2-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

The update timing is similar if two task periods are the same.

2-3 Motion Control Principles


Servo
Primary period (t) Execution command

Primary

MC

MC

MC

MC

MC
IO UPG IO UPG IO UPG IO UPG IO UPG
periodic task

Task period (t)

Priority-5
MC

MC

MC

MC

MC
IO UPG IO UPG IO UPG IO UPG IO UPG
periodic task

2
Additional Information

2-3-2 Example of Task Operations for Motion Control


If a Task Period Exceeded error occurs, the execution results from the task period immediately
before the start of the task periods matched are not updated. The execution results from one
more period before that period are updated.

Primray period(t) Task Period Exceeded occurred.

Primary
MC

MC
IO UPG IO IO IO UPG
periodic task

MC
Task period (t×2)

Priority-5
IO UPG MC IO UPG MC
periodic task
(A)
(B)

Symbol Description
(A) Axis Variable updated.
If a Task Period Exceeded error occurs, the values of the previous task period is updated.
(B) The values of an Axis Variable are not written during the user program execution.

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

Symbol Description
(A) Axis Variable updated.
The execution results from the priority-5 periodic task immediately before the start of the task periods
matched are updated.
(B) The values of an Axis Variable are not written during the user program execution.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-15


2 Motion Control Configuration and Principles

Using Motion Control Instructions in a Priority-16 Periodic Task


If high speed motion control is not required and/or your user program is too large, place motion control
instructions in a priority-16 periodic task.

 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. Therefore, pro-
cessing for multiple axes can be simultaneously executed or stopped.

Slave A Servo
IN Execution command
Primary period

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

Priority-16 UPG
periodic task FB

Execution of motion control instructions

Task period (primary period × 3)

Slave A Servo
IN Execution command
Primary period

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

Priority-16 UPG
periodic task FB

Execution of motion control instructions

Task period (primary period × 3)

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 per-
formed during motion control processing (MC) in the next primary periodic task after the peri-
odic 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
during the I/O refresh (IO) in the next period.

2-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

 Axis Variable Update Timing

2-3 Motion Control Principles


Axis Variables are system-defined variables for some of the axis parameters and for the monitor
information, such as the actual position and error information for the axes controlled by the MC
Function Module.
If you access an Axis Variable of the primary periodic task during the priority-16 periodic task, the
values of the variable that were read at the start of the priority-16 periodic task are used.
Also, the values of an Axis Variable are not written when a motion control instruction (FB) is exe-
cuted. They are written in motion control processing (MC) at the start of the next priority-16 periodic
task.

I/O Servo
OUT Execution
Primary period command 2

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC

2-3-2 Example of Task Operations for Motion Control


periodic task *3

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

Precautions for Correct Use


• 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 NX1P2 CPU Units.

Additional Information

For information on Axis Variables, refer to 3-1-3 Introduction to Axis Variables.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-17


2 Motion Control Configuration and Principles

Using Motion Control Instructions in Two Different Types of Tasks


If you have processes that require high-speed motion control and processes that do not require high-
speed motion control for the same axis, you can place the motion control instructions (FB) both in the
primary periodic task and in a priority-16 periodic task.
If motion control instructions (FB) are executed in both tasks within the period of the priority-16 periodic
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

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task FB2 FB2 FB2 FB2

FB2: MC_MoveRelative
Priority-16 UPG The instruction is buffered for
periodic task FB1 multi-execution of instructions.
FB1: MC_MoveAbsolute

Task period (primary period × 3)

The values of output variables for a motion control instruction and the values of system-defined vari-
ables 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.

Precautions for Correct Use


• 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 NX1P2 CPU Units.

Additional Information

For information on multi-execution of instructions, refer to 9-5-7 Multi-execution of Motion Control


Instructions (Buffer Mode).

2-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

2-4 EtherCAT Communications and Motion


2-4 EtherCAT Communications and
Motion Control
The MC Function Module controls Servo Drives, counters, and NX-series Position Interface Units
through the PDO communications of the EtherCAT Master Function Module in the CPU Unit. This sec-

Control
tion describes EtherCAT communications and other items related to the MC Function Module.

2-4-1 CAN Application Protocol over EtherCAT (CoE)


2
The MC Function Module exchanges data with the slaves on EtherCAT using the CAN application pro-
tocol over EtherCAT (CoE). With CoE, the parameters and control information held by the slaves are

2-4-1 CAN Application Protocol over EtherCAT (CoE)


specified according to data specifications of the object dictionary (OD). To communicate the data
between the Controller (communications master) and slaves, two methods are used: process data
objects (PDOs), which periodically exchange data in realtime, and service data objects (SDOs), which
exchange data when required.
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 parameter transfers.
Controller
(communications master) EtherCAT Slaves
communications lines

PDO communications Executed periodically.


Output data
Input data

SDO communications
Write data
Read data

Executed for requests.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-19


2 Motion Control Configuration and Principles

2-4-2 Relationship between EtherCAT Master Function Module and MC


Function Module
The NJ/NX-series CPU Unit can perform sequence control and motion control through connections to
EtherCAT slaves.

Sequence Control
• I/O ports for configuration slaves are automatically created when you create the EtherCAT Config-
uration 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 Config-
uration in EtherCAT Tab Page in the Sysmac Studio.
• Create Axis Variables in Motion Control Setup View and assign the EtherCAT slaves for which
motion 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 axes variables. However, do not use SDO
communications to write objects that are mapped to PDO communications. If you do, the oper-
ation of the slaves will depend on slave specifications. For OMRON slaves, SDO communica-
tions will result in errors.
• If EtherCAT slave Servo Drives, Encoder Input Terminals, and NX-series Position Interface
Units are not assigned to axes 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.

2-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

2-4 EtherCAT Communications and Motion


 NX701 CPU Unit
User program in PLC CPU Unit
Function Module

Device variables
Instructions Executed. EtherCAT
other than EtherCAT
Sequence slaves
motion control
control instructions
EtherCAT

Control
Master
Function EtherCAT EtherCAT

variables
Axis
Motion control MC Function Module Task period Module
instructions slaves,
•Profile processing
•Synchronization Servo Drives,
Motion control processing encoder input
Executed. terminals,
Other processing
Position
2
Interface Units

2-4-2 Relationship between EtherCAT Master Function Module and MC Function Module
 NX1P2 CPU Unit

User program in PLC CPU Unit


Function Module
Instructions Executed.

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

MC Function Module EtherCAT NX Units,


Master Position
•Profile processing
Function Interface Units
•Synchronization Task
processing Module
period
Other processing
variables
Axis

Motion control EtherCAT EtherCAT


Motion control instructions slaves,
Servo Drives,
Executed. encoder input
terminals,
Position
Interface Units

 NJ-series CPU Unit


User program in PLC CPU Unit
Function Module
Instructions CJ-series Units
I/O ports

other than Executed.


Device variables

motion control Basic I/O Units,


instructions Special Units
Sequence
control EtherCAT EtherCAT
slaves

Motion control MC Function Module Task period EtherCAT EtherCAT EtherCAT


variables
Axis

instructions Master slaves,


• Profile processing
Function Servo Drives,
• Synchronization
Module encoder input
processing
Motion control Executed. terminals,
Other processing
Position
Interface Units

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-21


2 Motion Control Configuration and Principles

2-4-3 Relationship between Process Data Communications Cycle and


Motion Control Period
The PLC Function Module sends motion control commands to the MC Function Module when motion
control instructions are executed in the user program. The MC Function Module then performs motion
control processing based on those commands and sends the results of processing as commands to the
EtherCAT’s Servo Drive or other device.
This type of data exchange is updated as shown in the following processing period.

 NX701 CPU Unit


• Primary period = Motion control 1 period = Process data communications cycle for EtherCAT
communications 1
• Task period of the priority-5 periodic task = Motion control 2 period = Process data communica-
tions cycle for EtherCAT communications 2

CPU Unit
Slaves
Execution of user Motion control processing
program in PLC by MC Function Module
Function Module EtherCAT Processing in slave

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.

2-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


2 Motion Control Configuration and Principles

2-4 EtherCAT Communications and Motion


 NX1P2 CPU Unit and NJ-series CPU Unit
• Primary period = Motion control period = Process data communications cycle for EtherCAT com-
munications

CPU Unit Sequence control period


(primary periodic task period or
Basic I/O Units and periodic task period)
Special Units

Control
Execution of user
program in PLC
Function Module
Slaves

Motion control processing 2


by MC Function Module EtherCAT Processing in slave

2-4-3 Relationship between Process Data Communications Cycle and Motion Control Period
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)

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 2-23


2 Motion Control Configuration and Principles

2-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Configuring Axes and Axes
Groups
3
This section describes the concept of axes and axes groups, the settings for axes that
are required for the MC test run function to operate on the Sysmac Studio, and the
instructions for creating and configuring axes and axes groups using the Sysmac Stu-
dio.

3-1 Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2


3-1-1 Introduction to Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3-1-2 Introduction to Axis Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3-1-3 Introduction to Axis Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3-1-4 Synchronizing Axis Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
3-1-5 Specifying an Axis in the User Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
3-2 Axis Setting Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3-2-1 Axis Configuration Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3-2-2 Setting Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3-3 Axes Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
3-3-1 Introduction to Axes Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
3-3-2 Introduction to Axes Group Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
3-3-3 Introduction to Axes Group Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
3-3-4 Specifying an Axes Group in the User Program . . . . . . . . . . . . . . . . . . . . . . 3-24
3-4 Setting Procedures for Axes Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
3-4-1 Setting Procedure for an Axes Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
3-4-2 Setting Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-1


3 Configuring Axes and Axes Groups

3-1 Axes
This section describes the axes that are used in a MC Function Module.

3-1-1 Introduction to Axes


In a motion control system, the targets of motion control are called axes. An axis can be an actual
Servo Drive, encoder, or other device connected via EtherCAT communications or it can be a virtual
Servo Drive or encoder within the MC Function Module.

Although all axes of NX701 and NJ-series CPU Units are motion control axes, 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 Settings.
Refer to Control Function on page 5-10 for details on the control function.

The MC Function Module supports the axis types that are given in the following table.
Axis type Description
Servo axis These axes are used by the EtherCAT slave Servo Drives and NX-series
Position Interface Units.*1 They are assigned to actual Servo Drives or
other devices.
If you use NX-series Position Interface Units, you can assign more than
one device, such as a Pulse Output Unit and Digital Input Unit, to the same
axis.
Virtual servo axis These are virtual axes that exist only inside the MC Function Module. They
are not used by actual Servo Drives. For example, they are used as master
axes for synchronizing control.
Encoder axis These axes are used by the EtherCAT slave Encoder Input Terminals and
NX-series Position Interface Units.*1 An encoder axis is assigned to an
actual encoder input terminal or other device. Encoder axes are assigned
to actual encoder input terminals. If one encoder input terminal contains
two encoder inputs, the individual encoder inputs will act as one axis.
Virtual encoder axis These axes are used virtually for encoder operation. A virtual encoder axis
is used temporarily in place of an encoder axis when there is no physical
encoder.*2

*1 Refer to 1-4-3 Function Specifications for the controllable devices.


*2 Virtual encoder axes are used in combination with motion control instructions that update the actual position of
the virtual encoder axis. Counting cannot be used with versions of the MC Function Module that do not support
these instructions.

3-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

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 Perfor-
mance Specifications for details.
Configuration element Description Page
Axis parameters The axis parameters set the maximum velocity, jogging, homing, P. 3-3
and other items for the axes operations controlled by the MC Func-
tion Module. Use the Sysmac Studio to set the axis parameters.
Axis Variables Axis Variables are system-defined variables for the actual position, P. 3-7
error 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 Explorer of the Sysmac Studio. The

3-1 Axes
names of the Axis Variables (called the Axis Variable names) are set
here.
Specifying axes in the In the user program, motion control is implemented with motion con- P. 3-9
user program trol instructions. Motion control instructions that perform single-axis
control are used to create axis commands. To control an axis with 3
axis commands, specify the Axis Variable name of the system-
defined variable or the Axis Variable name that was set with the Sys-
mac Studio for the Axis in-out variable of the instruction.

3-1-2 Introduction to Axis Parameters


3-1-2 Introduction to Axis Parameters
 Axis Parameters
Classification Parameter name
Axis Basic Axis Number
Settings
Motion Control*1
Axis Use
Axis Type
Control Function*2
Input Device/Output Device
Unit Conversion Unit of Display
Settings Command Pulse Count Per Motor Rotation
Work Travel Distance Per Motor Rotation
Reducer Use*3
Work Travel Distance Per Rotation*3
Work Gear Ratio*3
Motor Gear Ratio*3

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-3


3 Configuring Axes and Axes Groups

Classification Parameter name


Operation Set- Maximum Velocity
tings
Start Velocity*4
Maximum Jog Velocity
Maximum Acceleration
Maximum Deceleration
Acceleration/Deceleration Over
Operation Selection at Reversing
Velocity Warning Value
Acceleration Warning Value
Deceleration Warning Value
Positive Torque Warning Value*5
Negative Torque Warning Value*5
Actual Velocity Filter Time Constant
In-position Range
In-position Check Time
Zero Position Range
Other Immediate Stop Input Stop Method
Operation Set- Limit Input Stop Method
tings
Drive Error Reset Monitoring Time
Maximum Positive Torque Limit
Maximum Negative Torque Limit
Immediate Stop Input Logic Inversion*4
Positive Limit Input Logic Inversion*4
Negative Limit Input Logic Inversion*4
Home Proximity Input Logic Inversion*4
Limit Settings Software Limits
Positive Software Limit
Negative Software Limit
Following Error Over Value
Following Error Warning Value
Position Count Count Mode
Settings Modulo Maximum Position Setting Value
Modulo Minimum Position Setting Value
Encoder Type
Servo Drive Modulo Maximum Position Setting Value
Settings Modulo Minimum Position Setting Value
PDS State Control Method

3-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

Classification Parameter name


Homing Settings Homing Method
Home Input Signal
Homing Start Direction
Home Input Detection Direction
Operation Selection at Positive Limit Input
Operation Selection at Negative Limit Input
Homing Velocity
Homing Approach Velocity

3-1 Axes
Homing Acceleration
Homing Deceleration
Homing Jerk
Home Input Mask Distance
Home Offset 3
Homing Holding Time
Homing Compensation Value

3-1-2 Introduction to Axis Parameters


Homing Compensation Velocity

*1 Set this parameter when using the NX701 CPU Unit.


*2 Set this parameter when using the NX1P2 CPU Unit.
*3 A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use this
parameter.
*4 A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use this
parameter.
*5 This parameter is enabled only for torque control.
Refer to 5-2 Axis Parameters for details on axis parameters.

 Settings Required to Use Axes


The following settings must be made to use the axes that are created with the Sysmac Studio.
Classification Parameter name Setting Page
Axis Basic Axis Number Axis numbers are automatically set in the order P. 5-7
Settings that the axes are created.
Motion Control*1 Select Primary periodic task.
Axis Use Select Used axis.
Axis Type Select the type of axis to control.
Control Function*2 Select All.*3
Input Device/Output Specify the node address of the EtherCAT slave
Device device 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.


*2 Set this parameter when using the 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, select
Single-axis position control only.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-5


3 Configuring Axes and Axes Groups

 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.
Classification Parameter name Setting Page
Axis Basic Set- Axis Number The numbers are assigned in the order that the P. 5-7
tings axes are added.
Motion Control*1 Select Primary periodic task.
Axis Use Select Used axis.
Axis Type Select Servo axis.
Control Function*2 Select All.*3
Input Device/Output Specify the node address of the EtherCAT slave
Device device 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.
Unit Conversion Unit of Display Select the display unit (mm, degrees, etc.). P. 5-13
Settings Command Pulse Count Set the number of command pulses per motor
Per Motor Rotation rotation according to the encoder resolution.*4
Work Travel Distance Set the workpiece travel distance per motor rota-
Per Motor Rotation tion according to the machine specifications.
Reducer Use*5 Specify whether to use the reducer setting or not.
Work Travel Distance Set the work travel distance per rotation.
Per Rotation*5
Work Gear Ratio*5 Set the gear ratio for the workpiece.

Motor Gear Ratio*5 Set the gear ratio of the motor.


Position Count Count Mode Set this parameter according to the machine P. 5-25
Settings specifications.
Limit Settings Software Limits Set this parameter according to the device speci- P. 5-25
fications.

*1 Set this parameter when using the NX701 CPU Unit.


*2 Set this parameter when using the 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, select
Single-axis position control only.
*4 For example, if the encoder resolution is 10,000 pulses/rotation, set 10,000.
*5 A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use this
parameter.

Precautions for Correct Use


• 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
addresses 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 Sys-
mac 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-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

3-1-3 Introduction to Axis Variables


Axis Variables are system-defined variables for some of the axis parameters and for the monitor infor-
mation, such as the actual position and error information, for the axes controlled by the MC Function
Module. When you create axes with the Sysmac Studio, Axis Variables are registered in the variable
table in the order that the axes are created. Axis variables are structures with a data type of _sAX-
IS_REF.

Axis Variables

3-1 Axes
Each Axis Variable in the MC Function Module has two variable names: The Axis Variable name in
the system-defined variables and the Axis Variable name that is assigned when the axis is added on
the Sysmac Studio. The Axis Variable names in the system-defined variables are _MC_AX[0] to
_MC_AX[255], _MC1_AX[0] to _MC1_AX[255], _MC2_AX[0] to _MC2_AX[255].
When you add axes on the Sysmac Studio, the MC_Axis000 to MC_Axis255 are set by default for 3
_MC_AX[0] to _MC_AX[255]. The numbers are assigned in the order that the axes are added. You
can change each of these Axis Variables as required from the Sysmac Studio. You can use either
the Axis Variables for the system-defined variables or the Axis Variables that are added on the Sys-

3-1-3 Introduction to Axis Variables


mac Studio to specify the Axis Variables in the user program.

 Example When _MC_AX[0-255] Is Used

Axis Variable name in the system-


Default Axis Variable name when
defined variables (AT specification Axis number example
axis is added on the Sysmac Studio
in global variable table*1)
_MC_AX[0] MC_Axis000 Axis 0
_MC_AX[1] MC_Axis001 Axis 1
. . .
. . .
. . .
_MC_AX[255] MC_Axis255 Axis 255

*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], _MC1_AX[0-255], and _MC2_AX[0-255] are available for the NX701 CPU
Unit.
Only _MC_AX[0-11] is available for the NX1P2 CPU Unit.
Only _MC_AX[0-63] is available for the NJ-series CPU Unit.
• For the NX701 CPU Unit, you can access the same values of _MC_AX[0-255] and
_MC1_AX[0-255] if the axis numbers of them are the same. You can use either of the Axis
Variables, or both of them at the same time.
• The Axis Variable assigned to primary periodic task is _MC_AX[0-255] or _MC1_AX[0-255].
The Axis Variable assigned to priority-5 periodic task is _MC2_AX[0-255].

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-7


3 Configuring Axes and Axes Groups

Examples of Axis Variable Levels and Changing Axis Variable Names


In the descriptions below, _MC_AX[0] is used as an example. The same information applies to the
other variables.

_MC_AX[0] Axis Variable


_MC_AX[0].Status Level that indicates the axis status
_MC_AX[0].Status.Ready Variable that indicates that the axis is ready for operation
_MC_AX[0].Status.Disabled Variable that indicates when the axis is disabled
.
.
.
_MC_AX[0].Details Level that indicates the axis control status
_MC_AX[0].Details.Idle Variable that indicates when the axis is idle
_MC_AX[0].Details.InPosWaiting Variable that indicates in-position waiting
.
.
.
_MC_AX[0].Cmd Level that indicates the axis command values
_MC_AX[0].Cmd.Pos Variable that indicates the command current position
_MC_AX[0].Cmd.Vel Variable that indicates the command current velocity
_MC_AX[0].Cmd.AccDec Variable that indicates the command current acceleration/decelera-
tion rate in the axis monitor
.
.
.
_MC_AX[0].Act Level that indicates the axis current values
_MC_AX[0].Act.Pos Variable that indicates the actual current position
_MC_AX[0].Act.Vel Variable that indicates the actual current velocity
.
.
.
_MC_AX[0].Cfg Level that indicates the axis basic settings
_MC_AX[0].Cfg.AxNo Variable that indicates the axis number
_MC_AX[0].Cfg.AxEnable Variable that indicates when the axis is enabled
_MC_AX[0].Cfg.AxType Variable that indicates the axis type
.
.
.
_MC_AX[0].Scale.Units Variable that indicates the display unit
_MC_AX[1] Axis Variable
.
.
.

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.

Refer to Axis Variables on page 6-25 for details on Axis Variables.

3-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

3-1-4 Synchronizing Axis Variables


The user program for the priority-5 periodic task can access the values of an Axis Variable of an axis
that is controlled in the primary periodic task. The reverse is possible: the user program for the primary
periodic task can access the values of an Axis Variable of an axis that is controlled in the priority-5 peri-
odic task.
Also, the user program for the priority-16 periodic task can access the values of an Axis Variable that is
controlled in the primary periodic task.
The following table shows the relationship between the types of accessing tasks and the Axis Variables.

OK: Access possible ---: Access not possible

3-1 Axes
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 OK OK OK*4 ---
Priority-5 periodic task OK*5 --- OK OK 3
Priority-16 periodic task OK*5 OK*6 OK*4 ---
Priority-17 or priority-18
OK*5 OK*7 OK*4 OK*8

3-1-4 Synchronizing Axis Variables


periodic task
Priority-8 or priority-48
OK*5 OK*7 OK*4 OK*8
event task
*1 The user-defined Axis Variables, such as MC_Axis000, Loader1 and other Axis Variables, that are automatically gener-
ated 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 recommended
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 periodic task.

3-1-5 Specifying an Axis in the User Program


In the user program, an Axis Variable name is specified for the in-out variable Axis in motion control
instructions. In the following example, the Axis Variable name for the axis that was added for the sys-
tem-defined Axis Variable name of _MC_AX[0] has been changed to MyAxis1 in the Sysmac Studio.
In-out variable Axis

Specify an Axis
MC_Power_instance
Variable name. MC_Power
MyAxis1 Axis Axis MyAxis1
Enable Status MyAxis1OnStatus
ServoOn Busy MyAxis1OnBusy
Error MyAxis1OnError
ErrorID MyAxis1OnErrorID

You can also use the _MC_AX[0] system-defined variable in place of MyAxis1.
Refer to 6-2 Motion Control Instructions 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-9


3 Configuring Axes and Axes Groups

3-2 Axis Setting Procedure


This section gives the procedures to set servo axes that are newly created with the Sysmac Studio.

3-2-1 Axis Configuration Procedure

START

Create a project.

Create the EtherCAT Network Configuration.

Add axes.

Assign the axes.

Set the axis parameters.

Go online and synchronize the data.

Transfer the project to the Controller.

END

3-2-2 Setting Procedure


This section describes how to set an axis.

Starting the Sysmac Studio

1 Start the Sysmac Studio and click the New Project Button.

2 Set the project properties, select the device, and click the Create Button.

3-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

A new project is displayed.

3-2 Axis Setting Procedure


3
Creating the EtherCAT Network Configuration

3-2-2 Setting Procedure


There are two methods to create an EtherCAT Network Configuration: online and offline.

 Online Method
1 Double-click EtherCAT in the Multiview Explorer.
The EtherCAT Tab Page is displayed.

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-11


3 Configuring Axes and Axes Groups

 Offline Method
1 Double-click EtherCAT in the Multiview Explorer.
The EtherCAT Tab Page is displayed.

2 Right-click the slave to connect and select Insert from the menu.

3-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

The slave is inserted on the display.

3-2 Axis Setting Procedure


3

3-2-2 Setting Procedure


3 Insert the remaining slaves.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-13


3 Configuring Axes and Axes Groups

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.

Additional Information

Single-axis Position Control Axis is displayed for an NX1P2 CPU Unit.

An axis is added to the Multiview Explorer. The default name for the new axis is MC_Axis000.

 Copying an Axis
You can also add an axis by copying the axis settings for an existing axis.

3-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

Assigning an Axis

1 Right-click an axis in the Multiview Explorer and select Edit from the menu.

3-2 Axis Setting Procedure


3

3-2-2 Setting Procedure


The Axis Basic Settings are displayed in the Axis Parameter Settings Tab Page.

Additional Information

Control Function is displayed for an NX1P2 CPU Unit.

2 Select Primary periodic task or Priority-5 periodic task from Motion control.

Additional Information

The setting is available for the NX701 CPU Unit.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-15


3 Configuring Axes and Axes Groups

3 Select Servo axis in the Axis type.

4 Select All in the Control Function.

Additional Information

• You can select this parameter for an 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.

5 Select the Servo Drive to use.


This setting allows you to use a Servo Drive as an axis.

3-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

Setting Axis Parameters

Click each of the icons in the Axis Parameter Settings Tab Page.
The settings for each icon are displayed on the Axis Parameter Settings Tab Page.

3-2 Axis Setting Procedure


3

3-2-2 Setting Procedure


Right-click Axis Settings in the Multiview Explorer and select Axis Setting Table to enable setting the
axes parameters for all axes at the same time.

Precautions for Correct Use


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 val-
ues for the operating conditions of the device.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-17


3 Configuring Axes and Axes Groups

Additional Information

Changing Axis Variable Names in the User Program


Perform the following two procedures to change Axis Variable names that are already used.
• Change the Axis Variable name in the variable table in the variable declarations.
• Change the Axis Variable name in the user program.
Even if you change the Axis Variable names in the variable table, the Axis Variable names in the
user program do not change. An error will occur if you use a variable name that is not declared in
the variable table, in the user program. Always change the names in both places.

Downloading to the CPU Unit


Use the Synchronization menu command of the Sysmac Studio to download the project to the CPU
Unit.

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.

3-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

Additional Information

Introduction to Servo Drive Settings


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

3-2 Axis Setting Procedure


Pulse Output Units.
Connectable Servo Drive Models
You can connect the R88D-1SN-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.
3
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 or A-2 Connecting the G5-

3-2-2 Setting Procedure


series Servo Drive 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-19


3 Configuring Axes and Axes Groups

3-3 Axes Groups


This section describes the axes groups of the MC Function Module.

3-3-1 Introduction to Axes Groups


Use axes groups to perform complex operations on multiple axes, such as linear or circular interpola-
tion. An axes group consists of multiple axes. Use the Sysmac Studio to set Axes Group Variables to
enable execution of axes group motion control instructions or to enable access of the status of the axes
group. The MC Function Module can handle up to 64 groups. The specifications for axes groups are
shown in the following table.
Specifications
Item
NX701 NX1P2 NJ-series
Number of axes groups 64 groups max. 8 groups max. 32 groups max.
Number of composition axes 4 axes max. per axes group

The following elements are related to the axes groups of the MC Function Module.
Configuration element Description Page
Axes group parameters The axes group parameters set the maximum interpolation veloc- P. 3-21
ity, 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 Variable Axes Group Variables are system-defined variables that include a P. 3-21
portion of the axes group parameters as well as the command
interpolation velocity, error information, and other monitor informa-
tion 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 P. 3-24
in the user program control instructions. Motion control instructions that perform multi-
axes coordinated control are used to create axes group com-
mands. To control an axes group with axes group commands,
specify the axes group variable name of the system-defined vari-
able or the axes group variable name that was set with the Sysmac
Studio for the AxesGroup in-out variable of the instruction.

Precautions for Correct Use


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.

3-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

3-3-2 Introduction to Axes Group Parameters


 Axes Group Parameters
Classification Parameter name
Axes Group Basic Set- Axes Group Number
tings
Motion Control*1
Axes Group Use

3-3 Axes Groups


Composition
Composition Axes
Axes Group Operation Maximum Interpolation Velocity
Settings Maximum Interpolation Acceleration
Maximum Interpolation Deceleration
Interpolation Acceleration/Deceleration Over 3
Interpolation Velocity Warning Value
Interpolation Acceleration Warning Value

3-3-2 Introduction to Axes Group Parameters


Interpolation Deceleration Warning Value
Axes Group Stop Method
Correction Allowance Ratio
*1 Set this parameter when using the NX701 CPU Unit.

Refer to 5-3 Axes Group Parameters for details on axes group parameters.

 Settings Required to Use an Axes Group


The following settings must be made to use the axes groups that are created with the Sysmac
Studio.
Classification Parameter name Setting Page
Axes Group Axes Group Axes group numbers are automatically set in the P. 5-33
Basic Settings Number order that the axes groups are created.
Motion Control*1 Select Primary periodic task.
Axes Group Use Select Use.
Composition Select the axis composition to control.
Composition Axes This parameter sets the axes to assign to the axes
group.

*1 Set this parameter when using the NX701 CPU Unit.

Precautions for Correct Use


• 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 allo-
cated as an axis in an axes group.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-21


3 Configuring Axes and Axes Groups

3-3-3 Introduction to Axes Group Variables


Axes Group Variables are system-defined variables for the setting information and the monitoring infor-
mation, such as the actual position and error information, for the axes groups controlled by the MC
Function Module. When you create axes groups with the Sysmac Studio, Axes Group Variables are
registered in the variable table in the order that the axes groups are created. Axes Group Variables are
structures with a data type of _sGROUP_REF.

Axes Group Variable Names


Each Axes Group Variable in the MC Function Module has two variable names: The Axes Group
Variable name in the system-defined variables and the Axes Group Variable that is assigned when
the axes group is added on the Sysmac Studio. The Axes Group Variable names in the system-
defined variables are _MC_GRP[0] to _MC_GRP[63], _MC1_GRP[0] to _MC1_GRP[63],
_MC2_GRP[0] to _MC2_GRP[63].
When you add axes groups on the Sysmac Studio, MC_Group000 to MC_Group063 are set by
default for _MC_GRP[0] to _MC_GRP[63]. The numbers are assigned in the order that the axes are
added. You can change each of these Axes Group Variable names as required from the Sysmac
Studio.
You can use either the Axes Group Variable names for the system-defined variables or the Axes
Group Variable names that are set on the Sysmac Studio to specify the Axes Group Variables in the
user program.

 Example When _MC_GRP[0-63] Is Used


Axes Group Variable name in the
Default Axes Group Variable name when Axes group number
system-defined variables (AT speci-
axes group is added on Sysmac Studio example
fication in global variable table*1)
_MC_GRP[0] MC_Group000 Axes group 0
_MC_GRP[1] MC_Group001 Axes group 1
. . .
. . .
. . .
_MC_GRP[63] MC_Group063 Axes group 63

*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_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 NX1P2 CPU Unit.
Only _MC_GRP[0-63] 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].

3-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

Examples of Axes Group Variable Levels and Changing Axes Group


Variable Names
In the descriptions below, _MC_GRP[0] is used as an example. The same information applies to the
other axes group variables.
_MC_GRP[0] Axes Group Variables
_MC_GRP[0].Status Level that indicates the axes group status

3-3 Axes Groups


.
.
.
_MC_GRP[0].Cmd Level that indicates the axes group command values
_MC_GRP[0].Cmd.Vel Variable that indicates the command interpolation velocity
_MC_GRP[0].Cmd.AccDec Variable that indicates the command interpolation accelera-
tion/deceleration rate
.
.
.
3
_MC_GRP[0].Cfg Level that indicates the axes group basic settings

3-3-3 Introduction to Axes Group Variables


_MC_GRP[0].Cfg.GrNo Variable that indicates the axes group number
_MC_GRP[0].Cfg.GrEnable Variable that indicates when the axes group is enabled
_MC_GRP[0].Kinematics Level that indicates the kinematics transformation settings
_MC_GRP[0].Kinematics.GrType Variable that indicates the axis composition
_MC_GRP[0].Kinematics.Axis[0] Variable that indicates the axis A0 composition axis
.
.
.
_MC_GRP[0].Kinematics.Axis[3] Variable that indicates the axis A3 composition axis
_MC_GRP[1] Axes Group Variable
.
.
.

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 inter-
polation velocity.
Refer to Axes Group Variables on page 6-32 for details on Axes Group Variables.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-23


3 Configuring Axes and Axes Groups

3-3-4 Specifying an Axes Group in the User Program


In the user program, an axes group variable name is specified for the in-out variable AxesGroup in
motion control instructions. In the following example, the Axes Group Variable name for the axes group
that was added for the system-defined Axes Group Variable name of _MC_GRP[0] has been changed
to MyGroup1 in the Sysmac Studio.
In-out variable AxesGroup

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

3-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

3-4 Setting Procedures for Axes Groups

3-4 Setting Procedures for Axes Groups


This section gives the procedures to use the Sysmac Studio to set up an axes group. No configuration
is required if you are not going to use any axes group command instructions, such as linear interpola-
tion or circular interpolation.

3-4-1 Setting Procedure for an Axes Group

START

Start the Sysmac Studio.

Add an axes group. 3

Set the axes group parameters.

3-4-1 Setting Procedure for an Axes Group


Go online and synchronize the data.

Transfer the project to the Controller.

END

3-4-2 Setting Procedure


This section gives the procedures to use the Sysmac Studio to set up an axes group in a project that
already contains the axes.

Starting the Sysmac Studio

1 Start the Sysmac Studio and open the project.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-25


3 Configuring Axes and Axes Groups

Adding an Axes Group

1 Right-click Axes Group Settings in the Multiview Explorer and select Axes Group Settings
from the Add Menu.

An axes group is added to the Multiview Explorer. The default name for the new axes group is
MC_Group000.

 Copying an Axes Group


You can also create an axes group by copying an axes group from a project.

3-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

Setting Axes Group Parameters

3-4 Setting Procedures for Axes Groups


1 Right-click an axes group in the Multiview Explorer and select Edit from the menu.

3-4-2 Setting Procedure


The Axes Group Basic Settings are displayed in the Axes Group Parameter Settings Tab Page.

2 Select from Primary periodic task or Priority-5 periodic task from Motion Control.

Additional Information

The setting is available for the NX701 CPU Unit.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-27


3 Configuring Axes and Axes Groups

3 Select Used axes group in the Axes group use Box.

4 Select the composition of the axes group in the Composition Box. A 2-axis composition is
selected in the following example.

5 Assign the axis to use in the Logical axes Box.

3-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


3 Configuring Axes and Axes Groups

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.

3-4 Setting Procedures for Axes Groups


3
Additional Information

3-4-2 Setting Procedure


Changing Axes Group Variable Names in the User Program
Perform the following two procedures to change Axes Group Variable names that are already
used.
• Change the Axes Group Variable name in the variable table in the variable declarations.
• Change the Axes Group Variable name in the user program.
Even if you change the Axes Group Variable names in the variable table, the Axes Group Vari-
able names in the user program do not change. An error will occur if you use a variable name
that is not declared in the variable table, in the user program. Always change the names in both
places.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 3-29


3 Configuring Axes and Axes Groups

Downloading to the CPU Unit


Use the Synchronization menu command of the Sysmac Studio to download the project to the CPU
Unit.

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.

3-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Checking Wiring from the Sysmac
Studio
This section describes the MC Test Run operations of the Sysmac Studio. You can use
the MC Test Run to monitor sensor signals, check motor wiring, and more, all without
any programming. 4

4-1 Functions of the Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2


4-1-1 MC Test Run Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4-1-2 Application Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4-1-3 Axis Parameter Setting Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4-1-4 Starting the MC Test Run Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4-2 Monitoring Sensor Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4-3 Checking Motor Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4-3-1 Turning ON the Servo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4-3-2 Jogging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4-3-3 Homing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
4-3-4 Absolute Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
4-3-5 Relative Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 4-1


4 Checking Wiring from the Sysmac Studio

4-1 Functions of the Sysmac Studio


This section describes how to use the MC test run function to check wiring and basic settings. You can
use the MC test run function in the Sysmac Studio to check wiring without any programming.

4-1-1 MC Test Run Function


The MC test run operation supports the following functions.
Category Function Description Setting/monitor item
Axis operation Deceleration A deceleration stop is performed during the MC ---
stop Test Run.
Servo The Servo is turned ON and OFF. ---
ON/OFF
Resetting The errors in the MC Function Module are ---
errors reset.
Jogging Jogging is performed in the positive or negative Target Velocity
direction. Acceleration/Deceleration
Absolute posi- Absolute positioning is performed.* Target Position
tioning Target Velocity
Acceleration/Deceleration
Jerk
Relative posi- Relative positioning is performed. Travel Distance
tioning Target Velocity
Acceleration/Deceleration
Jerk
Homing Homing is performed using the homing parame- Homing Parameters
ter settings.

4-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


4 Checking Wiring from the Sysmac Studio

Category Function Description Setting/monitor item


Monitoring Error list The errors in the MC Function Module are mon- MC Common Errors
itored. Axis Errors
Axes Group Errors
Axis status The status of the axes is monitored. Axis Ready-to-execute
Standstill

4-1 Functions of the Sysmac Studio


Discrete Motion
Continuous Motion
Homing
Stopping
Home Defined
In Home Position
Actual posi- The actual position is monitored. Command and Actual Cur-
tion monitor rent Positions
Actual velocity The actual velocity is monitored. Command and Actual Cur-
monitor rent Velocities
Servo Drive The status of the Servo Drive is monitored. Servo ON/OFF
status Servo Ready 4
Main Power
Input signals The status of the input signals are monitored. Positive Limit Input

4-1-1 MC Test Run Function


Negative Limit Input
Immediate Stop Input
Home Proximity Input
Home Input
External Latch Inputs 1 to 2

* When the Count Mode of the axis is set to Rotary Mode, positioning is performed toward the target position in the
positive direction. For details, refer to the MC_MoveAbsolute (Absolute Positioning) instruction in the NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).

Note You can use MC Test Runs 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 manufacturer.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 4-3


4 Checking Wiring from the Sysmac Studio

4-1-2 Application Procedure


Before you perform an MC Test Run, check the following two items.
• Are the Sysmac Studio and Controller connected and are they online?
• Is the MC Test Run Mode currently in use from any other copy of the Sysmac Studio?
After you have confirmed these two items, perform the following operations as instructed.

START

Section 3 Configuring Axes and


Setup Create the EtherCAT slave configuration, add axes, Axes Groups
assign the axes, and set the axis parameters.

Section 4 Checking Wiring


Starting the MC Start the MC test run function. from the Sysmac Studio
test run function

Checking wiring Confirm sensor wiring.

Checking motor
operation Use jogging to check the direction of the motor.

Checking electronic
gear settings Perform relative positioning to check the travel distance.

Confirming homing Perform homing to check the homing operation.

Precautions for Correct Use


• 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 operations.
• When operating the Controller from the Sysmac Studio, always install external emergency cir-
cuits so that the Servomotor can be stopped safely whenever necessary. The Sysmac Studio
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.

4-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


4 Checking Wiring from the Sysmac Studio

4-1-3 Axis Parameter Setting Example


Set the following axis parameters before you execute the MC Test Run Mode in the Sysmac Studio.
The following setting example is for a one-axis device.
Servomotor
Encoder resolution: 20 bits/rotation

4-1 Functions of the Sysmac Studio


1 rotation
10 mm Ball screw
Ball screw pitch: 10 mm

Encoder Output Pulse Count per Motor Rotation


20 bits = 1,048,576

Parameter name Setting


Axis Variable Name Axis1*1
Axis Number 1*2
Axis Use Used axis
4
Axis Type Servo axis
Input Device/Output Device 1*3

4-1-3 Axis Parameter Setting Example


Unit of Display μm
Command Pulse Count Per Motor Rotation 1,048,576*4
Work Travel Distance Per Motor Rotation 10,000*4
Maximum Velocity 500,000*5
Maximum Jog Velocity 50,000*6
Maximum Acceleration 5,000,000*7
Maximum Deceleration 5,000,000*7
Software Limits Immediate stop for command position
Positive Software Limit 500,000*8
Negative Software Limit 0*8
Count Mode Linear Mode

*1 If there is more than one axis, a different variable name is set for each axis.
*2 If there is more than one axis, a different value is set for each axis.
*3 Set the same node address as for the Servo Drive.
If there is more than one axis, a different value is set for each axis.
*4 The position command unit will be 1 μm.
*5 The maximum velocity will be 3,000 r/min = 30 m/min = 0.5 m/s = 500,000 μm/s.
*6 The maximum jog velocity will be 10% of the maximum velocity, i.e., 0.05 m/s = 50,000 μm/s.
*7 The maximum acceleration and the maximum deceleration will be 5 m/s2.
The acceleration time to the maximum velocity (3,000 r/min) will be 0.1 s.
*8 Set a value that is within the movable range of the device.
The positive software limit is set to 50 cm = 500,000 μm.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 4-5


4 Checking Wiring from the Sysmac Studio

4-1-4 Starting the MC Test Run Function


The MC Test Run Mode is started from the Sysmac Studio.

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.

3 Select MC Test Run − Start from the Controller Menu.

When the following caution dialog box appears, read the message carefully. After you confirm
safety, click the OK Button.

The MC Test Run Tab Page is displayed.

4-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


4 Checking Wiring from the Sysmac Studio

4-2 Monitoring Sensor Signals


You can use the input signal display to check sensor signal wiring.

1 Select the axis to check on the MC Test Run Tab Page.

4-2 Monitoring Sensor Signals


4

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 4-7


4 Checking Wiring from the Sysmac Studio

4-3 Checking Motor Operation


Use the functions of the MC Test Run to check motor operation.

4-3-1 Turning ON the Servo


You can use the Servo ON Button to turn the Servo ON and OFF.

1 Select the axis for which to turn ON the Servo.

2 Click the Servo ON Button to turn ON the Servo.

3 Click the Servo OFF Button to turn OFF the Servo.

Precautions for Correct Use


• 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 operations.
• 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.

2 Click the Servo ON Button to turn ON the Servo.

3 Enter the target velocity, acceleration rate, and deceleration rate, and then press the Apply But-
ton.

4-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


4 Checking Wiring from the Sysmac Studio

4 Click the or Button.


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-3-3 Homing

4-3 Checking Motor Operation


Set the homing parameters in the Homing Settings on the Axis Parameter Settings Tab Page.

2 Click the Homing Tab on the MC Test Run Tab Page.


The following dialog box is displayed.

4-3-3 Homing
3 Select the axis to home.

4 Click the Servo ON Button to turn ON the Servo.

5 Click the Apply homing parameters Button.

6 Click the Button.


Check to see if the homing operation agrees with the settings.

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 4-9


4 Checking Wiring from the Sysmac Studio

4-3-4 Absolute Positioning

1 Click the Absolute positioning Tab on the MC Test Run Tab Page.
The following dialog box will appear.

2 Select the axis to perform absolute positioning.

3 Click the Servo ON Button to turn ON the Servo.

4 Enter the target position, target velocity, acceleration rate, deceleration rate, and jerk, and then
click the Apply Button.

5 Click the Button. Absolute positioning will start.


Check to see if positioning agrees with the settings.

4-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


4 Checking Wiring from the Sysmac Studio

4-3-5 Relative Positioning

1 Click the Relative positioning Tab on the MC Test Run Tab Page.
The following dialog box will appear.

4-3 Checking Motor Operation


4

4-3-5 Relative Positioning


2 Select the axis to perform relative positioning.

3 Click the Servo ON Button to turn ON the Servo.

4 Enter the target travel distance, target velocity, acceleration rate, deceleration rate, and jerk, and
then click the Apply Button.

5 Click the Button. Relative positioning will start.


Check to see if the travel distance agrees with the settings.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 4-11


4 Checking Wiring from the Sysmac Studio

4-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Motion Control Parameters
This section explains about axis parameters and axes group parameters used for
motion control.

5-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5


5-2 Axis Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5-2-1 Axis Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5-2-2 Axis Basic Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5-2-3 Unit Conversion Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
5-2-4 Operation Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20
5-2-5 Other Operation Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
5-2-6 Limit Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
5-2-7 Position Count Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
5-2-8 Servo Drive Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27
5-2-9 Homing Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28
5-2-10 Axis Parameter Setting Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-29
5-3 Axes Group Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
5-3-1 Axes Group Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
5-3-2 Axes Group Basic Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33
5-3-3 Axes Group Operation Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35
5-3-4 Enabling an Axes Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-1


5 Motion Control Parameters

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
x10 0
23
7
8
9
10
11
12
13
14
15
COM

DC24V
7mA

Downloaded.*2

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*1 MC common parameter settings*1
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.*2 some axis ter instruction*3
parameter settings
Data movement or
Accessing some other instructions
parameters as
variables

*1 There are no MC Common Parameter Settings for the current version of the MC Function Module.
*2 Use the Synchronization menu command of the Sysmac Studio to upload and download the project.
*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)
instructions.

 Data Flow for Setting MC Parameters


• Download your MC Parameter Settings to the CPU Unit using the Sysmac Studio to save those
settings in the CPU Unit's non-volatile memory. When you upload the MC Parameter Settings to
the Sysmac Studio, the MC Parameter Settings that were saved in the non-volatile memory are
uploaded.
• The settings that were saved in the non-volatile memory are applied to the main memory after you
download them or when the power is turned ON.
• If there are no problems with the saved settings, the MC Function Module executes control based
on the settings in the main memory.
• The settings of some of the parameters can be accessed as system-defined variables for motion
control.
• You can upload and download MC parameter settings regardless of the CPU Unit’s mode or the
status of the MC Function Module.
• When you start the download process, all axes in motion will stop immediately.

5-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

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
stopped 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 Dis-
abled).
Continuing sending commands to I/O devices
The following status immediately before downloading is maintained during the download:

5-1 Introduction
the Servo ON state for the MC_Power instruction and the output torque limit for the MC_-
SetTorqueLimit instruction.
The Servo ON state and torque limit are maintained even if the MC_Power and MC_Set-
TorqueLimit instructions are deleted from the user program after the program is updated by
downloading.

 Overwriting MC Parameters with Programming Instructions


5
• You can use motion control instructions like the MC_Write (Write MC Setting), MC_ChangeAxes-
InGroup (Change Axes in Group) or MC_WriteAxisParameter (Write Axis Parameters) instruction
to change the settings of some of the MC parameters in the main memory while the user program
is running.
• If the specified set value is outside the valid range, the Error output variable from the instruction
changes to TRUE and the MC parameter setting is not changed.
• Changes to MC parameter settings become valid in either of the following two situations.
• The axis or axes group is stopped and you execute an instruction for an axis command or
axes group command.
• You set the Buffer Mode Selection for the instruction to Aborting and execute more than one
instruction.
• For details on MC_Write (Write MC Setting), MC_ChangeAxesInGroup (Change Axes in Group),
MC_WriteAxisParameter (Write Axis Parameters) and other instructions, refer to the NJ/NX-
series Motion Instructions Reference Manual (Cat. No. W508).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-3


5 Motion Control Parameters

Precautions for Correct Use


• 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 (Changing 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.

5-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

5-2 Axis Parameters


The axis parameters set the maximum velocity, jerk, homing, and other items for the axes controlled by
the MC Function Module.
The number of axis parameters 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.
The same parameter settings are provided for each axis. This section describes only the parameters for
axis 1.

5-2-1 Axis Parameters

5-2 Axis Parameters


Use the Sysmac Studio to set the axis parameters for each axis.
Temporary changes*1
Reading
Classification Parameter name Applicable Page
Support variables*2
instruction
Axis Basic Axis Number --- --- OK P. 5-7
Settings --- ---
Motion Control*3 OK*4
Axis Use OK*5 MC_ChangeA OK 5
xisUse
Axis Type --- --- OK

5-2-1 Axis Parameters


Control Function*6 --- --- ---
Input Device/Output Device --- --- OK
Unit Conver- Unit of Display OK*7 MC_WriteAx- OK P. 5-13
sion Settings Command Pulse Count Per Motor Rota- isParameter*8 OK
tion
Work Travel Distance Per Motor Rotation OK
Reducer Use*9 ---

Work Travel Distance Per Rotation*9 ---

Work Gear Ratio*9 ---

Motor Gear Ratio*9 ---


Operation Set- Maximum Velocity OK*7 MC_WriteAx- --- P. 5-20
tings isParameter*8 ---
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_WriteAx- ---
Deceleration Warning Value isParameter*8 ---
Positive Torque Warning Value*11 ---

Negative Torque Warning Value*11 ---


In-position Range OK*12 ---
In-position Check Time OK ---

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-5


5 Motion Control Parameters

Temporary changes*1
Reading
Classification Parameter name Applicable Page
Support variables*2
instruction
Operation Set- Actual Velocity Filter Time Constant OK*7 MC_WriteAx- --- P. 5-20
tings Zero Position Range isParameter*8 ---
Other Opera- Immediate Stop Input Stop Method OK*7 MC_WriteAx- --- P. 5-24
tion Settings Limit Input Stop Method isParameter*8 ---
Drive Error Reset Monitoring Time ---
Maximum Positive Torque Limit ---
Maximum Negative Torque Limit ---
Immediate Stop Input Logic Inversion*10 ---

Positive Limit Input Logic Inversion*10 ---

Negative Limit Input Logic Inversion*10 ---

Home Proximity Input Logic Inversion*10 ---


Limit Settings Software Limits OK MC_Write --- P. 5-25
Positive Software Limit MC_WriteAx- ---
Negative Software Limit isParameter*8 ---
Following Error Over Value ---
Following Error Warning Value ---
Position Count Count Mode OK*7 MC_WriteAx- --- P. 5-25
Settings Modulo Maximum Position Setting Value isParameter*8 OK *4
Modulo Minimum Position Setting Value OK *4
Encoder Type --- --- ---
Servo Drive Modulo Maximum Position Setting Value --- --- --- P. 5-27
Settings Modulo Minimum Position Setting Value --- --- ---
PDS State Control Method*4 --- --- ---
Homing Set- Homing Method OK*7 MC_WriteAx- --- P. 5-28
tings Home Input Signal isParameter*8 ---
Homing Start Direction ---
Home Input Detection Direction ---
Operation Selection at Positive Limit ---
Input
Operation Selection at Negative Limit ---
Input
Homing Velocity ---
Homing Approach Velocity ---
Homing Acceleration ---
Homing Deceleration ---
Homing Jerk ---
Home Input Mask Distance ---
Home Offset ---
Homing Holding Time ---
Homing Compensation Value ---
Homing Compensation Velocity ---

*1 This column indicates if you can use instructions to temporarily change the settings.
*2 Indicates whether you can access the parameter with a system-defined variable for motion control in the user
program.

5-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

*3 Set this parameter when using the NX701 CPU Unit.


*4 A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this
parameter.
*5 A CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher are required for temporary
changes.
*6 Set this parameter when using the NX1P2 CPU Unit.
*7 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required for temporary
changes.
*8 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 instruction.
The parameters that can be temporarily changed with the MC_WriteAxisParameter instruction can be read
with the MC_ReadAxisParameter instruction.
*9 A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use this
parameter.
*10 A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use this
parameter.

5-2 Axis Parameters


*11 This parameter is enabled only for torque control.
*12 A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required for temporary
changes using the MC_Write instruction.
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required for temporary
changes using the MC_WriteAxisParameter instruction.
Refer to 3-2 Axis Setting Procedure for details on how to set axis parameters.
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). 5
Refer to 6-6 System-defined Variables for Motion Control for information on system-defined variables
for motion control.

5-2-2 Axis Basic Settings


5-2-2 Axis Basic Settings
The Axis Basic Settings are used to set whether to use the axis. If you use the axis, set the axis type
and the node address of the EtherCAT slave device.
Parameter name Function Setting range Default
Axis Number Set the logical number of the axis. This number spec- --- ---
ifies which of the following system-defined variables
to use:_MC_AX[0] to _MC_AX[63].
Motion Control *1 Assign to either of the primary periodic task or prior- 1 to 2 1
ity-5 periodic task.
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. I/O wiring is not required for virtual 0 to 3 2
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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-7


5 Motion Control Parameters

Parameter name Function Setting range Default


Input Device/Output Specify the node address of the EtherCAT slave 0 to 65535 ---
Device device that is assigned to the axis. *6
The Node Address parameter cannot be selected if
the Axis Type parameter is set to a virtual axis.

*1 Set this parameter when using the NX701 CPU Unit.


*2 Busy (Controlling) 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 program-
ming 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 for details.
*4 Set this parameter when using the 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.

Precautions for Correct Use


Using Absolute Encoders
When absolute encoders are used, the absolute encoder home offset for each axis is saved to
the battery-backup memory along with the axis number. The saved offset is lost if the axis num-
ber is changed. If you change the axis number, set the Homing Settings again.

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.

Item NX701-17 NX701-16


Settable axis numbers 0 to 255 0 to 127
Maximum number of 256 axes 128 axes
used real axes

Item NX1P2-11 NX1P2-10 NX1P2-90


Settable axis numbers 0 to 11 0 to 9 0 to 3
Maximum number of used real axes 8 axes 6 axes 4 axes
Used motion control servo 4 axes 2 axes ---
axes
Used single-axis position con- 4 axes 4 axes 4 axes
trol servo axes

Item NJ501-5 NJ501-4 NJ501-3


Settable axis numbers 0 to 63 0 to 31 0 to 15
Maximum number of 64 axes 32 axes 16 axes
used real axes

5-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

Item NJ301-12 NJ301-11 NJ101-10


Settable axis numbers 0 to 14 *1 0 to 14 *2 0 to 5
Maximum number of 8 axes 4 axes 2 axes
used real axes

*1 The range of axis number is 0 to 7 for a CPU Unit with unit version 1.05 or earlier.
*2 The range is 0 to 3 for a CPU Unit with unit version 1.05 or earlier.

Motion Control
For the NX701 CPU Unit, the axes to use are assigned to either of the primary periodic task or priority-
5 periodic task.

5-2 Axis Parameters


Additional Information

The Motion control setting is not available for the NX1P2 CPU Unit and NJ-series CPU Unit,
which support only the primary periodic task.

Axis Types
5
The following table describes the different axis types that you can select in the Axis Type parameter.
Axis type Description

5-2-2 Axis Basic Settings


Servo axis These axes are used by the EtherCAT slave Servo Drives and NX-series Position
Interface Units.*1 They are assigned to actual Servo Drives or other devices.
One Servomotor is used as one axis.
If you use NX-series Position Interface Units, you can assign more than one device,
such as a Pulse Output Unit and Digital Input Unit, to the same axis.
Virtual servo axis These virtual axes exist only inside the MC Function Module. They are not used by
actual Servo Drives. For example, they are used as master axes for synchronizing
control.
Encoder axis These axes are used by the EtherCAT slave Encoder Input Terminals and NX-
series Position Interface Units.*2 An encoder axis is assigned to an actual encoder
input terminal or other device.
If one encoder input terminal contains two counters, each counter will act as one
axis.
Virtual encoder axis These virtual axes are used for encoder operation. A virtual encoder axis is used
temporarily in place of an encoder axis when there is no physical encoder.*3

*1 Refer to 1-4-3 Function Specifications for the controllable devices.


*2 Refer to 1-4-3 Function Specifications for the controllable devices.
*3 Virtual encoder axes are used in combination with motion control instructions that update the actual position of
the virtual encoder axis. They cannot be used in place of encoder axes for versions of the MC Function Module
that do not support such instructions.

 Virtual Servo Axes


A virtual servo axis does not have a physical encoder or external I/O signals. Therefore, virtual
servo axes differ from servo axes in the following ways.
• They are always in Servo ON state.
• The actual current position equals the command current position.*
• The actual current velocity equals the command current velocity.*
• External input signals cannot be used.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-9


5 Motion Control Parameters

• If the MC_Home or MC_HomeWithParameter instruction is executed, the instruction is processed


as a zero position preset regardless of the setting of the Homing Method axis parameter.
• If a motion control instruction that uses a latch function is executed, you must set the trigger input
condition to Controller Mode. An error does not occur if you set it to Drive Mode, but a latch trigger
will not occur, so execution of the instruction will not end.
Latches are used by the following instructions: MC_TouchProbe (Enable External Latch),
MC_MoveFeed (Interrupt Feeding), MC_MoveLink (Synchronous Positioning), and other instruc-
tions.
• Errors do not occur for immediate stop inputs or positive/negative limit inputs because the input
signals do not exist.
* However, there is sometimes calculation error because processing is performed with long reals in the MC Func-
tion Module.

 Encoder Axes and Virtual Encoder Axes


Encoder and virtual encoder axes differ from servo and virtual servo axes in the following ways.
• They do not have command positions. They have only actual positions.
• You cannot use motion-type motion control instructions for them.

Precautions for Correct Use


You cannot set the axis type of a single-axis position control axis to Encoder axis or Virtual
encoder axis.

Control Function
Select the function of axis to control.
This setting is selectable only when you use an NX1P2 CPU Unit.

Control Function Description


All Sets the axis to a motion control axis for which all controls can be used.
Single-axis posi- Sets the axis to a single-axis position control axis for which only single-
tion control only axis position control can be used.

The following table shows the axis types that are available with the selected Control Function.

Control Function
Axis type Single-axis position
All
control only
Servo axis Yes Yes
Virtual servo axis Yes Yes
Encoder axis Yes No
Virtual encoder axis Yes No

5-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

The following table shows the enabled functions.

Control Function
Motion control function Single-axis position
All
control only
Single-axis position control Yes Yes
Single-axis synchronized control Yes No
Single-axis velocity control Yes Yes*1
Single-axis torque control Yes No
Multi-axes coordinated control Yes No

*1 You can use only the MC_MoveVelocity (Velocity Control) instruction.


Refer to Section 9 Motion Control Functions for details on motion control functions.

5-2 Axis Parameters


Additional Information

Select Single-axis position control only when you use NX1P2-90.

Input Device/Output Device


5
For a servo or encoder axis, the node address specifies the node address of the EtherCAT slave device
that is assigned to the axis. For an NX-series Position Interface Unit, select the node address of the

5-2-2 Axis Basic Settings


EtherCAT Coupler Unit and the NX Unit number of the Position Interface Unit.
The Node Address parameter cannot be selected if the Axis Type parameter is set to a virtual axis.

Precautions for Correct Use


• OMRON 1S-series Servo Drives and G5-series Servo Drives can be set to specific node
addresses 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 settings made in the Ether-
CAT 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 Servo
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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-11


5 Motion Control Parameters

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.

7-segment display CN7

ID
01 2 01
EF EF

23

23345
CD

CD
ID switch

45

45
AB

AB
67 67
89 89
x16 x1

Status indicators

• The rotary switches in the display area on the Servo Drive are used to set the EtherCAT node
address.
Node address setting range
Rotary switch setting
OMRON slaves Non-OMRON slaves*1
00 Value set from the Sysmac Value set from the Sysmac
Studio (1 to 512 *2) Studio (1 to 512 *2)
01 to 99 Node address switch setting

*1 The value set from the Sysmac Studio will be used for all non-OMRON slaves, regardless of any setting
at the slave.
*2 The value changes to 192 for the NJ-series CPU Unit.

5-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

5-2-3 Unit Conversion Settings


These parameters set position units.
Parameter name Function Setting range Default
Unit of Display Set the unit for command positions. 0 to 5 0
pulse
mm
μm
nm
degree
inch
Command Pulse Set the number of pulses per motor rotation 1 to 4,294,967,295 10,000
Count Per Motor for command positions according to the

5-2 Axis Parameters


Rotation*1 encoder resolution.*2 The command value is
converted to a number of pulses based on
the electronic gear ratio.
Work Travel Dis- Set the workpiece travel distance per motor 0.000000001 to 10,000
tance Per Motor rotation for command positions. 4,294,967,295
Rotation*3
Reducer Use*4 *5 Specify whether to use the reducer setting or TRUE or FALSE FALSE
not.
5
TRUE: Used.
FALSE: Not used.

5-2-3 Unit Conversion Settings


Work Travel Dis- Set the work travel distance per rotation. Positive long reals 10,000
tance Per Rotation
*4 *6 *7

Work Gear Ratio*4 Set the gear ratio for the workpiece. 1 to 4,294,967,295 1
*6

Motor Gear Ratio*4 Set the gear ratio of the motor. 1 to 4,294,967,295 1
*6

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-13


5 Motion Control Parameters

Precautions for Correct Use


• 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
counter 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 understand 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.

User Position Motion MC


program increment control Function Pulses Command
instruction Module position

Actual
position

Unit of Display
You can use the Unit of Display parameter to set the unit to display on the Sysmac Studio. The display
shows the position’s display unit. The following table describes the units you can set.
Unit Description
pulse Use this unit to express values in pulses.
mm Use this unit for comparatively long-distance direct operation.
μm Use this unit for precise direct operation.
nm Use this unit for more precise direct operation than μm.
degree Use this unit for rotary tables or other rotating axes.
inch Use this unit for direct operation.

Conditions to Use Reducers


When you set to use the reducer, the following condition must be met to use the unit conversion
settings.

5-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

• The result of the following calculation must be equal to or between 0.000000001 and 4,294,967,295:
Work travel distance per rotation × Work gear ratio ÷ Motor gear ratio.

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

5-2 Axis Parameters


and the motor gear ratio to be 3 in the calculation.

Electronic Gear Ratio (Unit Conversion Formula)


Use the electronic gear to set the relationship between the display unit and pulse unit in the MC Func-
tion Module. Use the Sysmac Studio and set the electronic gear ratio.

MC Function Servo 5
Command position Module Drive Y pulses
(X units) Electronic
gear

5-2-3 Unit Conversion Settings


Actual position
(X units)
X units
Command position value (pulses) = Command position (X units) × Electronic gear ratio

 When Not Using a Reducer


When you set not to use the reducer, the following formula is used to express the electronic gear
ratio.
Command Pulse Count Per Motor Rotation*1 (Y Pulses)
Electronic gear ratio =
Work Travel Distance Per Motor Rotation*2 (X Units)
*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.

Additional Information

The electronic gear converts units to the values that are used for positioning by the MC Function
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 exceeds 40 bits.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-15


5 Motion Control Parameters

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.
Parameter name Setting
Unit of Display mm
Command Pulse Count Per Motor Rotation 8,388,608
Work Travel Distance Per Motor Rotation 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

Parameter Settings for a Reduction Ratio of 1/9 for the Example


The travel distance of the workpiece for one rotation of the Servomotor is 10 mm × 1/9, or
1.1111... mm (a repeating decimal number).
For numbers that do not divide evenly, multiply the command pulse count per motor rotation and
the work travel distance per motor rotation by the same coefficient and set the parameters to the
results. Here, the reduction ratio is 1/9, so we use 9 as our coefficient.
• Command Pulse Count Per Motor Rotation: 75,497,472 (8,388,608 × 9)
• Work Travel Distance Per Motor Rotation: 10 (10 × 1/9 × 9)

 When Using a Reducer and the Count Mode Is Linear Mode


When you set to use a reducer and the Count Mode is Linear Mode, the following calculation for-
mula is used to have the electric gear ratio.
Command Pulse Count Per Motor Rotation × Motor Gear Ratio
Electronic gear ratio =
Work Travel Distance Per Rotation × Work Gear Ratio

Precautions for Correct Use


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
exceeds 40 bits.

5-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

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.

5-2 Axis Parameters


A reducer with a reduction ratio of 3/5 is used, so the ball screw turns three times for every five rota-
tions 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.

Parameter name Setting


Unit of Display mm
Command Pulse Count Per Motor Rotation 8,388,608
Work Travel Distance Per Rotation 10 5
Work Gear Ratio 3
Motor Gear Ratio 5

5-2-3 Unit Conversion Settings


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.

 When Using a Reducer and the Count Mode Is Rotary Mode


When you set to use a reducer and the Count Mode is Rotary Mode, the following calculation for-
mula is used to have the electric gear ratio.
In Rotary Mode, the Work Travel Distance Per Rotation is automatically determined and set by the
result of “Modulo maximum position - Modulo minimum position”.
Command Pulse Count Per Motor Rotation × Motor Gear Ratio
Electronic gear ratio =
Work Travel Distance Per Rotation × Work Gear Ratio
Command Pulse Count Per Motor Rotation × Motor Gear Ratio
=
(Modulo maximum position - Modulo minimum position) × Work Gear Ratio

Precautions for Correct Use


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
exceeds 40 bits.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-17


5 Motion Control Parameters

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
every rotation of the turntable.
Turntable
360 degree/rotation

Reduction ratio: 3/5

Servomotor encoder
resolution: 23 bits/rotation
(8,388,608 pulses per 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.
The Work Travel Distance Per Rotation is automatically determined and set by the result of “Modulo
maximum position - Modulo minimum position”.
A reducer with a reduction ratio of 3/5 is used, so the turntable (or workpiece) 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.

Parameter name Setting


Unit of Display degree
Command Pulse Count 8,388,608
Per Motor Rotation
Work Travel Distance Per Modulo maximum position - Modulo minimum position
Rotation
Work Gear Ratio 3
Motor Gear Ratio 5

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.

5-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

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 rota-
tion of the pulley. The travel distance per conveyor rotation is 360 mm.
Servomotor encoder resolution: 23 bits/rotation
(8,388,608 pulses per rotation) Travel distance per conveyor
rotation = 360 mm
Travel distance per pulley (Modulo maximum position/Modulo
rotation = 80 mm minimum position: 0 to 360)

Servomotor

Reducer

Reduction Mechanical
ratio: 3/5 ratio: 80/360

5-2 Axis Parameters


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
5
position - Modulo minimum position”.

5-2-3 Unit Conversion Settings


Parameter name Setting
Modulo Maximum Position 360
Modulo Minimum Position 0

A reducer with a reduction ratio of 3/5 is used, so the pulley turns three times for every five rotations
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).

Parameter name Setting


Unit of Display mm
Command Pulse Count 8,388,608
Per Motor Rotation
Work Travel Distance Per Modulo maximum position - Modulo minimum position
Rotation
Work Gear Ratio 240
Motor Gear Ratio 1,800

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-19


5 Motion Control Parameters

5-2-4 Operation Settings


These parameters set items for axis operation, such as the maximum velocity and maximum accelera-
tion/deceleration rate. Set them according to the specifications of the device you are controlling.
Parameter name Function Setting range Default
Maximum Velocity Set the maximum velocity for each axis.*1 Positive long reals 400,000,000
Do not set a value that exceeds the maximum *2
speed of the motor that you are using.
(Unit: command units/s)
Start Velocity*3 Set the start velocity for each axis. Positive long reals 0
Set a value that does not exceed the maxi-
mum velocity.
(Unit: command units/s)
Maximum Jog Set the maximum jog velocity for each axis.*4 Positive long reals 1,000,000
Velocity Set a value that does not exceed the maxi-
mum velocity.
(Unit: command units/s)
Maximum Accelera- Set the maximum acceleration rate for an axis Non-negative long 0
tion operation command. There will be no limit to reals
the acceleration rate if 0 is set. (Unit: com-
mand units/s2)
Maximum Decelera- Set the maximum deceleration rate for an axis Non-negative long 0
tion operation command. There will be no limit to reals
the deceleration rate if 0 is set. (Unit: com-
mand units/s2)
Acceleration/Decel- Set the operation for when the maximum 0 to 2 0
eration Over acceleration/deceleration rate would be
exceeded after excessive acceleration/decel-
eration during acceleration/deceleration con-
trol of the axis because stopping at the target
position is given priority.
0: Use rapid acceleration/deceleration.
(Blending is changed to Buffered.)*5
1: Use rapid acceleration/deceleration.
2: Minor fault stop*6
Operation Selection Specify the operation for reversing rotation for 0 to 1 0
at Reversing multi-execution of instructions, re-execution of
instructions, and interrupt feeding.*7
0: Deceleration stop
1: Immediate stop
Velocity Warning Set the percentage of the maximum velocity at 0 to 100 0
Value which to output a velocity warning for the axis.
No velocity warning is output if 0 is set. (Unit:
%)
Acceleration Warn- Set the percentage of the maximum accelera- 0 to 100 0
ing Value tion rate at which to output an acceleration
warning for the axis. No acceleration warning
is output if 0 is set. (Unit: %)
Deceleration Warn- Set the percentage of the maximum decelera- 0 to 100 0
ing Value tion rate at which to output a deceleration
warning for the axis. No deceleration warning
is output if 0 is set. (Unit: %)
Positive Torque Set the torque command value at which to 0 to 1,000 0
Warning Value*8 output a positive torque warning. No positive
torque warning is output if 0 is set. (Unit: %)

5-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

Parameter name Function Setting range Default


Negative Torque Set the torque command value at which to 0 to 1,000 0
Warning Value*8 output a negative torque warning. No negative
torque warning is output if 0 is set. (Unit: %)
Actual Velocity Fil- Set the time period to calculate the average 0 to 100 0
ter Time Constant travel of the actual velocity in milliseconds.
The average travel is not calculated if 0 is set.
(Unit: ms)
Use this to reduce variations in the actual cur-
rent velocity when axis velocity is slow.
In-position Range*9 Set the in-position width. (Unit: command Non-negative long 10
units) reals
In-position Check Set the in-position check time in milliseconds. 0 to 10,000 0
Time*9 Set 0 to check for the end of positioning only
when you define the home position during

5-2 Axis Parameters


homing and not check positioning at other
times. (Unit: ms)
Zero Position Range Set the home position detection width. (Unit: Non-negative long 10
command units) reals

*1 The maximum velocity is used as the command velocity if you specify a velocity command value that is greater
than the maximum velocity. This parameter also applies to interpolation control operation.
Do not set any value that exceeds the setting range of Maximum Velocity even if the connected Servomo-
tor/Servo Drive unit, as a single unit, provides a faster rotation speed than the maximum velocity.
*2 The maximum value that you can set is as follows when the value is converted to pulses: 5
For a CPU Unit with unit version 1.02 or earlier, the value is 400,000,000 [pulses/s].
For a CPU Unit with unit version 1.03 or later, the value is 500,000,000 [pulses/s].

5-2-4 Operation Settings


For a CPU Unit with unit version 1.11 or later, the value is 2,147,483,647 [pulses/s].
*3 A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use this
parameter.
*4 The maximum jog velocity is used as the command velocity if you specify a velocity command value that is
greater than the maximum jog velocity.
*5 For a CPU Unit with unit version 1.10 or later, Blending is not changed to Buffered. Refer to 9-5-7 Multi-execu-
tion of Motion Control Instructions (Buffer Mode) for details.
*6 For a CPU Unit with unit version 1.10 or later, the axis does not stop with an error when Blending is used for
operation. Refer to 9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode) for details.
*7 Refer to 9-5-6 Re-executing Motion Control Instructions and 9-5-7 Multi-execution of Motion Control Instruc-
tions (Buffer Mode) for details on the Operation Selection at Reversing parameter.
*8 This parameter is enabled only for torque control.
*9 The in-position check is processed by the MC Function Module. The function in the Servo Drive is not used.

Maximum Velocity
This section provides a setting example for the maximum velocity.

 Setting Example for the Maximum Velocity


The same machine as in When Not Using a Reducer on page 5-15 is described here for a Servomo-
tor with a maximum speed of 6,000 r/min.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-21


5 Motion Control Parameters

Workpiece

Servomotor
encoder resolution: 23 bits/rotation
(8,388,608 pulses per rotation) Reduction ratio: 1/5 Ball screw pitch: 10 mm

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.

Parameter name Setting


Unit of Display mm
Command Pulse Count Per Motor Rotation 8,388,608
Work Travel Distance Per Motor Rotation 2
Maximum Velocity 200

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.

Not Specifying Jerk Specifying Jerk

Velocity Velocity

Target velocity Target velocity

Start velocity Start 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

5-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

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 initial velocity is used. If the target
velocity is greater than the start velocity, acceleration/deceleration are performed at the specified accel-
eration/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 Instruction Instruction Instruction


executed. executed. executed.

Start velocity

0 Time

5-2 Axis Parameters


The start velocity is also used if the velocity is changed by the MC_SetOverride instruction. If the target
velocity is greater than the start velocity, acceleration/deceleration are performed at the specified accel-
eration/deceleration rates. If the target velocity is less than the start velocity, acceleration/deceleration
are not performed and the axis moves.
Velocity
100%→180% 180%→50% Override factor

180% 5
Start velocity

100%

5-2-4 Operation Settings


50%

0 Time

The start velocity is not used in the following cases.


• Torque Control Mode
• Cyclic synchronous velocity control
• Cyclic synchronous positioning
• Synchronized control
Note However, the start velocity is used for the MC_GearOut and MC_CamOut instructions.
• Multi-axes coordinated control
Note However, the start velocity for each axis is used to decelerate the axes to a stop.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-23


5 Motion Control Parameters

5-2-5 Other Operation Settings


These parameters are used to set the stopping methods and torque limits to use when the input sig-
nals are enabled.
Parameter name Function Setting range Default
Immediate Stop Set the stopping method in the MC Function Module 0, 2, or 3 0
Input Stop Method when the immediate stop input is enabled.
0: Immediate stop
2: Immediate stop and error reset
3: Immediate stop and Servo OFF
Limit Input Stop Set the stopping method in the MC Function Module 0 to 3 0
Method when the 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
Drive Error Reset Set the monitor time for a drive error reset. (Unit: ms) 1 to 1,000 200
Monitoring Time After the monitor time has elapsed, reset processing
will end even if the drive error is not yet reset.
Maximum Positive Set the maximum value of the positive torque limit.*1 0.0 to 1000.0 300.0
Torque Limit (Unit: %)
Maximum Negative Set the maximum value of the negative torque limit.*1 0.0 to 1000.0 300.0
Torque Limit (Unit: %)
Immediate Stop Set whether to reverse the logic of the immediate stop FALSE or FALSE*3
Input Logic Inver- input signal. TRUE
sion*2 FALSE: Do not reverse.
TRUE: Reverse.
Positive Limit Input Set whether to reverse the logic of the positive limit FALSE or FALSE*3
Logic Inversion*2 input signal. TRUE
FALSE: Do not reverse.
TRUE: Reverse.
Negative Limit Input Set whether to reverse the logic of the negative limit FALSE or FALSE*3
Logic Inversion*2 input signal. TRUE
FALSE: Do not reverse.
TRUE: Reverse.
Home Proximity Set whether to reverse the logic of the home proximity FALSE or FALSE
Input Logic Inver- input signal. TRUE
sion*2 FALSE: Do not reverse.
TRUE: Reverse.

*1 If Positive Torque Limit Value (60E0 hex) and Negative Torque Limit Value (60E1 hex) are mapped as PDOs,
the set values of these parameters are sent with EtherCAT process data communications. If a torque limit is
enabled with the MC_SetTorqueLimit instruction, the value that is specified with the input variable to the
instruction is sent.
*2 A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use this
parameter. You cannot reverse the logic for a CPU Unit with a unit version of 1.04 or earlier. This parameter is
set for devices, such as NX-series Digital Input Units, for which the logic of the input signals cannot be set. For
devices, such as OMRON 1S-series Servo Drives, for which you can set the input signal logic, set this param-
eter to not reverse the signal.
*3 If you assign an NX-series Pulse Output Unit to an axis, the default is TRUE.

5-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

5-2-6 Limit Settings


Use the following parameters to select functions for limiting the following error and for software limits.
Parameter name Function Setting range Default
Software Limits* Select the software limit function. 0 to 4 0
0: Disabled.
1: Deceleration stop for command position
2: Immediate stop for command position
3: Deceleration stop for actual position
4: Immediate stop for actual position
Positive Software Set the software limit in the positive direc- Long reals 2,147,483,647
Limit tion. (Unit: command units)
Negative Software Set the software limit in the negative direc- Long reals −2,147,483,648

5-2 Axis Parameters


Limit tion. (Unit: command units)
Following Error Over Set the excessive following error check Non-negative long reals 0
Value value. Set 0 to disable the excessive follow-
ing error check. (Unit: command units)
Following Error Set the following error warning check value. Non-negative long reals 0
Warning Value Set 0 to disable the following error warning that are less than or
check. (Unit: command units) equal to the Following
Error Over Value
5
* This function is enabled only when the Count Mode is Linear Mode and the home is defined.
Refer to 9-8-5 Software Limits for details on software limits.

5-2-6 Limit Settings


5-2-7 Position Count Settings
Set the count mode for the position.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on
using the NX-series Position Interface Units.
Parameter name Function Setting range Default
Count Mode Set the count mode for the position. 0 to 1 0
0: Linear Mode (finite length)
1: Rotary Mode (infinite length)
Modulo Maximum Set the modulo maximum position when the Count Long reals 2,147,483,647
Position Setting Value Mode is set to Rotary Mode. (Unit: command units)
Modulo Minimum Set the modulo minimum position when the Count Long reals −2,147,483,648
Position Setting Value Mode is set to Rotary Mode. (Unit: command units)
Encoder Type Set the encoder type.*1*2 0 to 1 0
0: Incremental encoder (INC)
1: Absolute encoder (ABS)

*1 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 Sevomotor/Servo Drive with built-in EtherCAT communica-
tions is used with an absolute external scale
*2 The settings are as follows when you use an OMRON G5-series Servomotor/Servo Drive with an absolute
external scale for fully-closed control, or when you use an OMRON G5-series Linear Motor Type Servomo-
tor/Servo Drive with built-in EtherCAT communications.
0: Incremental external scale
1: Absolute external scale

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-25


5 Motion Control Parameters

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.

 Linear Mode (Finite-length Axis)


• The linear mode is centered around 0. This mode is used for devices with a mechanically limited
range of motion, such as an XY stage.
• The setting range when the value is converted to pulses is 40 bits (signed integer: 0x8000000000
to 0x7FFFFFFFFF).
• You cannot specify a target position for relative or absolute positioning that exceeds this range.
• A command position overflow or underflow observation will occur if this range is exceeded for
operations that do not have a target position, such as velocity control, homing, or torque control.
Command position output will continue, but the actual position is not updated and will be fixed to
either the upper limit or the lower limit.
• While the value of the actual position is fixed, you can execute commands and stop the axis with
any operation that does not have a target position in the direction toward the linear range. Any
command that specifies a direction away from the range will cause an error on execution of the
instruction.
• The actual position does not update until the overflow or underflow status is cleared.

0x8000000000 0 0x7FFFFFFFFF

 Rotary Mode (Infinite Length Axis)


• This mode repeatedly counts with a ring counter for an infinite amount within the set range. Use
this mode for rotary tables or winding shafts.
• Use the Sysmac Studio to set the modulo maximum position and the modulo minimum position to
define the range of the ring counter.
• The setting range when the value is converted to pulses is 40 bits (signed integer: 0x8000000000
to 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 when you use a CPU Unit with unit version 1.11 or later.
The cause of the above position offset will be canceled by setting to use the reducer.
Refer to 5-2-3 Unit Conversion Settings on page 5-13 on use of reducers.

5-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

Modulo Maximum Position and Modulo Minimum Position Setting


Values
The settings of these parameters are enabled when the Count Mode is set to Rotary Mode. Set the
upper and lower limits of the ring counter.

Precautions for Correct Use


• 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 positioning is performed using the difference

5-2 Axis Parameters


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.

5
Encoder Type
Set the type of encoder to use for feedback input.

5-2-8 Servo Drive Settings


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 com-
munications is used with an absolute external scale

5-2-8 Servo Drive Settings


Set the value that is set on the Servo Drive or the Encoder Input Terminal that is connected.
Parameter name Function Setting range Default*1
Modulo Maximum Set the modulo maximum position that is −263 to 263−1 2,147,483,647
Position Setting Value set on the Servo Drive or the Encoder
(Unit: pulses)
Input Terminal. *2
Modulo Minimum Posi- Set the modulo minimum position that is −263 to 263−1 −2,147,483,648
tion Setting Value set on the Servo Drive or the Encoder
(Unit: pulses)
Input Terminal.*2
PDS State Control Set the state to which PDS state 0 to 1 0
Method*3 changes when Servo is turned OFF by
the MC_Power instruction.*4
0: Switched on by Servo OFF
1: Ready to switched on by Servo OFF

*1 The default range is all DINT integers. You can use the default range with OMRON 1S-series Servo Drives or
G5-series Servo Drives.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on using the NX-
series Position Interface Units.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-27


5 Motion Control Parameters

*2 If you use an OMRON GX-series EtherCAT Slave Encoder Input Terminal, the maximum value of the ring
counter (index 0x4003) of the Encoder Input Terminal must agree with the Modulo Maximum Position Setting
Value. The modulo minimum position setting value must be set to 0.
*3 A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this
parameter.
*4 If you set this parameter to 1, the Servo Ready (Switched on) status of OMRON G5-series Servo Drives can-
not be used. To use the Servo Ready (Switched on) status, set this parameter to 0. Refer to A-5 PDS State
Transition for details on the PDS state transition.

5-2-9 Homing Settings


Set the motor operation to use to determine home.
Parameter name Function Setting range Default
Homing Method*1*2 Set the homing operation. 0, 1, 4, 5, 8, 9, or 14
0: Proximity reverse turn/home proximity input OFF 11 to 14
1: Proximity reverse turn/home proximity input ON
4: Home proximity input OFF
5: Home proximity input ON
8: Limit input OFF
9: Proximity reverse turn/home input mask distance
11: Limit inputs only
12: Proximity reverse turn/holding time
13: No home proximity input/holding home input
14: Zero position preset
Home Input Signal Select the input to use for the home input signal. 0 or 1 0
0: Use Z-phase input as home
1: Use external home input*3
Homing Start Direc- Set the start direction for when homing is started. 0 or 2 0
tion 0: Positive direction
2: Negative direction
Home Input Detec- Set the home input detection direction for homing. 0 or 2 0
tion Direction 0: Positive direction
2: Negative direction
Operation Selection Set the stopping method when the positive limit input 0 to 2 1
at Positive Limit turns ON during homing.
Input 0: No reverse turn/minor fault stop (Stop according to
Limit Input Stop Method parameter.)
1: Reverse turn/immediate stop
2: Reverse turn/deceleration stop
Operation Selection Set the stopping method when the negative limit input 0 to 2 1
at Negative Limit turns ON during homing.
Input 0: No reverse turn/minor fault stop (Stop according to
Limit Input Stop Method parameter.)
1: Reverse turn/immediate stop
2: Reverse turn/deceleration stop
Homing Velocity Set the homing velocity. (Unit: command units/s) Positive long reals 10,000
Homing Approach Set the velocity to use after the home proximity input Positive long reals 1,000
Velocity turns ON. (Unit: command units/s)
Homing Accelera- Set the acceleration rate for homing. If the homing Non-negative long 0
tion acceleration is set to 0, the homing velocity or other reals
target velocity is used without any acceleration. (Unit:
command units/s2)

5-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

Parameter name Function Setting range Default


Homing Decelera- Set the deceleration rate for homing. If the homing Non-negative long 0
tion deceleration is set to 0, the homing approach velocity reals
or other target velocity is used without any decelera-
tion. (Unit: command units/s2)
Homing Jerk Set the jerk for homing. Set 0 for no jerk. (Unit: com- Non-negative long 0
mand units/s3) reals
Home Input Mask Set the home input mask distance when you set the Non-negative long 10,000
Distance Homing Operation Mode to a proximity reverse reals
turn/home input mask distance. (Unit: command units)
Home Offset Preset the actual position for the value that is set after Long reals 0
homing. (Unit: command units)
Homing Holding Set the holding time when you set the Homing Opera- 0 to 10,000 100
Time tion Mode to a proximity reverse turn/holding time.
(Unit: ms)

5-2 Axis Parameters


Homing Compensa- Set the homing compensation value that is applied Long reals 0
tion Value after the home is defined. (Unit: command units)
Homing Compensa- Set the velocity to use for homing compensation. Positive long reals 1,000
tion Velocity (Unit: command units/s).

*1 These parameters are for homing operation. Refer to Section 8 Homing for details.
*2 You cannot map the Z-phase input to a PDO for an OMRON G5-series Linear Motor Type Servo Drive. There-
fore, if you set the Homing Method to the No home proximity input/holding home input, which can use a Z-
phase input mapped to a PDO, do not select the Z-phase input for the home input signal. 5
*3 This setting can be used for an OMRON 1S-series Servo Drive or G5-series Servo Drive. The input allocated
to latch 1 for the Servo Drive is used as the external home input. In the default setting of the OMRON 1S-series

5-2-10 Axis Parameter Setting Example


Servo Drives or G5-series Servo Drives, the external latch input 1 is allocated to latch 1.
For details, refer to the AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communications
User’s Manual (Cat. No. I586), AC Servomotors/Servo Drives G5-series with Built-in EtherCAT Communica-
tions 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)
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on using the NX-
series Position Interface Units.

5-2-10 Axis Parameter Setting Example


This section provides examples of axis parameter settings related to positioning.

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

Gear Axis 1 Servo-


Axis 1 Axis 1: Servo axis
ratio Servo motor
Drive
Actual position
Encoder

Command position

Gear Axis 2
Axis 2 Servo Servo- Axis 2: Servo axis
ratio
Drive motor

Actual position
Encoder

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-29


5 Motion Control Parameters

Settings
Parameter name
Axis 1 Axis 2
Axis Variable Names Axis1 Axis2
Axis Number 1 2
Enabled Axes Used axis Used axis
Axis Type Servo axis Servo axis
Input Device/Output Device 1 2
Unit of Display μm*1 μm
Command Pulse Count Per Motor 1,048,576 1,048,576
Rotation
Work Travel Distance Per Motor Rota- 10,000 10,000
tion
Maximum Velocity 500,000*2 500,000*2
Maximum Jog Velocity 50,000*3 50,000*3
Maximum Acceleration 5,000,000*4 5,000,000*4
Maximum Deceleration 5,000,000*4 5,000,000*4
Software Limits Immediate stop for command posi- Immediate stop for command posi-
tion tion
Positive Software Limit 500,000*5 500,000
Negative Software Limit 0*5 0
Count Mode Linear Mode Linear Mode
*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 maximum
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.

Synchronized Control with Encoder as Master Axis


The following example is for a device that uses the actual position of axis 2 (an encoder), which is
attached to a conveyor, as the master axis. The Servo Drive on axis 1 is synchronized within a finite
range.

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

5-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

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 Rota- 1,048,576 1,048,576
tion
Work Travel Distance Per Motor Rotation 10,000 10,000
Maximum Velocity 500,000*2 ---

5-2 Axis Parameters


Maximum Jog Velocity 50,000*3 ---
Maximum Acceleration 5,000,000*4 ---
Maximum Deceleration 5,000,000*4 ---
Software Limits Immediate stop for command Disabled.
position
Positive Software Limit 500,000*5 ---
Negative Software Limit 0*5 ---
5
Count Mode Linear Mode Rotary Mode
Modulo Maximum Position --- 1,000,000*6

5-2-10 Axis Parameter Setting Example


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 maximum
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
axes. 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 Selec-
tion).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-31


5 Motion Control Parameters

5-3 Axes Group Parameters


Use the axes group parameters to set axes group operations related to axes groups that the MC Func-
tion Module controls, such as the axis configuration, maximum interpolation velocity, and axes group
stopping method. The axes group parameters are provided for each axes group. The number of axes
groups depends on the model. Refer to 1-4-2 Performance Specifications on page 1-7 for details. The
same parameter settings are provided for each axes group. This section describes only the parameters
for axes group 1.

5-3-1 Axes Group Parameters


Use the Sysmac Studio to set the axes group parameters for each axes group.
Temporary changes*1 Page
Reading
Classification Parameter name Applicable
Support variables*2
instruction
Axes Group Axes Group Number --- --- OK P. 5-33
Basic Settings
Motion Control*3 OK*4
Axes Group Use --- --- OK
Composition --- --- OK
Composition Axes OK*5 MC_Change OK
AxesInGroup
Axes Group Maximum Interpolation Velocity --- --- --- P. 5-35
Operation Set- Maximum Interpolation Acceleration --- --- ---
tings
Maximum Interpolation Deceleration --- --- ---
Interpolation Acceleration/Decelera- --- --- ---
tion Over
Interpolation Velocity Warning Value OK MC_Write ---
Interpolation Acceleration Warning OK MC_Write ---
Value
Interpolation Deceleration Warning OK MC_Write ---
Value
Axes Group Stop Method --- --- ---
Correction Allowance Ratio --- --- ---

*1 This column indicates if you can use instructions to temporarily change the settings.
*2 This column indicates whether you can access the parameter with a variable in the user program.
*3 Set this parameter when using the NX701 CPU Unit.
*4 A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this
parameter.
*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 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 Instructions Reference Manual (Cat. No. W508).
Refer to 6-6 System-defined Variables for Motion Control for information on system-defined variables
for motion control.

5-32 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

5-3-2 Axes Group Basic Settings


Set whether to use the axes group. If you are going to use the axes group, set the axis configuration
and the axes to use.
Parameter name Function Setting range Default
Axes Group Number Set the logical number of the axes group. This number --- ---
specifies which of the following system-defined vari-
ables to use: _MC_GRP[0-63], _MC1_GRP[0-63],
_MC2_GRP[0-63].
Motion Control*1 Assign to either of the primary periodic task or priority-5 1 or 2 1
periodic task.
1: Primary periodic task

5-3 Axes Group Parameters


2: Priority-5 periodic task
Axes Group Use Set whether to enable or disable the axes group. An 0 to 2 0
error occurs if you execute a motion control instruction
for an undefined or unused axes group.*2
0: Undefined axes group
1: Unused axes group
2: Used axes group
Composition Set the axis composition of the axes group. 0 to 2 0
0: 2 axes
1: 3 axes 5
2: 4 axes
Composition Axes Sets the axis number to assign to the axes group. Set 2 to 4 axes 0

5-3-2 Axes Group Basic Settings


Axis Variable names from the Sysmac Studio to use for
the A0 to A3 axes.

*1 Set this parameter when using the NX701 CPU Unit.


*2 An error occurs if you execute the MC_GroupEnable (Enable Axes Group) instruction for an axes group that
contains an unused axis.

Composition
The following table lists the axis compositions you can use with the MC Function Module. Use the Sys-
mac 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 Carte-
sian coordinate system is used.
3 axes A three-axis configuration is used. For example, a machine with a three-axis
Cartesian coordinate system is used.
4 axes A four-axis configuration is used. For example, a machine with a three-axis Car-
tesian coordinate system is used with a rotary axis at the end tool.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-33


5 Motion Control Parameters

Composition Axes
The axes that are in an axes group are called composition axes. To make it easier to reuse program-
ming with interpolation instructions for axes groups commands, logical 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.
Axis composition setting Settings in Composition Axes parameter
2 axes Set Axis Variable names (axis numbers) for axis A0 and axis A1.
3 axes Set Axis Variable names (axis numbers) for axis A0, axis A1, and axis A2.
4 axes Set Axis Variable names (axis numbers) for axis A0, axis A1, axis A2, and axis
A3.

Precautions for Correct Use


• Assign all of the composition axes to the same task.
• If you set the same axis number for multiple axes groups, you cannot enable these axes
groups simultaneously.
• An axis for which Control Function is set to Single-axis position control only cannot be allo-
cated as an axis in an 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.

 Composition Axes Setting Examples


• Example 1: Assigning Four Axes with Axis Numbers 1, 2, 5, and 8 to an Axes Group
Logical axis Axis number
Axis A0 Axis 1
Axis A1 Axis 2
Axis A2 Axis 5
Axis A3 Axis 8

• Example 2: Assigning Three Axes with Axis Numbers 1, 8, and 2 to an Axes Group
Logical axis Axis number
Axis A0 Axis 1
Axis A1 Axis 8
Axis A2 Axis 2
Axis A3 None

5-34 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

5-3-3 Axes Group Operation Settings


These parameters set items for axes group operation, such as the maximum interpolation velocity and
axes group stopping method. Set them according to the specifications of the device you are controlling.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on using
the NX-series Position Interface Units.
Parameter name Function Setting range Default
Maximum Interpola- Set the maximum interpolation velocity for Non-negative long 800,000,000
tion Velocity the path. Set 0 for no interpolation velocity reals
limit.
If a target velocity that exceeds the maxi-
mum interpolation velocity is specified for an

5-3 Axes Group Parameters


axes group operation instruction, the axis
will move at the maximum interpolation
velocity.
(Unit: command units/s)
Maximum Interpola- Set the maximum interpolation acceleration Non-negative long 0
tion Acceleration for the path. Set 0 for no interpolation accel- reals
eration limit. (Unit: command units/s2)
Maximum Interpola- Set the maximum interpolation deceleration Non-negative long 0
tion Deceleration for the path. Set 0 for no interpolation decel- reals
eration limit. (Unit: command units/s2)
5
Interpolation Accel- Set the operation for when the maximum 0 to 2 0
eration/Decelera- interpolation acceleration/deceleration rate
tion Over would be exceeded after excessive acceler-

5-3-3 Axes Group Operation Settings


ation/deceleration during acceleration/decel-
eration control of the axes group because
stopping at the target position is given prior-
ity.
0: Use rapid acceleration/deceleration.
(Blending is changed to Buffered.) *1
1: Use rapid acceleration/deceleration.
2: Minor fault stop *2
Interpolation Veloc- Set the percentage of the maximum interpo- 0 to 100 0
ity Warning Value lation velocity at which to output an interpo-
lation velocity warning. No interpolation
velocity warning is output if 0 is set. (Unit: %)
Interpolation Accel- Set the percentage of the maximum interpo- 0 to 100 0
eration Warning lation acceleration at which to output an
Value interpolation acceleration warning. No inter-
polation acceleration warning is output if 0 is
set. (Unit: %)

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-35


5 Motion Control Parameters

Parameter name Function Setting range Default


Interpolation Decel- Set the percentage of the maximum interpo- 0 to 100 0
eration Warning lation deceleration rate at which to output an
Value interpolation deceleration warning. No inter-
polation deceleration warning is output if 0 is
set. (Unit: %)
Axes Group Stop Set the stop method of the composition axes 0, 1, or 3 0
Method for which an error did not occur when an
error occurs that forces an immediate stop of
an axis that is in a multi-axes coordinated
control motion.
0: Immediate stop
1: Decelerate axes to a stop at maximum
deceleration rate of the axes
3: Immediate stop and Servo OFF
Correction Allow- This parameter applies when the center des- Single-precision 0
ance Ratio ignation method is used for a circular inter- floating-point num-
polation instruction. It compensates the ber between 0 and
distance when the distance between the 100
start point and the center point does not
equal the distance between the end point
and the center point. Set the allowable range
for that correction as a percentage of the
radius. Set the percentage to 0.1% or
greater. Error checking is not performed if 0
is set.

*1 For a CPU Unit with unit version 1.10 or later, Blending is not changed to Buffered. Refer to 9-5-7 Multi-execu-
tion of Motion Control Instructions (Buffer Mode) 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
operation. Refer to 9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode) for details .

5-36 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


5 Motion Control Parameters

5-3-4 Enabling an Axes Group


Specify the number of the axes group to enable in the MC_GroupEnable (Enable Axes Group) instruc-
tion to enable operation instructions for an axes group in the user program. An instruction error occurs
if you execute a motion control instruction for an axes group that is not enabled. You can enable more
than one axes group at the same time, but if you enable more than one axes group that include the
same axis, an instruction error occurs.
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

5-3 Axes Group Parameters


axes in the group will decelerate to a stop.

5-3-4 Enabling an Axes Group

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 5-37


5 Motion Control Parameters

5-38 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Motion Control Programming
This section provides the specifications of a motion control program and the operation
procedures that are required up through actual program development.

6-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2


6-2 Motion Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6-2-1 Function Blocks for PLCopen® Motion Control . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6-2-2 Motion Control Instructions of the MC Function Module . . . . . . . . . . . . . . . . . 6-4
6
6-3 State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
6-3-1 Status of the Motion Control Function Module . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
6-3-2 Axis States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6-3-3 Axes Group States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
6-4 Execution and Status of Motion Control Instructions . . . . . . . . . . . . . . . 6-10
6-4-1 Basic Rules for Execution of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
6-4-2 Execution Timing Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6-4-3 Timing Chart for Re-execution of Motion Control Instructions . . . . . . . . . . . . 6-15
6-4-4 Timing Chart for Multi-execution of Motion Control Instructions . . . . . . . . . . 6-16
6-5 Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
6-5-1 Types of Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
6-5-2 Valid Positions for Each Axis Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
6-6 System-defined Variables for Motion Control . . . . . . . . . . . . . . . . . . . . . . 6-19
6-6-1 Overview of System-defined Variables for Motion Control . . . . . . . . . . . . . . . 6-19
6-6-2 System for System-defined Variables for Motion Control . . . . . . . . . . . . . . . 6-22
6-6-3 Tables of System-defined Variables for Motion Control . . . . . . . . . . . . . . . . . 6-24
6-7 Cam Tables and Cam Data Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35
6-8 Programming Motion Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39
6-9 Creating Cam Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-41

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-1


6 Motion Control Programming

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 device variables in the same way as for a general-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 for details.

 NX701 CPU Unit

User program in PLC CPU Unit


Function Module
Device variables

Instructions Executed. EtherCAT


other than EtherCAT
Sequence slaves
motion control
control instructions
EtherCAT
Master
Function EtherCAT EtherCAT
variables
Axis

Motion control MC Function Module Task period Module


instructions slaves,
Profile processing

Synchronization

Servo Drives,
Motion control processing encoder input
Executed. terminals,
Other processing
Position
Interface Units

6-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

 NX1P2 CPU Unit


User program in PLC CPU Unit
Function Module
Instructions Executed.
other than Built-in I/O

I/O ports
Device variables
motion control Option Boards
instructions
Sequence NX Bus NX Units
control Function
Module
EtherCAT EtherCAT
slaves

MC Function Module EtherCAT NX Units,


Master Position
•Profile processing
Function Interface Units
•Synchronization Task
processing Module
period
Other processing
variables
Axis
Motion control EtherCAT EtherCAT
Motion control instructions slaves,
Servo Drives,
Executed. encoder input
terminals,
Position
Interface Units

 NJ-series CPU Unit

6-1 Introduction
User program in PLC CPU Unit
Function Module
Instructions CJ-series Units
other than Executed.

I/O ports
Device variables

motion control Basic I/O Units,


instructions Special Units
Sequence
control EtherCAT
6
EtherCAT
slaves

Motion control EtherCAT EtherCAT EtherCAT


variables
Axis

MC Function Module Task period


instructions Master slaves,
•Profile processing Function
•Synchronization Servo Drives,
Module encoder input
Motion control processing
Executed. terminals,
Other processing
Position
Interface Units

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-3


6 Motion Control Programming

6-2 Motion Control Instructions


Motion control instructions are used in the user program to execute motion controls for an NJ/NX-series
Controller. These instructions are defined as function blocks (FBs). The motion control instructions of
the MC Function Module are based on the technical specifications of function blocks for PLCopen®
motion control. There are two types of motion control instructions: PLCopen®-defined instructions and
instructions that are unique to the MC Function Module. This section provides an overview of the PLCo-
pen® motion control function blocks and gives the specifications of the MC Function Module.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for basic information on
the NJ/NX-series function blocks (FBs).
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use
NX-series Position Interface Units. Refer to the NX-series Position Interface Units User’s Manual (Cat.
No. W524) for information on using the NX-series Position Interface Units.

6-2-1 Function Blocks for PLCopen® Motion Control


PLCopen® standardizes motion control function blocks to define a program interface for the languages
specified in IEC 61131-3 (JIS B 3503). Single-axis positioning, electronic cams, and multi-axes coordi-
nated control are defined along with basic procedures for executing instructions.
By using PLCopen® motion control function blocks, the user program can be more easily reused with-
out hardware dependence. Costs for training and support are also reduced.

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

6-2-2 Motion Control Instructions of the MC Function Module


There are three types of motion control instructions. They are given in the following table.
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).

6-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-3 State Transitions


The states of axes and axes groups and state transitions caused by the execution of instructions are
based on the technical specifications of function blocks for PLCopen® motion control. This section pro-
vides an overall description of the MC Function Module, states, and state transitions.

6-3-1 Status of the Motion Control Function Module


The overall states of the MC Function Module are described in the following table.
State name Definition
MC Run Mode*1 Motion control instructions are enabled. The motion control
instructions in the user program are interpreted and motion con-
trol is performed. You can set the MC Run Mode state regard-
less of the operating mode of the CPU Unit.
MC Test Mode*2 In this state, you can execute a test run from the Sysmac Studio.

6-3 State Transitions


Saving Cam Table File*3 This state exists while the system performs save or wait pro-
cessing 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.
*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.
6
*5 When you turn OFF the power supply for the CPU Unit, make sure that generation of the cam table is not in
progress. If you turn OFF the power supply for the CPU Unit while generation of the cam table is in progress,

6-3-1 Status of the Motion Control Function Module


the cam table will not be generated correctly.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-5


6 Motion Control Programming

6-3-2 Axis States


The operation of an axis when motion control instructions are executed for it is shown in the following
figure. Motion control instructions are executed in sequence and axes enter one of the states listed in
the following table.
MC_GearIn (slave axis)
MC_Move MC_GearInPos (slave axis)
MC_MoveAbsolute MC_CamIn (slave axis)
MC_MoveRelative MC_CombineAxes (slave axis)
MC_MoveFeed *8 MC_MoveLink (slave axis) MC_SyncMoveVelocity
MC_MoveZeroPosition MC_MoveVelocity
MC_GearOut Synchronized Motion MC_TorqueControl
MC_CamOut Synchronized MC_MoveJog
Discrete Motion Continuous Motion
Discrete Continuous
*7
MC_Stop

Deceleration Stopping
Stopping MC_ImmediateStop
Error Deceleration Stopping *1
*6 ErrorStop
MC_Home *4
MC_HomeWithParameter *3

Homing Standstill *5 Axis Disabled *2


Homing Standstill Disabled

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 velocity control is set for the MoveMode input variable of the
MC_MoveFeed instruction until a trigger input is detected.
State name Definition
Servo OFF In this state, the Servo is OFF for the axis. When this state is moved to, the buff-
ered status for multi-execution of instructions is cleared.
Axis Disabled In this state, the Servo is OFF for the axis, the axis is stopped, and execution
preparations are completed.
Error Deceleration In this state, the Servo is OFF for the axis, the axis is stopped, and an axis error
Stopping*1 has occurred.
Servo ON In this state, the Servo is ON for the axis.

6-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

State name Definition


Stopped In this state, the Servo is ON for the axis and the axis is stopped.
Discrete Motion In this state, positioning is performed for the specified target position. This
includes when waiting the in-position status and when the velocity is 0 because
the override factor was set to 0 during a discrete motion.
Continuous Motion In this state, continuous motion control is executed with no specified target
position. This state exists during velocity control or torque control. This includes
when the velocity is 0 because the target velocity is set to 0 and when the
velocity is 0 due to an override factor set to 0 during continuous motion.
Synchronized Motion In this state, the synchronized control is performed for the axis with synchro-
nized control commands. This includes waiting for synchronization after chang-
ing to synchronized control instructions.
Deceleration Stopping In this state, the axis is stopping due to a MC_Stop or MC_TouchProbe (Enable
External Latch) instruction. This includes when Execute is TRUE after stopping
for the MC_Stop instruction. In this state, it is not possible to execute axis oper-
ation commands. If an attempt is made to execute one, CommandAborted for
the instruction changes to TRUE.
Error Deceleration In this state, the Servo is ON for the axis and an axis error has occurred. This
Stopping*1 includes during execution of the MC_ImmediateStop (Immediate Stop) instruc-

6-3 State Transitions


tion and during a deceleration stop for an axis error. It is not possible to execute
axis operation commands in this state. The instruction will enter the aborted
(CommandAborted = TRUE) status if executed.
Homing In this state, home is being searched for by the MC_Home or MC_HomeWith-
Parameter instruction.
Coordinated Motion In this state, the axes group was enabled by an instruction for an axes group
command. In this state, the axis is in motion for an axes group state of Group-
Moving, GroupStopping, or GroupErrorStop.
6
*1 The Error Deceleration Stopping state occurs both when the Servo is ON and when the Servo is OFF for the
axis.

6-3-2 Axis States


Note You can monitor the axis status in the member variables of the Axis Variables _MC_AX[0].Status to
_MC_AX[255].Status.

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 using
the NX-series Position Interface Units.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-7


6 Motion Control Programming

6-3-3 Axes Group States


The operation of an axes group when motion control instructions are executed for it is shown in the fol-
lowing figure.

Moving
Moving MC_GroupStop
Deceleration Stopping
Stopping

*1

MC_GroupImmediateStop
*6 Error Deceleration Stopping *2

ErrorStop
*3
MC_GroupEnable
Axes Group Disabled Standby *6

Disabled Standby
MC_GroupDisable *4
*5

*1 The Moving state is entered for any axes group motion control instruction.
*2 The ErrorStop state is entered from any other state. It is even entered if an error occurs when the axes group is
disabled.
*3 The Standby state is entered when the MC_GroupReset or ResetMCError instruction is executed for an
enabled axes group.
*4 The Disabled state is entered when the MC_GroupReset or ResetMCError instruction is executed for a dis-
abled axes group.
*5 The same state is returned to if the MC_GroupDisable is executed in ErrorStop state.
*6 Stopping state is entered when the Done output variable from the MC_GroupStop instruction is TRUE and the
Execute input variable to the same instruction is FALSE.
*7 Ready state is entered if all of the following conditions are met in 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.

State name Definition


Axes Group Disabled The axes group is disabled in this state. When this state is entered, the buffered
status for multi-execution of instructions is cleared.
Error Deceleration In this state, an error occurred in an axes group that is disabled.
Stopping*1
Axes Group Enabled The axes group is enabled in this state.

6-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

State name Definition


Standby In this state, no instructions for axes group commands are executing. (This is
independent of the Servo ON/OFF status of the composition axes in the axes
group)
Moving In this state, positioning is performed for the specified target position due to a
motion instruction for an axes group command. This includes during the in-posi-
tion check and when the velocity is 0 because the override factor was set to 0
while the group was in motion.
Deceleration Stopping In this state, the MC_GroupStop instruction is executing. This includes when
Execute is TRUE after stopping for the MC_GroupStop instruction. In this state,
it is not possible to execute a motion for an axes group command. If one is exe-
cuted, CommandAborted for the instruction will change to TRUE.
Error Deceleration In this state, an axes group error has occurred. This includes during execution
Stopping*1 of the MC_GroupImmediateStop (Axes Group Immediate Stop) instruction and
during a deceleration stop for an axes group error. It is not possible to execute
multi-axes coordinated control commands in this state. If an attempt is made to
execute one of them, CommandAborted for the instruction will change to
TRUE.

*1 The Error Deceleration Stopping state occurs both when the axes group is enabled and when it is disabled.

6-3 State Transitions


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.

6-3-3 Axes Group States

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-9


6 Motion Control Programming

6-4 Execution and Status of Motion


Control Instructions
Variables that represent the execution status of instructions and variables that are used to execute
motion control instructions are defined in the MC Function Module. There are two input variables that
you use to execute motion control instruction functions: Execute and Enable. The following output vari-
ables indicate the execution status of an instruction: Busy, Done, CommandAborted, and Error.

6-4-1 Basic Rules for Execution of Instructions


The basic rules for the MC Function Module are listed in the following table. You can find execution
examples in 6-4-2 Execution Timing Charts. Refer to these examples as well.
Item Rule
Exclusiveness of out- The following output variables are exclusively controlled and only one of them can be
puts TRUE at the same 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 corresponding 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_GroupReset, 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 Com-
mandAborted 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 param-
eters during each period when Enable is TRUE are used.
Omitting input param- The default value applies if you omit an input parameter for an instruction instance.*2
eters
Position (Target Posi- The input variable Position is defined as a value in the coordinate system. The input vari-
tion) and Distance able Distance is the relative length, i.e., it is the difference between two positions.
(Travel Distance)
Sign rules The input variables Acceleration, Deceleration, and Jerk are non-negative values. Posi-
tion (Target Position), Distance (Travel Distance), and Velocity (Target Velocity) can be
positive, negative, or 0.

6-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Item Rule
Error processing There are two output variables that represent an error when a problem occurs during the
execution 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
Achieved), and InSync all represent normal completion or normal operation and therefore

6-4 Execution and Status of Motion Control Instructions


will never be TRUE when the output variable Error is TRUE.
Types of errors:
• Instruction instance errors (e.g., parameter out of range and illegal condition for state
transition)
• Axis errors (e.g., Following Error Limit Exceeded and Servo Drive errors)
Some instruction instance errors may not cause an axis error but will cause the axis to
stop.
Operation of output The output variable Done, InGear (Gear Ratio Achieved), or InSync will change to TRUE
variable Done when the instruction ends operation normally or when the commanded condition is
reached. For movement instructions for which a target position is specified, the timing of
when the output variable Done changes to TRUE depends on the setting of the In-posi-
tion Check Time axis parameter.
• If the In-position Check Time axis parameter is set to any value but 0, output variable
Done changes to TRUE in the next period after the period in which positioning is com-
pleted.
• If the In-position Check Time axis parameter is set to 0, output variable Done changes
to TRUE in the next period after the period in which pulse distribution is completed.
When working with multiple instructions that operate on the same axis, the output vari-
able Done from the first instruction will not change to TRUE if another operation instruc-
tion takes over before the axis operation for the first instruction reaches the target 6
position.
Operation of output The output variable CommandAborted will change to TRUE when another operation

6-4-1 Basic Rules for Execution of Instructions


variable Command- instruction interrupts the commanded operation. For the MC Function Module, this vari-
Aborted able will change to TRUE when a motion control instruction is executed and the target
axis or axes group causes an error or is decelerating to a stop. All other output variables
change to FALSE when CommandAborted changes to TRUE.
Input variables out- The instruction instance will output an error when it is executed with an input variable that
side of valid range is outside of the valid range.
Operation of output The output variable Busy is TRUE when the instruction instance is executing. Busy will
variable Busy change to TRUE when the input variable Execute changes to TRUE. Busy will change to
FALSE when the output variable Done, CommandAborted, or Error changes to TRUE. It
is impossible to know when the above output variables will change. Write your programs
so that the instruction instance executes every period*3 while Busy is TRUE so that you
can monitor for changes in the output variables. For a single axis or single axes group,
the Busy variable of more than one instruction instance can be TRUE at the same time.
However, the output variable Active of only one instruction instance can be TRUE at one
time. However, the MC_Phasing (Shift Master Axis Phase) instruction is an exception to
this rule.
Output variable Active The output variable Active changes to TRUE when the instruction instance obtains per-
mission to control the applicable axis.
The output variable Active may change slower than the Busy variable.*4

*1 Under the PLCopen® specifications, Error changes to FALSE and ErrorID changes to 0 when Execute
changes to FALSE. When Error is TRUE, the motion control instruction is not executed. Instructions are not
executed after an error is cleared even if Execute is TRUE. Execute must change from FALSE to TRUE to exe-
cute the instruction. Enable-type motion control instructions are executed if their Enable variable is TRUE when
an error is reset.
*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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-11


6 Motion Control Programming

*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 Man-
ual (Cat. No. W508).
*4 Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for an output vari-
able timing chart.

Precautions for Correct Use


• 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 for details.
• Write the user program so that Execute is FALSE during the first period in which the instruction
is executed.

6-4-2 Execution Timing Charts


The motion control instructions in the MC Function Module are function blocks that are unconditionally
executed. This section calls instructions that are executed according to the Execute input variable "exe-
cute-type instructions" and instructions that are executed according to the Enable input variable
"enable-type instructions."
Execution condition Description
Execute variable These motion control instructions are executed when the input variable Execute to the
instruction 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 variable These motion control instructions are executed every period while the input variable
Enable to 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 Veloc-
ity, Acceleration, and Deceleration are an exception to this rule. The values when Posi-
tiveEnable or NegativeEnable changes to TRUE are used for these input variables.

Precautions for Correct Use


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 data tracing.

6-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Timing Charts for Execute-type Instructions


• The following timing chart shows the operation of the instruction when it is completed while the input
variable Execute is TRUE. The following timing chart is for when an error does not occur through
when Execute changes to FALSE.

Execute

6-4 Execution and Status of Motion Control Instructions


Busy

Done

CommandAborted

Error

• The following timing chart is for when an error occurs while input variable Execute is TRUE. After
completion, the output variable Error will remain TRUE even if Execute changes to FALSE.

Execute

Busy

Done

CommandAborted

Error
• The following timing chart is for when the instruction is interrupted during execution while input vari- 6
able Execute is TRUE.

6-4-2 Execution Timing Charts


Execute

Busy

Done

CommandAborted

Error

• The following timing chart is for when the input variable Execute is TRUE for only one period and an
error does not occur for the instruction. The output variable Done will change to TRUE for only one
period after the instruction operation is completed.

Execute

Busy

Done

CommandAborted

Error

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-13


6 Motion Control Programming

• The following timing chart is for when the input variable Execute is TRUE for only one period and an
error occurs for the instruction. The output variable Error will remain TRUE.

Execute

Busy

Done

CommandAborted

Error

Timing Charts for Enable-type Instructions


• The following timing chart is for when the input variable Enable changes to TRUE and an error does
not occur for the instruction.

Enable

Enabled

Busy

Error

• The following timing chart is for when 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).

6-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-4-3 Timing Chart for Re-execution of Motion Control Instructions


If the values of the input variables to the same instance are changed while the motion control instruction
is under execution and Execute is changed to TRUE, FALSE, and then back to TRUE again, operation
will follow the new values.
The following timing chart is for when the velocity is changed for MC_MoveAbsolute (Absolute Position-
ing) instruction.

6-4 Execution and Status of Motion Control Instructions


Execute

Busy

Active

Done

Error

Velocity
Target
velocity 2
Target
velocity 1

Time
For details on re-executing instructions for the MC Function Module, refer to 9-5-6 Re-executing Motion
Control Instructions and 9-7-4 Re-executing Motion Control Instructions for Multi-axes Coordinated
6
Control.

6-4-3 Timing Chart for Re-execution of Motion Control Instructions

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-15


6 Motion Control Programming

6-4-4 Timing Chart for Multi-execution of Motion Control Instructions


Another instance can be executed for an axis during axis motion. Set the input variable BufferMode to
specify when to start operation.
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
instructions.
“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-execution
of Motion Control Instructions (Buffer Mode) and 9-7-5 Multi-execution (Buffer Mode) of Motion Control
Instructions for Multi-axes Coordinated Control.

6-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-5 Positions
This section describes the positions that are used in motion control programming.

6-5-1 Types of Positions


The MC Function Modules uses the following two types of positions.
Type of position Definition
Command position This is the position that the MC Function Module outputs to control an axis.
Actual position The actual position as input from the Servo Drive or encoder input.

The following figure shows the relationship between the command position and the actual position for
an EtherCAT slave Servo Drive.
User program MC Function Module Command position Servo Drive
(pulses)
Motion Motion Command Electronic Command Following
control control position gear position error
Position loop M
instruction processing (command units) In-position check counter counter Velocity loop
Remainder Actual position Current loop
(pulses)
Actual position

6-5 Positions
Electronic Feedback E
(command units) gear counter
Remainder

The command position and actual position share the following items.
Item Command position Actual position
Count Mode You can set Linear Mode or Rotary The same Count Mode is used as
Mode. for the command position. 6
Position increment You can set one of the following: The unit is the same as the unit of
mm, μm, nm, inch, degree, or pulse. the command position.

6-5-1 Types of Positions


Software limits You can set the range of operation The range is the same as the range
of the software. for the command position.
Changing the current position You can change the actual position This value will be set to the same
to any desired position. position as the command position.*
Defining home Home is either defined or The status of home is the same as
undefined. the command position.

* If there is any following error before the change, the following error value is maintained in the actual position.

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.

User program MC Function Module Command position


(pulses)
Motion control Motion control Command position Electronic gear
instruction processing (command units) Actual
In-position check Remainder position Return
Actual position (pulses)
Electronic gear
(command units)
Remainder

• Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information
on the NX-series Position Interface Units.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-17


6 Motion Control Programming

6-5-2 Valid Positions for Each Axis Type


The following table lists the valid positions for each axis type.
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 some-
times calculation error because processing is performed with long reals in the MC Function Module.)
*2 This is used when there is no actual encoder.

6-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-6 System-defined Variables for Motion


Control
This section describes the variables of the MC Function Module.

6-6-1 Overview of System-defined Variables for Motion Control

6-6 System-defined Variables for Motion Control


The NJ/NX-series Controller is compliant with the IEC 61131-3 standard. Parameter settings, status
information, and other data are handled as variables in the user program in the NJ/NX-series Con-
troller. Of these, system-defined variables that belong to the MC Function Module are called system-
defined variables for motion control.

Types of System-defined Variables for Motion Control


The following table lists all of the types of system-defined variables for motion control.
Level 1 Level 2 Level 3 Description
System-defined System-defined vari- MC Common You can monitor the overall status of the
variables ables for motion con- Variable MC Function Module.
trol Axis Variables You can monitor axis status and the set-
tings of part of the axis parameters.
Axes Group You can monitor axes group status and the
Variables settings of part of the axes group parame- 6
ters.

 MC Common Variable

6-6-1 Overview of System-defined Variables for Motion Control


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 Axes Group Variables in the user program.
You can change any of the Axis Variables that you create on the Sysmac Studio.

• Axes Group Variables in the system-defined : _MC_AX[0] to _MC_AX[255]


variables : _MC1_AX[0] to _MC1_AX[255]
: _MC2_AX[0] to _MC2_AX[255]
• Default Axes Group Variables when axes : MC_Axis000 to MC_Axis255 (default)
groups are created on Sysmac Studio

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-19


6 Motion Control Programming

 Axes Group Variables


Use these variables to handle multiple axes as a single group.
You can use either the system-defined variables or the variables that are set on the Sysmac Studio
to specify the Axes Group Variables in the user program.
You can change any of the Axes Group Variables that you create on the Sysmac Studio.

• Axes Group Variables in the system-defined : _MC_GRP[0] to _MC_GRP[63]


variables : _MC1_GRP[0] to _MC1_GRP[63]
: _MC2_GRP[0] to _MC2_GRP[63]
• Default Axes Group Variables when axes : MC_Group000 to MC_Group063 (default)
groups are created on Sysmac Studio

Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on the vari-
ables that are used by an NJ/NX-series Controller.

6-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Data Types Used for System-defined Variables for Motion Control


System-defined variables for motion control use both basic data types and derivative data types.

 Basic Data Types


Category Data type Size Range of values Notation
Boolean BOOL 2* TRUE or FALSE TRUE or FALSE
Integer UINT 2 0 to +65,535 Binary expression: "2#" is added to the
front of the number

6-6 System-defined Variables for Motion Control


UDINT 4 0 to +4,294,967,295
Octal expression: "8#" is added to the
front of the number
Decimal expression: "10#" is added to the
front of the number
Hexadecimal expression: "16#" is added
to the front of the number
If you do not add any notation to the
beginning of a number, that number is
treated as a decimal number.
Example:
Binary Notation
2#1111_1111
2#1110_0000
Octal Notation
8#377
8#340
Decimal Notation 6
−12 0 123_456 +986
10#1234

6-6-1 Overview of System-defined Variables for Motion Control


Hexadecimal Notation
16#FF 16#ff
16#E0 16#e0
Floating- LREAL 8 −1.79769313486231e+308 to Written as (sign) + integer_part + (deci-
point −2.22507385850721e−308, mal_point) + (decimal_part) + (exponent).
numbers 0, You can omit items in parentheses.
2.22507385850721e−308 to Example:
1.79769313486231e+308,
2
positive infinity, or negative
infinity −12.0
0.0
0.4560
3.14159_26
−1.34E-12
−1.34e-12
1.0E+6
1.0e+6
1.234E6
1.234e6

* BOOL data is only 1 bit in size but it takes up 2 bytes of memory.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-21


6 Motion Control Programming

 Derivative Data Types


Type Description
Enumerated data types This data type uses one item from a prepared name list as
its value. Variables with this data type start with “_e.”
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 other
data types that are used by an NJ/NX-series Controller.

Attributes of System-defined Variables for Motion Control


The attributes that are shown in the following table are the same for all system-defined variables for
motion control.
Attribute Attribute of system-defined variables for motion control
Global/Local Global variable
R/W access Read only
Retain Non-retain
Network Publish Publish*

* Variables are published on the network with the variable names of the system-defined variables. The variable
names that are created when the axes or axes groups are created on the Sysmac Studio are not published to the
network.

6-6-2 System for System-defined Variables for Motion Control


System-defined variables for motion control consist of information representing the status of the MC
Function Module, status information for slave devices connected via EtherCAT communications and
NX Units mounted on the CPU Unit, and the portion of the MC parameter settings used to perform
motion control.
You can access system-defined variables for motion control as variables in the user program and
monitor them from the Sysmac Studio.

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

6-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Update Timing of System-defined Variables for Motion Control


The update timing of the system-defined variables for motion control is different in the NX-series CPU
Unit and NJ-series CPU Unit. The following shows the difference of the update timing.

 NX701 CPU Unit


When you access the primary periodic task and priority-5 periodic task to an axis, the motion control
variables are updated as follows:

6-6 System-defined Variables for Motion Control


• 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.
• The other area of the priority-5 periodic task is not updated from the default settings and will be
updated every task period of the priority-5 periodic task.

Variable area to
Primary periodic task Priority-5 periodic task
update
_MC_AX[0-255] Updated
_MC1_AX[0-255] Updated
_MC2_AX[0-255] Updated
_MC_GRP[0-63] Updated
_MC1_GRP[0-63] Updated
_MC2_GRP[0-63] Updated

 NX1P2 CPU Unit and NJ-series CPU Unit


The system-defined variables for motion control are updated every primary task period.
6

6-6-2 System for System-defined Variables for Motion Control

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-23


6 Motion Control Programming

6-6-3 Tables of System-defined Variables for Motion Control


This section provides tables that describe the system-defined variables for motion control.

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.
Variable name Data type Meaning Function
_MC_COM _sCOMMON_REF MC Common Variable
Status _sCOMMON_REF_STA MC Common Status
RunMode BOOL MC Run TRUE during MC Function Module
operation.
TestMode BOOL MC Test Run TRUE during test mode operation
from the Sysmac Studio.
CamTableBusy BOOL Cam Table File Save TRUE while the Cam Table is being
Busy saved or on standby.
Generate BOOL Generating Cam Table TRUE while the cam table is being
CamBusy*1 generated.
PFaultLvl _sMC_REF_EVENT MC Common Partial TRUE while the cam table is being
Fault generated.
Active BOOL MC Common Partial TRUE while there is an MC common
Fault Occurrence partial fault.
Code WORD MC Common Partial Contains the code for an MC com-
Fault Code mon partial fault. The upper four dig-
its of the event code have the same
value.
MFaultLvl _sMC_REF_EVENT MC Common Minor
Fault
Active BOOL MC Common Minor TRUE while there is an MC common
Fault Occurrence minor fault.
Code WORD MC Common Minor Contains the code for an MC com-
Fault Code mon minor fault. The upper four digits
of the event code have the same
value.
Obsr _sMC_REF_EVENT MC Common Obser-
vation
Active BOOL MC Common Obser- TRUE while there is an MC common
vation Occurrence observation.
Code WORD MC Common Obser- Contains the code for an MC com-
vation Code mon observation. The upper four dig-
its of the event code have the same
value.
*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required.

6-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Axis Variables
_MC_AX[0-255], _MC1_AX[0-255], and _MC2_AX[0-255] are the Axis Variables in the system-defined
variables. The data type is _sAXIS_REF, which is a structure variable. This section describes the con-
figuration of the Axis Variables and provides details on the members using _MC_AX[0-255] as an
example. The same information applies to MC1_AX[0-255] and _MC2_AX[0-255].
Variable name Data type Meaning Function
_MC_AX[0-255] _sAXIS_REF Axis Variable
Status _sAXIS_REF_STA Axis Status

6-6 System-defined Variables for Motion Control


Ready BOOL Axis Ready-to-execute TRUE when preparations for axis execution are
finished and the axis is stopped.
This variable indicates the same status as when
_MC_AX[*].Status.Standstill is TRUE (stopped).
Disabled BOOL Axis Disabled TRUE while the Servo is OFF for the axis.
The following axis states are mutually exclusive.
Only one can be TRUE at the same time.
Disabled, Standstill, Discrete, Continuous, Syn-
chronized, Homing, Stopping, ErrorStop, or Coor-
dinated
Standstill BOOL Standstill TRUE while the Servo is ON for the axis.
Discrete BOOL Discrete Motion TRUE while position control is executed toward
the target position. This includes when the velocity
is 0 because the override factor was set to 0
during a discrete motion.
Continuous BOOL Continuous Motion TRUE during continuous motion without a target
position.
This state exists during velocity control or torque 6
control.
This includes when the velocity is 0 because the

6-6-3 Tables of System-defined Variables for Motion Control


target velocity is set to 0 and when the velocity is 0
due to an override factor set to 0 during continu-
ous motion.
Synchronized BOOL Synchronized Motion TRUE during execution of synchronized control.
This includes waiting for synchronization after
changing to synchronized control instructions.
Homing BOOL Homing TRUE when homing for the MC_Home or
MC_HomeWithParameter instruction.
Stopping BOOL Deceleration Stopping TRUE until the axis stops for a MC_Stop or
MC_TouchProbe instruction.
This includes when Execute is TRUE after the
axis stops for an MC_Stop instruction. Axis motion
instructions are not executed while decelerating to
a stop. (CommandAborted is TRUE.)
ErrorStop BOOL Error Deceleration This status exists when the axis is stopping or
Stopping stopped for execution of the MC_ImmdediateStop
instruction or a minor fault (while
_MC_AX[*].MFaultLvl.Active is TRUE (Axis Minor
Fault Occurrence).
Axis motion instructions are not executed in this
state. (CommandAborted is TRUE.)
Coordinated BOOL Coordinated Motion TRUE when an axes group is enabled by a multi-
axes coordinated control instruction.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-25


6 Motion Control Programming

Variable name Data type Meaning Function


Details _sAXIS_REF_DET Axis Control Status Gives the control status of the command.
Idle BOOL Idle TRUE when processing is not currently performed
for the command value, except when waiting for
in-position state.*1
Idle and InPosWaiting are mutually exclusive.
They cannot both be TRUE at the same time.
InPosWaiting BOOL In-position Waiting TRUE when waiting for in-position state. The in-
position check performed when positioning for the
in-position check.
Homed BOOL Home Defined TRUE when home is defined.*2
FALSE: Home not defined.
TRUE: Home is defined
InHome BOOL In Home Position TRUE when the axis is in the range for home. It
gives an AND of the following conditions.
• Home defined
• The actual current position is in the zero posi-
tion range with home as the center.
TRUE also when the zero position is passed by
while the axis is moving in command status.
VelLimit*3 BOOL Command Velocity TRUE while the command velocity is limited to the
Saturation maximum velocity during synchronized control.
Dir _sAXIS_REF_DIR Command Direction Gives the command travel direction.
Posi BOOL Positive Direction TRUE when there is a command in the positive
direction.
Nega BOOL Negative Direction TRUE when there is a command in the negative
direction.
DrvStatus _sAX- Servo Drive Status Gives the status of the Servo Drive.
IS_REF_STA_DRV
ServoOn BOOL Servo ON TRUE when the Servomotor is powered.
Ready BOOL Servo Ready TRUE when the Servo is ready.*4
MainPower BOOL Main Power TRUE when the Servo Drive main power is ON.
P_OT BOOL Positive Limit Input TRUE when the positive limit input is enabled.
N_OT BOOL Negative Limit Input TRUE when the negative limit input is enabled.
HomeSw BOOL Home Proximity Input TRUE when the home proximity input is enabled.
Home BOOL Home Input TRUE when the home input is enabled.*5*6
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 warning.
ILA BOOL Drive Internal Limiting TRUE when the Servo Drive limiting function actu-
ally limits the axis. This corresponds to one of the
following limits in the G5-series Servo Drive.*7
CSP BOOL Cyclic Synchronous TRUE when the Servo is ON at the Servo Drive
Position (CSP) and the current mode is CSP Mode.*8
Control Mode
CSV BOOL Cyclic Synchronous TRUE when the Servo is ON at the Servo Drive
Velocity (CSV) and the current mode is CSV Mode.*6
Control Mode
CST BOOL Cyclic Synchronous TRUE when the Servo is ON at the Servo Drive
Torque (CST) and the current mode is CST Mode.*6
Control Mode

6-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Variable name Data type Meaning Function


Cmd _sAXIS_REF_CM- Axis Command Values
D_DATA
Pos LREAL Command Current Contains the current value of the command posi-
Position tion. (Unit: command units)
When the Servo is OFF and the mode is not posi-
tion control mode, this variable contains the actual
current position. *9
Vel LREAL Command Current Contains the current value of the command veloc-
Velocity ity. (Unit: command units/s)
A plus sign is added during travel in the positive

6-6 System-defined Variables for Motion Control


direction, and a minus sign during travel in the
negative direction. The velocity is calculated from
the difference with the command current position.
When the Servo is OFF and the mode is not the
position control mode, the velocity is calculated
based on the actual current position.
AccDec LREAL Command Current Contains the current value of the command accel-
Acceleration/Decelera- eration/deceleration rate. (Unit: command
tion units/s2)
The acceleration/deceleration rate is calculated
from the difference with the command current
velocity. A plus sign is added for acceleration, and
a minus sign is added for deceleration. The value
is 0 when the command acceleration/deceleration
rate of the instruction under execution is 0.
Jerk LREAL Command Current Contains the current value of the command jerk.
Jerk (command units/s3)
A plus sign is added when the absolute value of
acceleration/deceleration is increasing, and a 6
minus sign is added when it is decreasing. The
value is 0 when the command acceleration/decel-

6-6-3 Tables of System-defined Variables for Motion Control


eration rate and command jerk of the instruction
under execution is 0.
Trq LREAL Command Current Contains the current value of the command
Torque torque. (Unit: %)
A plus sign is added during travel in the positive
direction, and a minus sign during travel in the
negative direction. Contains the same value as
the actual current torque except in torque control
mode. *10
Act _sAX- Axis Current Value
IS_REF_ACT_DATA
Pos LREAL Actual Current Position Contains the actual current position. (Unit: com-
mand units) *9
Vel LREAL Actual Current Velocity Contains the actual current velocity. (Unit: com-
mand units/s)
A plus sign is added during travel in the positive
direction, and a minus sign during travel in the
negative direction.
Trq LREAL Actual Current Torque Contains the current value of the actual torque.
(Unit: %)
A plus sign is added during travel in the positive
direction, and a minus sign during travel in the
negative direction.
TimeStamp*11 ULINT Time Stamp Contains the time when the current position of the
axis was updated. This variable is valid for an axis
for which time stamping is operating. (Unit: ns)

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-27


6 Motion Control Programming

Variable name Data type Meaning Function


MFaultLvl _sMC_REF_EVENT Axis Minor Fault
Active BOOL Axis Minor Fault TRUE while there is an axis minor fault.
Occurrence
Code WORD Axis Minor Fault Code Contains the code for an axis minor fault.
The upper four digits of the event code have the
same value.
Obsr _sMC_REF_EVENT Axis Observation
Active BOOL Axis Observation TRUE while there is an axis observation.
Occurrence
Code WORD Axis Observation Contains the code for an axis observation.
Code The upper four digits of the event code have the
same value.
Cfg _sAXIS_REF_CFG Axis Basic Settings Gives the settings of the Axis Basic Settings
parameters.
AxNo UINT Axis Number Contains the logical number of the axis.
AxEnable _eMC_AXIS_USE Axis Use Shows if the axis is enabled or disabled.
0: _mcNoneAxis (Undefined Axis)
1: _mcUnusedAxis (Unused Axis)
2: _mcUsedAxis (Used Axis)
AxType _eMC_AXIS_TYPE Axis Type Contains the axis type. I/O wiring is not required
for virtual axes.
0: _mcServo (Servo Axis)
1: _mcEncdr (Encoder Axis)
2: _mcVirServo (Virtual Servo Axis)
3: _mcVirEncdr (Virtual Encoder Axis)
NodeAddress UINT Node Address Contains the EtherCAT slave address. A value of
16#FFFF indicates that there is no address. *12
ExecID*13 UNIT Execution ID Contains the task execution ID.
0: Not assigned to task (undefined axis)
1: Assigned to primary periodic task
2: Assigned to priority-5 periodic task
Scale _sAXIS_REF_S- Unit Conversion Set- Gives settings of the electronic gear ratio.
CALE tings
Num UDINT Command Pulse Contains the number of pulses per motor rotation
Count Per Motor Rota- for command positions. The command value is
tion converted to the equivalent number of pulses
based on the electronic gear ratio.
Den LREAL Work Travel Distance Contains the workpiece travel distance per motor
Per Motor Rotation rotation for command positions.*14
Units _eMC_UNITS Unit of Display Contains the display unit for command positions.
0: _mcPls (pulse)
1: _mcMm (mm)
2: _mcUm (μm)
3: _mcNm (nm)
4: _mcDeg (degree)
5: _mcInch (inch)
CountMode*13 _eMC_COUNT_MO Count Mode Contains the count mode.
DE 0: _mcCountModeLinear (linear mode)
1: _mcCountModeRotary (rotary mode)
MaxPos *13 LREAL Maximum Current Contains the maximum value of the current
Position position indication.*15
MinPos *13 LREAL Minimum Curernt Contains the minimum value of the current
Position position indication. *16

6-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

*1 This also includes states where processing is performed while in motion at velocity 0, during following error resets, during
synchronized control, and during coordinated motion.
*2 Even if the variable is TRUE, the home must be defined again in the following cases.
When you make a change in the position count settings or the unit conversion settings.
If an error or erroneous operation occurs on the Servo Drive, which leads to loss of absolute position data. Examples of
errors and erroneous operations include breaks of encoder cables and clear of absolute encoder data.
*3 Use VelLimit only for a slave axis that is currently in synchronized control.
*4 This variable is TRUE when the PDS state of the Servo Drive is either Ready to switch on, Switched on or Operation
enabled and the main circuit power supply (voltage enabled) is ON. However, if Main circuit power supply OFF
detection is set to Do not detect, ON/OFF status of the main circuit power supply is ignored. For details on the PDS
states and the Main circuit power supply OFF detection, refer to A-5 PDS State Transition.

6-6 System-defined Variables for Motion Control


*5 The Detailed Settings Area on the Axis Basic Settings Display of the Sysmac Studio gives the signal that is set for
encoder Z-phase detection digital input. You may not be able to map a PDO to this signal for servo drives from other man-
ufacturers. Refer to the manual for the connected servo drive for details.
*6 You cannot map this signal to a PDO for an OMRON G5-series Linear Motor Type Servo Drive with built-in EtherCAT com-
munications.
*7 This variable gives the status of bit 11 (internal limit enabled) in the Status Word (6041 hex) that is mapped to a PDO. The
conditions for this variable changing to TRUE depend on the specifications of the Servo Drive. Refer to the manual for the
connected servo drive for details. For an OMRON 1S-series Servo Drive or G5-series Servo Drive, this variable gives an
OR of the following four: torque limits, velocity limits, drive prohibit inputs, and software limits.
*8 This variable gives the value of the Modes of Operation Display (6061 hex) that is mapped to a PDO. The conditions CSP,
CSV, and CST changing to TRUE depend on the specifications of the Servo Drive. Refer to the manual for the connected
servo drive for details.
If the Modes of Operation Display (6061 hex) is not mapped to a PDO, the values of these variables depend on the unit
version of the CPU Unit as follows: For a CPU Unit with unit version 1.09 or earlier, they are always FALSE. 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.
*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. 6
For a CPU Unit with unit version 1.09 or earlier, the actual current position and the command current position axis vari-
ables will contain 0 or the lower limit. The lower limit is contained when the Count Mode is set to Rotary Mode and 0 is not
included in the range of position.

6-6-3 Tables of System-defined Variables for Motion Control


For a CPU Unit with unit version 1.10 or later, the actual current position and the command current position axis variables
will contain the actual current position output that is just before process data communications change to a non-estab-
lished state.
*10 If you display a data trace that compares the command current torque and the actual current torque in any mode other
than Torque Control Mode, the command current torque will change after one task period. This is caused by the timing of
processing the data trace. Refer to information on data tracing in the NJ/NX-series CPU Unit Software User’s Manual
(Cat. No. W501) for information on the timing of processing data tracing.
Data Trace Display Example

Torque Actual current torque

Command current torque

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.
*12 For an NX-series Position Interface Unit, this is the node address of the EtherCAT Coupler Unit under which the Position
Interface Unit is mounted.
*13 A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this variable.
*14 The parameter is disabled if you set to use a reducer in the unit conversion settings, which is the function added for CPU
Units with unit version 1.11 or later. To confirm alternatively enabled parameters, i.e. Work Travel Distance Per Rotation,
Work Gear Ratio, and Motor Gear Ratio, use the MC_ReadAxisParameter (Read Axis Parameters) instruction.
*15 If the Count Mode is set to Linear Mode, the position just before an overflow is given. In Rotary Mode, the modulo maxi-
mum position is given.
*16 If the Count Mode is set to Linear Mode, the position just before an underflow is given. In Rotary Mode, the modulo mini-
mum position is given.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-29


6 Motion Control Programming

 Relationship between Axis Variables and Axis Types


Axis Variables are enabled or disabled according to the axis type. Disabled members are FALSE or 0.
In the descriptions, _MC_AX[0-255] is used as an example. The same information applies to
_MC1_AX[0-255] and _MC2_AX[0-255]. Also, the following table shows which members are
enabled for each axis type.
Virtual Virtual
Servo Encoder
Variable name Data type Meaning servo encoder
axis axis
axis axis
_MC_AX[0-255] _sAXIS_REF Axis Variable
Status _sAXIS_REF_STA Axis Status
Ready BOOL Axis Ready-to-execute Enabled Enabled --- ---
Disabled BOOL Axis Disabled Enabled Enabled Enabled Enabled
Standstill BOOL Standstill Enabled Enabled --- ---
Discrete BOOL Discrete Motion Enabled Enabled --- ---
Continuous BOOL Continuous Motion Enabled Enabled --- ---
Synchronized BOOL Synchronized Motion Enabled Enabled --- ---
Homing BOOL Homing Enabled Enabled --- ---
Stopping BOOL Deceleration Stopping Enabled Enabled --- ---
ErrorStop BOOL Error Deceleration Enabled Enabled --- ---
Stopping
Coordinated BOOL Coordinated Motion Enabled Enabled --- ---
Details _sAXIS_REF_DET Axis Control Status
Idle BOOL Idle Enabled Enabled Enabled Enabled
InPosWaiting BOOL In-position Waiting Enabled Enabled --- ---
Homed BOOL Home Defined Enabled Enabled --- ---
InHome BOOL In Home Position Enabled Enabled --- ---
VelLimit BOOL Command Velocity Enabled Enabled --- ---
Saturation
Dir _sAXIS_REF_DIR Command Direction
Posi BOOL Positive Direction Enabled Enabled --- ---
Nega BOOL Negative Direction Enabled Enabled --- ---
DrvStatus _sAXIS_REF_STA_DRV Servo Drive Status
ServoOn BOOL Servo ON Enabled --- --- ---
Ready BOOL Servo Ready Enabled --- --- ---
MainPower BOOL Main Power Enabled --- --- ---
P_OT BOOL Positive Limit Input Enabled --- --- ---
N_OT BOOL Negative Limit Input Enabled --- --- ---
HomeSw BOOL Home Proximity Input Enabled --- --- ---
Home BOOL Home Input Enabled --- --- ---
ImdStop BOOL Immediate Stop Input Enabled --- --- ---
Latch1 BOOL External Latch Input 1 Enabled --- --- ---
Latch2 BOOL External Latch Input 2 Enabled --- --- ---
DrvAlarm BOOL Drive Error Input Enabled --- --- ---
DrvWarning BOOL Drive Warning Input Enabled --- --- ---
ILA BOOL Drive Internal Limiting Enabled --- --- ---
CSP BOOL Cyclic Synchronous Enabled --- --- ---
Position (CSP) Con-
trol Mode
CSV BOOL Cyclic Synchronous Enabled --- --- ---
Velocity (CSV) Control
Mode
CST BOOL Cyclic Synchronous Enabled --- --- ---
Torque (CST) Control
Mode

6-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Virtual Virtual
Servo Encoder
Variable name Data type Meaning servo encoder
axis axis
axis axis
Cmd _sAXIS_REF_CMD_DATA Axis Command Values
Pos LREAL Command Current Enabled Enabled --- ---
Position
Vel LREAL Command Current Enabled Enabled --- ---
Velocity
AccDec LREAL Command Current Enabled Enabled --- ---
Acceleration/Decelera-
tion

6-6 System-defined Variables for Motion Control


Jerk LREAL Command Current Enabled Enabled --- ---
Jerk
Trq LREAL Command Current Enabled Enabled --- ---
Torque
Act _sAXIS_REF_ACT_DATA Axis Current Value
Pos LREAL Actual Current Position Enabled Enabled Enabled Enabled
Vel LREAL Actual Current Velocity Enabled Enabled Enabled Enabled
Trq LREAL Actual Current Torque Enabled Enabled --- ---
TimeStamp ULINT Time Stamp Enabled --- Enabled ---
MFaultLvl _sMC_REF_EVENT Axis Minor Fault
Active BOOL Axis Minor Fault Enabled Enabled Enabled Enabled
Occurrence
Code WORD Axis Minor Fault Code Enabled Enabled Enabled Enabled
Obsr _sMC_REF_EVENT Axis Observation
Active BOOL Axis Observation Enabled Enabled Enabled Enabled
Occurrence
Code WORD Axis Observation Enabled Enabled Enabled Enabled 6
Code
Cfg _sAXIS_REF_CFG Axis Basic Settings

6-6-3 Tables of System-defined Variables for Motion Control


AxNo UINT Axis Number Enabled Enabled Enabled Enabled
AxEnable _eMC_AXIS_USE Axis Use Enabled Enabled Enabled Enabled
AxType _eMC_AXIS_TYPE Axis Type Enabled Enabled Enabled Enabled
NodeAddress UINT Node Address Enabled --- Enabled ---
ExecID*1 UNIT Execution ID Enabled Enabled Enabled Enabled
Scale _sAXIS_REF_SCALE Unit Conversion Set-
tings
Num UDINT Command Pulse Enabled Enabled Enabled Enabled
Count per Motor Rota-
tion
Den*2 LREAL Work Travel Distance Enabled Enabled Enabled Enabled
per Motor Rotation
Units _eMC_UNITS Unit of Display Enabled Enabled Enabled Enabled
CountMode*1 _eMC_COUNT_MODE Count Mode Enabled Enabled Enabled Enabled
MaxPos*1 LREAL Maximum Current Enabled Enabled Enabled Enabled
Position
MinPos*1 LREAL Minimum Current Enabled Enabled Enabled Enabled
Position
*1 A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this variable.
*2 The parameter is disabled if you set to use a reducer in the unit conversion settings, which is the function added for CPU
Units with unit version 1.11 or later.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-31


6 Motion Control Programming

Axes Group Variables


_MC_GRP[0-63], _MC1_GRP[0-63], and _MC2_GRP[0-63] are the system-defined Axes Group Vari-
ables. The data type is _sGROUP_REF, which is a structure. This section describes the configuration of
the Axes Group Variables and provides details on the members 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
applies to _MC1_AX[*] and _MC2_AX[*].
Variable name Data type Meaning Function
_MC_GRP[0-63] _sGROUP_REF Axes Group Variable
Status _sGROUP_REF_STA Axes Group Status
Ready BOOL Ready to Execute TRUE when the axes group is stopped and is
ready to execute. The condition for being
ready to execute is an AND of the following
conditions.
• Execution of the MC_Stop instruction is not
in progress for any composition axis.
• _MC_GRP[*].Status.Standby is TRUE
(stopped).
• The Servo is ON for the composition axes.
• _MC_AX[*].Details.Homed is TRUE (home
is defined) for the composition axes.
Disabled BOOL Axes Group Disabled TRUE when the axes group is disabled and
stopped. The following axes group status are
mutually exclusive. Only one of them can be
TRUE at a time.
Disabled, Standby, Moving, Stopping, or Error-
Stop
Standby BOOL Standby TRUE when the axes group motion instruction
is stopped. (This is independent of the Servo
ON/OFF status of the composition axes in the
axes group)
Moving BOOL Moving TRUE while an axes group motion instruction
is executed toward the target position.
This includes in-position waiting status and
when the velocity is 0 for an override.
Stopping BOOL Deceleration Stopping TRUE until the axes group stops for an
MC_GroupStop instruction. This includes
when Execute is TRUE after the axes stop for
an MC_GroupStop instruction. Axes group
motion instructions are not executed in this
state. (CommandAborted is TRUE.)
ErrorStop BOOL Error Deceleration TRUE while the axes group is stopping or
Stopping stopped for the MC_GroupImmediateStop
instruction or for an axes group minor fault
(when _MC_GRP[*].MFaultLvl.Active is
TRUE). Axes group motion instructions are
not executed in this state. (CommandAborted
is TRUE.)
Details _sGROUP_REF_DET Axes Group Control Gives the control status of the instruction.
Status
Idle BOOL Idle TRUE when processing is not currently per-
formed for the command value, except when
waiting for in-position state.*1
Idle and InPosWaiting are mutually exclusive.
They cannot both be TRUE at the same time.
InPosWaiting BOOL In-position Waiting TRUE when waiting for in-position state for
any composition axis.
TRUE during positioning operations during the
in-position check.*2

6-32 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Variable name Data type Meaning Function


Cmd _sGROUP_REF_CMD_ Axes Group Command
DATA Values
Vel LREAL Command Contains the current value of the command
Interpolation Velocity interpolation velocity. The interpolation veloc-
ity is calculated from the difference with the
interpolation command current position. A
plus sign is added during travel in the positive
direction, and a minus sign is added during
travel in the negative direction. The value is 0
when the axes group is disabled.

6-6 System-defined Variables for Motion Control


AccDec LREAL Command Contains the current value of the command
Interpolation interpolation acceleration/deceleration. The
Acceleration/ interpolation acceleration/deceleration rate is
Deceleration calculated from the difference with the com-
mand interpolation velocity. A plus sign is
added for acceleration, and a minus sign is
added for deceleration. The value is 0 when
the axes group is disabled, or when the com-
mand acceleration/deceleration rate of the
current axes group motion instruction is 0.
MFaultLvl _sMC_REF_EVENT Axes Group Minor
Fault
Active BOOL Axes Group Minor TRUE while there is an axes group minor fault.
Fault Occurrence
Code WORD Axes Group Minor Contains the error code for an axes group
Fault Code minor fault.
The upper four digits of the event code have
the same value.
Obsr _sMC_REF_EVENT Axes Group Observa- 6
tion
Active BOOL Axes Group Observa- TRUE while there is an axes group observa-

6-6-3 Tables of System-defined Variables for Motion Control


tion Occurrence tion.
Code WORD Axes Group Observa- Contains the code for an axes group observa-
tion Code tion.
The upper four digits of the event code have
the same value.
Cfg _sGROUP_REF_CFG Axes Group Basic Gives the settings of the Axes Group Basic
Settings Settings parameters.
GrpNo UINT Axes Group Number Contains the logical number of the axes group.
GrpEnable _eMC_GROUP_USE Axes Group Use Shows if the axes group is enabled or dis-
abled.
0: _mcNoneGroup (Undefined Axes Group)
1: _mcUnusedGroup (Unused Axes Group)
2: _mcUsedGroup (Used Axes Group)
ExecID*3 UNIT Execution ID Contains the assigned task execution ID.
0: Not assigned to task (undefined axes
group)
1: Assigned to primary periodic task
2: Assigned to priority-5 periodic task

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-33


6 Motion Control Programming

Variable name Data type Meaning Function


Kinematics _sGROUP_REF_KIM Kinematics Contains the definition of the kinematic con-
Transformation versions for the axes group.
Settings
GrpType _eMC_TYPE Composition Gives the axis composition of multi-axes coor-
dinated control.
0: _mcXY (two axes)
1: _mcXYZ (three axes)
2: _mcXYZU (four axes)
Axis[0] UINT Composition Axis for Contains the axis number that is assigned to
Axis A0 axis A0.
Axis[1] UINT Composition Axis for Contains the axis number that is assigned to
Axis A1 axis A1.
Axis[2] UINT Composition Axis for Contains the axis number that is assigned to
Axis A2 axis A2.
Axis[3] UINT Composition Axis for Contains the axis number that is assigned to
Axis A3 axis A3.
*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.
*3 A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this variable.

6-34 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-7 Cam Tables and Cam Data Variables


The MC Function Module uses the cam profile curves that you create on the Cam Editor of the Sysmac
Studio as cam tables. The cam table data is handled as cam data variables in the user program in the
NJ/NX-series Controller.

Creating and Saving Cam Tables

Sysmac Studio: Used to create cam profile curves and cam definition variables.
Spreadsheet software: Used to edit cam tables in CSV format.

6-7 Cam Tables and Cam Data Variables


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

• After cam data is


downloaded Main memory User program
Non-volatile memory • When power is
turned ON Modified.
Cam Table Cam data variables Data movement instructions
Saved. Overwritten. MC_GenerateCam
Table instruction*3
Uploaded. Cam definition variables*4
*1 *2 MC_SaveCamTable
instruction 6

*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 following page
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 variable 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.

 Cam Table Data Flow


• Use the Sysmac Studio to download the cam profile curves that you created in the Sysmac Studio
to the CPU Unit to save them as cam tables in the non-volatile memory in the CPU Unit. When
you upload a cam table to the Sysmac Studio, the cam table that was saved in the non-volatile
memory is uploaded.
• The cam tables that were saved in non-volatile memory are implemented as cam data variables in
the main memory after you download them or when the power is turned ON.
• You can use the user program to edit cam data variables and cam definition variables in the main
memory. Refer to 9-2-5 Cam Tables for information on cam data variables and cam definition vari-
ables.
• The MC_GenerateCamTable (Generate Cam Table) instruction in the user program can overwrite
the cam data variable in main memory according to the value of the cam definition variable.
• The motion control instruction MC_SaveCamTable saves the cam data variables in the main
memory to non-volatile memory.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-35


6 Motion Control Programming

• You can upload the cam definition variable that were created in the Cam Data Settings of the Sys-
mac Studio even after the variable is changed in the user program. If the cam definition variable
was created as a user-defined variable, you cannot upload it after it is changed in the user pro-
gram.
• Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504-E1-10 or later) for infor-
mation on creating 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 CPU Unit mode
or the status of the MC Function Module. You cannot upload cam data, download 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.

Precautions for Correct Use


• 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 Sys-
mac 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
stopped 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 Dis-
abled).
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_Set-
TorqueLimit instruction.
The Servo ON state and torque limit are maintained even if the MC_Power and MC_Set-
TorqueLimit instructions are deleted from the user program after the program is updated by
downloading.

6-36 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

Editing a Cam Data Variable on the Computer after Editing It from


the User Program
If you edit or overwrite a cam data variable from the user program and then use the MC_SaveCamTable
instruction to save the cam table to non-volatile memory, you cannot edit the data with the Cam 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.

Transfer Cam Table [Controller to File]:


Uploads the cam table from the Controller and saves it in a CSV file.
Transfer Cam Table [File to Controller]:
Downloads the cam table from a CSV file to the Controller.

6-7 Cam Tables and Cam Data Variables


Save/Export
Edit Spreadsheet
Sysmac Studio
Read/Import CSV file software

Upload Download

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

* Use the Synchronization menu command of the Sysmac Studio to upload and download the project.
6
 Saving a Cam Table from Non-volatile Memory to a CSV File
• Right-click a cam profile that you edited in the Cam Data Settings of the Sysmac Studio and select
Transfer Cam Table [Controller to File] from the menu.
• The Save Dialog Box is displayed. Enter the file save location and file name, and then click the
Save Button.

 Editing CSV Files


• Use spreadsheet software or other CSV-compatible software to edit the CSV file.

 Transferring the CSV File to the CPU Unit


• Right-click the cam profile to download and select Transfer Cam Table [File to Controller] from
the menu.
• The Open File Dialog Box is displayed. Specify the file to transfer, and then click the OK Button.
• To enable the cam table that you transferred, reset the Controller or cycle the power supply to the
Controller after the cam table is transferred.

Precautions for Correct Use


• Synchronize the data with the Controller before you transfer a cam table from a file to the Con-
troller.
• If you transfer the cam table to the Controller during a synchronization operation after you
transfer a cam table from a file to the Controller, the cam table in the Controller is replaced with
the data in the Cam Data Settings. Either transfer the cam data from the file to the Controller
again, or do not include the Cam Data Settings in the synchronization data.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-37


6 Motion Control Programming

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.

Cam Profile Curve Names


When a cam profile is created in the Sysmac Studio, CamProfile0 is used as the default name. Each
time you create another cam profile, the number on the end of the name is incremented. You can
change the name of any cam profile as required from the Sysmac Studio.
The cam profile names that are set on the Sysmac Studio are used as the cam table names.

Specifying Cam Tables in the User Program


In the user program, the cam table name is specified for the in-out variable CamTable in motion control
instructions.
In-out variable CamTable

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

6-38 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-8 Programming Motion Controls


Place motion control instructions in the user program of the NJ/NX-series Controller to perform motion
control. Programs that contain motion control instructions are called motion control programs.

Precautions for Correct Use


• 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 maximum
number of controlled axes for that CPU Unit.
• When you reuse a project, make sure that the maximum number of control axes for the CPU
Unit model is not exceeded.

6-8 Programming Motion Controls


• Even axes that are set as unused axes are included in the number of control axes.

Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on program-
ming.
This section gives the procedure to create a program in an existing project on the Sysmac Studio.

1 Starting the Sysmac Studio


Start the Sysmac Studio and open the project.

2 Adding a Program
Right-click Programs in the Multiview Explorer and select Multipart Ladder or Structured Text
from the Add Menu.
6

A program is added to the Multiview Explorer.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-39


6 Motion Control Programming

3 Editing the Program


Right-click a section in the new program and select Edit from the menu. The Program Edit Tab
Page is displayed.

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.

6-40 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


6 Motion Control Programming

6-9 Creating Cam Tables


This section will explain how to use the Cam Editor of the Sysmac Studio to create a cam table.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on the Cam Editor.

1 Adding a Cam Profile


Right-click Cam Data Settings in the Multiview Explorer and select CamProfile from the Add
Menu.

6-9 Creating Cam Tables


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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 6-41


6 Motion Control Programming

2 Editing the Cam Profile


Right-click the cam profile in the Multiview Explorer and select Edit from the menu.

The Cam Profile Edit Tab Page is displayed.

Make the settings and enter the cam profile.


Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific proce-
dures.

6-42 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Manual Operation
This section describes manual operation when the MC Function Module is used
together with an OMRON 1S-series Servo Drive.

7-1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2


7-2 Turning ON the Servo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7-2-1 Turning ON the Servo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7-2-2 Setting Axis Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7-2-3 Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7-3 Jogging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
7-3-1 Jogging Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
7-3-2 Setting Axis Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 7
7-3-3 Setting Example for Input Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
7-3-4 Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 7-1


7 Manual Operation

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.

Precautions for Correct Use


You must set the axes to perform manual operation. Refer to Section 3 Configuring Axes and
Axes Groups for details on how to set axes.

Additional Information

• Use the Sysmac Studio if you want to perform manual operation without programming. Refer
to 4-3 Checking Motor Operation for information on how to use the Sysmac Studio to perform
manual operation.
• Refer to Section 6 Motion Control Programming for information on how to create user pro-
grams.
• The same procedures and operations are applicable to an OMRON G5-series Servo Drive.

7-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


7 Manual Operation

7-2 Turning ON the Servo


You can turn the Servo ON or OFF to enable or disable sending operation commands to the Servo
Drive. The MC_Power (Power Servo) motion control instruction is used.
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

Specify the axis to move with the Axis in-out variable. Change the Enable input variable for MC_Power
to TRUE to turn ON the Servo. Change Enable to FALSE to turn OFF the Servo.

7-2 Turning ON the Servo


Precautions for Correct Use
• 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
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.

7
Additional Information

If an OMRON 1S-series Servomotor or G5-series Servomotor with an absolute encoder is used,

7-2-1 Turning ON the Servo


or if an OMRON G5-series Linear Motor Type Servomotor/Servo Drive with built-in EtherCAT
communications is used with an absolute external scale, home is defined when the Enable input
variable to the MC_Power instruction changes to TRUE.

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 Ser-
vomotor/Servo Drive with built-in EtherCAT communications is used with an absolute external
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 Infor-
mation.

7-2-1 Turning ON the Servo

1 Adding and Setting an Axis


Add and set an axis from the Sysmac Studio. For details, refer to 3-2-2 Setting Procedure.

2 Setting Axis Parameters

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 7-3


7 Manual Operation

Set the axis parameters from the Sysmac Studio. For details, refer to 3-2-2 Setting Procedure.

3 Writing the User Program


Create the user program from the Sysmac Studio. For details, refer to 6-8 Programming Motion
Controls.

4 Downloading Axis Parameters and the User Program


Download the axis parameters and user program to the CPU Unit. Use the Synchronization
menu command of the Sysmac Studio to download the project to the CPU Unit.
For details, refer to 3-2-2 Setting Procedure.

5 Executing the User Program


Execute the user program and change the Enable input variable for MC_Power to TRUE. The
Servo Drive will change to the Servo ON state.

7-2-2 Setting Axis Parameters


Only the following axis parameter settings are required if you want only to change to the Servo ON
state. The following table provides examples of the settings.
Parameter name Setting
Axis Variable Name Axis1*1
Axis Number 1*2
Axis Use Used axis
Axis Type Servo axis
Input Device/Output Device 1*3

*1 If there is more than one axis, a different variable name is set for each axis.
*2 If there is more than one axis, a different value is set for each axis.
*3 Set the node address to the same value as the node address that is set on the Servo Drive. If there is more
than one axis, a different value is set for each axis.

7-2-3 Programming Example


The following sample programming turns the Servo ON and OFF for an axis named Axis1 based on the
value of bit A.
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-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


7 Manual Operation

7-3 Jogging
Use the motion control instruction MC_MoveJog for jogging.
Body name Instance name
In-out variable MC_MoveJog_instance
MC_MoveJog
A
Axis1 Axis Axis Axis1
PositiveEnable Busy
B NegativeEnable CommandAborted
Velocity Error
Acceleration ErrorID
Deceleration

Input variables Output variables

Specify the axis to jog with the Axis in-out variable. Change the PositiveEnable input variable to TRUE
to start the axis with the specified positive Velocity (Target Velocity) and Acceleration (Acceleration
Rate). Change PositiveEnable to FALSE to decelerate and stop the axis at the specified Deceleration
(Deceleration Rate).
Similarly, if you change the NegativeEnable input variable to TRUE, the axis will start in the negative
direction. Change NegativeEnable to FALSE to stop the axis. You can perform jogging even if the home
has not yet been defined.

7-3 Jogging
7-3-1 Jogging Procedure

1 Adding and Setting an Axis


7
Add and set an axis from the Sysmac Studio. For details, refer to 3-2-2 Setting Procedure.

7-3-1 Jogging Procedure


2 Setting Axis Parameters
Set the axis parameters from the Sysmac Studio. For details, refer to 3-2-2 Setting Procedure.

3 Writing the User Program


Create the user program from the Sysmac Studio. For details, refer to 6-8 Programming Motion
Controls.

4 Downloading Axis Parameters and the User Program


Download the axis parameters and user program to the CPU Unit. Use the Synchronization
menu command of the Sysmac Studio to download the project to the CPU Unit.
For details, refer 3-2-2 Setting Procedure.

5 Executing the User Program


Execute the user program and change the Enable input variable for MC_Power to TRUE to
change the Servo Drive to the Servo ON state. Change either the PositiveEnable or Nega-
tiveEnable input variable for the MC_MoveJog instruction to TRUE to jog.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 7-5


7 Manual Operation

7-3-2 Setting Axis Parameters


Set the following axis parameters if you want to jog when home is not defined. The following setting
example is for a one-axis device.
Servomotor
Encoder resolution: 23 bits/rotation 1 rotation
10 mm Ball screw
Ball screw pitch: 10 mm

Encoder output pulses per motor rotation


23 bits = 8,388,608

Parameter name Setting


Axis Variable Name Axis1*1
Axis Number 1*2
Enabled Axes Used axis
Axis Use Servo axis
Input Device/Output Device 1*3
Command Pulse Count Per Motor Rota- 8,388,608*4
tion
Work Travel Distance Per Motor Rotation 10,000*4
Software Limits Enabled for actual position
Unit of Display μm
Count Mode Linear Mode
Maximum Velocity 500,000*5
Maximum Jog Velocity 50,000*6
Maximum Acceleration 5,000,000*7
Maximum Deceleration 5,000,000*7

*1 If there is more than one axis, a different variable name is set for each axis.
*2 If there is more than one axis, a different value is set for each axis.
*3 Set the node address to the same value as the node address that is set on the Servo Drive. If there is more
than one axis, a different value is set for each axis.
*4 The position command unit will be 1 μm.
*5 The maximum velocity will be 3,000 r/min = 30 m/min = 0.5 m/s = 500,000 μm/s.
*6 The maximum jog velocity will be 10% of the maximum velocity, i.e., 0.05 m/s = 50,000 μm/s.
*7 The maximum acceleration and the maximum deceleration are 5 m/s2. The acceleration time to the maximum
velocity (3,000 r/min) is 0.1 s.

7-3-3 Setting Example for Input Variables


This section describes the settings for the MC_MoveJog input variables Velocity (Target Velocity),
Acceleration (Acceleration Rate), and Deceleration (Deceleration Rate).
• 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).

7-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


7 Manual Operation

7-3-4 Programming Example


The following programming example jogs an axis named Axis1 in the positive direction for the value of
bit A and in the negative direction for the value of bit B.
MC_MoveJog_instance
MC_MoveJog
A Axis1 Axis Axis
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).

7-3 Jogging
7

7-3-4 Programming Example

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 7-7


7 Manual Operation

7-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Homing
This section describes homing.

8-1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2


8-2 Homing Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8-2-1 Setting Homing Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8-2-2 Monitoring the Homing Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12
8-3 Homing Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
8-4 Homing with an Absolute Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14
8-4-1 Outline of Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15
8-4-2 Setting Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16
8-5 High-speed Homing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-1


8 Homing

8-1 Outline
This section describes the operations that are performed when the MC Function Module is combined
with an OMRON G5-series Servo Drive.
To perform positioning to absolute positions in a positioning system, you must first define the home. 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 prox-
imity 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.

Precautions for Correct Use


• The defined home is lost in the following situations.
• When MC_SetPosition is executed.
• When an overflow or underflow occurs in Linear Mode.
• When homing is started.
• The control state of EtherCAT communications is not Operational state.
• Some of the homing functions are restricted for the NX-series Position Interface Units. Refer to
the NX-series Position Interface Units User’s Manual (Cat. No. W524) for details.

Additional Information

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 external scale, home is defined when the Enable input
variable to the MC_Power instruction changes to TRUE.

8-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

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.

The MC_MoveZeroPosition (High-speed Home) instruction is also provided to perform positioning to


home as defined for the previously described method.

Name Description
High-speed Homing The axis returns to home using an absolute position of 0 as the target position.
The MC Function Module can operate the motor even when home is undefined (excluding
MC_MoveZeroPosition).

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.
Positioning If home is not defined, the position at startup is defined as 0 to control movement.
Interrupt feeding
Starting cam operation
Starting gear operation
Synchronous positioning

8-1 Outline
Combining axes
Torque control
Zone monitoring
Linear interpolation Interpolation cannot be used.
Circular interpolation If it is used, an instruction error will occur. 8

Additional Information

Software limits are not valid when home is not defined.

Changes in the home definition status for operations and events are listed in the following table.
Home definition status
Operation or event Condition for change
change
Servo turned ON or axis Incremental encoder No change
enabled When absolute data is read normally from the Home is defined.
absolute encoder
When absolute data cannot be read from the Home is undefined.
absolute encoder
Changing the current position When starting Home is undefined.
Homing When starting Home is undefined.
When ending Home is defined.
Overflows and underflows When overflow or underflow occurs Home is undefined.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-3


8 Homing

Precautions for Correct Use


• For a virtual axis, home is always defined with a zero position preset. The setting of the Hom-
ing 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 incor-
rect 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.

8-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

8-2 Homing Procedure


This section describes the procedure to perform homing.

1 Adding and Setting an Axis


Add and set an axis from the Sysmac Studio.

2 Setting Axis Parameters


Set the homing method with the homing parameters.

3 Writing the User Program


Create the user program from the Sysmac Studio. For details, refer to 6-8 Programming Motion
Controls.

4 Downloading Axis Parameters and the User Program


Download the axis parameters and user program to the CPU Unit. Use the Synchronization
menu command of the Sysmac Studio to download the project to the CPU Unit.
For details, refer to 3-2-2 Setting Procedure.

5 Executing the User Program


Execute the user program and change the Enable input variable for MC_Power to TRUE to
change the Servo Drive to the Servo ON state. Homing is performed when the Execute input

8-2 Homing Procedure


variable to the MC_Home or MC_HomeWithParameter instruction changes to TRUE.

8-2-1 Setting Homing Parameters


Set the homing parameters to specify the homing procedure. Set the homing parameters from the Sys-
mac Studio.
Parameter name Description
Homing Method Set the homing operation. 8
Home Input Signal Select the input to use for the home input signal.
Homing Start Direction Set the start direction for when homing is started.

8-2-1 Setting Homing Parameters


Home Input Detection Direction Set the home input detection direction for homing.
Operation Selection at Positive Limit Set the stopping method when the positive limit input turns ON during
Input homing.
Operation Selection at Negative Limit Set the stopping method when the negative limit input turns ON during
Input homing.
Homing Velocity Set the homing velocity. (Unit: command units/s)
Homing Approach Velocity Set the velocity to use after the home proximity input turns ON. (Unit:
command units/s)
Homing Acceleration Set the acceleration rate for homing. If the homing acceleration is set to
0, the homing velocity or other target velocity is used without any accel-
eration. (Unit: command units/s2)
Homing Deceleration Set the deceleration rate for homing. If the homing deceleration is set to
0, the homing approach velocity or other target velocity is used without
any deceleration. (Unit: command units/s2)
Homing Jerk Set the jerk for homing. Set 0 for no jerk. (Unit: command units/s3)
Home Input Mask Distance Set the home input feeding distance when you set the Homing Opera-
tion Mode to the proximity reverse turn/home input mask distance.
(Unit: command units)

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-5


8 Homing

Parameter name Description


Home Offset Preset the actual position for the value that is set after homing. (Unit:
command units)
Homing Holding Time Set the holding time when you set the Homing Operation Mode to the
proximity reverse turn/holding time. (Unit: ms)
Homing Compensation Value Set the homing compensation value that is applied after the home is
defined. (Unit: command units)
Homing Compensation Velocity Set the velocity to use for homing compensation (command units/s).

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
The homing parameters are described individually below.

Homing Methods
You can select any of the ten operations 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 tables shows the homing parameters that are used for each Homing Operation Mode.

8-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

(Yes: Parameter is used, No: Parameter is not used.)


Homing parameters

Operation Selection at Negative Limit Input


Operation Selection at Positive Limit Input

Homing Compensation Velocity


Home Input Detection Direction

Homing Compensation Value


Homing Approach Velocity

Home Input Mask Distance


Homing Operation Mode

Homing Start Direction

Homing Holding Time


Home Position Offset
Homing Acceleration

Homing Deceleration
Home Input Signal

Homing Velocity

Homing Jerk
Proximity reverse turn/home proximity Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
input OFF
Proximity reverse turn/home proximity Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
input ON
Home proximity input OFF Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
Home proximity input ON Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
Limit input OFF Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
Proximity reverse turn/home input mask Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes
distance

8-2 Homing Procedure


Limit inputs only No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
Proximity reverse turn/holding time No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes
No home proximity input/holding home Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
input
Zero position preset No No No No No No No No No No No Yes No No No

For details on the Homing Operation Modes, refer to the NJ/NX-series Motion Control Instructions Ref-
erence Manual (Cat. No. W508).
8
Additional Information

8-2-1 Setting Homing Parameters


You cannot map the Z-phase input to a PDO for an OMRON G5-series Linear Motor Type Servo
Drive with built-in EtherCAT communications. Therefore, if you use the No Home Proximity
Input/Holding Home Input Homing Operation Mode, which can use a Z-phase input mapped to a
PDO, do not select the Z-phase input for the home input signal.

Home Input Signal


In a Homing Method that uses a home input signal, select either the Z phase signal of the Servo Drive
or an external home signal as the signal to define home.

Precautions for Correct Use


This parameter can be used to set a home input signal only when you are connected to an
OMRON 1S-series Servo Drive or G5-series Servo Drive.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-7


8 Homing

Homing Start Direction


Select the direction (positive or negative) in which the axis starts moving when homing is started. If
homing starts while the home proximity signal is ON in a Homing Operation Mode that includes reversal
operation for a proximity reverse turn, the axis starts motion in the direction opposite to the home input
detection direction (regardless of the setting of the homing start direction).
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
Homing start direction: Positive
Home input detection direction: Positive
Home proximity ON
input signal OFF

Operation command (1) Start (3)


Negative Positive
direction Start (2) Start direction
(1) and (3): The home proximity signal is OFF, so the axis starts moving in the homing start direc-
tion.
(2): The home proximity signal is ON, so the axis starts moving in the direction opposite to
the home input detection direction.
Homing start direction: Negative
Home input detection direction: Negative
Home proximity ON
input signal OFF

(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 direc-
tion.
(2): The home proximity signal is ON, so the axis starts moving in the direction opposite to
the home input detection direction.

Home Input Detection Direction


Select the direction (positive or negative) in which to detect home. Refer to Homing Start Direction on
page 8-8 for the relationship between the home detection method and the initial direction when homing
starts.

Operation Selection at Positive Limit Input and Operation Selection


at Negative Limit Input
• Select the operation when the axis reaches a limit input in the operating direction during homing:
reverse the axis and continue with homing, or do not reverse the axis, create an error, and stop the
axis. To reverse the axis, also select the stopping method.

8-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

• An error occurs and the axis stops if the axis is set to reverse direction, and the limit signal in the
home input detection direction turns ON when traveling at the homing approach velocity. However, if
the Homing Operation Mode is 13 (no home proximity input/holding home input), which does not use
proximity signals, no error will occur and the axis will not stop.
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 home
input detection direction to the other limit input.
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

8-2 Homing Procedure


Start Stops

Homing Velocity
Set the homing velocity in command units/s.

8
Homing Approach Velocity

8-2-1 Setting Homing Parameters


Set the velocity after the home proximity input turns ON 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 acceler-
ation.

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-9


8 Homing

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 Input Mask Distance


Set the home input mask distance in command units when you set Homing Operation Mode 9 (proxim-
ity reverse turn/home input mask distance). This is the distance from when the home proximity input
signal (i.e., from when deceleration starts) until home is defined.
Home input detection direction

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 to the battery-backup
memory in the CPU Unit.

8-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

Homing Holding Time


Set the holding time when you set homing operation mode 12 (proximity reverse turn/holding time).
This is the time from when the home proximity input signal (i.e., from when deceleration starts) until
home is defined.
Home input detection direction

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
Positive direction
direction Start Stops.

Homing velocity

Torque limit
Torque limit is continued even
Command torque from previous operation after the set time elapses.

8-2 Homing Procedure


Homing Compensation Value
After home is defined, relative positioning is performed at the set value to adjust the position of home.
This homing compensation is performed at the homing compensation velocity.
Adjusting the workpiece is sometimes difficult after home is defined. The homing compensation can be
used to fine-tune the position of home after it is determined. This is useful when you cannot easily
replace the home proximity sensor or when home has moved after a motor replacement.
8
Homing Compensation Velocity

8-2-1 Setting Homing Parameters


If you set a homing compensation value, set the velocity to use for the compensation in command units
per second (command units/s).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-11


8 Homing

8-2-2 Monitoring the Homing Operation


You can read Axis Variables in the user program to monitor the homing status and the input signal sta-
tus.
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].Status.Homing BOOL Homing TRUE when homing for the MC_Home or
MC_HomeWithParameter instruction.
_MC_AX[0-255].Dtails.Homed BOOL Home TRUE when home is defined.
Defined FALSE: Home not defined.
TRUE: Home is defined
_MC_AX[0-255].Dtails.InHome BOOL In Home TRUE when the axis is in the range for home. It
Position gives an AND of the following conditions.
Home defined.
Actual current position is within the zero position
range of home. 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 TRUE when the positive limit input is enabled.
Limit Input
_MC_AX[0-255].DrvStatus.N_OT BOOL Negative TRUE when the negative limit input is enabled.
Limit Input
_MC_AX[0-255].DrvSta- BOOL Home Prox- TRUE when the home proximity input is enabled.
tus.HomeSw imity Input
_MC_AX[0-255].DrvStatus.Home BOOL Home Input TRUE when the home input is enabled.

8-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

8-3 Homing Operation


Select the home definition method based on the configuration of the positioning system and its pur-
pose. There are 10 Homing Operation Modes supported by the MC Function Module. You can also fine-
tune the home that is detected with a homing compensation value.

Additional Information

• The most suitable mode depends on the configuration of the positioning system and the appli-
cation. 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).

8-3 Homing Operation


8

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-13


8 Homing

8-4 Homing with an Absolute Encoder


This section describes how to use an OMRON 1S-series Servomotor/Servo Drive with built-in Ether-
CAT communications.
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.

Motor (absolute encoder)


CPU Unit MC_Power executed.
Servo Drive
M
Battery-free backup
Absolute data

Battery

Precautions for Correct Use


• If you use an OMRON 1S-series Servo Drive, connect a battery to the CPU Unit.
• If you use an absolute encoder of an OMRON G5-series Servo Drive, connect a battery to the
CPU Unit and an absolute encoder backup battery to 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 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 pre-
viously mentioned step.
• If there is an error for the Battery in the CPU Unit when the power supply to the Controller is
turned ON, an Absolute Encoder Home Offset Read Error (event code:14600000 hex) occurs.
You can use the ResetMCError instruction to reset the error and turn ON the Servo.
For a CPU Unit with unit version 1.09 or earlier, when the error is reset and the Servo is turned
ON, home is defined with an absolute encoder home offset value of 0.
For a CPU Unit with unit version 1.10 or later, home will be left undefined until it is defined by
the MC_Home or MC_HomeWithParameter instruction executed after error reset.
In order to operate with correct positions, execute the MC_Home or MC_HomeWithParameter
instruction to define the correct home position. If the power supply to the Controller is turned
OFF, home will become undefined.

8-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

Additional Information

If you use an OMRON G5-series Linear Motor Type Servomotor/Servo Drive with built-in Ether-
CAT communications, you can set the absolute encoder home position. If you use a Linear
Motor Type, observe the following points when reading this section.
• A Linear Motor Type does not use an encoder. It uses an external scale, which functions in a
similar way.
• “Absolute encoder” in this section means “absolute external scale” for a Linear Motor Type.
• An absolute external scale does not have the rotation data of an absolute encoder. Any rota-
tion data setting procedures that are required for an absolute encoder and not required. A bat-
tery to back up the rotation data is also not required.
• Refer to the G5-series AC Servomotors/Servo Drives with Built-in EtherCAT Communications
Linear Motor Type User’s Manual (Cat. No. I577) for the specifications of Linear Motor Type.

8-4-1 Outline of Function


To define home with an absolute encoder system, the absolute encoder offset compensation is per-
formed when the MC_Power (Power Servo) instruction is executed.

8-4 Homing with an Absolute Encoder


For a CPU Unit with unit version 1.10 or later, home is also defined when EtherCAT process data com-
munications change from a non-established to an established state, in addition to the previously men-
tioned step.
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 to the battery-backup memory in the CPU Unit as the abso-
lute encoder home offset.
The absolute encoder home offset is also set to the difference (i.e., the offset) between the command
position after defining home and the absolute value when the MC_Home or MC_HomeWithParameter
instruction is executed. The MC Function Module automatically saves the absolute encoder home off-
set to the battery-backup memory in the CPU Unit. You do not have to perform a save operation from
the Sysmac Studio.

Precautions for Correct Use 8


• When absolute encoders are used, the absolute encoder home offset for each axis is saved to
the battery-backup memory along with the axis number. The saved offset is lost if the axis

8-4-1 Outline of Function


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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-15


8 Homing

Applicable Servomotors
The following table lists the Servomotors that use the absolute encoder home setting.
Manufacturer Series Servo Drive Servomotor
OMRON 1S Series R88D-1SN-ECT R88M-1S
R88M-1T
R88M-1C
G5 Series R88D-KN-ECT R88M-KS
R88M-KT
R88M-KC
R88D-KN-ECT-L R88L-EC

Precautions for Correct Use


You cannot use this absolute encoder for an NX-series Pulse Output Unit.

Connecting the Servo Drive


Connect the Servo Drive correctly according to information in the NJ/NX-series CPU Unit Built-in Ether-
CAT Port User’s Manual (Cat. No. W505).

8-4-2 Setting Procedure


This section describes the procedure to set the home of an absolute encoder system.

1 Absolute Encoder Setup


Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for the setup proce-
dures.

2 Setting Axis Parameters


Set the Encoder Type in the Position Count Settings of the axis parameters in the MC Function
Module to 1 (absolute encoder (ABS)). For details, refer to 5-2-7 Position Count Settings.

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 automatically saved to the battery-
backup memory in the CPU Unit as the absolute encoder home offset.

Absolute Encoder Setup


The absolute encoder must be set up the first time it is used, to initialize the rotation data to 0, when the
absolute encoder is stored for an extended period of time without a battery connected, etc.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for detailed setup proce-
dures.

8-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


8 Homing

Precautions for Correct Use


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 com-
pleted, 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 pro-
cedure.

Using an Absolute Encoder in Rotary Mode


If you set the Count Mode axis parameter to Rotary Mode, the actual position will be a ring-shaped
counter in the range between the modulo maximum position setting value and the modulo minimum
position setting value. When using an absolute encoder in Rotary Mode, the absolute encoder home
offset is automatically calculated and updated in the MC Function Module each motion control period.
The updated absolute encoder home offset is automatically saved to the battery-backup memory in the
CPU Unit when the power supply to the Controller 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.

8-4 Homing with an Absolute Encoder


8

8-4-2 Setting Procedure

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 8-17


8 Homing

8-5 High-speed Homing


This function performs quick positioning to the home. Home is defined in advance. Use the
MC_MoveZeroPosition (High-speed Homing) instruction and specify the target velocity, acceleration
rate, deceleration rate, and jerk. If you execute this instruction when home is not defined an instruction
error will occur.
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).

8-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Motion Control Functions
This section describes the motion control functions that are used when connected to
OMRON 1S-series Servo Drives with built-in EtherCAT communications.

9-1 Single-axis Position Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3


9-1-1 Outline of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9-1-2 Absolute Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
9-1-3 Relative Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
9-1-4 Interrupt Feeding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
9-1-5 Cyclic Synchronous Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
9-1-6 Stopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
9-1-7 Override Factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
9-2 Single-axis Synchronized Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
9-2-1 Overview of Synchronized Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
9-2-2 Gear Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
9-2-3 Positioning Gear Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
9-2-4 Cam Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
9-2-5 Cam Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
9-2-6 Synchronous Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24 9
9-2-7 Combining Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
9-2-8 Master Axis Phase Shift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26
9-2-9 Slave Axis Position Compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26
9-2-10 Achieving Synchronized Control in Multi-motion . . . . . . . . . . . . . . . . . . . . . . 9-27
9-3 Single-axis Velocity Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-29
9-3-1 Velocity Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-29
9-3-2 Cyclic Synchronous Velocity Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-30
9-4 Single-axis Torque Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-31
9-5 Common Functions for Single-axis Control . . . . . . . . . . . . . . . . . . . . . . . 9-32
9-5-1 Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32
9-5-2 Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-34
9-5-3 Acceleration and Deceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-35
9-5-4 Jerk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-37
9-5-5 Specifying the Operation Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-38
9-5-6 Re-executing Motion Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-42
9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode) . . . . . . . . . . . . 9-47

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-1


9 Motion Control Functions

9-6 Multi-axes Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-53


9-6-1 Outline of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-53
9-6-2 Linear Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-56
9-6-3 Circular Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-57
9-6-4 Axes Group Cyclic Synchronous Positioning . . . . . . . . . . . . . . . . . . . . . . . . . 9-57
9-6-5 Stopping Under Multi-axes Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . 9-58
9-6-6 Overrides for Multi-axes Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . . . 9-59
9-7 Common Functions for Multi-axes Coordinated Control . . . . . . . . . . . . . 9-61
9-7-1 Velocity Under Multi-axes Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . . 9-61
9-7-2 Acceleration and Deceleration Under Multi-axes Coordinated Control . . . . . . 9-62
9-7-3 Jerk for Multi-axes Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-63
9-7-4 Re-executing Motion Control Instructions for Multi-axes
Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-64
9-7-5 Multi-execution (Buffer Mode) of Motion Control Instructions for Multi-axes
Coordinated Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-65
9-8 Other Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-73
9-8-1 Changing the Current Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-73
9-8-2 Torque Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-74
9-8-3 Latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-74
9-8-4 Zone Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-75
9-8-5 Software Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-76
9-8-6 Following Error Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-77
9-8-7 Following Error Counter Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-78
9-8-8 Axis Following Error Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-78
9-8-9 In-position Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-79
9-8-10 Changing Axis Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-81
9-8-11 Enabling Digital Cam Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-81
9-8-12 Displaying 3D Motion Monitor for User Coordinate System . . . . . . . . . . . . . . 9-82

9-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-1 Single-axis Position Control


The MC Function Module can be connected to OMRON 1S-series Servo Drives with built-in EtherCAT
communications or G5-series Servo Drives with built-in EtherCAT communications to implement posi-
tion control, velocity control, and torque control. This section describes positioning operation for single
axes.
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.

9-1-1 Outline of Operation


The single-axis control function of the MC Function Module consists of control for motion profile com-
mands and synchronized control. There are three Control Modes for motion profile commands: position
control, velocity control, and torque control. In synchronized control, the slave axis (i.e., the axis being
controlled) operates in a synchronized relationship to the master axis, as expressed by a cam profile
curve or a gear ratio. Manual operations such as jogging and homing are also supported.

EtherCAT Feedback Commands EtherCAT


slave Synchronization slave
processing
+ Command
Actual Phasing position Output
Input Position processing
position

9-1 Single-axis Position Control


Velocity processing
Command
velocity

Torque processing
Command
torque

External I/O processing for EtherCAT slave External


input output

Note You can use the command position or actual position as the input to the synchronization processing.
9
Resetting Axis Errors 9-1-1 Outline of Operation

If an error occurs in an axis, you can use the MC_Reset instruction to remove the error once you have
eliminated the cause.
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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-3


9 Motion Control Functions

9-1-2 Absolute Positioning


Absolute positioning specifies the absolute coordinates of the target position in relation to home. You
can perform positioning, such as shortest way positioning on a rotary table, by setting the Count Mode
to Rotary Mode and specifying the operation direction.
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).

9-1-3 Relative Positioning


Relative positioning specifies the distance from the actual position. You can specify a travel distance
that exceeds the ring counter range by setting the Count Mode to Rotary Mode.
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).

9-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-1-4 Interrupt Feeding


Interrupt feeding feeds the axis at the specified velocity and for the specified distance from the actual
position when a trigger signal occurs.
You can also select to output an error if the trigger signal does not occur within the specified travel dis-
tance when you specify either absolute or relative positioning.
Feeding is not affected by following error. This is achieved by using the latch function of the Servo Drive
to determine the actual position when the trigger signal occurs. You can also use the window function to
disable trigger signals that occur outside of a specified position range. For applications such as wrap-
ping machines, this enables feeding only on trigger signals for printed marks on films and eliminates
other influences.

Motion Relative to the Actual Position


 Feeding for a Specified Distance in the Moving Direction
Velocity
Interrupt input
Actual Position
Relative positioning, The figure on the left shows that there is a follow
absolute positioning, Specified travel delay in relation to the command position.
or velocity control distance

9-1 Single-axis Position Control


Command position
Relative positioning,
absolute positioning,
or velocity control

When the interrupt input occurs, the specified travel distance is


added to the actual position and used as the target position for
the command position.

 Feeding for a Specified Distance in the Direction Opposite to the Moving


Direction

Velocity 9
Interrupt input 9-1-4 Interrupt Feeding

Actual Position
Relative positioning, The figure on the l
absolute positioning, delay in relation to
or velocity control

Specified travel
distance

Relative positioning, Command position


absolute positioning,
or velocity control

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-5


9 Motion Control Functions

For details, refer to the MC_MoveFeed (Interrupt Feeding) instruction in the NJ/NX-series Motion Con-
trol 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-1-5 Cyclic Synchronous Positioning


Cyclic synchronous positioning is used to output a target position to a specified axis each control period
in the primary periodic task or a periodic task. The target position is specified as an absolute position.
You can use it to move in a specific path that you create.
Command position Command Servo
Position
position Drive
Target positions (black dots)
specified with the input M
parameters

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 required
to use cyclic synchronous positioning.

9-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

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.

Stopping for Servo Drive Input Signals


Axis motion is stopped for the immediate stop input signal or a limit input signal from the Servo Drive.
You can select the stop method with the Sysmac Studio.

 Immediate Stop Input


Stop processing in the MC Function Module is executed according to the state of the Servo Drive
input signals. You can select one of the following stopping methods for the MC Function Module.
• Immediate stop
• Immediate stop and error reset
• Immediate stop and Servo OFF

Precautions for Correct Use


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.

9-1 Single-axis Position Control


 Limit Inputs (Positive Limit Input or Negative Limit Input)
Stop processing in the MC Function Module is executed according to the state of the Servo Drive
input signals. You can select one of the following stopping methods for the MC Function Module.
• Immediate stop
• Deceleration stop
• Immediate stop and error reset
• Immediate stop and Servo OFF

9
Precautions for Correct Use
• If a limit input signal turns ON, do not execute an instruction for axis command of the axis in
9-1-6 Stopping

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
instruction that has a Deceleration input variable, the axis decelerates to a stop at the deceler-
ation rate given by Deceleration.
• If the signal to decelerate to a stop is input during execution of a synchronous movement
instruction 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-7


9 Motion Control Functions

Additional Information

• You must set up the Servo Drive in order to use the input signals from the Servo Drive. An
OMRON 1S-series Servo Drive with built-in EtherCAT communications or G5-series Servo
Drive with built-in EtherCAT communications has an immediate stop input and limit input
assigned in its default settings.
• Refer to A-1 Connecting the 1S-series Servo Drive for setting examples for connection to an
OMRON 1S-series Servo Drive.
• Refer to A-2 Connecting the G5-series Servo Drive for setting examples for connection to an
OMRON G5-series Servo Drive.

Stopping with Motion Control Instructions


Use the MC_Stop or MC_ImmediateStop instruction to stop single-axis operation.

 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.
For details, refer to the MC_Stop and MC_ImmediateStop instructions in the NJ/NX-series Motion Con-
trol Instructions Reference Manual (Cat. No. W508).

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 Servo Drive.

Stopping Due to Errors or Other Problems


 Stopping for Errors during Single-axis Operation
When an error occurs during single-axis operation, the axis will stop immediately or decelerate to a
stop depending on the error. Refer to 11-2-2 Error Descriptions for details on the stop method for
each error.

 Stopping for a Software Limit


To stop for a software limit, set the Software Limits axis parameter. You can select from the following
stop methods for the software limits.
• Enabled for command position. Decelerate to a stop.
• Enabled for command position. Immediate stop.
• Enabled for actual position. Decelerate to a stop.
• Enabled for actual position. Immediate stop.
Refer to 9-8-5 Software Limits for details on software limits.

9-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Stopping Due to Motion Control Period Exceeded Error


If motion control processing does not end within two periods, a Motion Control Period Exceeded
error occurs. All axes stop immediately.

Precautions for Correct Use


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 error occurs in either of the tasks.
Refer to A-6-2 Motion Control for multi-motion.

 Errors That Cause the Servo to Turn OFF


An immediate stop is performed if an error occurs that causes the Servo to turn OFF. When the
Servo is turned OFF, the Servo Drive will operate according to the settings in the Servo Drive.

 Stopping Due to Start of MC Test Run


All axes will decelerate to a stop at their maximum deceleration if a MC Test Run is started from the
Sysmac Studio.

 Stopping Due to End of MC Test Run


All axes will decelerate to a stop at their maximum deceleration if a MC Test Run is stopped from the
Sysmac Studio.
• 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.

9-1 Single-axis Position Control


 Stopping Due to Change in CPU Unit Operating Mode
All axes will decelerate to a stop at their maximum deceleration if the CPU Unit operating mode
changes.

Precautions for Correct Use


• If an error that results in deceleration to a stop occurs during execution of a synchronous
movement instruction that has a Deceleration input variable, the axis decelerates to a stop at
the deceleration rate given by Deceleration.
• If an error that results in deceleration to a stop occurs during execution of a synchronous 9
movement instruction 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. 9-1-6 Stopping

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 remains ON 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
control instructions are cleared. The CommandAborted output variables from the motion con-
trol instructions therefore remain FALSE.
• 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-9


9 Motion Control Functions

Stop Method
• Deceleration Stop
Velocity

Axis stops at the deceleration rate that


is specified for the instruction or at the
maximum deceleration rate.

Time
• Immediate Stop
Velocity

The command is no longer updated. The


axis moves only for the pulses remaining in
the Servo Drive and then stops. The stop
position is the command position when the
cause of the immediate stop occurred.

Time
• Immediate Stop and Error Reset
Velocity

The actual position when the cause of the


immediate stop occurred is used as the
command position. Inertia will take the axis
past this position, but it will return to the
actual position when the cause of the
immediate stop occurred and stop there.

Time
• Immediate Stop and Servo OFF
Velocity

The command is no longer updated. When


the Servo is turned OFF, the axis stops using
the method that is specified by the Disable
Operation Option Code (object 605C hex)
that is set in the Servo Drive.

Time

9-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

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

Immediate stop input

Command velocity

9-1 Single-axis Position Control


9
9-1-6 Stopping

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-11


9 Motion Control Functions

9-1-7 Override Factors


You can use the MC_SetOverride instruction to set override factors for the motion of the axes that are
currently in motion. The velocity override factor is set as a percentage of the target velocity. It can be set
between 0% and 500%. If an override factor of 0% is set for the target velocity, operating status will con-
tinue with the axis stopped as a velocity of 0. 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.

 Overriding the MC_MoveAbsolute Instruction


An example of a time chart for using the Set Override Factors instruction for the MC_MoveAbsolute
(Absolute Positioning) instruction is given below.
Previous Instruction: MC_MoveAbsolute

Execute

Busy

Active

Done

CommandAborted

Current Instruction

Enable

Enabled

Busy

VelFactor 100 200 50

Velocity
Override factor: 200%

Override factor: 100%

Override factor: 50%

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

9-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-2 Single-axis Synchronized Control


This section describes the operation of synchronized control for single axes.

9-2-1 Overview of Synchronized Control


Synchronous control synchronizes the position of a slave axis with the position of a master axis. The
command position or actual position of any axis can be specified for the master axis. If the command
velocity for the slave axis exceeds the maximum velocity that is set in the axis parameters, the com-
mand is performed at the maximum velocity of the axis. If this occurs, any insufficient travel distance is
distributed and output in the following periods.

Precautions for Correct Use


• 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 synchro-
nized control instructions such as the MC_GearIn (Start Gear Operation) instruction or the
MC_Camin (Start Cam Operation) instruction, an Illegal Master Axis Specification (event
code: 54620000 hex) occurs.

9-2 Single-axis Synchronized Control


Refer to 9-2-10 Achieving Synchronized Control in Multi-motion if you desire to specify the
master axis in a different task from the slave axis.

9-2-2 Gear Operation


This function specifies the gear ratio between the master axis and the slave axis and starts operation.
Start gear operation with the MC_GearIn (Start Gear Operation) instruction. End synchronization with
the MC_GearOut (End Gear Operation) instruction or the MC_Stop instruction.

Specify with
Master_Reference.
Gear Operation
Numerator
9
Actual position Command position
Denominator 9-2-1 Overview of Synchronized Control

Remainder
Command position

Most recent command


position

You can set the gear ratio numerator, gear ratio denominator, position type, acceleration rate, and
deceleration 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 tar-
get 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-13


9 Motion Control Functions

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 Man-
ual (Cat. No. W508).

9-2-3 Positioning Gear Operation


This function specifies the gear ratio between the master axis and the slave axis and starts operation.
Positioning gear operation allows you to set the positions of the master and slave axes at which to start
synchronization. Start positioning gear operation with the MC_GearInPos instruction. End synchroniza-
tion with the MC_GearOut instruction or the MC_Stop instruction.

Specify with
ReferenceType.
Gear Operation
Numerator
Actual position Command position
Denominator

Remainder
Command position

Most recent command


position

You can set the gear ratio numerator, gear ratio denominator, position type, acceleration rate, and
deceleration 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 tar-
get 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

Travel distance of slave axis


RatioNumerator
= Travel distance of master axis ×
RatioDenominator

Slave

Execute Time
For details on positioning gear operation, refer to the MC_GearInPos (Positioning Gear Operation), the
MC_GearOut (End Gear Operation), and the MC_Stop instructions in the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No. W508).

9-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-2-4 Cam Operation


Cam operation synchronizes the position of the slave axis with the master axis according to a cam
table. Start cam operation with the MC_CamIn (Start Cam Operation) instruction. End cam operation
with the MC_CamOut (End Cam Operation) instruction or the MC_Stop instruction. Create a cam table
using the Cam Editor in the Sysmac Studio and download it to the CPU Unit. Use the Synchronization
menu command of the Sysmac Studio to download the project to the CPU Unit.

Specify with
ReferenceType.
Cam Operation

Cam
Actual position processing Command position

Command position

Most recent command


position

Cam table
Phase Displacement
Cam Operation 0.0 0.0 Cam
start point
Master axis Displacement 0.1 10.0
Cam Profile Curve 0.2 50.0

9-2 Single-axis Synchronized Control


Phase Number of valid cam data
Displacement
359.8 100.0
359.9 50.0 Maximum number
Slave 360.0 0.0 Cam of cam data
axis 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 higher,
the following operation is possible: if another MC_CamIn (Start Cam Operation) instruction is executed
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 table 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 Man- 9
ual (Cat. No. W508).
For details on the Cam Editor, refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504).
9-2-4 Cam Operation

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-15


9 Motion Control Functions

9-2-5 Cam Tables


This section describes the cam tables that are used for cam operation.

Cam Table Terminology

Term Description
cam operation An operation that takes one master axis and one slave axis and follows the cam profile
curve to derive the displacement of the slave axis from the phase of the master axis.
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. 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 trapecloid.
cam data Data made up of phases (master axis) and displacements (slave axis) for cam opera-
tion.
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.
cam start point The first point in the cam data.
cam end point The last point of valid cam data in the cam data. If the cam end point is less than the
number of cam data, all phases and displacements after the cam end point will be 0.
cam block start point The start point for a cam block. It is the same as the cam start point at the start of the
cam operation. If the cam profile curve continues, this will be the same as the cam
block end point.
cam block end point The end point for a cam block. It is the same as the cam end point at the end of the
cam operation. If the cam profile curve continues, this will be the same as the cam
block start point. The cam block end point is defined as (horizontal axis, vertical axis)
= (phase end point, displacement end point).
original cam data Cam data that is created by dividing up the cam profile curve in the Cam Editor.
program-modified cam The cam data changed by the user program while the CPU Unit is in operation.
data
master axis The axis that serves as the input to the cam operation. You can specify either Linear
Mode or Rotary Mode.
slave axis The axis that serves as the output from the cam operation. You can specify either Lin-
ear Mode or Rotary Mode.
phase The relative distance on the master axis from the start point of the cam table.
displacement The relative distance on the slave axis from the master following distance.
valid cam data The cam data other than the cam start point and other than data where the phase is 0.
invalid cam data The cam data other than the cam start point where the phase is 0.
number of valid cam data The number of sets of cam data.
maximum number of The maximum number of sets of cam data that the cam table can contain.
cam data
cam data index The number of the cam data that is executed.

9-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Term Description
cam table start position The absolute position of the master axis that corresponds to the cam start point
(phase = 0).
master following dis- The master start distance where the slave axis starts cam operation represented as
tance 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 absolute
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

End point displacement


for block 1
End point for block 1
Start point for block 2

9-2 Single-axis Synchronized Control


Block 1 Block 2
End point
Cam start point displacement
Cam end point for block 2
(block start point)
(block start point)

End phase for block 1 End phase for block 2


Phase

9
9-2-5 Cam Tables

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-17


9 Motion Control Functions

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 adja-
cent 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.
1 cycle Command position during
cam operation
Cam table
350 The phase is calculated from the master
Phase Displacement Cam data index axis position each cycle. The linear
300 interpolation of cam data is used to
Cam start point 0 0 0 calculate the displacement from the phase.
250 (These are the red dots on the line.)
Cam data 60 200 1
200
120 100 2 Displacement
150
180 300 3
100
240 100 4
50
300 200 5
0
Cam end point 360 0 6 0 60 120 180 240 300 360
Phase
Cam data (black dots on the line).

Precautions for Correct Use


• 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
use the cam data variable for motion control instructions in a task that does not control the
variable. An Incorrect Cam Table Specification (event code: 54390000 hex) will occur.

9-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Cam Table Specifications

Item Description
Maximum number of cam data per 65,535 points
cam table
Maximum size of all cam data 1,048,560 points*1
Maximum number of cam tables 640 tables*2
Switching cam operation You can switch to a different cam operation by executing a motion control
instruction
Changing cam data Cam data can be edited from the user program.
Cam data can be overwritten with the Generate Cam Table instruction.*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 • When the data is downloaded from the Sysmac Studio
memory • 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° allows
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.

9-2 Single-axis Synchronized Control


*4 Use the Synchronization menu command of the Sysmac Studio to upload and download the project.

Data Type of Cam Tables


A cam table is declared as an array of cam data structures. The type declaration for the cam data struc-
ture is shown below.

TYPE
(*Cam data structure*)
_sMC_CAM_REF :
STRUCT
Phase : REAL; (*Phase*)
Distance : REAL; (*Displacement*) 9
END_STRUCT;
END_TYPE
9-2-5 Cam Tables

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-19


9 Motion Control Functions

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.

Switching Cam Tables


You can switch cam tables by re-executing the cam operation instruction during cam operation. After
switching, cam operation will be performed with the cam table you specified for re-execution of the
instruction. The EndOfProfile and Index output variables from the MC_CamIn instruction are output
according to the new cam table.
Slave Displacement Cam table 1 Cam table 2
(Slave axis)

Re-executed Master Phase


(Master axis)

Precautions for Correct Use


• 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 tim-
ing for switching the cam table to avoid excessive velocity discontinuity.

Loading/Saving Cam Data and Saving Cam Tables


Cam data can be loaded and saved from the user program just like any other variables. For example,
you can use MyCam1[0].Phase to specify the phase and MyCam1[0].Distance to specify the displace-
ment in the first array elements of a cam table named MyCam1. Cam data overwritten from the user
program can be saved to the non-volatile memory in the CPU Unit as a cam table by executing the
MC_SaveCamTable instruction.

Precautions for Correct Use


• Overwritten cam data will be lost if the CPU Unit is turned OFF or the cam data is downloaded
from the Sysmac Studio before the Save Cam Table instruction is executed or if the instruction
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.
• Cam data saved to non-volatile memory can be loaded by using the upload function of the
Sysmac Studio.
• 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).

9-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Updating Cam Table Properties


The MC Function Module must identify the cam end point of the cam table. If an overwrite is performed
from the user program during cam operation and the number of valid cam data changes, you must
update the number of valid cam data to the latest value. Use the MC_SetCamTableProperty instruction
for this.
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.
Cam data structure array Phase Displacement
MyCam1 [0] 0 0 Cam start point
. . .
. . .
. . . Valid data
MyCam1 [997] 359.8 2
MyCam1 [998] 359.9 1 Maximum number of data: 5,000
MyCam1 [999] 360.0 0 Cam end point
MyCam1 [1000] 0 0
. . .
. . .

9-2 Single-axis Synchronized Control


Invalid data
. . .
MyCam1 [4999] 0 0

Precautions for Correct Use


• 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 9
(Cat. No. W508).
9-2-5 Cam Tables

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-21


9 Motion Control Functions

Generate Cam Table


With a CPU Unit with unit version of 1.08 or later and the Sysmac Studio version 1.09 or higher, you can
generate the cam table by executing the MC_GenerateCamTable (Generate Cam Table) instruction.
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 Index).
It is not necessary to execute the MC_SetCamTableProperty (Set Cam Table Properties) instruction after
the MC_GenerateCamTable instruction is completed.

Cam table Cam table


before instruction execution after instruction execution
Element Phase Displacement The cam data is Element Phase Displacement
numbers numbers
calculated and written to
0 0.0 0.0 0 0.0 0.0
the table when the
1 0.0 0.0 instruction is executed. 1 1.0 1.0
... ... ... ... ... ...
179 0.0 0.0 179 179.0 199.0
180 0.0 0.0 Cam end point 180 180.0 200.0
181 0.0 0.0 181 0.0 0.0
... ... ... ... ... ...

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

The cam data variable is an array variable with the data type of cam data structure _sMC_CAM_REF.
You create the cam data variable on the Cam Editor of the Sysmac Studio.
For CamProperty, specify the cam property variable. The cam property variable is an array variable with
the data type of cam property structure _sMC_CAM_PROPERTY. You create the cam property variable
as a user-defined variable on the global variable table of the Sysmac Studio. Or, you create the variable
using the cam data settings on the Sysmac Studio.
For CamNodes, specify the cam node variable. The cam node variable is an array variable with the data
type of cam node structure _sMC_CAM_NODE. You create the cam node variable as a user-defined
variable on the global variable table of the Sysmac Studio. Or, you create the variable using the cam
data settings on the Sysmac Studio.
The cam property variable and the cam node variable are collectively called “cam definition variable”.
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.

9-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

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.

1 Create a user program, in advance, that includes the following processing.


• Assigning the value of the cam definition variable that is set from the HMI to the Generate
Cam Table instruction.
• Displaying the cam variable that is created by the Generate Cam Table instruction graphically
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.

3 Execute the Generate Cam Table instruction.

4 Verify the curve shape of the generated cam table and the value of the end point index displayed
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 vari-
able.

7 Repeat steps 2 to 6.

9-2 Single-axis Synchronized Control


For details on the cam definition variable and the Generate Cam Table instruction, refer to the MC_Gen-
erateCamTable 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-E1-10 or later) for information
on creating and transferring the cam definition variables using the Sysmac Studio.

9
9-2-5 Cam Tables

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-23


9 Motion Control Functions

9-2-6 Synchronous Positioning


This function performs positioning using a trapezoidal curve while synchronizing the specified slave
axis to the specified master axis. This is a type of electronic cam, but it does not use cam tables created
in the Cam Editor. Operation starts when the MC_MoveLink (Synchronous Positioning) instruction is
executed. Use the MC_Stop instruction to stop the axes in motion. Operation is performed for the Slave
(Slave Axis) and the following are set: Master (Master Axis), MasterDistance (Master Axis Travel Dis-
tance), MasterDistanceInACC (Master Distance In Acceleration), MasterDistanceInDEC (Master Dis-
tance In Deceleration), SlaveDistance (Slave Axis Travel Distance), and MasterStartDistance (Master
Following Distance). The command position or actual position can be specified for the master axis. You
can specify one of the following as the start condition for synchronous operation: start of instruction,
when trigger is detected, or when master axis reaches the master following distance.
The velocity and position of the slave axis are determined by the ratio of the travel distances of the mas-
ter axis and the slave axis as shown in the following figure. The sync start position shown in the follow-
ing figure represents the position where the sync start condition is met.
Master axis position

MasterDistanceInDEC

MasterDistance
Master
Following MasterDistanceInACC
Distance

Time
Slave axis position

SlaveDistance

Time
Slave axis velocity

Time
For details on synchronous positioning, refer to the MC_MoveLink (Synchronous Positioning) and
MC_Stop instructions in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No.
W508).

9-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-2-7 Combining Axes


The sum or difference of two positions can be used as the command position for the slave axis. Opera-
tion starts when the MC_CombineAxes instruction is executed. Use the MC_Stop instruction to stop
axes in motion.
The following figure is an example demonstrating operation when subtracting axes. Slave (Slave Axis)
command current position = Master (Master Axis) command current position − Auxiliary (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

9-2 Single-axis Synchronized Control


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

9
9-2-7 Combining Axes

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-25


9 Motion Control Functions

9-2-8 Master Axis Phase Shift


The phase of the master axis as viewed from the slave axis can be shifted for the current instruction.
The shift amount as viewed from the slave axis is a relative amount. During synchronization, the slave
axis will synchronize to the relative distance of the master axis. You can execute the MC_Phasing (Shift
Master Axis Phase) instruction to shift the phase for a synchronized control instruction.
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

Master axis position Actual master


as viewed from the axis position
slave axis

Master axis velocity Time


as viewed from the
slave axis

Slave axis position Time


Slave axis
position when
phase offset is 0

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) instruction
in the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).

9-2-9 Slave Axis Position Compensation


This function compensates the position of the slave axis currently in synchronized control.
An offset calculated from the value of the input variable is added to the command current position. The
result is output to the Servo Drive to compensate the position of the slave axis in synchronized control.
Even when the MC Function Module commands the same travel distance to two axes, their actual travel
distance may be different due to mechanical strain or other factors. This function can perform compen-
sation in such a case.
To perform position compensation for the slave axis in synchronized control, execute the MC_SyncOff-
setPosition (Cyclic Synchronous Position Offset Compensation) instruction.

9-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

For details on slave axis position compensation, refer to the MC_SyncOffsetPosition (Cyclic Synchro-
nous Position Offset Compensation) instruction in the NJ/NX-series Motion Control Instructions Refer-
ence Manual (Cat. No. W508).

9-2-10 Achieving Synchronized Control in Multi-motion


When you use the standard functions of the MC Function Module, if the synchronized control instruc-
tions are executed between axes assigned to different tasks in the multi-motion, an Illegal Master Axis
Specification (event code: 54620000 hex) occurs.
However, you can perform synchronized control of the master axis that is controlled in the primary peri-
odic task and the slave axis that is controlled in the priority-5 periodic task by using the MC_Period-
icSyncVariables (Periodic Axis Variable Synchronization between Tasks) instruction.

The cam operation and gear operation synchronized with the master axis and slave axis are available
for the following combinations.

Slave axis task


Mster axis task
Primary periodic task Priority-5 periodic task
Primray periodic task Synchronized by motion control Synchronized control is achieved by
instructions executing the
MC_PeriodicSyncVariables
(Periodic Axis Variable
Synchronization between Tasks)

9-2 Single-axis Synchronized Control


instruction and using the virtual
master axis in the priority-5 periodic
task.
Priority-5 periodic task Not available. Synchronized by motion control
instructions

Axis Composition in Operation Examples


In the following figure, axis 1 is the master axis. Axis 2 is a slave axis that requires high-speed and high-
precision control. It is assigned to the primary periodic task. Axis 3 is a slave axis that does not require
precision. It is assigned to a priority-5 periodic task. The master axis (axis 1) is assigned to the primary
periodic task.
9
 Physical Axis Composition
9-2-10 Achieving Synchronized Control in Multi-motion

Axis 1

1:2 2:3

Axis 2 Axis 3

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-27


9 Motion Control Functions

 Logical Axis Composition

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
:

Axis 3
Slave axis

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 details on
the MC_PeriodicSyncVariables (Periodic Axis Variable Synchronization between Tasks) instruction.

9-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-3 Single-axis Velocity Control


This section describes the operation of velocity control for single axes.
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-3-1 Velocity Control


Velocity control is used to constantly move an axis at the specified velocity. You can also specify the
acceleration rate, deceleration rate, and jerk. 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 moving. If any other motion control instruction is executed with multi-execution of
instructions during velocity control, the operation will switch only after reaching the target velocity.
Execute

Busy

Active

InVelocity

CommandAborted

9-3 Single-axis Velocity Control


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 tar-
get position commands to achieve the specified target velocity. 9
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
9-3-1 Velocity Control

to eliminate this following error.


For details, refer to the MC_MoveVelocity (Velocity Control) instruction in the NJ/NX-series Motion Con-
trol Instructions Reference Manual (Cat. No. W508).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-29


9 Motion Control Functions

9-3-2 Cyclic Synchronous Velocity Control


The control mode of the Servo Drive is set to Velocity Control Mode and a command speed is output
every control period. To stop an axis, use the MC_Stop instruction or execute another motion control
instruction. If you specify a target velocity of 0, the axis will not move but the axis status will indicate that
it is moving.
MC_SyncMoveVelocity Instruction
Execute

InVelocity

Busy

Active

CommandAborted

Error

ErrorID 16#0000

MC_Stop Instruction
Execute

Done

Busy

Active

Velocity Deceleration stop


performed for the
MC_Stop instruction.
Target velocity

Time
Target velocity is changed Target velocity is not
every primary period. changed.

Control Mode
CSP CSV CSP CSV

Changed. Changed. Changed.


The Servo Drive will receive commands in the velocity control loop. Therefore, if any disturbance
causes 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).

Precautions for Correct Use


You cannot use cyclic synchronous velocity control for an NX-series Pulse Output Unit.

9-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-4 Single-axis Torque Control


Torque control continuously applies the specified amount of torque. You can use TorqueRamp to spec-
ify the rate of change of the torque until the Torque (Target Torque) is reached. 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.

Precautions for Correct Use


• To be safe, always set a velocity limit value for torque control.
• You cannot use single-axis torque control for an NX-series Pulse Output Unit.

Example 1: Direction Designation = Example 2: Direction Designation =


Positive Direction Negative Direction
Torque Torque

Torque Time

TorqueRamp
TorqueRamp

9-4 Single-axis Torque Control


Time Torque

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 control 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).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-31


9 Motion Control Functions

9-5 Common Functions for Single-axis


Control
This section describes the common functions used for single-axis control.
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.
Type of position Definition
Command position This is the position that the MC Function Module outputs to control an axis.
Actual position The actual position as input from the Servo Drive or encoder input.

The following figure shows the relationship between the command position and the actual position for
an EtherCAT slave Servo Drive.
User program MC Function Module Command position Servo Drive
Electronic (pulses)
Motion Motion Command Command Following M
gear Position loop
control control position position error
instruction processing (command units) In-position check counter counter Velocity loop
Remainder Actual position Current loop
Electronic (pulses)
Actual position
(command units) gear Feedback E
counter
Remainder

The command position and actual position share the following items.
Item Command position Actual position
Count Mode You can set Linear Mode or Rotary The same Count Mode is used as
Mode. for the command position.
Position increment You can set one of the following: The unit is the same as the unit of
mm, μm, nm, inch, degree, or pulse. the command position.
Software limits You can set the range of operation The range is the same as the range
of the software. for the command position.
Changing the current position You can change the actual position This value will be set to the same
to any desired position. position as the command position.*
Defining home Home is either defined or The status of home is the same as
undefined. the command position.

* If there is any following error before the change, the following error value is maintained in the actual position.

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.

9-32 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Axis Parameters That Are Related to Positions


Parameter name Function Setting range Default
In-position Range Set the in-position width. (Unit: command Non-negative long 10
units) reals
In-position Check Set the in-position check time in millisec- 0 to 10,000 0
Time onds. Set 0 to check for the end of position-
ing only when you define the home position
during homing and not check positioning at
other times. (Unit: ms)
Software Limits Select the software limit function. 0 to 4 0
0: Disabled.
1: Deceleration stop for command position
2: Immediate stop for command position
3: Deceleration stop for actual position
4: Immediate stop for actual position
Positive Software Set the software limit in the positive direc- Long reals 2,147,483,647
Limit tion. (Unit: command units)
Negative Software Set the software limit in the negative direc- Long reals −2,147,483,648
Limit tion. (Unit: command units)

9-5 Common Functions for Single-axis Control


Following Error Over Set the excessive following error check Non-negative long 0
Value value. Set 0 to disable the excessive follow- reals
ing error check. (Unit: command units)
Following Error Set the following error warning check value. Non-negative long 0
Warning Value Set 0 to disable the following error warning reals that are less
check. (Unit: command units) than or equal to the
Following Error Over
Value

Specifying Target Positions for Axis Operations


The actual position or distance for a positioning motion is specified with the Position (Target Position)
and Distance (Travel Distance) input variables to the motion control instruction.

Monitoring Positions 9
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
9-5-1 Positions

applies to _MC1_AX[*] and _MC2_AX[*].


Variable name Data type Meaning Function
_MC_AX[0-255].Cmd.Pos LREAL Command Current This is the current value of the command posi-
Position tion. When the Servo is OFF and the mode is
not the position control mode, the actual cur-
rent position is output.
_MC_AX[0-255].Act.Pos LREAL Actual Current Posi- This is the actual current position.
tion

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-33


9 Motion Control Functions

9-5-2 Velocity

Types of Velocities
The following two types of axis velocities are used in the MC Function Module.
Velocity type Definition
Command velocity This is the velocity that the MC Function Module outputs to control an axis.
Actual velocity This is the velocity calculated in the MC Function Module based on the actual posi-
tion input from the Servo Drive or encoder input.*

* This value is given if the Velocity actual value (606C hex) is mapped in the PDOs and assigned to the Actual Cur-
rent Velocity.

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 electronic gear.

Axis Parameters That Are Related to Velocities

Parameter name Function Setting range Default


Maximum Velocity Specify the maximum velocity for the axis. If a Positive long reals 400,000,000
target velocity that exceeds the maximum
velocity is specified for an axis motion instruc-
tion, the axis will move at the maximum veloc-
ity.
Start Velocity*1 Set the start velocity for each axis. Positive long reals 0
Set a value that does not exceed the maximum
velocity.
(Unit: command units/s)
Maximum Jog Velocity Set the maximum jog velocity for each axis.*2 Positive long reals 1,000,000
Set a value that does not exceed the maximum
velocity.
(Unit: command units/s)
Velocity Warning Value Set the percentage of the maximum velocity at 0 to 100 0
which to output a velocity warning for the axis.
No velocity warning is output if 0 is set.
(Unit: %)
Actual Velocity Filter Set the time period to calculate the average 0 to 100 0
Time Constant travel of the actual velocity in milliseconds. The
average travel is not calculated if 0 is set.
(Unit: ms)
Use this to reduce variations in the actual cur-
rent velocity when axis velocity is slow.

*1 A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use this
parameter.
*2 The maximum jog velocity is used as the command velocity if you specify a velocity command value that is
greater than the maximum jog velocity.

9-34 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Specifying Target Velocities for Axis Operations


The velocity used in an actual positioning motion is specified by the Velocity (Target Velocity) input vari-
able to the motion control instruction.

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
applies to _MC1_AX[*] and _MC2_AX[*].
Variable name Data type Meaning Function
_MC_AX[0-255].Cmd.Vel LREAL Command Current This is the current value of the command
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.
_MC_AX[0-255].Act.Vel LREAL Actual Current This is the actual current velocity. A plus
Velocity sign is added during travel in the positive
direction, and a minus sign is added
during travel in the negative direction.

9-5 Common Functions for Single-axis Control


9-5-3 Acceleration and Deceleration

Unit of Acceleration and Deceleration Rates


Acceleration rates and deceleration rates are given in command units/s2. The command unit is the
value obtained from unit conversion of the position display unit and the electronic gear.

Axis Parameters That Are Related to Acceleration and Deceleration


Parameter name Function Setting range Default
Maximum Acceleration Set the maximum acceleration rate for an axis Non-negative long 0
operation command. There will be no limit to reals
the acceleration rate if 0 is set. 9
(Unit: command units/s2)
Maximum Deceleration Set the maximum deceleration rate for an axis Non-negative long 0
9-5-3 Acceleration and Deceleration

operation command. There will be no limit to reals


the deceleration rate if 0 is set.
(Unit: command units/s2)
Acceleration/Decelera- Set the operation for when the maximum accel- 0 to 2 0
tion Over eration/deceleration rate would be exceeded
after excessive acceleration/deceleration
during acceleration/deceleration control of the
axis because stopping at the target position is
given priority.
0: Use rapid acceleration/deceleration. (Blend-
ing is changed to Buffered.) *1
1: Use rapid acceleration/deceleration.
2: Minor fault stop *2

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-35


9 Motion Control Functions

Parameter name Function Setting range Default


Acceleration Warning Set the percentage of the maximum accelera- 0 to 100 0
Value tion rate at which to output an acceleration
warning for the axis. No acceleration warning is
output if 0 is set.
(Unit: %)
Deceleration Warning Set the percentage of the maximum decelera- 0 to 100 0
Value tion rate at which to output a deceleration warn-
ing 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-execu-
tion of Motion Control Instructions (Buffer Mode) 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
operation. Refer to 9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode) for details.

Specifying Acceleration and Deceleration Rates for Axis Operation


The acceleration and deceleration rates used in an actual positioning motions are specified by the
Acceleration (Acceleration Rate) and Deceleration (Deceleration Rate) input variables to the motion
control instruction.

Monitoring Acceleration and Deceleration Rates


You can read Axis Variables in the user program to monitor acceleration and deceleration rates.
In the descriptions, a variable name _MC_AX[*] is used as an example, but the same information
applies to _MC1_AX[*] and _MC2_AX[*].
Variable name Data type Meaning Function
_MC_AX[0-255].Cmd.AccDec LREAL Command Current This is the current value of the com-
Accelera- mand acceleration/deceleration rate.
tion/Deceleration A plus sign is added for acceleration,
and a minus sign is added for decel-
eration.

9-36 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Example of Acceleration/Deceleration Operation


Velocity
Maximum velocity
(2) Target velocity
after velocity
change

(1) Target velocity


at startup

A D
Time
A
Ta1 Ta2 Td

When Starting For Velocity Changes When Decelerating


Ta1: Actual acceleration time Ta2: Actual acceleration time Td: Actual deceleration time
A: Acceleration rate A: Acceleration rate D: Deceleration rate
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 updated acceleration or deceleration rate, positioning is performed at an acceleration or

9-5 Common Functions for Single-axis Control


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 specified,
the velocity waveform during acceleration will be an S-curve, which will reduce the shock and vibration
on the machine.

Additional Information

Jerk is also called jolt, surge and lurch.

Jerk Unit
Jerk is given in command units/s3. The command unit is the value obtained from unit conversion of the
9
position display unit and the electronic gear. 9-5-4 Jerk

Specifying Jerk for Axis Motion


The jerk used in an actual positioning motion is specified with the Jerk input variable to the motion con-
trol instruction. The same value is used for acceleration and deceleration.
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 of Velocity Control When Jerk Is Specified


The acceleration will change at a constant rate over the range where jerk is specified. The command
velocity will form a smooth S curve. A fixed acceleration rate is used in areas where the jerk is set to
0. This command velocity will form a straight line.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-37


9 Motion Control Functions

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
Acceleration
Acceleration rate rate
at startup

Time
Jerk
Jerk
at startup
Time

25% 25%

Monitoring Jerk
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
applies to _MC1_AX[*] and _MC2_AX[*].
Variable name Data type Meaning Function
_MC_AX[0-255].Cmd.Jerk LREAL Command Current This is the current value of the com-
Jerk mand jerk.

9-5-5 Specifying the Operation Direction


If you want to specify a rotation direction, such as shortest way, using an index table, set the Count
Mode to Rotary Mode. Next, set the operation direction with the Direction input variable to the motion
control instruction for an absolute position. 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. Posi-
tioning 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 posi-
tion are closer to each other.
Positive direction Motion starts in the positive direction.

9-38 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Direction Operation
Negative direction Motion starts in the negative direction.
Current direction Motion starts in the same direction as the previous operation.
No direction specified Motion starts in the direction that does not pass through the upper and lower limits of
the 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 difference between the target position and the command current
position as the target distance. This enables you to perform multi-turn positioning on
the ring counter.

Example for Shortest Way


The following example illustrates when positioning is performed towards a target position of −20 when
the command current position is 50.
Modulo maximum
position setting
value: 100
Command current position:
50

Target position: Target position:


−20 −20

9-5 Common Functions for Single-axis Control


0

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.

Example for Positive Direction


The following example illustrates when positioning is performed towards a target position of −20 when 9
the command current position is 50. 9-5-5 Specifying the Operation Direction

Modulo maximum
position setting
value: 100
Command current position:
50

Target position: Target position:


−20 −20
0

Modulo minimum
position setting
value: −70
Moves in positive direction.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-39


9 Motion Control Functions

Example for Negative Direction


The following example illustrates when positioning is performed towards a target position of −20 when
the command current position is 50.
Modulo maximum
position setting
value: 100
Command current position:
50

Target position: Target position:


−20 −20
0

Modulo minimum
position setting
value: −70
Moves in negative direction.

Example for Current Direction


The following example illustrates when positioning is performed towards a target position of −20 when
the command current position is 50.

Modulo maximum
position setting
value: 100
Command current position:
50

Target position: Target position:


−20 −20
0

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.

9-40 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Precautions for Correct Use


Observe the following precautions on the operation direction of the previous operation.
• If the MC_Home or MC_HomeWithParameter instruction exceeds the point where the home
input was detected and reverses operation, the opposite direction of the home input detection
direction is used.
• If a homing compensation value is set for the MC_Home or MC_HomeWithParameter instruc-
tion, the axis will move in the direction of the compensation value.
• If an immediate stop is specified for the MC_TouchProbe (Enable External Latch) instruction,
the latch position may be exceeded and the direction may be reversed.
• The direction may be reversed for the MC_MoveFeed (Interrupt Feeding) instruction.
• When the MC_ResetFollowingError instruction is executed, the error is set to zero, so the
command direction is used.
• If an immediate stop is specified for an external input signal or resetting the error counter is
specified for stopping for a limit input, the operation may reverse direction toward the position
where the external input signal was received.

Example for No Direction Specification

9-5 Common Functions for Single-axis Control


The following example illustrates when positioning is performed towards a target position of −20 when
the command current position is 50.
Modulo maximum
position setting
value: 100
Command current position:
50

Target position: Target position:


−20 −20
0

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 9
−70, the command current position is −20, and positioning is performed towards a target position of
290.
9-5-5 Specifying the Operation Direction

Modulo maximum
position setting
value: 100

Command current Position after


position: −20 positioning: −50
0

Modulo minimum
position setting
value: −70

190
Performs relative positioning with target distance of (290
(target position) − 100 (upper limit)) = 190.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-41


9 Motion Control Functions

9-5-6 Re-executing Motion Control Instructions


This section describes how to modify input variables of the same instance of a motion control instruc-
tion during operation of a single axis and re-execute that instruction. The input variables Position (Tar-
get Position), Distance (Travel Distance), Velocity (Target Velocity), Acceleration (Acceleration Rate),
Deceleration (Deceleration Rate), and Torque (Target Torque) and sometimes other input variables can
be changed by re-execution. An instruction error will occur if you change an input variable that cannot
be changed and attempt to re-execute the instruction. If you re-execute an instruction that has been
buffered due to multi-execution of instructions, the input variables for the instruction in the buffer will
change.
For details on input variables that can be changed, refer to the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508).

Changing the Target Position


If you change the target position with re-execution, the operation may change depending on the timing
of the change and the new target position. If the direction of motion reverses due to a change in the tar-
get position, you can choose to decelerate to a stop after a reverse turn or stop immediately after
reversing with the Operation selection at Reversing axis parameter.

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

↑Executed. ↑Initial ↑New ↑Executed. ↑Initial ↑New


command command command command
position position position position

If you re-execute an instruction during triangular


control or during deceleration, acceleration to
the target velocity will occur again. In some
cases, the axis will not reach the target velocity.

 When a Reverse Turn Occurs for the New Command Value


Decelerating to a Stop after Reverse Turn Stopping Immediately after Reverse Turn
Velocity Velocity
↓Command re-executed. ↓Command re-executed.
If the travel distance upon
reverse turn is small,
triangular control is
performed as it was for
the first execution of the
↓Initial command position instruction.
↑Executed. ↑New command ↑Executed. ↑Initial ↑New command
position command position
position

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.

9-42 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Triangular Control Patterns


The triangular control shown in the figure below may result if the travel distance is shortened due to
a change in the target position.
No Reverse Turn
Velocity

↓Command re-executed.

Executed.↑ ↑New command ↑Initial command


position position

 Excessive Deceleration Patterns


In the following case, priority is given to stopping at the target position. Therefore, the deceleration
rate will exceed the specified deceleration rate. If the deceleration rate exceeds the rate that is set in
the Maximum Deceleration axis parameter, the operation set in the Acceleration/Deceleration Over
axis parameter setting is performed.

If There Is No Reverse Turn and the Target Position Would Be Exceeded at the
Specified Deceleration Rate

9-5 Common Functions for Single-axis Control


No Reverse Turn
Velocity

↓Command re-executed.

↑Executed. ↑Initial command position


↑New command position

If There Is A Reverse Turn and Decelerating to a Stop Would Exceed a


Software Limit
No Reverse Turn

Velocity

↓Command re-executed.
9
9-5-6 Re-executing Motion Control Instructions

↑Executed. Reverse
operation
↑Software limit

If There Is A Reverse Turn and Decelerating to a Stop Would Result in


Command Current Position Overflow or Underflow
No Reverse Turn

Velocity

↓Command re-executed.

↑Executed. Reverse
operation
↑Counter upper limit

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-43


9 Motion Control Functions

Changing the Travel Distance


Even if you change the travel distance and re-execute the MC_MoveRelative (Relative Positioning)
instruction, 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.
Re-execution Instruction during Motion Re-execution Just Before End of Positioning
Velocity Velocity
↓Command re-executed. ↓Command re-executed.

↑Executed. ↑Initial ↑Travel distance ↑Executed. ↑Initial Travel distance ↑


travel specified when travel specified when
distance instruction was distance instruction was
re-executed re-executed
If the instruction is re-executed just before the end of positioning,
positioning for the travel distance that is specified when the instruction
is re-executed is sometimes based on the position to which the axis
was moved for the initial travel distance.

Precautions for Correct Use


Do not change the travel distance and re-execute the instruction just before the end of position-
ing.

Changing the Target Velocity


The operation is changed only during acceleration (including acceleration for triangular control) and
constant-velocity motion. Changes are also accepted when the axis is decelerating, but operation is not
affected.

Changing the Acceleration Rate


The operation is changed only during acceleration and acceleration during triangular control. If it is
changed when moving at a constant speed, the changed rate applies to acceleration for an override.
Changes are also accepted when the axis is decelerating, but operation is not affected.

Changing the Deceleration Rate


The deceleration rate is changed only during acceleration, constant-velocity motion, deceleration, trian-
gular control, or during deceleration-exceed control. If the new deceleration rate causes the axis to
exceed the target position, stopping at the target position is given the highest priority. Therefore, in this
case, the actual deceleration rate will exceed the specified deceleration rate.

 Patterns Where Deceleration Rate Increases


Trapezoidal Control Triangular Control Followed by Trapezoidal Control
Velocity Instruction Instruction Increased deceleration rate allows
Velocity
↓re-executed ↓re-executed operation to reach target velocity
There is an area of for trapezoidal control.
acceleration due to There is an area of
the increased acceleration due to the
deceleration rate increased deceleration
during deceleration rate during deceleration

↑Executed. ↑Command position ↑Executed. ↑Command position

9-44 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Patterns Where Deceleration Rate Decreases


Trapezoidal Control or Triangular Control Deceleration-exceed Control
Velocity Velocity If the command position is exceeded
at the reduced deceleration rate, a
↓Instruction re-executed
switch is made to deceleration-
Decreased deceleration exceed control.
rate makes it impossible
to reach target velocity
so a change is made to No change for re-execution
triangular control. during deceleration

↑Executed. ↑Command position ↑Executed. ↑Command position

Changing the Torque Command


The torque command value will change based on the torque ramp specification when you re-execute a
motion control instruction.

Programming Example for Re-execution


This example demonstrates changing the target position from 1000 to 2000 for absolute positioning. In
this example, the variable Axis1Pos is used as the input parameter to the target position. Specify the
target position to 1000 with the MOV instruction and change Axis1Execute to TRUE to begin position-

9-5 Common Functions for Single-axis Control


ing. Specify the target position to 2000 during operation and change Axis1Execute to TRUE again to
switch to a positioning operation for the new target position of 2000.

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
9
0 BufferMode 9-5-6 Re-executing Motion Control Instructions

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-45


9 Motion Control Functions

 Timing Charts
Variables
Axis1PosSet1

Axis1PosSet2

Axis1Pos 1000 2000

Input Parameter
Axis1Execute

Output Parameters
Axis1Done

Axis1Busy

Axis1Active

Precautions for Correct Use


For input variables that are not changed, always use the same values as before re-execution of
the instruction.

9-46 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode)


You can execute another motion control instruction while an axis is moving. In the PLCopen® technical
specifications, this functionality is defined as Buffer Mode, but in the MC Function Module this is some-
times referred to as multi-execution of instructions. You can use multi-execution of instructions to exe-
cute multiple motion control instructions in sequence without stopping the overall motion.
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 was in operation just before exe-
block cuting the multi-execution instruction.
Buffered instruction Next function block A motion control instruction that was executed during an axis motion
and is waiting to be executed.
Transit velocity Blending When blending is specified, it specifies the command velocity to use
by 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 select
one of the following Buffer Modes. The main difference between these modes is the timing at which the
buffered instructions are executed and the transit velocity.
Buffer Mode Description of operation

9-5 Common Functions for Single-axis Control


Aborting The current instruction is aborted and the multi-executed instruction is
executed.
Buffered The buffered instruction is executed after the operation for the current
instruction is normally finished.
Blending The buffered instruction is executed after the target position of the cur-
rent instruction is reached. In this mode, no stop is performed between
the current instruction and the buffered instruction. You can select
from the following transit velocities for when the current instruction
reaches the target position.
Blending Low (low velocity) The transit velocity is set to the target velocity of the current instruction
or the buffered instruction, whichever is lowest.
Blending Previous (previous The target velocity of the current instruction is used as the transit
velocity) velocity.
Blending Next (next velocity) The target velocity of the buffered instruction is used as the transit
velocity.
Blending High (high velocity) The transit velocity is set to the target velocity of the current instruction 9
or the buffered instruction, whichever is highest.

The multi-execution instruction is buffered in the MC Function Module and will be executed at the spec-
Mode)
9-5-7 Multi-execution of Motion Control Instructions (Buffer

ified BufferMode timing and transit velocity for both buffered and blending modes. There is one buffer for
each axis. If aborting is specified, the instruction that was executed last is executed immediately, so it is
not buffered.

Precautions for Correct Use


• Only one multi-execution instruction is 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-47


9 Motion Control Functions

Aborting
This is the default mode. No buffering is performed in this mode. The current command is aborted and
the new instruction is executed. Aborting Mode can be used for multi-execution of instructions for
motion control instructions for both single-axis control and synchronized control.

 When a Reverse Turn Does Not Occur for the Command Position of the Multi-
execution Instruction
Executing More than One Instruction Multi-execution during Acceleration/Deceleration
during Constant-velocity Motion
Velocity ↓Multi-execution timing Velocity ↓Multi-execution timing

↑Executed. ↑Initial ↑Buffered ↑Executed. ↑Initial ↑Buffered


command command command command
position position position position

If you use multi-execution of an instruction during


triangular control or during deceleration, the axis will
accelerate to the target velocity of the buffered instruction.
In some cases, the axis will not reach the target velocity.

 When a Reverse Turn Occurs for the Command Position of the Multi-execution
Instruction
Decelerating to a Stop after Reversing Stopping Immediately after Reversing
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-
multi-execution of instructions reverse turn is small, triangular execution of instructions during acceleration
during acceleration, the axis control is performed as it was for or 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. This also occurs during deceleration.

Buffered
The buffered 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.
The target position is reached
and the next command is
Velocity executed after the current
↓Multi-execution timing
operation is normally finished.

Current instruction Buffered instruction

Time

9-48 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

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 posi-
tion will be the total of the values for both instructions. For absolute travel, the final position will be the
target position of the second multi-execution 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

Precautions for Correct Use


In a blending mode, you cannot combine single-axis and synchronized control.

Version Information

9-5 Common Functions for Single-axis Control


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 previ-
ous case, the maximum acceleration/deceleration rate is used and the blending operation is con-
tinued.

An example for an Acceleration/Deceleration Over operation is given below.

Use Rapid Acceleration/Deceleration (Blending Is Changed to Buffered)


 For a CPU Unit with Unit Version 1.09 or Earlier
Velocity Current instruction Buffered instruction

9
When the current
instruction is completed,
the buffered instruction is
Mode)
9-5-7 Multi-execution of Motion Control Instructions (Buffer

executed.
Current instruction Buffered instruction

Time
Multi-execution of instructions

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-49


9 Motion Control Functions

 For a CPU Unit with Unit Version 1.10 or Later


The operation with the following setting is shown below.
The operation will be the same even if you select Minor fault stop.
Here, BufferMode is set to Blending Next.
Current
instruction Buffered instruction
Target velocity of the
buffered instruction
Transit velocity The maximum acceleration rate is used, and
execution of the buffered instruction starts when the
target position of the current instruction is exceeded.
After switching the instruction, the acceleration rate
of the buffered instruction is used.

Multi-execution of Time
instructions

Use Rapid Acceleration/Deceleration


 BufferMode Is Set to Blending Previous
Velocity Current instruction Buffered instruction
Transit velocity
used.

Stopping at the target position is not possible for


the deceleration rate of the buffered instruction.
Rapid deceleration is therefore used to stop at the
Current instruction target position.

Multi-execution of instructions Buffered instruction Time

 BufferMode Is Set to Blending Next


Velocity Current instruction Buffered instruction

With the acceleration rate of the Transit velocity used.


current instruction, it is impossible
to reach the target velocity of the
buffered instruction at the target
position.
Rapid acceleration is therefore
used to reach the target velocity
at the target position. Buffered instruction

Current instruction
Time
Multi-execution of instructions

9-50 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Blending Low (Low Velocity)


Operation is performed using the target position of the current instruction and the target velocity that
is the slower of the target velocities for the current instruction and buffered instruction.

 Blending Previous (Previous Velocity)


Operation is performed with the target velocity of the current instruction until the target position of
the current instruction is reached. Operation is performed after acceleration/deceleration to the tar-
get velocity of the buffered instruction once the target position is reached.

When the Direction of Operation Does Not Change


Cases Resulting in Acceleration
The transit velocity is
Multi-execution the command velocity of
of instruction the current instruction
Velocity

Current instruction Buffered instruction

9-5 Common Functions for Single-axis Control


Time
Cases Resulting in Deceleration
Multi-execution
of instruction
Velocity

Current instruction Buffered instruction

Time

When the Direction of Operation Changes


Multi-execution of instruction
Velocity

9
Mode)
9-5-7 Multi-execution of Motion Control Instructions (Buffer

The transit velocity is the command velocity of the current instruction


Current instruction

Time

Buffered instruction

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-51


9 Motion Control Functions

 Blending Next (Next Velocity)


Operation is performed using the target position of the current instruction and the target velocity of
the buffered instruction.

Cases Resulting in Acceleration The transit velocity is the command


velocity of the buffered command
Multi-execution of instruction
Velocity

Current instruction
Buffered instruction

Time
Cases Resulting in Deceleration
Multi-execution of instruction

Velocity

Current instruction Buffered instruction

Time

 Blending High (High Velocity)


Operation is performed using the target position of the current instruction and the target velocity that
is the faster of the target velocities for the current instruction and buffered instruction.

9-52 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-6 Multi-axes Coordinated Control


This section describes the operation of multi-axes coordinated control. With the MC Function Module,
you can set an axes group in advance from the Sysmac Studio to perform interpolation control for mul-
tiple axes.

9-6-1 Outline of Operation


Multi-axes coordinated control performs a motion with multiple related axes together as a single group
to control the path of the target control object. The MC Function Module treats all axes that perform
coordinated operation as an axes group. Axes groups are set from the Sysmac Studio. In the user pro-
gram, turn ON the Servo for each axis and then enable the axes group that is going to perform the
multi-axes coordinated control. The purpose of multi-axes coordinated control is the coordinated opera-
tion of all axes belonging to the target axes group. Therefore, you cannot execute any single-axis oper-
ation motion control instructions on the axes in an enabled axes group. Furthermore, if any error occurs
for any axis in an axes group, all axes in the axes group will stop according to the setting of the Axis
Group Stop Method group axes parameter.
The MC Function Module can perform linear interpolation with two to four axes or circular interpolation
with two axes.
Coordinate conversion
EtherCAT Feedback Commands EtherCAT
slave slave

9-6 Multi-axes Coordinated Control


Actual Multi-axes position Command
Input 1 processing Output 1
position 1 position 1

Actual Command
Input 2 Output 2
position 2 position 2

Actual Command
Input 3 Output 3
position 3 position 3

Additional Information 9
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
9-6-1 Outline of Operation

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-53


9 Motion Control Functions

Enabling and Disabling Axes Groups


To enable an axes group, specify the axes group for the MC_GroupEnable (Enable Axes Group)
instruction. An instruction error will occur if you try to execute an axes group instruction when the axes
group is still disabled. To disable an axes group, specify the axes group for the MC_GroupDisable (Dis-
able Axes Group) instruction. When you disable an axes group that is in operation, all axes in that axes
group will decelerate to a stop at the maximum deceleration rate that is specified in their axis parameter
settings.

Turn ON Servo for each axis


with MC_Power.

Define home for


all of the axes.

Enable axes group with


MC_GroupEnable.

Perform interpolation operation.


Axes group enabled.

Disable axes group with


MC_GroupDisable.

Turn OFF Servo for each


axis with MC_Power.

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 Instruc-
tions Reference Manual (Cat. No. W508).

Changing the Axes in an Axes Group


You can use the MC_ChangeAxesInGroup (Change Axes in Group) instruction to temporarily change
the composition axes for an axes group that is disabled. If the axes group is enabled, use the
MC_GroupDisable (Disable Axes Group) instruction to disable the axes group before you change the
composition axes. A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher
are required to use this instruction.

Precautions for Correct Use


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

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

9-54 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Reading Axes Group Positions


You can use the MC_GroupReadPosition (Read Axes Group Position) instruction to read the command
current positions and the actual current positions of an axes group. A CPU Unit with unit version 1.01 or
later and Sysmac Studio version 1.02 or higher are required to use this instruction.
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).

Resetting Axes Group Errors


If an error occurs in an axes group, you can use the MC_GroupReset instruction to remove the error
once you have eliminated the cause.
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-6 Multi-axes Coordinated Control


9
9-6-1 Outline of Operation

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-55


9 Motion Control Functions

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 interpola-
tion velocity, interpolation acceleration, interpolation deceleration, and jerk.
The MC Function Modules 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.
Y

La1
Td
L

Fa1 F

Ta

A
La0
X

Axis A1 motion Fa0

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

9-56 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-6-3 Circular Interpolation


Circular interpolation is used to move two of the logical axes A0 to A3 in a circular motion on a 2D
plane. Either absolute or relative positioning is possible. You can specify the circular interpolation mode,
path direction, interpolation velocity, interpolation acceleration, interpolation deceleration, and com-
bined jerk for the two axes.
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

9-6 Multi-axes Coordinated Control


• Center
• Radius

Precautions for Correct Use


Set the Count Mode to Linear Mode for the axis that you use for circular interpolation. If the
instruction is executed with this axis in Rotary Mode, an instruction error will occur.

9-6-4 Axes Group Cyclic Synchronous Positioning


You can cyclically output specified target positions for the axes in an axes group. You can specify target 9
positions that are calculated in the user program as absolute positions to move the axes in any desired
path.
9-6-3 Circular Interpolation

A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required to use
this instruction.
For details on axes group cyclic synchronous positioning for an axes group, refer to the MC_GroupSyn-
cMoveAbsolute (Axes Group Cyclic Synchronous Absolute Positioning) instruction in the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-57


9 Motion Control Functions

9-6-5 Stopping Under Multi-axes Coordinated Control


Multi-axes coordinated control of axes groups will stop when you execute certain motion control instruc-
tions in the user program or when an error or some other problem occurs.

Stopping with Motion Control Instructions


Use the MC_GroupStop or MC_GroupImmediateStop instruction to stop axes group operation.

 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 other device. Other operation com-
mands are not acknowledged while decelerating to a stop for this instruction and while the input vari-
able 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.
For details, refer to the MC_GroupStop and MC_GroupImmediateStop instructions in the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).

Stopping Due to Errors or Other Problems


 Stopping for Errors during Axes Group Motion
If an error that results in a deceleration stop occurs for any composition axis in the axes group during
an axes group motion, all of the axes will decelerate to a stop on the interpolation path at the inter-
polation deceleration rate. The interpolation deceleration rate is determined by the deceleration rate
that is specified for the controlling instruction. If an error that results in an immediate stop occurs for
any composition axis in the axes group during an axes group motion, the other axes in the axes
group will stop according to the setting of the Axes Group Stop Method parameter in the axes group
parameters.
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

 Stopping Due to Motion Control Period Exceeded Error


If motion control processing does not end within two periods, a Motion Control Period Exceeded
error occurs. All axes stop immediately.

Precautions for Correct Use


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 error occurs in either of the tasks.
Refer to A-6-2 Motion Control for multi-motion.

9-58 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Stopping Due to Start of MC Test Run


All axes will decelerate to a stop at their maximum deceleration if a MC Test Run is started from the
Sysmac Studio.

 Stopping Due to Change in CPU Unit Operating Mode


All axes will decelerate to a stop at their maximum deceleration when the CPU Unit operating mode
changes.

Additional Information

• If you execute the MC_GroupDisable (Disable Axes Group) instruction during axes group
operation, 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 remain

9-6 Multi-axes Coordinated Control


TRUE and the Servo remains ON.
• 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 Command-
Aborted from the current motion control instructions change 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.

9-6-6 Overrides for Multi-axes Coordinated Control


You can use the MC_GroupSetOverride (Set Group Overrides) instruction to set override factors for 9
multi-axes coordinated control of the axes group in the current interpolation operation. The velocity
override factor is set as a percentage of the target velocity for interpolation. It can be set between 0% 9-6-6 Overrides for Multi-axes Coordinated Control

and 500%. If an override factor of 0% is set for the interpolation target velocity, operating status will con-
tinue with the axis stopped at a velocity of 0. 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 interpolation
velocity is exceeded when an override factor is changed, the maximum interpolation velocity for the
axes group is used.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-59


9 Motion Control Functions

 Overrides for the MC_MoveLinear (Linear Interpolation) Instruction


An example of a time chart for using the Set Override Factors instruction for the MC_MoveLinear
(Linear Interpolation) instruction is given below.
Previous Instruction: MC_MoveLinear
Execute

Busy

Active

Done

CommandAborted

Current Instruction

Enable

Enabled

Busy

VelFactor 100 200 50

Interpolation velocity When overrides are disabled


with MC_GroupSetOverride, the
Override factor: 200% target velocity returns to 100%.

Override factor: 100%

Override factor: 50%

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

9-60 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-7 Common Functions for Multi-axes


Coordinated Control
This section describes the common functions for multi-axes coordinated control.

9-7-1 Velocity Under Multi-axes Coordinated Control


To specify the velocity for multi-axes coordinated control, specify the interpolation velocity on the path.
The unit is the same as for single axes, command units/s.

Types of Velocities
The following is the only type of interpolation velocity for axes groups supported by the MC Function

9-7 Common Functions for Multi-axes Coordinated Control


Module.
Velocity type Definition
Command interpolation velocity This is the actual value of the command interpolation velocity output by
the MC Function Module to control an axes group.

Axis Parameters That Are Related to Velocities


Parameter name Function Setting range Default
Maximum Interpolation Set the maximum interpolation velocity for Non-negative long 800,000,000
Velocity the path. Set 0 for no interpolation velocity reals
limit. If a target velocity that exceeds the
maximum interpolation velocity is specified
for an axes group operation instruction, the
axis will move at the maximum interpolation
velocity.
Interpolation Velocity Set the percentage of the maximum inter- 0 to 100 0
Warning Value polation velocity at which to output an inter-
polation velocity warning. No interpolation
velocity warning is output if 0 is set.
(Unit: %) 9
9-7-1 Velocity Under Multi-axes Coordinated Control

Specifying Target Velocities for Axis Operations


The interpolation velocity used in an actual positioning motion is specified by the Velocity (Target Veloc-
ity) input variable to the motion control instruction.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-61


9 Motion Control Functions

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[*].
Variable name Data type Meaning Function
_MC_GRP[0-63].Cmd.Vel LREAL Command Interpo- This is the current value of the com-
lation Velocity mand interpolation velocity. A plus
sign is added during travel in the pos-
itive direction, and a minus sign is
added during travel in the negative
direction.

9-7-2 Acceleration and Deceleration Under Multi-axes Coordinated


Control
Multi-axes coordinated control performs control on the path for the interpolation acceleration and inter-
polation deceleration rates. The unit is the same as for single axes, command units/s2.

Axis Parameters That Are Related to Interpolation Acceleration and


Interpolation Deceleration
Parameter name Function Setting range Default
Maximum Interpolation Set the maximum interpolation acceleration Non-negative long 0
Acceleration for the path. Set 0 for no interpolation accel- reals
eration limit.
(Unit: command units/s2)
Maximum Interpolation Set the maximum interpolation deceleration Non-negative long 0
Deceleration for the path. Set 0 for no interpolation decel- reals
eration limit.
(Unit: command units/s2)
Interpolation Accelera- Set the operation for when the maximum 0 to 2 0
tion/Deceleration Over interpolation acceleration/deceleration rate
would be exceeded after excessive acceler-
ation/deceleration during accelera-
tion/deceleration control of the axes group
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
Interpolation Accelera- Set the percentage of the maximum inter- 0 to 100 0
tion Warning Value polation acceleration at which to output an
interpolation acceleration warning. No inter-
polation acceleration warning is output if 0
is set.
(Unit: %)
Interpolation Decelera- Set the percentage of the maximum inter- 0 to 100 0
tion Warning Value polation deceleration rate at which to output
an interpolation deceleration warning. No
interpolation deceleration warning is output
if 0 is set.
(Unit: %)

9-62 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

*1 For a CPU Unit with unit version 1.10 or later, Blending is not changed to Buffered. Refer to 9-5-7 Multi-execu-
tion of Motion Control Instructions (Buffer Mode) 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
operation. Refer to 9-5-7 Multi-execution of Motion Control Instructions (Buffer Mode) for details.

Specifying an Interpolation Acceleration and Interpolation


Deceleration for an Axes Group
The interpolation acceleration and interpolation deceleration rates used in an actual positioning motion
are specified by the Acceleration (Acceleration Rate) and Deceleration (Deceleration Rate) input vari-
ables to the motion control instruction.

Monitoring Interpolation Acceleration and Interpolation Deceleration


Rates
You can read Axes Group Variables in the user program to monitor interpolation acceleration and inter-

9-7 Common Functions for Multi-axes Coordinated Control


polation deceleration rates.
In the descriptions, a variable name _MC_GRP[*] is used as an example, but the same information
applies to _MC1_GRP[*] and _MC2_GRP[*].
Variable name Data type Meaning Function
_MC_GRP[0-63].Cmd.AccDec LREAL Command Interpo- This is the current value of the com-
lation Accelera- mand interpolation accelera-
tion/Deceleration tion/deceleration rate. A plus sign is
added for acceleration, and a minus
sign is added for deceleration.

9-7-3 Jerk for Multi-axes Coordinated Control


Jerk for multi-axes coordinated control is used to reduce shock and vibration on the machine by
smoothing the interpolation acceleration/deceleration rate along the interpolation path into an S-curve.
The unit is the same as for single axes, command units/s3.

Specifying Jerk for Axes Group Motion


9
The jerk used in an actual interpolation is specified by the Jerk input variable to the motion control
instruction.
9-7-3 Jerk for Multi-axes Coordinated Control

Jerk Example (Setting Other than 0)


The acceleration/deceleration rate will change at a constant rate over the range where jerk is specified.
The command interpolation velocity will form a smooth S-curve. A fixed interpolation acceleration rate is
used in areas where the jerk is set to 0. This command interpolation velocity will form a straight line.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-63


9 Motion Control Functions

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

9-7-4 Re-executing Motion Control Instructions for Multi-axes


Coordinated Control
If you re-execute a linear interpolation or circular interpolation instruction, an instruction error will occur.

Busy

Active

Done

CommandAborted

Error

ErrorID 16#0000 Error code

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

9-64 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-7-5 Multi-execution (Buffer Mode) of Motion Control Instructions for


Multi-axes Coordinated Control
You can perform multi-execution for multi-axes coordinated control in axes groups the same way as you
can for axis operations. You can perform path control for multiple continuous lines and/or arcs if you use
Buffer Mode under multi-axes coordinated control.

(3) (4)
(2) Linear interpolation: (1), (3), (5), and (7)
Circular interpolation: (2), (4), and (6)
(5)

(6) (7)
(1) Point B

Point A
You can set the BufferMode input variable to motion control instruction to select one of the same Buffer

9-7 Common Functions for Multi-axes Coordinated Control


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 instructions. Multi-execution of instruction cannot be used from an axis operation
instruction to an axes group operation instruction and vice-versa.

Precautions for Correct Use


• Up to seven instructions can be buffered at the same time for a single axes group. If multi-exe-
cution is performed for eight 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. 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 multi-execution instruction starts at the 9
current interpolation velocity when the multi-execution instruction is executed. With Aborting Mode you
cannot combine single-axis control, including synchronized single-axis control and axes group control.
Instructions for Multi-axes Coordinated Control
9-7-5 Multi-execution (Buffer Mode) of Motion 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.
Multi-execution during Constant-velocity Motion Multi-execution during Acceleration/Deceleration

Multi-instruction timing Multi-instruction timing

Executed. Initial command position Buffered command Executed. Initial command position Buffered command
position position

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-65


9 Motion Control Functions

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
velocity changes for the axes will not be continuous.

Example: Interpolation Velocity and Velocities of Axes for Two-axis Cartesian


Coordinates
Y coordinate

Fy F

X coordinate
Y-axis motion

Fx
X-axis motion
Ta Td

Buffered
The multi-execution 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.
The target position is reached
and the next command is
executed after the current
Velocity ↓Multi-execution timing operation is normally finished.

Current instruction Buffered instruction

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 buff-
ered instruction is executed after the target position of the current instruction is reached. The axes do
not stop at the target position. The two motions are blended together at the interpolation velocity speci-
fied with the BufferMode input variable.
The Interpolation Acceleration/Deceleration Over axes group parameter is used to select one of the fol-
lowing operations for when the acceleration/deceleration that is specified in the buffered instruction
would exceed the target position.
• Use rapid acceleration/deceleration. (Blending is changed to Buffered.)

9-66 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

• Use rapid acceleration/deceleration.


• Minor fault stop

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 continued.
Also, the axis does not stop with an error even if you select Minor fault stop. Similar to the pre-
vious case, the maximum acceleration/deceleration rate is used and the blending operation is
continued.
• Note that the following restriction applies to CPU Units with unit version 1.09 or earlier.
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
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.

9-7 Common Functions for Multi-axes Coordinated Control


 Blending Low (Low Velocity)
Operation is performed using the target position of the current instruction and the target velocity that
is the slower of the target velocities for the current instruction and buffered instruction.

 Blending Previous (Previous Velocity)


Operation is performed with the target velocity of the current instruction until the target position of
the current instruction is reached. Operation is performed after acceleration/deceleration to the tar-
get velocity of the buffered instruction once the target position is reached.
Cases Resulting in Acceleration
The transit velocity is the command
velocity of the current instruction
Multi-execution of instruction
Velocity

Current instruction Buffered instruction

9
Time
Instructions for Multi-axes Coordinated Control
9-7-5 Multi-execution (Buffer Mode) of Motion Control
Cases Resulting in Deceleration
Multi-execution of instruction
Velocity

Current instruction Buffered instruction

Time

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-67


9 Motion Control Functions

 Blending Next (Next Velocity)


Operation is performed using the target position of the current instruction and the target velocity of
the buffered instruction.
Cases Resulting in Acceleration
The transit velocity is the command
velocity of the buffered command
Multi-execution of instruction
Velocity

Current instruction Buffered instruction

Time
Cases Resulting in Deceleration
Multi-execution of instruction
Velocity

Current instruction Buffered instruction

Time

 Blending High (High Velocity)


Operation is performed using the target position of the current instruction and the target velocity that
is the faster of the target velocities for the current instruction and buffered instruction.

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.
No. Transition mode Description
0 Transition Disabled (_mcTM- Do not perform any processing for transitions (default). No
None) attempt is made to lessen the shock, but this results in a
shorter operation time.
10 Superimpose Corners (_mcT- The deceleration of the current instruction is superimposed
MCornerSuperimposed) on the acceleration of the buffered instruction. You can keep
the linear velocity of the interpolation path constant.

Additional Information

The PLCopen® technology specifications define numbers 0 through 9. Number 10 is unique to


the MC Function Module.

9-68 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Transition Disabled (0: _mcTMNone)


No processing is performed to connect the two positions.

TransitionMode = _mcTMNone and BufferMode = _mcBuffered


The axis moves to position End1, stops, and then moves to position End2.
Y coordinate
End2

Multi-execution of instruction

Start1 End1/ Start2

X coordinate

Operation Pattern for X Axis Coordinates

Velocity

9-7 Common Functions for Multi-axes Coordinated Control


Start1 End1 Time
Operation Pattern for Y Axis Coordinates

Velocity

Start 2 End 2 Time

9
Instructions for Multi-axes Coordinated Control
9-7-5 Multi-execution (Buffer Mode) of Motion Control

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-69


9 Motion Control Functions

TransitionMode = _mcTMNone and BufferMode = _mcBlending


The axis moves to position End1, and then moves to position End2.

Y coordinate
End2

Multi-execution of instruction

Start1 End1/ Start2


X coordinate

Operation Pattern for X Axis Coordinates


Velocity

Start1 End1 Time

Operation Pattern for Y Axis Coordinates BufferMode = _mcBlendingPrevious


Velocity

Start2 End2 Time

9-70 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

TransitionMode = _mcTMNone and BufferMode = _mcAborting


The axis moves from End1’ (multi-execution of instruction) to End2.
Y coordinate
End2

Multi-execution of instruction

End1
Start1 End1’/ Start2

X coordinate

Operation Pattern for X Axis Coordinates

Velocity

9-7 Common Functions for Multi-axes Coordinated Control


Start1 End1’ Time

Operation Pattern for Y Axis Coordinates

Velocity

Start2 End2 Time

 Superimpose Corners (10: _mcTMCornerSuperimposed)


The deceleration of the current instruction is superimposed on the acceleration of the buffered
instruction. Operation is executed in the same amount of time as for the deceleration of the current
instruction, no matter what is specified as the acceleration for the buffered instruction. The superim-
posed area will apply no jerk even if jerk is specified.
The deceleration of the current
instruction is superimposed on the 9
acceleration of the buffered instruction.
Velocity
Instructions for Multi-axes Coordinated Control
9-7-5 Multi-execution (Buffer Mode) of Motion Control

Current instruction Buffered instruction

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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-71


9 Motion Control Functions

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
instruction are the same.

Combining Transition Modes and Multi-execution of Instructions


The following table shows the combinations of Transition Modes and Buffer Modes.
OK: Operation possible. ---: Generates an error and stops.
Buffer Mode Blending Blending Blending Blending
Aborting Buffered
Transition Mode Low Previous Next High
Transition Disabled (_mcTM- OK OK OK OK OK OK
None)
Superimpose Corners*1 --- --- OK OK OK OK
(_mcTMCornerSuperimposed)

*1 For superimpose corners, the deceleration for the current instruction and the acceleration for the buffered
instruction will be superimposed.

9-72 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-8 Other Functions


This section describes other functions of the MC Function Module.
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-8-1 Changing the Current Position


The command current position of a Servo axis can be changed to a specified value. The actual current
position changes to a value that maintains the current following error with the command current posi-
tion. For an encoder axis, you can change the actual current position. Use the MC_SetPosition instruc-
tion to specify the actual position you want to modify.
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 position using the new absolute coordinates.
However, the travel distance will stay the same when you position to a relative value.

Precautions for Correct Use


• When the Count Mode is Rotary Mode, an instruction error will occur if you specify a position
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)

9-8 Other Functions


 Timing Chart for Execution While Axis Is Stopped

Execute

Busy

Active
9
Done
9-8-1 Changing the Current Position

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-73


9 Motion Control Functions

9-8-2 Torque Limit


The output torque is limited by enabling and disabling the torque limit function of the Servo Drive and by
setting the torque limit value.
Different limits can be specified for the positive torque limit and negative torque limit.
For details, refer to the MC_SetTorqueLimit instruction in the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508).

Precautions for Correct Use


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 variable, 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 program 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 G5-series Servo Drives, or a GX-EC0211/EC0241
Encoder Input Terminal.
Use WindowOnly to detect only trigger signals within a specific start point and end point. The following
chart shows the ranges for different Count Modes.

 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

9-74 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

 Rotary Mode
• The FirstPosition can be less than, equal to, or greater than the LastPosition. 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.
First Position ≤ Last Position First Position > Last Position
Valid range FirstPosition to LastPosition LastPosition to FirstPosition

Count value
0x7FFFFFFFFF
Modulo maximum
position setting value
FirstPosition

LastPosition
Modulo minimum position
setting value (= 0)
0

Window
Latch enabled range Latch enabled range

LastPosition = 330° −0+ FirstPosition = 330° −0+

Range in which latching Range in which latching


is enabled (The border is enabled (The border
values are included.) values are not included.)

FirstPosition = 210° LastPosition = 210°

For details on latching, refer to the MC_TouchProbe (Enable External Latch) and MC_AbortTrigger

9-8 Other Functions


(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 when
you use NX-series Pulse Output Units.

9-8-4 Zone Monitoring


9
This function detects whether the command position or actual position of an axis is in the specified
range (zone). Use the MC_ZoneSwitch (Zone Monitor) instruction to specify the first position and last 9-8-4 Zone Monitoring

position of the zone to check. The InZone output variable for the Zone Monitor instruction will change to
TRUE when the position of the axis enters the specified zone. You can also specify multiple zones for a
single axis. Zones can overlap.
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).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-75


9 Motion Control Functions

9-8-5 Software Limits


Actual positions can be monitored in the MC Function Module software. This function is separate from
the hardware-based limit input signals. Set the range to monitor by setting the software limits in the Pos-
itive Software Limit and Negative Software Limit axis parameters. 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.

Negative software limit Positive software limit

Software range of motion

Negative limit input signal Positive limit input signal

Electrical range of motion

Mechanical stopper Mechanical stopper

Mechanical range of motion

 Axis Parameters That Are Related to Software Limits


Parameter name Function Setting range Default
Software Limits Select the software limit function. 0 to 4 0: Disabled
0: Disabled
1: Deceleration stop for command position*1
2: Immediate stop for command position
3: Deceleration stop for actual position*1
4: Immediate stop for actual position
Positive Software Set the software limit in the positive direction. Long reals*2 2,147,483,647
Limit The unit is command units.
Negative Software Set the software limit in the negative direction. −2,147,483,648
Limit The unit is command units.

*1 If the actual position goes beyond a software limit during execution of a movement instruction that has a Decel-
eration input variable, the axis decelerates to a stop at the deceleration rate given by Deceleration. If the actual
position goes beyond a software limit during execution of a movement instruction that does not have a Deceler-
ation input variable, the axis decelerates to a stop at the maximum deceleration that is set in the axis parame-
ters.
*2 Positions can be set within a 40-bit signed integer range when converted to pulses.
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.

 Executing Motion Instructions


• When the Actual Position Is within the Software Limits
An instruction error will occur if the target position is outside the software limit range.

9-76 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

• When the Actual Position Is outside the Software Limits


Motion is allowed only toward the software limit range. As long as the motion is toward the range,
the target position does not need to be within the software limit range.

Precautions for Correct Use


Do not execute an instruction for an axis command for a target position that is outside of the soft-
ware limit range.

 During Axis Motion


When the axis is in discrete motion, synchronized motion, continuous motion, or coordinated motion:
• An axis error will occur if the software limits are enabled for the command position and the com-
mand position leaves the range.
• An axis error will occur if the software limits are enabled for the actual position and the actual posi-
tion leaves the range.

Additional Information

Software limits can be enabled when the Count Mode is set to Linear Mode and home is defined.
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.

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

9-8 Other Functions


9-8-6 Following Error Monitoring
Following error is the difference between the command position and the actual position of an axis. The
MC Function Module monitors the following error every motion control period.
If the value of the following error exceeds the Following Error Over Value that is set in the axes parame-
ters, Following Error Limit Exceeded minor fault level error occurs. If it exceeds the Following Error
Warning Value, a Following Error Warning observation occurs. Monitoring the following error is disabled 9
during execution of the holding operation for homing. 9-8-6 Following Error Monitoring

 Axis Parameters That Are Related to Monitoring the Following Error


You can set the check values for monitoring the following error by setting the appropriate axis
parameters. Set the Following Error Warning Value so that it is less than the Following Error Over
Value.
Set the axis parameters from the Sysmac Studio.
Parameter name Function Setting range Default
Following Error Set the excessive following error check Non-negative long 0
Over Value value. Set 0 to disable the excessive follow- reals
ing error check. (Unit: command units)
Following Error Set the following error warning check value. Non-negative long 0
Warning Value Set 0 to disable the following error warning reals that are less
check. (Unit: command units) than or equal to the
Following Error
Over Value

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-77


9 Motion Control Functions

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-8-7 Following Error Counter Reset


Resetting the following error counter resets the following error to 0.
Use the MC_ResetFollowingError instruction in the user program to reset the following error counter.
You can use the MC_ResetFollowingError instruction for each axis during positioning or during homing.
If you execute a following error counter reset while the axis is in motion, the current motion control
instruction will be aborted and the command position will be set to the same value as the actual posi-
tion.
The home will remain defined even after executing a following error counter reset.
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 Counter
You can choose to reset the following error counter on an immediate stop, on a limit input stop, or
after homing is completed by setting the appropriate axis parameters. Set the axis parameters from
the Sysmac Studio.
Parameter name Function Setting range Default
Immediate Stop Set the stopping method in the MC Function 0, 2, or 3 0
Input Stop Method Module when the immediate stop input is
enabled.
0: Immediate stop
2: Immediate stop and error reset
3: Immediate stop and Servo OFF
Limit Input Stop Set the stopping method in the MC Function 0 to 3 0
Method Module when the positive limit input or nega-
tive 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.

9-8-8 Axis Following Error Monitoring


You can monitor the amount of following error for the command position or the actual position between
two axes. Use the MC_AxesObserve (Monitor Axis Following Error) instruction to specify the permitted
following error and the two axes to monitor. If the permitted following error is exceeded, the Invalid out-
put variable for the Monitor Axis Following Error instruction will change to TRUE.
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 operation.

Precautions for Correct Use


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 appropriate 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).

9-78 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

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-8-9 In-position Check


You can check to see if the actual current position has reached the specified range for the target posi-
tion during positioning or homing. After command output of the target position is completed, positioning
is considered to be finished when the difference between the target position and the actual current posi-
tion is within the in-position range. An instruction error occurs if the position is not within the in-position
within the in-position check time.
Positioning Monitoring Time
An In-position Check Time Exceeded error will occur if the in-
position status is not reached within the set time after the completion
of a command (after the command has been executed).
|Following error|

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

9-8 Other Functions


Time

 Axis Parameters That Are Related to In-position Checks


You can set the check conditions for the in-position check by setting the appropriate axis parame-
ters. Set the in-position check time if you want to start any of the following operations only after con-
firming that axes are in position.
Parameter name Function Setting range Default
In-position Range Set the in-position width. Non-negative long 10 9
(Unit: command units) reals
In-position Check Set the in-position check time in milliseconds. 0 to 10,000 0
9-8-9 In-position Check

Time Set 0 to check for the end of positioning only


when you define the home position during
homing and not check positioning at other
times.
(Unit: ms)

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.

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 possi-
ble without waiting for positioning to finish.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-79


9 Motion Control Functions

Additional Information

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

 Monitor Information That Is Related to In-position Checks


You can read Axis Variables from the user program to monitor when positioning finishes.
In the descriptions, a variable name _MC_AX[*] is used as an example, but the same information
applies to _MC1_AX[*] and _MC2_AX[*].
Variable name Data type Meaning Function
_MC_AX[0-255].Details.Idle BOOL Idle TRUE when processing is not currently
performed for the command value,
except when waiting for in-position
state.* Idle and InPosWaiting are mutu-
ally exclusive. 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.

* 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[*].
Variable name Data type Meaning Function
_MC_GRP[0-63].Details.Idle BOOL Idle TRUE when processing is not currently
performed for the command value,
except when waiting for in-position
state.*1
Idle and InPosWaiting are mutually
exclusive. 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.

9-80 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

9-8-10 Changing Axis Use


You can use the MC_ChangeAxisUse (Change Axis Use) instruction to temporarily change the setting
of the Axis Use axis parameter. To change an axis in this way, it must be set as a Used axis or as an
Unused axis (changeable to used axis) in the Axis Use axis parameter. 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 vir-
tual 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.

Precautions for Correct Use


• 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).

9-8-11 Enabling Digital Cam Switch


You can use the MC_DigitalCamSwitch (Enable Digital Cam Switch) instruction to turn the digital out-
puts ON or OFF according to the axis position.
The setting of the ValueSource input variable to the instruction also allows you to adjust for the acceler-
ation or deceleration rate.

9-8 Other Functions


Always use this function together with the NX_AryDOutTimeStamp instruction and with a Digital Output
Unit that supports time stamp refreshing. The NX_AryDOutTimeStamp instruction turns the specified
digital outputs ON or OFF at specified timing of the time stamp.
A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are required to use
this function.

Precautions for Correct Use


You can use this instruction for an axis that is assigned to an NX-series Position Interface Unit. 9
The NX Units that can be used are NX-EC0 and NX-ECS, also must be running the 9-8-10 Changing Axis Use
time stamping.

Refer to the MC_DigitalCamSwitch (Enable Digital Cam Switch) instruction in the NJ/NX-series Motion
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-E1-02 or later) for Digital Output
Unit that supports time stamp refreshing.

Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524-E1-02 or later) for time
stamping and time stamps.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-81


9 Motion Control Functions

9-8-12 Displaying 3D Motion Monitor for User Coordinate System


In the case that coordinate systems (such as SCARA robot and vertical articulated robot) other than
orthogonal coordinate system are implemented by user programs, this function can be used to display
the path of robot hands, etc. in 3D with Sysmac Studio.
You can create an _sMC_POSITION_REF type user-defined variable and display in 3D Motion Monitor
Display Mode.
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 Data type Meaning


CommandPosition ARRAY [0..5] OF LREAL Command Current Position
ActualPosition ARRAY [0..5] OF LREAL Actual Current Position

The following list describes each member.

Member Description
User-defined variable.CommandPosition[0] This is an X-axis component for the command current position.
This member is assigned a user-defined variable that indicates
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 position.
This member is assigned a user-defined variable that indicates
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 position.
This member is assigned a user-defined variable that indicates
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 indicates
the X-axis position of the actual current position handled 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 indicates
the Y-axis position of the actual current position handled 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 indicates
the Z-axis position of the actual current position handled in a
user program.
User-defined variable.ActualPosition[3] to [5] Not used.

9-82 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


9 Motion Control Functions

Each member is assigned a user-defined variable. The followings are the examples.

Name Data type Description


3D_position _sMC_POSITION_REF User-defined variable for 3D display
MCS_Cmd_TransX LREAL User-defined variable that indicates the X-axis
position of the command current position gen-
erated by a user program
MCS_Cmd_TransY LREAL User-defined variable that indicates the Y-axis
position of the command current position gen-
erated by a user program
MCS_Cmd_TransZ LREAL User-defined variable that indicates the Z-axis
position of the command current position gen-
erated by a user program
MCS_Act_TransX LREAL User-defined variable that indicates the X-axis
position of the actual current position handled
in a user program
MCS_Act_TransY LREAL User-defined variable that indicates the Y-axis
position of the actual current position handled
in a user program
MCS_Act_TransZ LREAL User-defined variable that indicates the Z-axis
position of the actual current position handled
in a user program

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;

9-8 Other Functions


3D_position.ActualPosition[1] := MCS_Act_TransY;
3D_position.ActualPosition[2] := MCS_Act_TransZ;

 Overview of Operating Procedures


1 Create an _sMC_POSITION_REF type user-defined variable.

2 Create a program in which user-defined variables that indicate the command current position 9
and actual current position for 3D display are assigned to each member of the created user-
defined variable.
System
9-8-12 Displaying 3D Motion Monitor for User Coordinate

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.

4 Set the created user-defined variable in the Value Column in the 3D Machine Model Parameter
Settings section.

5 Execute the user program.

6 Start tracing the data with the data trace to sample the data.

7 Check the trace results on the Data Trace Tab Page.

Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on 3D Motion Mon-
itor Display Mode.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 9-83


9 Motion Control Functions

9-84 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10

Sample Programming
This section describes basic application methods for homing, error monitoring, and
other functions, and provides programming samples for absolute positioning, cam oper-
ation, and other axis operations.

10-1 Overview of Sample Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2


10-1-1 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10-1-2 Installation and Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10-1-3 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10-2 Basic Programming Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
10-2-1 Monitoring EtherCAT Communications and Turning ON Servos . . . . . . . . . . 10-3
10-2-2 Interlocking Axis Operation with Master Control Instructions . . . . . . . . . . . . 10-5
10-2-3 Error Monitoring and Error Resetting for Single-axis Operation and
Synchronized Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
10-2-4 Error Monitoring and Error Resetting for
Multi-axes Coordinated Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10-2-5 Monitoring for Instruction Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
10-2-6 Checking to See If Errors Are Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
10-2-7 Stopping Axes during Single-axis Operation . . . . . . . . . . . . . . . . . . . . . . . . 10-19
10-2-8 Stopping an Axes Group in Coordinated Motion . . . . . . . . . . . . . . . . . . . . . 10-23
10-2-9 Homing and Absolute Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-29
10-2-10 Changing the Target Position by Re-execution of an Instruction . . . . . . . . . 10-34
10-2-11 Interrupt Feeding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-40
10-2-12 Changing the Cam Table by Re-execution of an Instruction . . . . . . . . . . . . 10-44
10-2-13 Using a Cam Profile Curve to Correct the Sync Position . . . . . . . . . . . . . . . 10-53
10-2-14 Shifting the Phase of a Master Axis in Cam Motion . . . . . . . . . . . . . . . . . . . 10-63
10-2-15 Changing the Actual Position during Velocity Control . . . . . . . . . . . . . . . . . 10-71
10-2-16 Changing a Cam Data Variable and Saving the Cam Table . . . . . . . . . . . . 10-77
10-2-17 Temporarily Changing Axis Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-86
10-2-18 Updating the Cam Table End Point Index . . . . . . . . . . . . . . . . . . . . . . . . . . 10-89

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-1


10 Sample Programming

10-1 Overview of Sample Programming


This section provides information that applies to all of the sample programming.

Precautions for Correct Use


• 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 devices,
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 Servo configuration example


CPU Unit NJ501-100 (unit version 1.0)
Power Supply Unit NJ-Px3001
Servo Drive R88D-1SN-ECT
Servomotor R88M-1
Encoder Input Terminal GX-EC0211 (version 1.1)

10-1-2 Installation and Wiring


Refer to the following manual for details on installing and wiring the devices.

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 cables GX-series EtherCAT Slave Units User’s Manual (Cat. No. W488)

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, 5-2 Axis Parameters, and A-1 Connecting the 1S-
series Servo Drive in this manual.
Servo parameters AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communica-
tions User’s Manual (Cat. No. I586)

10-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2 Basic Programming Samples

Samples
This section provides programming samples for the basic functions of the MC Function Module.

Precautions for Correct Use


• When you use these programming samples for reference, be sure to add programming for suit-
able interlocks that suit the operating conditions of the devices.
10
• Enter the variables that are used in the programming samples from the Programming Layer in

10-2-1 Monitoring EtherCAT Communications and Turning ON Servos


the Edit Pane of the Sysmac Studio.

10-2-1 Monitoring EtherCAT Communications and Turning ON Servos


In this sample, the MC_Power (Power Servo) instruction is executed to turn ON the Servo for the Servo
Drive when EtherCAT process data communications are established with the Servo Drive.
Samples are provided for both ladder diagram and ST programming.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Cfg.NodeAddress UINT --- This is the node address.
_EC_PDSlavTbl[N] BOOL FALSE TRUE when EtherCAT process data communi-
cations for node address N are in Operational
state.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-3


10 Sample Programming

Ladder Diagram
Check if the Servo Drive is ready when StartPg is TRUE.

StartPg MC_Axis000.DrvStatus.Ready Lock0

If the Servo Drive 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

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

10-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-2 Interlocking Axis Operation with Master Control Instructions
You can place the MC_Power (Power Servo) instruction between the MC (Master Control Start) and

Samples
MCR (Master Control End) instructions in ladder diagrams to interlock axis operation. When Mc_On is
FALSE in this sample, the MC_Power (Power Servo) instruction between the MC and MCR instructions
is disabled to turn OFF the Servo. The CommandAborted output variable from the current motion con-
trol instruction changes to TRUE at the same time, and axis motion stops.
You cannot use the MC instruction in ST. Therefore, a sample is provided only for a ladder diagram. 10

Main Variables Used in the Programming Samples

10-2-2 Interlocking Axis Operation with Master Control Instructions


Variable name Data type Default Comment
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
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
instruction. Control programming is not given in
this sample. In actual programming, program
controls for the required device operation.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.

Timing Chart
Mc_On

StartPg

Pwr_Bsy

Pwr_Status

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-5


10 Sample Programming

Ladder Diagram
When Mc_On is TRUE, master control is started.

Mc_On MC
In
0 MCNo

Check if the Servo Drive is ready when StartPg is TRUE.

StartPg MC_Axis000.DrvStatus.Ready Lock0

If the Servo Drive 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

Master control is ended.


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

10-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-3 Error Monitoring and Error Resetting for Single-axis Operation
and Synchronized Operation

Samples
You can monitor error status by monitoring the status of Axis Minor Fault Occurrence in the Axis Vari-
able. If a minor fault level error occurs in this sample, the Enable input variable for the MC_Power
instruction changes to FALSE to turn OFF the Servo. If the external button is ON and the command cur-
rent velocity is zero, the error is reset with the MC_Reset (Reset Axis Error) instruction. Samples are
provided for both ladder diagram and ST programming.
10

Main Variables Used in the Programming Samples

10-2-3 Error Monitoring and Error Resetting for Single-axis Operation and Synchronized Operation
Variable name Data type Default Comment
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Status.ErrorStop BOOL FALSE TRUE while there is a minor fault level error for
axis 0 and the axis is decelerating to a stop or
stopped.
MC_Axis000.Details.Idle BOOL FALSE TRUE when the command current velocity for
axis 0 is zero, except when waiting for in-posi-
tion state.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications 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 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0

If the Servo Drive 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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-7


10 Sample Programming

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

// 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 current 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
);

10-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated
Operation

Samples
You can monitor error status by monitoring the status of Axis Minor Fault Occurrence in the Axis Vari-
ables and Axes Group Minor Fault Occurrence in the Axes Group Variable. If a minor fault level error
occurs in this sample, the Execute input variable for the MC_GroupDisable (Disable Axes Group)
instruction changes to TRUE to disable the axes group. If the external button is ON and the command
current velocity for the axes group is zero, the error is reset with the MC_GroupReset (Reset Axes
Group Error) instruction.
10
Samples are provided for both ladder diagram and ST programming.

10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation
Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Group000 _sGROUP_REF --- This is the Axes Group Variable for axes group
0.
MC_Group000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axes group 0.
MC_Group000.Details.Idle BOOL FALSE TRUE when the command interpolation velocity
for axes group 0 is zero, except when waiting for
in-position state.
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
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.
Pwr1_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR1 instance of the
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 StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
ResetON BOOL FALSE This variable gives the status of the external
button that is used to reset errors.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-9


10 Sample Programming

Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.

StartPg MC_Axis000.DrvStatus.Ready Lock1

Check if the Servo Drive for axis 1 is ready when StartPg is TRUE.

StartPg MC_Axis001.DrvStatus.Ready Lock2

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

10-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


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

Samples
Execute Done
Busy Hm2_Bsy
CommandAborted Hm2_Ca
Error Hm2_Err
ErrorID Hm2_ErrID
10
The status of the axes group and the status of home for axis 0 and axis 1 are checked.

10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation
MC_Group000.Status.Disabled Hm1_D Hm2_D Lock3

If home is defined for axis 0 and axis 1, the axes group is enabled.
GRP_EN
MC_GroupEnable
Lock3 MC_Group000 AxesGroup AxesGroup Grp_En_D
Execute Done
Busy Grp_En_Bsy
CommandAborted Grp_En_Ca
Error Grp_En_Err
ErrorID Grp_En_ErrID

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.

ReserON MC_Group000.Status.ErrorStop MC_Group000.Details.Idle Lock4

If ResetON is TRUE and the axes group is stopped, the error is


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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-11


10 Sample Programming

ST Programming
// Check that the Servo Drive is ready when StartPg is TRUE and 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
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 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 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 is 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 is 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 axes 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 disabled.
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 stopped, the error is reset.
IF (ResetON=TRUE)
AND (MC_Group000.Status.ErrorStop=TRUE)
AND (MC_Group000.Details.Idle=TRUE) THEN
Grp_Reset_Ex := TRUE;
END_IF;

//MC_Power1
PWR1(
Axis := MC_Axis000,
Enable := Pwr1_En,
Status => Pwr1_Status,

10-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Busy => Pwr1_Bsy,
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
);

Samples
//MC_Power2
PWR2(
Axis := MC_Axis001,
Enable := Pwr2_En,
Status => Pwr2_Status,
Busy => Pwr2_Bsy, 10
Error => Pwr2_Err,
ErrorID => Pwr2_ErrID

10-2-4 Error Monitoring and Error Resetting for Multi-axes Coordinated Operation
);

// 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,

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-13


10 Sample Programming

Failure => Grp_Reset_Fai,


Error => Grp_Reset_Err,
ErrorID => Grp_Reset_ErrID
);

10-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-5 Monitoring for Instruction Errors
In this sample, further processing is not performed if there is an error when the MC_Power (Power

Samples
Servo) instruction is executed. Whether further processing is possible is indicated by the UpgOn vari-
able.
Samples are provided for both ladder diagram and ST programming.

10
Main Variables Used in the Programming Samples

10-2-5 Monitoring for Instruction Errors


Variable name Data type Default Comment
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Pwr_Bsy BOOL FALSE This variable is assigned to the Busy output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
UpgOn BOOL FALSE TRUE if further program execution is performed.

Ladder Diagram

Check if the Servo Drive is ready when StartPg is TRUE.


StartPg MC_Axis000.DrvStatus.Ready Lock0

If the Servo Drive 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

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-15


10 Sample Programming

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;

IF (Pwr_Status=TRUE)
OR (Pwr_Bsy=TRUE) THEN
UpgOn := TRUE; // Further processing executed.
ELSE
UpgOn := FALSE; // Further processing not executed.
END_IF;

// MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);

10-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-6 Checking to See If Errors Are Reset
In this sample, the MC_Reset (Reset Axis Error) instruction is executed if an external button turns ON

Samples
while there is a minor fault level error. Further normal processing is not executed until the Done output
variable from the MC_Reset instruction changes to TRUE.
If the Failure output variable changes to TRUE, the axis decelerated to a stop or an MC common error
has occurred. The cause that made the Failure output variable from the MC_Reset instruction turn ON
is read.
10
Samples are provided for both ladder diagram and ST programming.

10-2-6 Checking to See If Errors Are Reset


Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
ResetON BOOL FALSE This variable gives the status of the external
button that is used to reset errors.
GetFaultFactor --- --- This is the process to read the cause of the
error. Program it according to the device.
RegularProcess --- --- This is the normal processing. Program it
according to the device.

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

If the Failure output variable from the MC_Reset instruction changes to TRUE, processing is performed to read
the cause of the device error with GetFaultFactor. Program GetFaultFactor according to the device.
MC_Axis000.MFaultLvl.Active Reset_Fail GetFaultFactor
EN GetFaultFactor

If a minor fault level error did not occur or was reset, normal device processing (RegularProcess) is performed.
Program GetFaultFactor according to the device.

MC_Axis000.MFaultLvl.Active RegularProcess
EN RegularProcess

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-17


10 Sample Programming

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,
// processing 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 processing (RegularProcess) is performed.
// Program GetFaultFactor 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,
ErrorID => Reset_ErrID
);

10-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-7 Stopping Axes during Single-axis Operation
In this sample, the MC_Stop instruction is executed to decelerate to a stop if an external button turns

Samples
ON during execution of the MC_MoveAbsolute (Absolute Positioning) instruction. If there is a minor fault
level error, the CommandAborted output variable from the MC_Stop instruction changes to TRUE. In
that case, the MC_ImmediateStop instruction is executed to stop immediately. If for any reason the
Error output variable from the MC_Stop instruction changes to TRUE, the MC_ImmediateStop instruc-
tion is executed to stop immediately. If the MC_ImmediateStop instruction is executed, the axis status is
Error Deceleration Stopping. 10
Samples are provided for both ladder diagram and ST programming.

10-2-7 Stopping Axes during Single-axis Operation


Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Stp_Ca BOOL FALSE This variable is assigned to the Command-
Aborted output variable from the STP instance
of the MC_Stop instruction.
Stp_Err BOOL FALSE This variable is assigned to the Error output
variable from the STP instance of the MC_Stop
instruction.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
StopOn BOOL FALSE This variable gives the status of the external
button that is used to stop. The MC_Stop
instruction is executed to stop the axis if this
variable is TRUE.

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-19


10 Sample Programming

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 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 StopOn is TRUE, the MC_Stop instruction is executed.


STP
MC_Stop
StopOn MC_Axis000 Axis Axis Stp_D
Execute Done
LREAL#5000.0 Deceleration Busy Stp_Bsy
Jerk Active Stp_Act
BufferMode CommandAborted Stp_Ca
Error Stp_Err
ErrorID Stp_ErrID

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

10-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


ST Programming
// If the input parameters for absolute positioning and stopping are not set, the target values and other parameters
are set.

Samples
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveAbsolute (Absolute Positioning) instruction 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; 10
Mv_Abs_Dir := _eMC_DIRECTION#_mcPositiveDirection;

10-2-7 Stopping Axes during Single-axis Operation


// 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 is executed.
IF (Pwr_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex:=TRUE;
END_IF;

// If homing is completed, absolute positioning is executed.


IF Hm_D=TRUE THEN
Mv_Abs_Ex := TRUE;
END_IF;

// If StopOn is TRUE, stopping is executed.


IF StopOn=TRUE THEN
Stp_Ex:=TRUE;
END_IF;

// If the Error or CommandAborted output variable from the MC_Stop instruction changes 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,

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-21


10 Sample Programming

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

10-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-8 Stopping an Axes Group in Coordinated Motion
In this sample, the MC_GroupStop instruction is executed to decelerate to a stop if an external button

Samples
turns ON during execution of the MC_MoveLinearAbsolute (Absolute Linear Interpolation) instruction. If
there is a minor fault level error, the CommandAborted output variable from the MC_GroupStop instruc-
tion changes to TRUE. In that case, the MC_GroupImmediateStop instruction is executed to stop imme-
diately. If for any reason the Error output variable from the MC_GroupStop instruction changes to
TRUE, the MC_GroupImmediateStop instruction is executed to stop immediately. If the
MC_GroupImmediateStop instruction is executed, the axes group status is Error Deceleration Stop- 10
ping.

10-2-8 Stopping an Axes Group in Coordinated Motion


Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Group000 _sGROUP_REF --- This is the Axes Group Variable for axes group 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.
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
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.
Pwr1_Status BOOL FALSE This variable is assigned to the Status output variable
from the PWR1 instance of the 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.
Grp_Stp_Ca BOOL FALSE This variable is assigned to the CommandAborted
output variable from the GRP_EN instance of the
MC_GroupStop instruction.
Grp_Stp_Err BOOL FALSE This variable is assigned to the Error output variable
from the GRP_EN instance of the MC_GroupStop
instruction.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON if Eth-
erCAT process data communications are active and
normal.
StopOn BOOL FALSE This variable gives the status of the external button
that is used to stop. The MC_GroupStop instruction is
executed to stop the axes group if this variable is
TRUE.
InitFlag BOOL FALSE TRUE if the input parameters are set for the
MC_MoveLinearAbsolute and MC_GroupStop
instructions.
Grp_En_Ex BOOL FALSE This variable is used to execute the GRP_EN instance
of the MC_GroupEnable instruction. It is used in ST
programming.
Mv_Lin_Abs_Ex BOOL FALSE This variable is used to execute the MV_LIN_ABS
instance of the MC_MoveLinear instruction. It is used
in ST programming.
Grp_Stp_Ex BOOL FALSE This variable is used to execute the GRP_STP
instance of the MC_GroupStop instruction. It is used
in ST programming.
Grp_Imd_Stp_Ex BOOL FALSE This variable is used to execute the GRP_IMD_STP
instance of the MC_GroupImmediateStop instruction.
It is used in ST programming.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-23


10 Sample Programming

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

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

10-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


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

Samples
Execute Done
MC_Group000.Status.Disabled Busy Grp_En_Bsy
CommandAborted Grp_En_Ca
Error Grp_En_Err
ErrorID Grp_En_ErrID
10
The input parameters for the MC_MoveLinearAbsolute and MC_GroupStop instructions are set.
InitFlag 1 // Parameters for MC_MoveLinearAbsolute

10-2-8 Stopping an Axes Group in Coordinated Motion


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 axes group is enabled, linear interpolation is executed.


MV_LIN_ABS
MC_MoveLinear
MC_Group000.Status.Ready MC_Group000 AxesGroup AxesGroup Mv_Lin_Abs_D
Execute Done
Mv_Lin_Abs_Pos Position Busy Mv_Lin_Abs_Bsy
Mv_Lin_Abs_Vel Velocity Active Mv_Lin_Abs_Act
Mv_Lin_Abs_Acc Acceleration CommandAborted Mv_Lin_Abs_Ca
Mv_Lin_Abs_Dec Deceleration Error Mv_Lin_Abs_Err
Mv_Lin_Abs_Jrk Jerk ErrorID Mv_Lin_Abs_ErrID
Mv_Lin_Abs_Cs CoordSystem
Mv_Lin_Abs_Bm BufferMode
Mv_Lin_Abs_Tm TransitionMode

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

If the Error or CommandAborted output variable of the MC_GroupStop instruction is TRUE,


the MC_GroupImmediateStop instruction is executed to stop immediately.
GRP_IMD_STP
MC_GroupImmediateStop
Grp_Stp_Err MC_Group000 AxesGroup AxesGroup Grp_Imd_Stp_D
Execute Done
Busy Grp_Imd_Stp_Bsy
Grp_Stp_Ca
CommandAborted Grp_Imd_Stp_Ca
Error Grp_Imd_Stp_Err
ErrorID Grp_Imd_Stp_ErrID

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-25


10 Sample Programming

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 Interpolation) 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.


Grp_Stp_Dec := LREAL#1000.0;
Grp_Stp_Jrk := LREAL#1000.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 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;

// 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 (FaultHandler) 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 is 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 is executed for axis 1.
IF (Pwr2_Status=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;
END_IF;

10-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


// If home is defined for axis 0 and axis 1 and the axes group is disabled, the axes group is enabled.
IF (MC_Group000.Status.Disabled=TRUE)
AND (Hm1_D=TRUE) AND (Hm2_D=TRUE) THEN

Samples
Grp_En_Ex:= TRUE;
END_IF;

// If the axes group is enabled, absolute linear interpolation is executed.


IF MC_Group000.Status.Ready=TRUE THEN
Mv_Lin_Abs_Ex:=TRUE; 10
END_IF;

10-2-8 Stopping an Axes Group in Coordinated Motion


// 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 are 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,
Error => Hm1_Err,
ErrorID => Hm1_ErrID
);

HM2(
Axis := MC_Axis001,
Execute := Hm2_Ex,
Done => Hm2_D,
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca,
Error => Hm2_Err,
ErrorID => Hm2_ErrID

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-27


10 Sample Programming

);

//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,
Done => Grp_Stp_D,
Busy => Grp_Stp_Bsy,
Active => Grp_Stp_Act,
CommandAborted => Grp_Stp_Ca,
Error => Grp_Stp_Err,
ErrorID => Grp_Stp_ErrID
);

//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
);

10-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-9 Homing and Absolute Positioning
In this sample, the starting point for homing is assumed to be where the home proximity input is ON.

Samples
The Homing Method is set to home proximity input OFF. After homing is completed to define home,
absolute positioning is executed.
Home input detection direction

ON
Negative limit input signal
OFF
10
ON
Home proximity input signal
OFF

10-2-9 Homing and Absolute Positioning


ON
Home input signal
OFF

Homing start direction


Negative Positive direction
direction Start Homing Absolute positioning
completed. completed.

Samples are provided for both ladder diagram and ST programming.

Axis Parameter Settings That Are Related to Homing

Parameter name Setting Description


Homing Method 4: Home proximity input OFF Home is defined where the home proximity input
turns OFF.
Operation Selection at Posi- 1: Reverse turn/immediate The positive limit input is not used, so the default
tive Limit Input stop setting is used for this parameter.
Operation Selection at Neg- 2: Reverse turn/deceleration The axis decelerates to a stop and reverses direc-
ative Limit Input stop tion when the negative limit input is detected.
Homing Start Direction 2: Negative direction When homing is performed, the axis starts moving
in the negative direction.
Home Input Detection 1: Positive direction Home is detected while the axis moves in the pos-
Direction itive direction.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.Status.StandStill BOOL FALSE TRUE while the Servo is OFF for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
Hm_Ex BOOL FALSE This variable is used to execute the MC_Home
instruction. It is used in ST programming.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-29


10 Sample Programming

Variable name Data type Default Comment


Mv_Abs_Ex BOOL FALSE This variable is used to execute the MC_Move-
Absolute (Absolute Positioning) instruction. It is
used in ST programming.

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

10-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.

Samples
StartPg MC_Axis000.DrvStatus.Ready Lock0

If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0. 10
PWR
MC_Power

10-2-9 Homing and Absolute Positioning


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

If the Servo is ON and home is defined, absolute positioning is executed.


MV_ABS
MC_MoveAbsolute
Pwr_Status Hm_D MC_Axis000 Axis Axis Mv_Abs_D
Execute Done
LREAL#50000.0 Position Busy Mv_Abs_Bsy
LREAL#10000.0 Velocity Active Mv_Abs_Act
LREAL#1000.0 Acceleration CommandAborted Mv_Abs_Ca
LREAL#1000.0 Deceleration Error Mv_Abs_Err
LREAL#0.0 Jerk ErrorID Mv_Abs_ErrID
_eMC_DIRECTION#_mcShortestWay Direction
BufferMode

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-31


10 Sample Programming

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) instruction 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 is executed.
IF (Pwr_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex:=TRUE;
ELSE
Hm_Ex:=FALSE;
END_IF;

// If the Servo is ON and home is defined, absolute positioning is executed.


IF (Pwr_Status=TRUE)
AND (Hm_D=TRUE) THEN
Mv_Abs_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
);

10-32 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


//MC_MoveAbsolute
MV_ABS(
Axis := MC_Axis000,

Samples
Execute := Mv_Abs_Ex,
Position := Mv_Abs_Pos,
Velocity := Mv_Abs_Vel,
Acceleration := Mv_Abs_Acc,
Deceleration := Mv_Abs_Dec,
Direction := Mv_Abs_Dir, 10
Done => Mv_Abs_D,
Busy => Mv_Abs_Bsy,

10-2-9 Homing and Absolute Positioning


Active => Mv_Abs_Act,
CommandAborted => Mv_Abs_Ca,
Error => Mv_Abs_Err,
ErrorID => Mv_Abs_ErrID
);

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-33


10 Sample Programming

10-2-10 Changing the Target Position by Re-execution of an Instruction


This sample starts absolute positioning to a target position of 1000 and then uses the same instance of
the absolute positioning instruction to change the target position to 2000.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
ReExeSw BOOL FALSE This variable is used to re-execute the instruc-
tion.
Mv_Abs_Ex BOOL FALSE This variable is used to execute the MC_Move-
Absolute (Absolute Positioning) instruction. It is
used in ST programming.
Hm_Ex BOOL FALSE This variable is used to execute the MC_Home
instruction. It is used in ST programming.

10-34 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Timing Chart
 Ladder Diagram

Samples
Pwr_Status

Hm_D

Hm_Bsy 10
Mv_Abs_Ex

10-2-10 Changing the Target Position by Re-execution of an Instruction


Mv_Abs_D

Mv_Abs_Bsy

Mv_Abs_Act

ReExeSw

Command position

Time

Command velocity

Time

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-35


10 Sample Programming

 ST Programming
Pwr_Status

Hm_Ex

Hm_D

Hm_Bsy

Mv_Abs_Ex

Mv_Abs_D

Mv_Abs_Bsy

Mv_Abs_Act

ReExeSw

Command position

Time

Command velocity

Time

10-36 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.

Samples
StartPg MC_Axis000.DrvStatus.Ready Lock0

If the Servo Drive for axis 0 is ready, turn ON the Servo for axis 0.
PWR 10
MC_Power
Lock0 MC_Axis000 Axis Axis Pwr_Status

10-2-10 Changing the Target Position by Re-execution of an Instruction


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.
MC_Axis000.Details.Homed Mv_Abs_Act Mv_Abs_Ex

When ReExeSw changes to TRUE, the absolute positioning instruction is re-executed to change the target position to 2000.

ReExeSw 1 Mv_Abs_Pos := LREAL#2000.0;

Restart_Ex

Absolute positioning is executed according to the status of Mv_Abs_Ex.


MV_ABS
MC_MoveAbsolute
Mv_Abs_Ex MC_Axis000 Axis Axis Mv_Abs_D
Execute Done
Restart_Ex Mv_Abs_Pos 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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-37


10 Sample Programming

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;
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 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 is executed.
IF (Pwr_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex:=TRUE;
END_IF;

// After homing is completed for axis 0, absolute positioning is executed if it is not already in progress.
IF (Hm_D=TRUE)
AND (Mv_Abs_Act=FALSE) THEN
Mv_Abs_Ex := TRUE;
ELSE
Mv_Abs_Ex := FALSE;
END_IF;

// When ReExeSw changes to TRUE, the absolute positioning instruction is re-executed to change the target
position to 2000.
IF ReExeSw=TRUE THEN
Mv_Abs_Pos :=LREAL#2000.0;
Mv_Abs_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

10-38 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


);

//MC_Home
HM(
Axis := MC_Axis000,

Samples
Execute := Hm_Ex,
Done => Hm_D,
Busy => Hm_Bsy,
CommandAborted => Hm_Ca,
Error => Hm_Err,
ErrorID => Hm_ErrID 10
);

10-2-10 Changing the Target Position by Re-execution of an Instruction


//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
);

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-39


10 Sample Programming

10-2-11 Interrupt Feeding


This sample performs interrupt feeding when an interrupt occurs during velocity control. One of the fol-
lowing is specified for the Direction variable when velocity control is performed in Rotary Mode.
• _mcPositiveDirection
• _mcNegativeDirection
• _mcCurrentDirection
This sample uses _mcCurrentDirection. A positive value is specified for the FeedDistance input variable
to perform feeding in the same direction as the motion before the interrupt input. A negative value is
specified for the FeedDistance input variable to perform feeding in the opposite direction as the motion
before the interrupt input. For example, if a positive value is specified for the FeedDistance input vari-
able when the motion was in the negative direction before the interrupt input, feeding is performed in
the negative direction. If a negative value is specified for the FeedDistance input variable, feeding is
performed in the positive direction.
Velocity control Interrupt feeding
Velocity

Time

Axis Parameter Settings

Parameter name Setting Description


Count Mode Rotary Mode Rotary Mode is set as the count mode for the position.
Modulo Maximum Position 360 The Modulo Maximum Position is set to 360.
Setting Value
Modulo Minimum Position 0 The Modulo Minimum Position is set to 0.
Setting Value
Homing Method Zero position preset A zero position preset is performed to define home.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned
ON if EtherCAT process data communica-
tions are active and normal.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
TrigRef _sTRIGGER_REF --- This parameter specifies the trigger input
condition to use for the interrupt input. Latch
1 of the Servo Drive is used in this sample.
Hm_Ex BOOL FALSE This variable is used to execute the
MC_Home instruction. It is used in ST pro-
gramming.

10-40 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Variable name Data type Default Comment
Mv_Feed_Ex BOOL FALSE This variable is used to execute the
MC_MoveFeed (Interrupt Feeding) instruc-
tion. It is used in ST programming.

Samples
InitFlag BOOL FALSE TRUE if the input parameters are set for the
MC_MoveFeed instruction.

Ladder Diagram
10
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.
StartPg MC_Axis000.DrvStatus.Ready Lock0

10-2-11 Interrupt Feeding


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

The input parameters for interrupt feeding are set.

InitFlag 1 // Parameters for MC_MoveFeed


2 Mv_Feed_TrigRef.Mode := _eMC_TRIGGER_MODE#_mcDrive;
3 Mv_Feed_TrigRef.LatchID := _eMC_TRIGGER_LATCH_ID#_mcLatch1;
4 Mv_Feed_TrigRef.InputDrive := _eMC_TRIGGER_INPUT_DRIVE#_mcEncoderMark;
5 Mv_Feed_TrigVar := FALSE;
6 Mv_Feed_Pos := LREAL#2000.0;
7 Mv_Feed_Vel := LREAL#1000.0;
8 Mv_Feed_Acc := LREAL#10000.0;
9 Mv_Feed_Dec := LREAL#10000.0;
10 Mv_Feed_Dir := _eMC_DIRECTION#_mcCurrentDirection;
11 Mv_Feed_Mm := _eMC_MOVE_MODE#_mcVelocity;
12 Mv_Feed_FeedDis := LREAL#500.0;
13 Mv_Feed_FeedVel := LREAL#500.0;
14 // The Input Parameter Initialization Completed Flag is changed to TRUE.
15 InitFlag := TRUE;

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-41


10 Sample Programming

If homing is completed, interrupt feeding is executed.

MV_FEED
MC_MoveFeed
MC_Axis000 Axis Axis
MvFeed_TrigRef TriggerInput TriggerInput
Hm_D Mv_Feed_TrigVar TriggerVariable TriggerVariable Mv_Feed_D
Execute Done
WindowOnly InFeed Mv_Feed_InFeed
FirstPosition Busy Mv_Feed_Bsy
LastPosition Active Mv_Feed_Act
ReferenceType CommandAborted Mv_Feed_Ca
Mv_Feed_Pos Position Error Mv_Feed_Err
Mv_Feed_Vel Velocity ErrorID Mv_Feed_ErrID
Mv_Feed_Acc Acceleration
Mv_Feed_Dec Deceleration
Jerk
Mv_Feed_Dir Direction
Mv_Feed_Mm MoveMode
Mv_Feed_FeedDis FeedDistance
Mv_Feed_FeedVel FeedVelocity
BufferMode
ErrorDetect

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;

10-42 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
IF (Pwr_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex:=TRUE;
END_IF;

Samples
// If homing is defined, interrupt feeding is executed.
IF Hm_D=TRUE THEN
Mv_Feed_Ex:=TRUE;
END_IF;
10
// MC_Power

10-2-11 Interrupt Feeding


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,
Execute := Mv_Feed_Ex,
Position := Mv_Feed_Pos,
Velocity := Mv_Feed_Vel,
Acceleration := Mv_Feed_Acc,
Deceleration := Mv_Feed_Dec,
Direction := Mv_Feed_Dir,
MoveMode := Mv_Feed_Mm,
FeedDistance := Mv_Feed_FeedDis,
FeedVelocity := Mv_Feed_FeedVel,
Done => Mv_Feed_D,
InFeed => Mv_Feed_InFeed,
Busy => Mv_Feed_Bsy,
Active => Mv_Feed_Act,
CommandAborted => Mv_Feed_Ca,
Error => Mv_Feed_Err,
ErrorID => Mv_Feed_ErrID
);

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-43


10 Sample Programming

10-2-12 Changing the Cam Table by Re-execution of an Instruction


This sample changes the cam table during cam motion. CamProfile0 is used when the command posi-
tion for axis 0 is 5000 or less and CamProfile1 is used when it is over 5000.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
CamProfile0 ARRAY[0..100] OF --- This is the cam data variable.*
_sMC_CAM_REF
CamProfile1 ARRAY[0..10] OF --- This is the cam data variable.*
_sMC_CAM_REF
Pwr1_S BOOL FALSE This variable is assigned to the Status out-
put variable from the PWR1 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Pwr2_S BOOL FALSE This variable is assigned to the Status out-
put variable from the PWR2 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
CamTable0 BOOL FALSE TRUE when CamProfile0 is used for the
cam table.
CamTable1 BOOL FALSE TRUE when CamProfile1 is used for the
cam table.
Camin_InCam0 BOOL FALSE This variable is assigned to the InCam out-
put variable from the CAMIN instance of the
MC_CamIn instruction. It is TRUE during
cam motion for CamProfile0. After this vari-
able changes to TRUE, it remains TRUE
until the operation is completed or canceled.
Camin_InCam1 BOOL FALSE This variable is assigned to the InCam out-
put variable from the CAMIN instance of the
MC_CamIn instruction. It is TRUE during
cam motion for CamProfile1. After this vari-
able changes to TRUE, it remains TRUE
until the operation is completed or canceled.
Mv_Abs_Act BOOL FALSE This variable is assigned to the Active out-
put variable from the MV_ABS instance of
the MC_MoveAbsolute instruction.
Hm1_Ex BOOL FALSE This variable is used to re-execute the
MC_Home instruction for axis 0.
Hm2_Ex BOOL FALSE This variable is used to re-execute the
MC_Home instruction for axis 1.
Mv_Abs_Ex BOOL FALSE This variable is used to execute the
MC_MoveAbsolute (Absolute Positioning)
instruction.
Camin_Ex BOOL FALSE This variable is used to execute the MC_-
CamIn (Start Cam) instruction. It is used in
ST programming.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned
ON if EtherCAT process data communica-
tions are active and normal.
* The array elements ARRAY[0..N] are set with the Cam Editor in the Sysmac Studio. The range of the array is 0 to
109 in this sample.

10-44 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Timing Chart
 Ladder Diagram

Samples
Command current position of axis 0
5000.0
CamTable1

10
CamTable0

10-2-12 Changing the Cam Table by Re-execution of an Instruction


CamTable1

MV_ABS Mv_Abs_Act

CAMIN CAMIN.Execute

Camin_Bsy

Camin_Act

Camin_InCam0

Camin_InCam1

Camin_InSync

CamProfile0 CamProfile1

 ST Programming

Command current position of axis 0


5000.0
CamTable1

CamTable0

CamTable1

MV_ABS Mv_Abs_Act

CAMIN Camin_Ex

Camin_Bsy

Camin_Act

Camin_InCam0

Camin_InCam1

Camin_InSync

CamProfile0 CamProfile1

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-45


10 Sample Programming

Ladder Diagram
To change from one cam table to another, two instances of the MC_CamIn (Start Cam Operation) instruction with
the same instance name are used. A different output parameter is assigned to the InCam (Cam Motion) output vari-
able from each instance. 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

10-46 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


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

Samples
Execute Done
Busy Hm1_Bsy
CommandAborted Hm1_Ca
Error Hm1_Err
ErrorID Hm1_ErrID
10
If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed.

10-2-12 Changing the Cam Table by Re-execution of an Instruction


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

If homing is completed for axis 0, absolute positioning is executed.


MV_ABS
MC_MoveAbsolute
Hm1_D MC_Axis000 Axis Axis Mv_Abs_D
Execute Done
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
Jerk ErrorID Mv_Abs_ErrID
_eMC_DIRECTION#_mcPositiveDirection Direction
BufferMode

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

Mv_Abs_Act CamTable0 Camin_InCam0 Lock3

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-47


10 Sample Programming

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

10-48 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


ST Programming
// If the input parameters for absolute positioning and starting cam operation are not set, the target values and other
parameters are set.

Samples
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveAbsolute (Absolute Positioning) instruction are set.
Mv_Abs_Pos := LREAL#10000.0;
Mv_Abs_Vel := LREAL#2000.0;
Mv_Abs_Acc := LREAL#2000.0;
Mv_Abs_Dec := LREAL#2000.0; 10
// The input parameters for the MC_CamIn (Start Cam Operation) instruction are set.
Camin_EM := TRUE;

10-2-12 Changing the Cam Table by Re-execution of an Instruction


Camin_StMode := _eMC_START_MODE#_mcAbsolutePosition;
Camin_StPos := LREAL#1.0;
Camin_MStDis := LREAL#1.0;
Camin_MSc := LREAL#1.0;
Camin_SSc := 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 cam table is selected.
CamTable0 :=BOOL#TRUE;
CamTable1 :=BOOL#FALSE;

// 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 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 is 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 is executed.
IF (Pwr2_S=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-49


10 Sample Programming

Hm2_Ex:=TRUE;
END_IF;

// If homing is completed for axis 0, absolute positioning is executed.


IF Hm1_D=TRUE THEN
Mv_Abs_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 TRUE.
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,


// then the instance that uses CamProfile0 for the cam table is executed.
// 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;

// If CamTable1 is TRUE during absolute positioning,


// then the instance that uses CamProfile1 for the cam table is executed.
IF (Mv_Abs_Act=TRUE)
AND (CamTable1=TRUE) THEN
Camin_Ex := TRUE;
END_IF;

//MC_Camin
IF CamTable0=TRUE THEN
CAMIN(
Master := MC_Axis000,
Slave := MC_Axis001,
CamTable := CamProfile0,
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_InCam0,
InSync => Camin_InSync,
EndOfProfile => Camin_EOP,
Index => Camin_Index,
Busy => Camin_Bsy,
Active => Camin_Act,
CommandAborted => Camin_Ca,

10-50 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Error => Camin_Err,
ErrorID => Camin_ErrID
);
END_IF;

Samples
IF CamTable1=TRUE THEN
CAMIN(
Master := MC_Axis000,
Slave := MC_Axis001,
CamTable := CamProfile1,
Execute := Camin_Ex, 10
Periodic := Camin_EM,
StartMode := Camin_StMode,

10-2-12 Changing the Cam Table by Re-execution of an Instruction


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;

// MC_Power for axis 0


PWR1(
Axis := MC_Axis000,
Enable := Pwr1_En,
Status => Pwr1_S,
Busy => Pwr1_Bsy,
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
);

// MC_Power for axis 1


PWR2(
Axis := MC_Axis001,
Enable := Pwr2_En,
Status => Pwr2_S,
Busy => Pwr2_Bsy,
Error => Pwr2_Err,
ErrorID => Pwr2_ErrID
);

// MC_Home for axis 0


HM1(
Axis := MC_Axis000,
Execute := Hm1_Ex,
Done => Hm1_D,
Busy => Hm1_Bsy,
CommandAborted => Hm1_Ca,
Error => Hm1_Err,
ErrorID => Hm1_ErrID

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-51


10 Sample Programming

);

// MC_Home for axis 1


HM2(
Axis := MC_Axis001,
Execute := Hm2_Ex,
Done => Hm2_D,
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca,
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
);

10-52 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-13 Using a Cam Profile Curve to Correct the Sync Position
This sample uses a cam profile curve to correct a slave axis in a gear motion. The slave axis for gear

Samples
motion is MC_Axis001, a virtual Servo axis, and the slave axis for cam motion is MC_Axis002, also a
virtual Servo axis. These slave axes are combined with MC_CombineAxes and the results is output to
MC_Axis003, a Servo axis. The master axis is MC_Axis000, a Servo axis.
The processing flow is as follows:

Synchronized motion with gear operation instructions Synchronized motion with cam operation instructions 10
Master axis: MC_Axis000 Master axis: MC_Axis000
Slave axis: MC_Axis001 Slave axis: MC_Axis002

10-2-13 Using a Cam Profile Curve to Correct the Sync Position


Corrected Motion with
Combine Axes Instruction
Slave axis: MC_Axis003

 Axis Type Settings


The axes types are set in the axis parameters for each axis as given below.

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

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
MC_Axis001.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 1.
MC_Axis002 _sAXIS_REF --- This is the Axis Variable for axis 2.
MC_Axis002.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 2.
MC_Axis003 _sAXIS_REF --- This is the Axis Variable for axis 3.
MC_Axis003.Details.Homed BOOL FALSE TRUE when home is defined for axis 3.
MC_Axis003.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 3.
CamProfile0 ARRAY[0..109] OF --- This is the cam data variable.*1
_sMC_CAM_REF
Pwr1_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR1 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Pwr4_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR4 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Vel_InVel BOOL FALSE TRUE when the target velocity for
MC_MoveVelocity for axis 0 is reached.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-53


10 Sample Programming

Variable name Data type Default Comment


StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned
ON if EtherCAT process data communica-
tions are active and normal.
Gearin_Ex BOOL FALSE This variable is used to execute the
MC_GearIn (Start Gear Operation) instruc-
tion.*2
Camin_Ex BOOL FALSE This variable is used to execute the MC_-
CamIn (Start Cam Operation) instruction.*2
Combine_Ex BOOL FALSE This variable is used to execute the MC_-
CombineAxes (Combine Axes) instruction.*2
*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 109 in this sample.
*2 The variable is used in ST programming.

10-54 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Timing Chart
 Ladder Diagram

Samples
VEL Vel_InVel

GEARIN GEARIN.Execute

Gearin_InGear 10
Gearin_Bsy

10-2-13 Using a Cam Profile Curve to Correct the Sync Position


Gearin_Act

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-55


10 Sample Programming

 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

10-56 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.

Samples
StartPg MC_Axis000.DrvStatus.Ready Lock0

Check if the Servo Drive for axis 3 is ready when StartPg is TRUE. 10
StartPg MC_Axis003.DrvStatus.Ready Lock3

10-2-13 Using a Cam Profile Curve to Correct the Sync Position


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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-57


10 Sample Programming

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

If homing is completed for axis 0, velocity control is executed.


VEL
MC_MoveVelocity
Hm1_D Vel_InVel
MC_Axis000 Axis Axis
Execute InVelocity
LREAL#100.0 Velocity Busy Vel_Bsy
LREAL#0.0 Acceleration Active Vel_Act
LREAL#0.0 Deceleration CommandAborted Vel_Ca
Jerk Error Vel_Err
_eMC_DIRECTION#_mcPositiveDirection Direction ErrorID Vel_ErrID
Continuous
BufferMode

If homing is completed for axis 0, gear operation is executed.


GEARIN
MC_GearIn
MC_Axis000 Master Master
Vel_InVel MC_Axis001 Slave Slave GearIn_InGear
Execute InGear
UINT#1 RatioNumerator Busy GearIn_Bsy
UINT#1 RatioDenominator Active GearIn_Act
_eMC_REFERENCE_TYPE#_mcCommand ReferenceType CommandAborted GearIn_Ca
LREAL#0.0 Acceleration Error GearIn_Err
LREAL#0.0 Deceleration ErrorID GearIn_ErrID
Jerk
BufferMode

When axis 0 reaches the target velocity, cam operation is executed.

CAMIN
MC_CamIn
MC_Axis000 Master Master
MC_Axis002 Slave Slave
Vel_InVel 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

10-58 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


If both gear and cam operation are in progress, the Combine Axes instruction is executed.
COMBINE
MC_CombineAxes
MC_Axis001 Master Master

Samples
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
10
RatioNumeratorAuxiliary Error Combine_Err
RatioDenominatorAuxiliary ErrorID Combine_ErrID

10-2-13 Using a Cam Profile Curve to Correct the Sync Position


_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 values and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction are 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 set.
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;

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-59


10 Sample Programming

// 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();
END_IF;

// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is 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 3 and home is not defined, the MC_Home instruction is executed for axis 3.
IF (Pwr4_Status=TRUE)
AND (MC_Axis003.Details.Homed=FALSE) THEN
Hm4_Ex:=TRUE;
END_IF;

// If homing is completed for axis 0, velocity control is executed.


IF Hm1_D=TRUE THEN
Vel_Ex:=TRUE;
END_IF;

// When axis 0 reaches the target velocity, gear operation is executed.


IF Vel_InVel=TRUE THEN
Gearin_Ex := TRUE;
END_IF;

// When axis 0 reaches the target velocity, cam operation is executed.


IF Vel_InVel=TRUE THEN
Camin_Ex := TRUE;
END_IF;

// 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;

// MC_Power for axis 0


PWR1(
Axis := MC_Axis000,
Enable := Pwr1_En,
Status => Pwr1_Status,
Busy => Pwr1_Bsy,
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
);

// MC_Power for axis 3


PWR4(

10-60 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Axis := MC_Axis003,
Enable := Pwr4_En,
Status => Pwr4_Status,
Busy => Pwr4_Bsy,
Error => Pwr4_Err,

Samples
ErrorID => Pwr4_ErrID
);

// MC_Home for axis 0


HM1(
Axis := MC_Axis000, 10
Execute := Hm1_Ex,
Done => Hm1_D,

10-2-13 Using a Cam Profile Curve to Correct the Sync Position


Busy => Hm1_Bsy,
CommandAborted => Hm1_Ca,
Error => Hm1_Err,
ErrorID => Hm1_ErrID
);

// MC_Home for axis 3


HM4(
Axis := MC_Axis003,
Execute := Hm4_Ex,
Done => Hm4_D,
Busy => Hm4_Bsy,
CommandAborted => Hm4_Ca,
Error => Hm4_Err,
ErrorID => Hm4_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
CAMIN(
Master := MC_Axis000,
Slave := MC_Axis002,
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,

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-61


10 Sample Programming

Index => Camin_Index,


Busy => Camin_Bsy,
Active => Camin_Act,
CommandAborted => Camin_Ca,
Error => Camin_Err,
ErrorID => Camin_ErrID
);

//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
);

10-62 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-14 Shifting the Phase of a Master Axis in Cam Motion
This sample synchronizes a slave axis in cam motion with a master axis in velocity control. If StartOn is

Samples
TRUE, the phase of the master axis is shifted with the MC_Phasing (Shift Master Axis Phase) instruc-
tion. The slave axis is synchronized with the shifted phase.

Main Variables Used in the Programming Samples


10
Variable name Data type Default Comment

10-2-14 Shifting the Phase of a Master Axis in Cam Motion


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
MC_Axis001.Details.Homed BOOL FALSE TRUE when home is defined for axis 1.
MC_Axis001.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 1.
CamProfile0 ARRAY[0..360] OF --- This is the cam data variable.*
_sMC_CAM_REF
Pwr1_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR1 instance of the
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.
StartOn BOOL FALSE This variable is used to start shifting the
phase of the master axis.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned
ON if EtherCAT process data communica-
tions are active and normal.
Camin_Ex BOOL FALSE This variable is used to execute the MC_-
CamIn (Start Cam) instruction. It is used in
ST programming.
Vel_Ex BOOL FALSE This variable is used to execute the
MC_MoveVelocity (Velocity Control) instruc-
tion. It is used in ST programming.
Phasing_Ex BOOL FALSE This variable is used to execute the
MC_Phasing (Shift Master Axis Phase)
instruction. It is used in ST programming.
* 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-63


10 Sample Programming

Timing Chart
 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

10-64 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


 ST Programming
StartOn

Samples
MC_Phasing
Phasing_Ex

Phasing_Bsy
10
Phasing_Act

Phasing_D

10-2-14 Shifting the Phase of a Master Axis in Cam Motion


MC_MoveVelocity
Vel_Ex

Vel_InVel

MC_CamIn

Camin_Ex

Camin_InCam

Camin_InSync

Camin_Bsy

Command velocity

MC_Axis000

MC_Axis001

Time

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-65


10 Sample Programming

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

10-66 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


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

Samples
Execute Done
Busy Hm2_Bsy
CommandAborted Hm2_Ca
Error Hm2_Err
ErrorID Hm2_ErrID
10
If homing is completed for axis 0, velocity control is executed.

10-2-14 Shifting the Phase of a Master Axis in Cam Motion


VEL
MC_MoveVelocity
Hm1_D Vel_InVel
MC_Axis000 Axis Axis
Execute InVelocity
LREAL#1000.0 Velocity Busy Vel_Bsy
LREAL#100000.0 Acceleration Active Vel_Act
LREAL#100000.0 Deceleration CommandAborted Vel_Ca
Jerk Error Vel_Err
_eMC_DIRECTION#_mcPositiveDirection Direction ErrorID Vel_ErrID
Continuous
BufferMode

When axis 0 reaches the target velocity, cam operation is executed.

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-67


10 Sample Programming

ST Programming
// If the input parameters for the motion 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 are set.
Vel_Vel := LREAL#1000.0;
Vel_Acc := LREAL#100000.0;
Vel_Dec := LREAL#100000.0;
Vel_Dir := _eMC_DIRECTION#_mcPositiveDirection;

// The input parameters for the MC_Phasing (Shift Master Axis Phase) instruction are set.
Phasing_Ps := LREAL#500.0;
Phasing_Vel := LREAL#1000.0;
Phasing_Acc := LREAL#0.0;
Phasing_Dec := LREAL#0.0;

// The input parameters for the MC_CamIn (Start Cam Operation) instruction are set.
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 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 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 is 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 is executed for axis 1.
IF (Pwr2_Status=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;

10-68 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


END_IF;

// If homing is completed for axis 0, velocity control is executed.


IF Hm1_D=TRUE THEN
Vel_Ex:=TRUE;

Samples
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; 10
END_IF;

10-2-14 Shifting the Phase of a Master Axis in Cam Motion


// If StartOn is TRUE and cam motion is in sync, shifting the phase of the master axis is started.
IF (StartOn=TRUE)
AND (Camin_InSync=TRUE) THEN
Phasing_Ex:=TRUE;
END_IF;

// MC_Power for axis 0


PWR1(
Axis := MC_Axis000,
Enable := Pwr1_En,
Status => Pwr1_Status,
Busy => Pwr1_Bsy,
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
);

// MC_Power for axis 1


PWR2(
Axis := MC_Axis001,
Enable := Pwr2_En,
Status => Pwr2_Status,
Busy => Pwr2_Bsy,
Error => Pwr2_Err,
ErrorID => Pwr2_ErrID
);

// MC_Home for axis 0


HM1(
Axis := MC_Axis000,
Execute := Hm1_Ex,
Done => Hm1_D,
Busy => Hm1_Bsy,
CommandAborted => Hm1_Ca,
Error => Hm1_Err,
ErrorID => Hm1_ErrID
);

// MC_Home for axis 1


HM2(
Axis := MC_Axis001,
Execute := Hm2_Ex,
Done => Hm2_D,
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca,
Error => Hm2_Err,
ErrorID => Hm2_ErrID
);

//MC_MoveVelocity
VEL(
Axis := MC_Axis000,

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-69


10 Sample Programming

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

10-70 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-15 Changing the Actual Position during Velocity Control
This sample changes the absolute values of the command current position and the actual current posi-

Samples
tion for an axis in velocity control.

Precautions for Correct Use


• When you use the MC_SetPosition instruction for an axis in motion, the travel distance
between execution of the instruction and changing the actual position will remain as error. 10
• Home will become undefined when the MC_Set Position instruction is executed.

10-2-15 Changing the Actual Position during Velocity Control


Axis Parameter Settings

Parameter name Setting Description


Count Mode Rotary Mode Rotary Mode is set as the count mode for the position.
Modulo Maximum Position 360 The Modulo Maximum Position is set to 360.
Setting Value
Modulo Minimum Position 0 The Modulo Minimum Position is set to 0.
Setting Value
Homing Method Zero position preset A zero position preset is performed to define home.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
StartSetPos BOOL FALSE This variable gives the status of the external
button that is used to change the actual posi-
tion.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned
ON if EtherCAT process data communications
are active and normal.
Vel_Ex BOOL FALSE This variable is used to execute the
MC_MoveVelocity (Velocity Control) instruc-
tion. It is used in ST programming.
SetPos_Ex BOOL FALSE This variable is used to execute the MC_Set-
Position instruction. It is used in ST program-
ming.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-71


10 Sample Programming

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

Command current velocity

Command current position

Actual current position

Time

10-72 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


 ST Programming
MC_MoveVelocity
Vel_Ex

Samples
Ve_InVel

Vel_Bsy

10
MC_SetPosition
Set_Pos_Ex

10-2-15 Changing the Actual Position during Velocity Control


Set_Pos_D

Set_Pos_Bsy

MC_Axis000

Command current velocity

Command current position

Actual current position

Time

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-73


10 Sample Programming

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, velocity control is executed.


VEL
MC_MoveVelocity
Pwr_Status Vel_InVel
MC_Axis000 Axis Axis
Execute InVelocity
LREAL#36.0 Velocity Busy Vel_Bsy
LREAL#1000.0 Acceleration Active Vel_Act
LREAL#1000.0 Deceleration CommandAborted Vel_Ca
LREAL#100.0 Jerk Error Vel_Err
Direction ErrorID Vel_ErrID
Continuous
BufferMode

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

10-74 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


ST Programming
// If the input parameters for the instructions are not set, the target values and other parameters are set.
IF InitFlag=FALSE THEN

Samples
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction are set.
Vel_Vel := LREAL#36.0;
Vel_Acc := LREAL#1000.0;
Vel_Dec := LREAL#1000.0;
Vel_Jrk := LREAL#100.0;
10
// The input parameters for the MC_SetPosition instruction are set.
Set_Pos_Pos := LREAL#0.0;

10-2-15 Changing the Actual Position during Velocity Control


// 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
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, velocity control is executed for axis 0.


IF Pwr_Status=TRUE THEN
Vel_Ex:=TRUE;
END_IF;

// If StartSetPos is TRUE while the Servo is ON, the Set Position instruction is executed.
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,

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-75


10 Sample Programming

Deceleration := Vel_Dec,
Jerk := Vel_Jrk,
InVelocity => Vel_InVel,
Busy => Vel_Bsy,
Active => Vel_Act,
CommandAborted => Vel_Ca,
Error => Vel_Err,
ErrorID => Vel_ErrID
);

//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-76 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


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

Samples
the Sysmac Studio. The displacements for phases of 0° to 180° are multiplied by 2 and the displace-
ments 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. 10
Precautions for Correct Use

10-2-16 Changing a Cam Data Variable and Saving the Cam Table
• 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 Proper-
ties) 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_Save-
CamTable instruction, the cam data variable will revert to the contents from before it was
changed by the user program.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
CamProfile0 ARRAY[0..360] OF --- This is the cam data variable.*
_sMC_CAM_REF
Pwr1_Status BOOL FALSE This variable is assigned to the Status output vari-
able from the PWR1 instance of the MC_Power
instruction. It is TRUE when the Servo is ON.
Pwr2_Status BOOL FALSE This variable is assigned to the Status output vari-
able from the PWR2 instance of the MC_Power
instruction. It is TRUE when the Servo is ON.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON if
EtherCAT process data communications are active
and normal.
WriteCamdata BOOL FALSE This variable is used to start changing the cam
data. 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 execution the Save Cam
Table instruction.
_MC_COM.Status. BOOL FALSE This system-defined variable is TRUE while cam
CamTableBusy table data is being saved.
Sv_Cam_Ex BOOL FALSE This variable is used to execute the MC_SaveCam-
Table instruction.
Camin_Ex BOOL FALSE This variable is used to execute the MC_CamIn
(Start Cam) instruction. It is used in ST program-
ming.
* 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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-77


10 Sample Programming

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

10-78 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


Ladder Diagram
Check if the Servo Drive for axis 0 is ready when StartPg is TRUE.

Samples
StartPg MC_Axis000.DrvStatus.Ready Lock0

Check if the Servo Drive for axis 1 is ready when StartPg is TRUE. 10
StartPg MC_Axis001.DrvStatus.Ready Lock1

10-2-16 Changing a Cam Data Variable and Saving the Cam Table
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 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.

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-79


10 Sample Programming

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.

1 IF (WriteDone=TRUE) AND (SaveCamtable=TRUE) AND (_MC_COM.Status.CamTableBusy=FALSE) THEN


2 Sv_Cam_Ex := TRUE;
3 END_IF;

If Sv_Ca_TimeUp is TRUE, Sv_Cam_Ex is changed to FALSE.


If Sv_Cam_Ex changes to FALSE, Sv_Ca_TimeUp changes to FALSE and Sv_Cam_Ex changes to TRUE.
The MC_SaveCamTable instruction is executed again.

Sv_Cam_Ex Sv_Ca_TimeUp Sv_Cam_Ex

If Sv_Cam_Ex changes to TRUE, the MC_SaveCamTable instruction is executed.


SV_CAM
MC_SaveCamTable
Sv_Cam_Ex CamProfile0 CamTable CamTable Sv_Cam_D
Execute Done
Busy Sv_Cam_Bsy
CommandAborted Sv_Cam_Ca
Error Sv_Cam_Err
ErrorID Sv_Cam_ErrID

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

10-80 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


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

Samples
In Q
T#1s PT ET

Sv_Ca_CountLoad changes to TRUE for one period when the cam table is saved.
If Sv_Ca_CountLoad is TRUE, the retry counter is reset.
10
Sv_Ca_CountLoad
SaveCamTable

10-2-16 Changing a Cam Data Variable and Saving the Cam Table
If a Cannot Execute Save Cam Table error occurs three times, Sv_Ca_CountUp is changed to TRUE.
When 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
Sv_Cam_Disable CTD Sv_Ca_CountUP
CD Q
Sv_Ca_CountLoad Load CV
INT#3 PV

If homing is completed for axis 0, velocity control is executed.


VEL
MC_MoveVelocity
Hm1_D MC_Axis000 Axis Axis Vel_InVel
Execute InVelocity
LREAL#1000.0 Velocity Busy Vel_Bsy
LREAL#0.0 Acceleration Active Vel_Act
LREAL#0.0 Deceleration CommandAborted Vel_Ca
Jerk Error Vel_Err
_eMC_DIRECTION#_mcPositiveDirection Direction ErrorID Vel_ErrID
BOOL#False Continuous
BufferMode

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

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-81


10 Sample Programming

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 are 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 set.
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 for any of the axes, 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_COM.MFaultLvl.Active=TRUE) THEN
FaultHandler();
END_IF;

// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is 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 is executed for axis 1.

10-82 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


IF (Pwr2_Status=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;
END_IF;

Samples
// 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 of 0° to 180° are multiplied by 2 and the displacements for phases of 181° to 360°
are multiplied by 0.5.
// When the changes are completed, WriteDone is changed to TRUE. 10
IF (WriteCamdata=TRUE)
AND (_MC_COM.Status.CamTableBusy=FALSE) THEN

10-2-16 Changing a Cam Data Variable and Saving the Cam Table
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 homing is completed for axis 0, velocity control is executed.


IF Hm1_D=TRUE THEN
Vel_Ex:=TRUE;
END_IF;

// If the changes to the cam data variable are completed, SaveCamtable is TRUE, and a cam table file save opera-
tion 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_TimeUp is TRUE, Sv_Cam_Ex is changed to FALSE.


// If Sv_Cam_Ex is FALSE, Sv_Ca_TimeUp changes to FALSE and Sv_Cam_Ex changes to TRUE.
// The MC_SaveCamTable instruction is executed again.
IF (Sv_Cam_Ex=TRUE)
AND (Sv_Ca_TimeUp=FALSE) THEN
Sv_Cam_Ex := TRUE;
ELSE
Sv_Cam_Ex := FALSE;
END_IF;

// If Sv_Ca_CountUp is FALSE and a Cannot Execute Save Cam Table error occurs,
// Sv_Cam_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 ,

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-83


10 Sample Programming

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 changed 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 and axis 0 is at the target
velocity, the cam operation is executed.
IF (Vel_InVel=TRUE)
AND (WriteDone=TRUE)
AND (Sv_Cam_D=TRUE) THEN
Camin_Ex:=TRUE;
END_IF;

//MC_SaveCamTable
SV_CAM(
CamTable :=CamProfile0,
Execute := Sv_Cam_Ex,
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
);

10-84 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


// MC_Power for axis 0
PWR1(
Axis := MC_Axis000,
Enable := Pwr1_En,
Status => Pwr1_Status,

Samples
Busy => Pwr1_Bsy,
Error => Pwr1_Err,
ErrorID => Pwr1_ErrID
);

// MC_Power for axis 1 10


PWR2(
Axis := MC_Axis001,

10-2-16 Changing a Cam Data Variable and Saving the Cam Table
Enable := Pwr2_En,
Status => Pwr2_Status,
Busy => Pwr2_Bsy,
Error => Pwr2_Err,
ErrorID => Pwr2_ErrID
);

// MC_Home for axis 0


HM1(
Axis := MC_Axis000,
Execute := Hm1_Ex,
Done => Hm1_D,
Busy => Hm1_Bsy,
CommandAborted => Hm1_Ca,
Error => Hm1_Err,
ErrorID => Hm1_ErrID
);

// MC_Home for axis 1


HM2(
Axis := MC_Axis001,
Execute := Hm2_Ex,
Done => Hm2_D,
Busy => Hm2_Bsy,
CommandAborted => Hm2_Ca,
Error => Hm2_Err,
ErrorID => Hm2_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
);

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-85


10 Sample Programming

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
Check Time, Positive Software Limit, and Negative Software Limit.

Main Variables Used in the Programming Samples

Variable name Data type Default Comment


MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
InitFlag BOOL FALSE This variable indicates the status of parameter settings.
FALSE while parameters are changed.
TRUE after the changes to the parameters are completed.
StartPg BOOL FALSE This variable is used to execute the MC_Write instruction.

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 StartPg is TRUE, the setting of the In-position Check Time is changed.


WRITE1
MC_Write
MC_Axis000 Target Target
StartPg Write1_Sv SettingValue SettingValue Write1_D
Execute Done
Write1_Pn ParameterNumber Busy Write1_Bsy
CommandAborted Write1_Ca
Error Write1_Err
ErrorID Write1_ErrID

If changing the setting of the In-Position Check Time is completed,


the setting of the Positive Software Limit is changed.
WRITE2
MC_Write
MC_Axis000 Target Target
Write1_D Write2_Sv SettingValue SettingValue Write2_D
Execute Done
Write2_Pn ParameterNumber Busy Write2_Bsy
CommandAborted Write2_Ca
Error Write2_Err
ErrorID Write2_ErrID

10-86 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


If changing the setting of the Positive Software Limit is completed, the setting of the Negative Software Limit is changed.
WRITE3
MC_Write

Samples
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 10
ErrorID Write3_ErrID

10-2-17 Temporarily Changing Axis Parameters


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 StartPg is TRUE, the setting of the In-position Check Time is changed.


IF StartPg =TRUE THEN
Write1_Ex := 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
Write2_Ex := TRUE;
END_IF;

// If changing the setting of the Positive Software Limit is completed, the setting of the Negative Software Limit is
changed.
IF Write2_D = TRUE THEN
Write3_Ex := TRUE;
END_IF;

// MC_Write
WRITE1(
Target := MC_Axis000,
SettingValue := Write1_Sv,
Execute := Write1_Ex,
ParameterNumber := Write1_Pn,
Done => Write1_D,
Busy => Write1_Bsy,
CommandAborted => Write1_Ca,
Error => Write1_Err,
ErrorID => Write1_ErrID
);

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-87


10 Sample Programming

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

10-88 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


10 Sample Programming

10-2 Basic Programming


10-2-18 Updating the Cam Table End Point Index
This sample increases the valid number of data points by 10 in a cam table with a maximum number of

Samples
data points of 110 and a valid number of data points of 100. It also updates the end point index.

Main Variables Used in the Programming Samples


10
Variable name Data type Default Comment
CamProfile0 ARRAY[0..109] OF --- This is a cam data variable with a maximum

10-2-18 Updating the Cam Table End Point Index


_sMC_CAM_REF number of data points of 110.* It contains
100 valid cam data points and 10 null cam
data points.
WriteCamdata BOOL FALSE This variable is used to start changing the
cam data. It is changed to TRUE to start
editing.
WriteDone BOOL FALSE This variable is used to indicate when the
changes to the cam data are completed. It
changes to TRUE when the changes to the
cam data are completed.
* The array elements ARRAY[0..N] are set with the Cam Editor in the Sysmac Studio. The range of the array is 0 to
109 in this sample.

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;

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 10-89


10 Sample Programming

If the changes to the cam data variable are completed, the Set Cam Table Properties instruction is executed.
SET_CAM
MC_SetCamTableProperty
WriteDone CamProfile0 CamTable CamTable CamProfile0 Set_Cam_D
Execute Done
EndPointIndex Set_Cam_Epi
MaxDataNumber Set_Cam_Mdn
Busy Set_Cam_B
CommandAborted Set_Cam_Ca
Error Set_Cam_Err
ErrorID Set_Cam_ErrID

ST Programming
// The axis parameters are set. When setting the parameters is completed, InitFlag is changed to TRUE.
IF InitFlag=FALSE THEN
// The phases and displacements for null cam data are set.
PhaseData:=REAL#99.0;
DistanceData:=REAL#250.0;

// The Initialization Completed Flag is changed to TRUE.


InitFlag := TRUE;
END_IF;

// 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 changed.
// 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 Properties 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
);

10-90 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11
Troubleshooting
This section describes the items to check when problems occur in the MC Function
Module. It includes error diagnosis and countermeasures for error indications, and error
diagnosis and countermeasures for operating conditions.

11-1 Overview of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2


11-1-1 How to Check for Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
11-1-2 Errors Related to the Motion Control Function Module . . . . . . . . . . . . . . . . . 11-6
11-2 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12
11-2-1 Error Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12
11-2-2 Error Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-21
11-2-3 Error Causes and Remedies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-1


11 Troubleshooting

11-1 Overview of Errors


You manage all of the errors that occur on the NJ/NX-series Controller as events. The same methods
are used for all events. This allows you to see what errors have occurred and find corrections for them
with the same methods for the entire range of errors that is managed (i.e., CPU Unit, NX Units, NX-
series Slave Terminals, EtherCAT slaves, and CJ-series Units).
However, only EtherCAT slaves as Sysmac devices are supported.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on Sysmac
devices.
Host computer HMI

EtherNet/IP

Troubleshooter

Built-in
NJ/NX-series EtherNet/IP port CJ-series Units/
CPU Unit NX Units
Troubleshooting functions

Sysmac Studio

Built-in EtherCAT port

EtherCAT

EtherCAT
slaves

Error management range for NX701 CPU Unit

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.
To perform troubleshooting from an HMI, connect the HMI to the built-in EtherNet/IP port on the CPU
Unit.
This manual describes the errors that originate in the Motion Control Function Module. Refer to the
NJ/NX-series Troubleshooting Manual (Cat. No. W503) for specific corrections when errors occur and
for troubleshooting information on the entire NJ/NX-series Controller. For information on errors that
occur when motion control instructions are executed, refer to each instruction in the NJ/NX-series
Motion Control Instruction Reference Manual (Cat. No. W508).

Precautions for Correct Use


• You can use CJ-series Units only with NJ-series CPU Units.
• The only CPU Unit on which NX Units can be mounted is an NX1P2 CPU Unit.
• Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.

11-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

11-1-1 How to Check for Errors

11-1 Overview of Errors


You can check to see if an error has occurred with the following methods.

Checking method What you can check


Checking the indicators CPU Unit operating status
Troubleshooter of the Sysmac Studio You can check for current Controller errors, a log of past Controller
errors, error sources, error causes, and corrections.
Checking with the Troubleshooter of an You can check for current Controller errors, a log of past Controller
HMI* errors, error sources, causes, and corrections.
Checking with instructions that read function You can check the highest-level status and highest-level event
module error status code in the current Controller errors. 11
Checking with System-defined Variables You can check the current Controller error status for each function
module.

11-1-1 How to Check for Errors


* To perform troubleshooting from an HMI, connect the HMI to the built-in EtherNet/IP port on the CPU Unit. Refer
to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the applicable range of the
HMI Troubleshooter.
This section describes the above checking methods.

Checking the Indicators


You can use the PWR/POWER, RUN, and ERROR indicators to determine the level of an error. The fol-
lowing table shows the relationship between the Controller’s indicators and the event level.

 NX-series CPU Unit

Indicator
PWR/ Error confirmation with the Sysmac
RUN ERROR CPU Unit operating status
POWER Studio or an HMI
(Green) (Red)
(Green)
Not lit Not lit Not lit Power Supply Error Not possible:
Lit Not lit Not lit CPU Unit Reset*1, *2, *3 /Hard- Refer to the NJ/NX-series Trouble-
ware Initialization Error*4, *2, *3 shooting Manual (Cat. No. W503).

Lit Not lit or Lit CPU Error*3, *5


flashing
Lit Flashing Lit System Initialization Error
more than
30 sec-
onds
Lit Not lit Lit Major fault level*2, *3 Possible:
Lit Lit Flashing Partial fault level Connect the Sysmac Studio or an HMI
and check the cause of and correction
Lit Lit Flashing Minor fault level for the error in the troubleshooting
Lit Lit Not lit Observation functions of the Sysmac Studio or the
Troubleshooter of the HMI.
Lit Lit Not lit Normal operation in RUN mode ---
Lit Not lit Not lit Normal operation in PROGRAM ---
mode*1, *2
Lit Flashing Not lit Normal operation in startup state ---

*1 This error can occur for NX701 CPU Units. If the status of indicators shown above continues 30 seconds or
longer, this error exists.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-3


11 Troubleshooting

*2 If you can go online with the CPU Unit from the Sysmac Studio with a direct USB connection, the CPU Unit is
in PROGRAM mode. If you cannot go online, a CPU Unit Reset or Hardware Initialization Error has occurred.
*3 If you cannot go online with the CPU Unit from the Sysmac Studio, it is also possible that the USB cable is
faulty or that the network type on the Sysmac Studio is not set for a direct USB connection. Refer to the NJ/NX-
series Troubleshooting Manual (Cat. No. W503) if you cannot go online with the CPU Unit.
*4 This error can occur for NX1P2 CPU Units. If the status of indicators shown above continues 30 seconds or
longer, this error exists.
*5 If you can go online with the CPU Unit from the Sysmac Studio with a direct USB connection, a major fault level
error has occurred. If you cannot go online, a CPU Unit Error has occurred.

 NJ-series CPU Unit

Indicator
Error confirmation with the Sysmac
PWR RUN ERROR CPU Unit operating status
Studio or an HMI
(Green) (Green) (Red)
Not lit Not lit Not lit Power Supply Error Not possible:
Lit Not lit Not lit Refer to the NJ/NX-series Trouble-
CPU Unit Reset*1, *2
shooting Manual (Cat. No. W503).
Lit Flashing Lit Incorrect Power Supply Unit Con-
nected
Lit Not lit Lit CPU Unit Watchdog Timer
Error*2, *3
Lit Not lit Lit Major fault level*2, *3 Possible:
Connect the Sysmac Studio or an HMI
Lit Lit Flashing Partial fault level
and check the cause of and correction
Lit Lit Flashing Minor fault level for the error in the troubleshooting
Lit Lit Not lit Observation functions of the Sysmac Studio or the
Troubleshooter of the HMI.
Lit Lit Not lit Normal operation in RUN mode ---
Lit Not lit Not lit Normal operation in PROGRAM ---
mode*1, *2
Lit Flashing Not lit Normal operation in startup state ---

*1 If you can go online with the CPU Unit from the Sysmac Studio with a direct USB connection, the CPU Unit is
in PROGRAM mode. If you cannot go online, the CPU Unit is being reset.
*2 If you cannot go online with the CPU Unit from the Sysmac Studio, it is also possible that the USB cable is
faulty or that the network type on the Sysmac Studio is not set for a direct USB connection. Refer to the NJ/NX-
series Troubleshooting Manual (Cat. No. W503) if you cannot go online with the CPU Unit.
*3 If you can go online with the CPU Unit from the Sysmac Studio with a direct USB connection, a major fault level
error has occurred. If you cannot go online, a watchdog timer error has occurred in the CPU Unit.

Checking with the Troubleshooting Function of Sysmac Studio


When an error occurs, you can connect the Sysmac Studio online to the Controller to check current
Controller errors and the log of past Controller errors. You can also check the cause of the error and
corrections.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the procedures to check for
errors with the Sysmac Studio.

Checking with the Troubleshooter of an HMI


If you can connect communications between an HMI and the Controller when an error occurs, you can
check for current Controller errors and the log of past Controller errors. You can also check the cause of
the error and corrections.
To perform troubleshooting from an HMI, connect the HMI to the built-in EtherNet/IP port on the CPU
Unit.

11-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the procedures to check for
errors with an HMI.

11-1 Overview of Errors


Checking with Instructions That Read Error Status
You can use instructions in the user program to check the error status of each function module. The fol-
lowing table gives the instruction that is used to get error information for the Motion Control Function
Module.

Instruction Name Outline of function


GetMCError Get Motion Control Error The GetMCError instruction gets the highest level status (par-
Status tial fault or minor fault) and highest level event code of the cur-
rent Controller errors in the Motion Control Function Module.
11
For details on the instructions that get error status, refer to the NJ/NX-series Instructions Reference

11-1-1 How to Check for Errors


Manual (Cat. No. W502).

Checking with System-defined Variables


You can use the error status variables in the system-defined variables and the system-defined variables
for motion control to check for errors that have occurred in the Motion Control Function Module.

 Error Status Variables


You can check for errors in each function module of the NJ/NX-series Controller with error status
variables. The following variables show the error status of the Motion Control Function Module.

Variable name Data type Meaning Function


_MC_ErrSta WORD MC Error Status Gives the collective error status of all error status for
the Motion Control Function Module.
_MC_ComErrSta WORD MC Common Gives the collective error status of all errors that
Error Status occur for common processing in the Motion Control
Function Module.
_MC_AX_ErrSta ARRAY[] OF Axis Error Status Gives the collective error status of all error status for
WORD each axis.
_MC_GRP_ErrSta ARRAY[] OF Axes Group Error Gives the collective error status of all error status for
WORD Status each axes group.

The meanings of the individual bits in the above error status variables are given below.

Bit Name Description Value Meaning


15 Master Detection*1 This bit indicates whether the master detected an TRUE Error
error in the slaves that it manages. FALSE No error
14 Slave Summary*2 Gives the collective error status of all error status for TRUE Error
EtherCAT slaves that are assigned to axes in the FALSE No error
Motion Control Function Module.
8 to 13 Reserved
7 Major Fault Indicates if there is a major fault level error. TRUE Error
FALSE No error
6 Partial Fault Indicates if there is a partial fault level error. TRUE Error
FALSE No error
5 Minor Fault Indicates if there is a minor fault level error. TRUE Error
FALSE No error
4 Observation Indicates if there is an observation level error. TRUE Error
FALSE No error
0 to 3 Reserved

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-5


11 Troubleshooting

*1 This bit is not used in the error status variables for the Motion Control Function Module.
*2 For the Motion Control Function Module, only _MC_ErrSta (MC Error Status) is used.

 System-defined Variables for Motion Control


You can monitor the MC Common Variable, Axis Variables, and Axes Group Variables of the system-
defined variables for motion control to see if errors have occurred in the Motion Control Function
Module.
Refer to 6-6 System-defined Variables for Motion Control for information on system-defined vari-
ables for motion control.

11-1-2 Errors Related to the Motion Control Function Module


This section describes the errors that are related to the Motion Control Function Module.

Sources of Errors Related to the Motion Control Function Module


Errors can occur internally in the Motion Control Function Module, or they can occur in EtherCAT com-
munications, which are used to connect to the Servo Drives and other slaves.
• Inside MC Function Module
• EtherCAT Master Function Module
• Built-in EtherCAT communications port hardware
• EtherCAT slaves
CPU Unit Sysmac Studio
HMI

Or
MC Function Module
EtherCAT Master
Function Module

Built-in EtherCAT Error information


communications port
EtherCAT

EtherCAT
slaves

You can check the sources and causes of the errors in the system-defined variables or from the Sys-
mac Studio or an HMI.

Precautions for Correct Use


Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.

11-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Classifications
There are the following three sources of errors in the Motion Control Function Module.

11-1 Overview of Errors


Classification Description
MC Common Errors If an error is detected in the common portion of the Motion Control Function Mod-
ule, the corresponding bit in the MC Common Error Status variable shows the
error.
Axis Error If an error is detected for an axis, the corresponding bit in the Axis Error Status
variable shows the error.*
Axes Group Errors If an error is detected for an axes group, the corresponding bit in the Axes Group
Error Status variable shows the error. 11
* If an axis error with a minor fault level or higher level occurs, operation is also not possible for an axes group that
contains the axis as a composition axis.

11-1-2 Errors Related to the Motion Control Function Module


Event Levels
This section describes the operation of the Motion Control Function Module for each event level.

Event level of the error Operation


Major fault All NJ/NX-series Controller control operations stop for errors in this event level.
Partial fault All control operations for one of the function modules in the NJ/NX-series Control-
ler stop for errors in this event level. If a partial fault level error occurs in the Motion
Control Function Module, all function of the Motion Control Function Module, such
as axis operation, stop.
Minor fault Some of the control operations for one of the function modules in the NJ/NX-
series Controller stop for errors in this event level. If a minor fault level error occurs
in the Motion Control Function Module, the relevant axis or axes group stops.
Observation Errors in the observation level do not affect NJ/NX-series Controller control opera-
tions. Observations are reported in order to prevent them from developing into
errors at the minor fault level or higher.
Information Events that are classified as information provide information that do not indicate
errors.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-7


11 Troubleshooting

MC Function Module Errors by Source


The following tables list the errors in each event level that can occur for each source.

 MC Common Errors

Level Error name


Major fault • None
Partial fault • Motion Control Parameter Setting Error
• Cam Data Read Error
• Required Process Data Object Not Set
• Axis Slave Disabled
• Network Configuration Information Missing for Axis Slave
• Motion Control Initialization Error
• Motion Control Period Exceeded Error
• Absolute Encoder Home Offset Read Error
Minor fault • Cam Table Save Error
• Other execution errors for motion control instructions
Observation • Cannot Execute Save Cam Table Instruction
• Too Many Reset Motion Control Error Instructions
Information • Error Clear from MC Test Run Tab Page

11-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

 Axis Errors

Level Error name

11-1 Overview of Errors


Major fault • None
Partial fault • None
Minor fault • Cam Table Data Error during Cam • Home Proximity/Homing Direction
Motion Limit Input Detected
• Immediate Stop Instruction Executed • Home Input/Homing Opposite Direc-
• Positive Software Limit Exceeded tion Limit Input Detected
• Negative Software Limit Exceeded • Home Input/Homing Direction Limit
• In-position Check Time Exceeded Input Detected
• Following Error Limit Exceeded • Invalid Home Input Mask Distance
• Immediate Stop Input • No Home Input 11
• Positive Limit Input Detected • No Home Proximity Input
• Negative Limit Input Detected • Slave Error Detected

11-1-2 Errors Related to the Motion Control Function Module


• Illegal Following Error • MC Common Error Occurrence
• Servo OFF Error • Latch Position Overflow
• Absolute Encoder Current Position • Latch Position Underflow
Calculation Failed • Master Sync Direction Error
• Servo Main Circuit Power OFF • Slave Disconnection during Servo ON
• Interrupt Feeding Interrupt Signal • Feed Distance Overflow
Missing • Error in Changing Servo Drive Control
• Homing Opposite Direction Limit Input Mode
Detected • Master Axis Position Read Error
• Homing Direction Limit Input Detected • Auxiliary Axis Position Read Error
• Homing Limit Inputs Detected in Both • EtherCAT Slave Communications
Directions Error
• Home Proximity/Homing Opposite • Other execution errors for motion con-
Direction Limit Input Detected trol instructions
Observation • Following Error Warning • Command Position Underflow
• Velocity Warning • Actual Position Overflow
• Acceleration Warning • Actual Position Underflow
• Deceleration Warning • Slave Observation Detected
• Positive Torque Warning • Notice of Insufficient Travel Distance to
• Negative Torque Warning Achieve Blending Transit Velocity
• Command Position Overflow • Other execution errors for motion con-
trol instructions
Information • Slave Error Code Report

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-9


11 Troubleshooting

 Axes Group Errors

Level Error name


Major fault • None
Partial fault • None
Minor fault • Axes Group Immediate Stop Instruction Executed
• Home Undefined during Coordinated Motion
• Axes Group Composition Axis Error
• Other execution errors for motion control instructions
Observation • Velocity Warning
• Acceleration Warning
• Deceleration Warning
• Notice of Insufficient Travel Distance to Achieve Blending Transit Velocity
Information • None
You can change the event level for some events. Refer to NJ/NX-series CPU Unit Software User’s Man-
ual (Cat. No. W501) for information on changing event levels. Refer to 11-2 Troubleshooting in this man-
ual to see the events for which you can change the event level.

Errors Related to EtherCAT Communications, EtherCAT Slaves, and


NX Units
The following Motion Control Function Module error can occur due to errors in EtherCAT communica-
tions, EtherCAT slaves, or NX Units.

Error name Event code Cause Operation for error


EtherCAT Slave 8440 0000 hex A communications error occurred The Servo is turned OFF for the
Communications for the EtherCAT slave or NX Unit axis with an error and operations
Error that is allocated to an axis in the other than error resets are not
Motion Control Function Mod- acknowledged.*2
ule.*1
Slave Error 742F 0000 hex An error was detected for the Eth- The Servo is turned OFF for the
Detected erCAT slave or NX Unit that is axis with an error and operations
allocated to an axis in the Motion other than error resets are not
Control Function Module. acknowledged.
*1 When an error occurs in communications with an EtherCAT slave, an error also occurs in the EtherCAT Master
Function Module. If you assign more than one device to the same axis, a communications error occurs for the
axis if a communications error occurs for even one of the devices.
*2 When an error occurs in slave communications, home becomes undefined for the axis.

Servo Drive Errors


This section describes the notification that is provided for errors that occur in OMRON 1S-series Servo
Drives and G5-series Servo Drives.
There is a difference between the timing of when the Motion Control Function Module detects the error
in the Servo Drive and when the error code is obtained from the Servo Drive. The Motion Control Func-
tion Module therefore reports different events for the error in the Servo Drive and the error code.

 Error Notification
When the Motion Control Function Module detects an error, a Slave Error Detected minor fault level
error (742F0000 hex) occurs. At this point, the Motion Control Function Module performs the error
operation (i.e., it turns OFF the Servo).

11-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

 Error Code Notification


When the Servo Drive reports the error code, the Motion Control Function Module generates a Slave
Error Code Report information event (94220000 hex). The error code (the main part of the error dis-

11-1 Overview of Errors


play number) from the Servo Drive is included in the lower two digits of the attached information of
the Slave Error Code Report event. For example, if the attached information is displayed as FF13,
the error with display number 13 (Main Circuit Power Supply Undervoltage) occurred in the Servo
Drive.
You must change the settings to receive notification of the Slave Error Code Report event. Map
object 603F hex (Error Code) in the PDO Edit Pane.

Errors Related to NX Units 11


Error and error code notifications are provided for errors that occur for OMRON NX-series Position
Interface Units in the same way as they are for OMRON 1S-series Servo Drives and G5-series Servo

11-1-2 Errors Related to the Motion Control Function Module


Drives.
However, NX-series Position Interface Units do not have an object that corresponds to object 603F hex
(Error Code), so 0000 hex is given for the Slave Error Code Report (94220000 hex) in the attached
information.
Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) or the NX-series Ether-
CAT Coupler Unit User’s Manual (Cat. No. W519) for details on errors that occur in NX-series Position
Interface Units.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-11


11 Troubleshooting

11-2 Troubleshooting
This section describes the errors that can occur and the corrections for them.

11-2-1 Error Table


The errors (i.e., events) that can occur in the Motion Control Function Module are given on the following
pages.
The following abbreviations and symbols are used in the event level column.

Abbreviation Name
Maj Major fault level
Prt Partial fault level
Min Minor fault level
Obs Observation
Info Information

Symbol Meaning
S Event levels that are defined by the system.
U Event levels that can be changed by the user.*
* This symbol appears only for events for which the user can change the event level.
The upper four digits of the event codes that are given in the following table are output as the error
codes to the system-defined variable for motion control.
A version in parentheses in the Event code column is the unit version of the CPU Unit when the event
occurs for only specific unit versions of the CPU Unit.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for all NJ/NX-series event codes.

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
44210000 hex Motion Con- A fatal error was • An error occurred in the soft- S page 11-22
trol Function detected in the ware.
Processing Motion Control
Error Function Module.
14600000 hex Absolute The absolute • When the retained variables are S page 11-22
Encoder encoder current backed up with a battery, this
Home Offset position that is event indicates that the life of
Read Error retained during the battery in the CPU Unit has
power interruptions expired.
was lost. • An error occurred in the soft-
ware.
• Backup memory failure
14610000 hex Motion Con- The MC parameters • The power supply to the Con- S page 11-23
trol Parame- that were saved in troller was interrupted or com-
ter Setting non-volatile mem- munications with the Sysmac
Error ory are missing. Studio were disconnected while
downloading the motion control
parameter settings or clearing
memory.
• Non-volatile memory failure
14620000 hex Cam Data The cam data that • Power was interrupted during S page 11-23
Read Error was saved in non- save processing for cam data
volatile memory is • Non-volatile memory failure
missing.

11-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
34600000 hex Required The object that is • The required PDOs are not S page 11-24
Process Data required for the axis mapped when the axis type is

11-2 Troubleshooting
Object Not type is not allocated set to a servo axis or encoder
Set to PDO. axis.
• Non-volatile memory failure
34630000 hex Axis Slave The slave to which • The slave to which the axis is S page 11-24
Disabled the axis is assigned assigned is disabled.
is disabled.
34640000 hex Network The network config- • The EtherCAT network configu- S page 11-25
Configura- uration information ration information is not regis-
tion Informa- is not registered for tered for the slave to which the
tion Missing the slave to which axis is assigned. 11
for Axis Slave the axis is
assigned.

11-2-1 Error Table


44200000 hex Motion Con- A fatal error • Hardware has failed. S page 11-25
trol Initializa- occurred in the sys-
tion Error tem and prevented
initialization of the
Motion Control
Function Module.
74200000 hex Motion Con- Processing for the • The processing load in the pri- S page 11-26
trol Period primary periodic mary periodic task is too heavy.
Exceeded task was not fin-
ished within two
control periods.
14630000 hex Cam Table Saving a cam table • Saving a cam table to a file S page 11-26
Save Error to a file failed. failed.
54770000 hex Cam Table The phases are not • Data containing cam table S page 11-27
Data Error in ascending order phases that are not in ascend-
during Cam in the cam table. ing order was detected during
Motion cam motion.
• The phase and displacement of
the start point in the cam table
were not 0 during cam opera-
tion.
• The phase of the end point in
the cam table when converted
to pulses was not 1 pulse or
greater during cam operation.
54850000 hex Immediate An Immediate Stop • An Immediate Stop instruction S page 11-27
Stop Instruc- (MC_ImmediateS- was executed.
tion Executed top) instruction was
executed.
54860000 hex Axes Group An Axes Group • A Group Immediate Stop S page 11-28
Immediate Immediate Stop instruction was executed.
Stop Instruc- (MC_GroupImmedi-
tion Executed ateStop) instruc-
tion was executed.
64450000 hex Positive Soft- The position • The position exceeded the posi- S page 11-28
ware Limit exceeded the posi- tive software limit.
Exceeded tive software limit
while the axis is in
motion.
64460000 hex Negative The position • The position exceeded the neg- S page 11-29
Software exceeded the nega- ative software limit.
Limit tive software limit
Exceeded while the axis is in
motion.
64470000 hex In-position The in-position • Time is required to complete S page 11-29
Check Time check was not com- positioning.
Exceeded pleted within the
monitoring time.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-13


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
64480000 hex Following The error between • The positioning operation has S page 11-30
Error Limit the command cur- poor following performance and
Exceeded rent position and the actual motion is slower than
actual current value the command.
exceeded the Fol-
lowing Error Over
Value.
64490000 hex Immediate The immediate stop • An immediate stop input signal S page 11-30
Stop Input input turned ON. was detected.
• The immediate stop input signal
is not connected correctly or
the logic setting for the immedi-
ate stop input is wrong.
644A 0000 hex Positive Limit The positive limit • A positive limit input signal was S page 11-31
Input input turned ON. detected.
Detected • The positive limit input signal is
not connected correctly or the
logic setting for the positive limit
input is wrong.
644B 0000 hex Negative The negative limit • A negative limit input signal was S page 11-31
Limit Input input turned ON. detected.
Detected • The negative limit input signal is
not connected correctly or the
logic setting for the negative
limit input is wrong.
64560000 hex Illegal Follow- The difference • The command current position S page 11-32
ing Error between the com- was restricted so that the axis
mand position and velocity of the slave axis would
the actual current not exceed the axis maximum
position exceeds velocity for the specified travel
the range of 30-bit distance.
data when con- • Performance of slave axis posi-
verted to pulses. tioning operation is poor and
the actual motion is slower than
the command.
64570000 hex Servo OFF The Servo was • The Servo was turned OFF for S page 11-32
Error turned OFF for an an axis due to an axes group
axis due to an axes error.
group error.
64580000 hex Absolute It was not possible • The unit conversion settings, S page 11-33
Encoder Cur- to correctly restore the ring counter setting in the
rent Position the current position Controller, or the ring counter
Calculation from the absolute setting in the Servo Drive set-
Failed encoder information tings was changed.
that was saved • The position to restore when
when power was converted to pulses exceeded
interrupted. the range of signed 40-bit data.
64590000 hex Home Unde- Home of the logical • The command position or S page 11-34
fined during axis became unde- actual position overflowed or
Coordinated fined during axes underflowed for a logical axis in
Motion group motion or an axes group motion or a logi-
while decelerating cal axis that was decelerating to
to a stop. a stop and the home definition
was lost.
• A slave communications error
occurred for a logical axis and
home became undefined during
axes group motion or while
decelerating to a stop.
• A slave for a logical axis left the
network or was disabled and
home became undefined during
axes group motion or while
decelerating to a stop.

11-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
74210000 hex Servo Main The main circuit • The main circuit power of the S page 11-34
Circuit Power power of the Servo Servo Drive was interrupted

11-2 Troubleshooting
OFF Drive turned OFF while the Servo was ON.
while the Servo was
ON.
74230000 hex Interrupt An interrupt input • The latch enabled range speci- S page 11-35
Feeding was not received fication is invalid.
Interrupt Sig- during execution of • There is a problem with the wir-
nal Missing an MC_MoveFeed ing of the interrupt signal.
(Interrupt Feeding)
• The sensor that outputs the
instruction.
interrupt signal has failed.
74240000 hex Homing The limit signal in • The Operation Selection at S page 11-35 11
Opposite the direction oppo- Negative Limit Input or Opera-
Direction site to the homing tion Selection at Positive Limit
Limit Input direction was Input parameter is set to No

11-2-1 Error Table


Detected detected during a reverse turn.
homing operation. • The location of the homing
input signal sensors, homing
settings, and homing start posi-
tion cause a limit input to be
reached.
• The input signal sensor wiring
is incorrect or the sensor is
faulty.
74250000 hex Homing The limit signal in • The Operation Selection at S page 11-36
Direction the homing direc- Negative Limit Input or Opera-
Limit Input tion was detected tion Selection at Positive Limit
Detected during a homing Input parameter is set to No
operation. reverse turn.
• The location of the homing
input signal sensors, homing
settings, and homing start posi-
tion cause a limit input to be
reached.
• The input signal sensor wiring
is incorrect or the sensor is
faulty.
74260000 hex Homing Limit The limit signals in • The wiring of the limit signal is S page 11-36
Inputs both directions incorrect.
Detected in were detected • The limit sensor is installed in
Both Direc- during a homing the wrong location.
tions operation.
• The contact logic of the limit
signal is not correct.
• The limit sensor failed.
74270000 hex Home Prox- The home proxim- • The wiring of the home proxim- S page 11-37
imity/Homing ity input and the ity signal or limit signal is incor-
Opposite limit signal in the rect.
Direction direction opposite • The home proximity sensor or
Limit Input to the homing direc- limit sensor is installed in the
Detected tion were detected wrong location.
during a homing • The contact logic of the home
operation.
proximity signal or limit signal is
not correct.
• The home proximity sensor or
limit sensor failed.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-15


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
74280000 hex Home Prox- The home proxim- • The wiring of the home proxim- S page 11-37
imity/Homing ity input and the ity signal or limit signal is incor-
Direction limit signal in the rect.
Limit Input homing direction • The home proximity sensor or
Detected were detected at limit sensor is installed in the
the same time wrong location.
during a homing • The contact logic of the home
operation.
proximity signal or limit signal is
not correct.
• The home proximity sensor or
limit sensor failed.
74290000 hex Home The home input and • The wiring of the home input S page 11-38
Input/Hom- the limit signal in signal or limit signal is incorrect.
ing Opposite the direction oppo- • The home input sensor or limit
Direction site to the homing sensor is installed in the wrong
Limit Input direction were location.
Detected detected at the
• The contact logic of the home
same time during a input signal or limit signal is not
homing operation.
correct.
• The home input signal output
device or limit sensor failed.
742A0000 hex Home The home input and • The wiring of the home input S page 11-38
Input/Hom- the limit signal in signal or limit signal is incorrect.
ing Direction the homing direc- • The home input sensor or limit
Limit Input tion were detected sensor is installed in the wrong
Detected at the same time location.
during a homing
• The contact logic of the home
operation.
input signal or limit signal is not
correct.
• The home input signal output
device or limit sensor failed.
742B0000 hex Invalid Home The setting of the • The set value of the home input S page 11-39
Input Mask home input mask mask distance when the oper-
Distance distance is not suit- ating mode of the MC_Home
able for the instruction is set to Proximity
MC_Home or Reverse Turn/Home Input Mask
MC_HomeWithPa- Distance is insufficient to decel-
rameter instruction. erate from the homing velocity
to the homing approach veloc-
ity.
742C 0000 hex No Home There was no home • There was no home signal input S page 11-39
Input signal input during during the homing operation.
the homing opera- • A limit signal was detected
tion. Or, a limit sig- before there was a home input.
nal was detected
before there was a
home input.
742D 0000 hex No Home There was no home • There was no home proximity S page 11-40
Proximity proximity signal signal input during the homing
Input input during the operation when a home proxim-
homing operation. ity input signal was specified.
742F 0000 hex Slave Error An error was • An error was detected for the S page 11-40
Detected detected for the EtherCAT slave or NX Unit that
EtherCAT slave or is allocated to an axis.
NX Unit that is allo-
cated to an axis.
74300000 hex Axes Group An error occurred • An error occurred for an axis in S page 11-41
Composition for an axis in an an axes group that was in
Axis Error axes group. motion.
74330000 hex MC Com- An MC common • Partial fault level MC common S page 11-41
mon Error error occurred. error occurred.
Occurrence

11-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
74340000 hex Latch Posi- An overflow • An overflow occurred for the S page 11-41
tion Overflow occurred for the latched position for the

11-2 Troubleshooting
latched position for MC_TouchProbe (Enable Exter-
the MC_Touch- nal Latch) instruction.
Probe (Enable
External Latch)
instruction.
74350000 hex Latch Posi- An underflow • An underflow occurred for the S page 11-42
tion Under- occurred for the latched position for the
flow latched position for MC_TouchProbe (Enable Exter-
the MC_Touch- nal Latch) instruction.
Probe (Enable
External Latch) 11
instruction.
74360000 hex Master Sync The master axis • The master axis continued to S page 11-42

11-2-1 Error Table


Direction continued to move move in the direction opposite
Error in the direction to the sync direction of the mas-
opposite to the sync ter and slave axes, resulting in
direction. an overflow.
74370000 hex Slave Dis- One of the following One of the following occurred S page 11-43
connection occurred while the while the Servo was ON for the
during Servo Servo was ON for EtherCAT slave or NX Unit that is
ON the EtherCAT slave allocated to an axis.
or NX Unit that is • Disconnection or replacement
allocated to an axis.
• Disablement
• Disconnection or
• Restart of the NX bus on the
replacement
NX-series CPU Unit
• Disablement
• Restart of the NX
bus on the NX-
series CPU Unit
74380000 hex Feed Dis- The target position • The target position after the S page 11-43
tance Over- after the interrupt interrupt input was received for
flow input was received the MC_MoveFeed (Interrupt
for the MC_Move- Feeding) instruction exceeded
Feed (Interrupt the range of signed 40-bit data
Feeding) instruc- when converted to pulses.
tion overflowed or
underflowed.
74390000 hex Error in Changing the Con- • When the MC_SyncMoveVeloc- S page 11-44
Changing trol Mode was not ity instruction was stopped, the
Servo Drive completed within actual current velocity was not
Control Mode the specified time. reduced to 10% or less of the
maximum velocity within 10
seconds for three consecutive
periods after a command veloc-
ity of 0 was output.
• For an OMRON 1S-series
Servo Drive or G5-series Servo
Drive, the actual current veloc-
ity was not reduced to 10% or
less of the maximum velocity
within 10 seconds for three con-
secutive periods when the
MC_TorqueControl instruction
was stopped.
• Changing the Control Mode of
the Servo Drive between CSP,
CSV, and CST was not com-
pleted within one second after
the command was executed.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-17


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
743A0000 hex Master Axis The synchronized • EtherCAT process data com- S page 11-45
Position control instruction munications are not established
Read Error was not executed for the master axis of the syn-
because an error chronized control instruction or
occurred in the the I/O data of the NX Unit can-
position of the mas- not be used for control.
ter axis of the syn- • The slave of the master axis for
chronized control the synchronized control
instruction. instruction was disconnected or
disabled.
• An Absolute Encoder Current
Position Calculation Failed error
(64580000 hex) was detected
for the master axis of the syn-
chronized control instruction.
• The master axis for the syn-
chronized control instruction is
an unused axis.
743B 0000 hex Auxiliary Axis The synchronized • EtherCAT process data com- S page 11-46
Position control instruction munications are not established
Read Error was not executed for the auxiliary axis of the syn-
because an error chronized control instruction or
occurred in the the I/O data of the NX Unit can-
position of the auxil- not be used for control.
iary axis of the syn- • The slave of the auxiliary axis
chronized control for the synchronized control
instruction. instruction was disconnected or
disabled.
• An Absolute Encoder Current
Position Calculation Failed error
(64580000 hex) was detected
for the auxiliary axis of the syn-
chronized control instruction.
• The auxiliary axis for the syn-
chronized control instruction is
an unused axis.
84400000 hex EtherCAT A communications • A communications error S page 11-47
Slave Com- error occurred for occurred for the EtherCAT slave
munications the EtherCAT slave or NX Unit that is allocated to
Error or NX Unit that is an axis.
allocated to an axis.
571D 0000 hex Too Many There are more • There are more than 100 S page 11-47
(Ver. 1.02 to Reset Motion than 100 instances instances of the ResetMCError
Ver. 1.09) Control Error of the ResetMCEr- (Reset Motion Control Error)
Instructions ror (Reset Motion instruction declared in the user
Control Error) program. Instances inside func-
instruction. tion blocks are included.
644C 0000 hex Following The following error • Performance of positioning S page 11-48
Error Warn- exceeded the Fol- operation is poor and the actual
ing lowing Error Warn- motion is slower than the com-
ing Value. mand.
644D 0000 hex Velocity The command • The command velocity U S page 11-48
Warning velocity exceeded exceeded the velocity warning
the velocity warn- value.
ing value.
644E0000 hex Acceleration The command • The command acceleration rate U S page 11-49
Warning acceleration exceeded the acceleration
exceeded the warning value.
acceleration warn-
ing value.

11-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
644F 0000 hex Deceleration The command • The command deceleration rate U S page 11-49
Warning deceleration exceeded the deceleration

11-2 Troubleshooting
exceeded the warning value.
deceleration warn-
ing value.
64500000 hex Positive The torque com- • The torque command value U S page 11-50
Torque Warn- mand value exceeded the positive torque
ing exceeded the posi- warning value.
tive torque warning
value.
64510000 hex Negative The torque com- • The torque command value U S page 11-50
Torque Warn- mand value exceeded the negative torque 11
ing exceeded the nega- warning value.
tive torque warning
value.

11-2-1 Error Table


64520000 hex Command The number of • In Linear Mode, the command U S page 11-51
Position pulses for the com- position when converted to
Overflow mand position over- pulses exceeded the upper limit
flowed. of signed 40-bit data.
64530000 hex Command The number of • In Linear Mode, the command U S page 11-51
Position pulses for the com- position when converted to
Underflow mand position pulses exceeded the lower limit
exceeded the valid of signed 40-bit data.
range. (It under-
flowed.)
64540000 hex Actual Posi- The number of • The actual position when con- U S page 11-52
tion Overflow pulses for the actual verted to pulses exceeded the
position overflowed. upper limit of signed 40-bit
data.
64550000 hex Actual Posi- The number of • The actual position when con- U S page 11-52
tion Under- pulses for the actual verted to pulses exceeded the
flow position under- lower limit of signed 40-bit data.
flowed.
74320000 hex Slave Obser- A warning was • A warning was detected for the U S page 11-53
vation detected for an Eth- EtherCAT slave or NX Unit that
Detected erCAT slave or NX is allocated to an axis.
Unit.
743C0000 hex Cannot Exe- You cannot save a • An attempt was made to exe- S page 11-53
cute Save cam table to a file cute the MC_SaveCamTable
Cam Table when non-volatile instruction when another opera-
Instruction memory is being tion was accessing the non-vol-
accessed by atile memory (e.g., transfer or
another operation. data trace operation from the
Sysmac Studio).
94200000 hex Notice of There is not suffi- • When the Acceleration/Decel- U S page 11-54
Insufficient cient travel distance eration Over parameter was set
Travel Dis- to accelerate or to Use rapid acceleration/decel-
tance to decelerate to the eration (Blending is changed to
Achieve transit velocity Buffered), the results of profile
Blending during blending creation caused the accelera-
Transit Veloc- operation. tion/deceleration rate to be
ity exceeded when blending was
specified, so buffered was
used.
• Blending was specified, but the
target position was already
reached, so it was changed to
Buffered because the profile
could not be created.
94210000 hex Error Clear An error was • An error was cleared from the S page 11-54
from MC Test cleared from the MC Test Run Pane of the Sys-
Run Tab MC Test Run Pane mac Studio.
Page of the Sysmac Stu-
dio.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-19


11 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
94220000 hex Slave Error The error code was • The error code was reported by S page 11-55
Code Report reported by the the slave when a Slave Error
slave when a Slave Detected error (742F0000 hex)
Error Detected error occurred.
occurred.

11-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

11-2-2 Error Descriptions


This section describes the information that is given for individual errors.

11-2 Troubleshooting
Controller Error Descriptions
The items that are used to describe individual errors (events) are described in the following copy of an
error table.

Event name Gives the name of the error. Event code Gives the code of the error.
Meaning Gives a short description of the error.
11
Source Gives the source of the error. Source details Gives details on Detection Tells when the
the source of the timing error is detected.
error.

11-2-2 Error Descriptions


Error attributes Level Tells the level of Recovery Gives the recov- Log category Tells which log
influence on con- ery method.*2 the error is saved
trol.*1 in.*3
Effects User program Tells what will hap- Operation Provides special information on the operation that results
pen to execution of from the error.
the user pro-
gram.*4
Indicators Gives the status of the built-in EtherNet/IP port and built-in EtherCAT port indicators. Indicator status is given only for
errors in the EtherCAT Master Function Module and the EtherNet/IP Function Module.
System-defined Variable Data type Name
variables Lists the variable names, data types, and meanings for system-defined variables that provide direct error notification,
that are directly affected by the error, or that contain settings that cause the error.
Cause and cor- Assumed cause Correction Prevention
rection
Lists the possible causes, corrections, and preventive measures for the error.
Attached This is the attached information that is displayed by the Sysmac Studio or an HMI.*5
information
Precautions/ Provides precautions, restrictions, and supplemental information. If the user can set the event level, the event levels
Remarks that can be set, the recovery method, operational information, and other information is also provided.

*1 One of the following:


Major fault: Major fault level
Partial fault: Partial fault level
Minor fault: Minor fault level
Observation
Information
*2 One of the following:
Automatic recovery: Normal status is restored automatically when the cause of the error is removed.
Error reset: Normal status is restored when the error is reset after the cause of the error is removed.
Cycle the power supply: Normal status is restored when the power supply to the Controller is turned OFF and then back
ON after the cause of the error is removed.
Controller reset: Normal status is restored when the Controller is reset after the cause of the error is removed.
Depends on cause: The recovery method depends on the cause of the error.
*3 One of the following:
System: System event log
Access: Access event log
*4 One of the following:
Continues: Execution of the user program will continue.
Stops: Execution of the user program stops.
Starts: Execution of the user program starts.
*5 Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the applicable range of the HMI
Troubleshooter.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-21


11 Troubleshooting

Version Information
With NX701 CPU Units, a variable name that starts with _MC_AX[*] may start with _MC1_AX[*]
or _MC2_AX[*] instead. Similarly, a variable name that starts with _MC_GRP[*] may start with
_MC1_GRP[*] or _MC2_GRP[*] instead.

Error Descriptions

Event name Motion Control Function Processing Error Event code 44210000 hex
Meaning A fatal error was detected in the Motion Control Function Module.
Source PLC Function Module Source details MC Common Detection Continuously
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply.
Effects User program Stops. Operation It will not be possible to perform axis control. The Control-
ler will stop.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
An error occurred in the software. Contact your OMRON representative. None
Attached Attached information 1: System information
information Attached information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks

Event name Absolute Encoder Home Offset Read Error Event code 14600000 hex
Meaning The absolute encoder current position that is retained during power interruptions was lost.
Source Motion Control Function Module Source details MC Common Detection At power ON, at
timing Controller reset,
or when down-
loading
Error attributes Level Partial fault Recovery Error reset Log category System
Effects User program Continues. Operation It will not be possible to perform axis control.
System-defined Variable Data type Name
variables _MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence
Cause and Assumed cause Correction Prevention
correction
When the retained variables are Replace the Battery in the CPU Unit, When the retained variables are
backed up with a battery, this event reset the error, and perform homing to backed up with a battery, periodically
indicates that the life of the battery in define home. replace the battery in the CPU Unit.
the CPU Unit has expired. For the Battery life, refer to the NX-
series CPU Unit Hardware User’s
Manual (Cat. No. W535) or the NJ-
series CPU Unit Hardware User’s
Manual (Cat. No. W500)
An error occurred in the software. If this error persists, replace the CPU None
Backup memory failure Unit, reset the error, and perform
homing to define home.
Attached None
information
Precautions/ None
Remarks

11-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Motion Control Parameter Setting Error Event code 14610000 hex
Meaning The MC parameters that were saved in non-volatile memory are missing.
Source Motion Control Function Module Source details MC common Detection At power ON, at

11-2 Troubleshooting
timing Controller reset,
or when down-
loading
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Continues. Operation It will not be possible to perform axis control.
System-defined Variable Data type Name
variables
_MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence 11
Cause and Assumed cause Correction Prevention
correction The power supply to the Controller Download the MC parameters from Do not turn OFF the power supply

11-2-2 Error Descriptions


was interrupted or communications the Sysmac Studio. during save processing for the param-
with the Sysmac Studio were discon- eters.
nected while downloading the motion
control parameter settings or clearing
memory.
Non-volatile memory failure If the error occurs even after the None
above correction is performed, non-
volatile memory has failed. After you
replace the CPU Unit, download all
settings including the Axis Settings
from the Sysmac Studio.
Attached None
information
Precautions/ None
Remarks

Event name Cam Data Read Error Event code 14620000 hex
Meaning The cam data that was saved in non-volatile memory is missing.
Source Motion Control Function Module Source details MC Common Detection At power ON, at
timing Controller reset,
or when down-
loading
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Continues. Operation It will not be possible to perform axis control.
System-defined Variable Data type Name
variables
_MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence
Cause and Assumed cause Correction Prevention
correction Power was interrupted during save Download the cam data from the Sys- Do not turn OFF the power supply
processing for cam data mac Studio. during save processing for the cam
data.
Non-volatile memory failure If the error occurs even after the None
above correction is performed, non-
volatile memory has failed. After you
replace the CPU Unit, download all
settings including the Axis Settings
from the Sysmac Studio.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-23


11 Troubleshooting

Event name Required Process Data Object Not Set Event code 34600000 hex
Meaning The object that is required for the axis type is not allocated to PDO.
Source Motion Control Function Module Source details MC Common Detection At power ON, at
timing Controller reset,
or when down-
loading
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Continues. Operation It will not be possible to perform axis control.
System-defined Variable Data type Name
variables
_MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence
Cause and Assumed cause Correction Prevention
correction The required PDOs are not mapped Map the PDOs that are required for Map the PDOs that are required for
when the axis type is set to a servo the relevant axis type. Refer to A-1-2 the axis types that are used. Refer to
axis or encoder axis. Servo Drive Settings or A-2-2 Servo A-1-2 Servo Drive Settings or A-2-2
Drive Settings for the required PDOs. Servo Drive Settings for the required
PDOs.
Non-volatile memory failure If the error occurs even after the None
above correction is performed, non-
volatile memory has failed. After you
replace the CPU Unit, download all
settings including the Axis Parameter
Settings from the Sysmac Studio.
Attached None
information
Precautions/ None
Remarks

Event name Axis Slave Disabled Event code 34630000 hex


Meaning The slave to which the axis is assigned is disabled.
Source Motion Control Function Module Source details MC Common Detection At power ON, at
timing Controller reset,
or when down-
loading
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Continues. Operation It will not be possible to perform axis control.
System-defined Variable Data type Name
variables _MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence
Cause and Assumed cause Correction Prevention
correction
The slave to which the axis is Enable the slave to which the axis is Enable the slaves to which axes are
assigned is disabled. assigned in the EtherCAT settings. If assigned in the EtherCAT settings. If
there is no slave, set the axis type to a there are no slaves, set the axis type
virtual axis. to a virtual axis when using an axis in
the program.
Attached None
information
Precautions/ None
Remarks

11-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Network Configuration Information Missing for Axis Slave Event code 34640000 hex
Meaning The network configuration information is not registered for the slave to which the axis is assigned.
Source Motion Control Function Module Source details MC Common Detection At power ON, at

11-2 Troubleshooting
timing Controller reset,
when download-
ing, when starting
Servo ON status,
or when changing
an unused axis to
a used axis
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Continues. Operation It will not be possible to perform axis control. 11
System-defined Variable Data type Name
variables
_MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-

11-2-2 Error Descriptions


rence
Cause and Assumed cause Correction Prevention
correction
The EtherCAT network configuration Register the EtherCAT network con- Register the network configuration
information is not registered for the figuration information for the slave to information for the slaves to which
slave to which the axis is assigned. which the axis is assigned. Or, set the axes are assigned.
axis type to a virtual axis.
Attached None
information
Precautions/ None
Remarks

Event name Motion Control Initialization Error Event code 44200000 hex
Meaning A fatal error occurred in the system and prevented initialization of the Motion Control Function Module.
Source Motion Control Function Module Source details MC Common Detection At power ON, at
timing Controller reset,
or when down-
loading
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply.
Effects User program Continues. Operation It will not be possible to perform axis control. It will not be
possible to execute motion control instructions.
System-defined Variable Data type Name
variables
_MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence
Cause and Assumed cause Correction Prevention
correction
Hardware has failed. Replace the CPU Unit. None
Attached Attached information 1: Controller information
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-25


11 Troubleshooting

Event name Motion Control Period Exceeded Event code 74200000 hex
Meaning Processing for the primary periodic task was not finished within two control periods.
Source Motion Control Function Module Source details MC Common Detection Continuously
timing
Error attributes Level Partial fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for all axes. Axes in motion stop
immediately.
System-defined Variable Data type Name
variables
_MC_COM.PFaultLvl.Active BOOL MC Common Partial Fault Occur-
rence
Cause and Assumed cause Correction Prevention
correction The processing load in the primary Reduce the amount of processing in Write the programs for the primary
periodic task is too heavy. the primary periodic task or set the periodic task so that they perform only
control period to a value that is long the processes required in the speci-
enough not to cause operation prob- fied period. Or, set the period of the
lems. Check the task period in the primary periodic task to be long
Task Period Monitor of the Sysmac enough to complete all required pro-
Studio. cessing.
Attached None
information
Precautions/ None
Remarks

Event name Cam Table Save Error Event code 14630000 hex
Meaning Saving a cam table to a file failed.
Source Motion Control Function Module Source details MC Common Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset or Log category System
cycling power
supply
Effects User program Continues. Operation This error may occur when you read a cam table because
the cam data in non-volatile memory may be corrupted.
System-defined Variable Data type Name
variables _MC_COM.MFaultLvl.Active BOOL MC Common Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
Saving a cam table to a file failed. Save the file again. If the problem still None
occurs, non-volatile memory has
failed. Replace the CPU Unit.
Attached None
information
Precautions/ None
Remarks

11-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Cam Table Data Error during Cam Motion Event code 54770000 hex
Meaning The phases are not in ascending order in the cam table.
Source Motion Control Function Module Source details Axis Detection During instruc-

11-2 Troubleshooting
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant axes. Relevant axis
decelerates to a stop if it is in motion.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
Data containing cam table phases Correct the cam table data so that the Place the phase data into ascending
that are not in ascending order was phases are in ascending order. order in the cam table data. 11
detected during cam motion.
The phase and displacement of the Correct the cam table data so that the Set the cam table data so that the

11-2-2 Error Descriptions


start point in the cam table were not 0 phase and displacement of the start phase and displacement of the start
during cam operation. point are 0. point are 0.
The phase of the end point in the cam Correct the cam table data so that the Set the cam table data so that the
table when converted to pulses was phase of the end point is 1 pulse or phase of the end point is 1 pulse or
not 1 pulse or greater during cam greater when converted to pulses. greater when converted to pulses.
operation.
Attached None
information
Precautions/ None
Remarks

Event name Immediate Stop Instruction Executed Event code 54850000 hex
Meaning An Immediate Stop (MC_ImmediateStop) instruction was executed.
Source Motion Control Function Module Source details Axis Detection At instruction
timing execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation An immediate stop is performed according to the Stop
Mode that is set in the StopMode input variable to the
MC_ImmediateStop instruction. If the axis is part of an
axes group in motion, all other axes will act according to
the Axes Group Stop Mode Selection.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction An Immediate Stop instruction was --- ---
executed.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-27


11 Troubleshooting

Event name Axes Group Immediate Stop Instruction Executed Event code 54860000 hex
Meaning An Axes Group Immediate Stop (MC_GroupImmediateStop) instruction was executed.
Source Motion Control Function Module Source details Axes group Detection At instruction
timing execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation An immediate stop is performed for all axes in the axes
group according to the Immediate Stop Input Stop Method
axis parameter.
System-defined Variable Data type Name
variables
_MC_GRP[*].MFaultLvl.Active BOOL Axes Group Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction A Group Immediate Stop instruction --- ---
was executed.
Attached None
information
Precautions/ None
Remarks

Event name Positive Software Limit Exceeded Event code 64450000 hex
Meaning The position exceeded the positive software limit while the axis is in motion.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Follows the setting of the Software Limit Function Selec-
tion.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The position exceeded the positive Find the reason that the software limit (The goal is to enable detecting the
software limit. was exceeded and make suitable cor- software limits when they are
rections. exceeded due to unanticipated
causes. Preventative measures are
not required.)
Attached None
information
Precautions/ Whenever you change the positive software limit setting, make sure that the new setting is safe.
Remarks

11-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Negative Software Limit Exceeded Event code 64460000 hex
Meaning The position exceeded the negative software limit while the axis is in motion.
Source Motion Control Function Module Source details Axis Detection During instruc-

11-2 Troubleshooting
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Follows the setting of the Software Limit Function Selec-
tion.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The position exceeded the negative Find the reason that the software limit (The goal is to enable detecting the
software limit. was exceeded and make suitable cor- software limits when they are 11
rections. exceeded due to unanticipated
causes. Preventative measures are
not required.)

11-2-2 Error Descriptions


Attached None
information
Precautions/ Whenever you change negative software limit settings, make sure that the new setting is safe.
Remarks

Event name In-position Check Time Exceeded Event code 64470000 hex
Meaning The in-position check was not completed within the monitoring time.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant axis. Relevant axis
decelerates to a stop if it is in motion.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction Time is required to complete position- Determine the cause of the slow posi- Remove the cause of poor following
ing. tioning and remove the cause of the performance or oscillation/vibration in
error. Or, adjust the Servo Drive or the positioning operation as much as
adjust the In-position Check Time or possible.
In-position Range. Increase the loop
gain if you adjust the Servo Drive.
However, make sure that you keep
the loop gain low enough so that the
control does not oscillate.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-29


11 Troubleshooting

Event name Following Error Limit Exceeded Event code 64480000 hex
Meaning The error between the command current position and actual current value exceeded the Following Error Over Value.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant axis. Relevant axis
decelerates to a stop if it is in motion.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The positioning operation has poor Remove the cause of poor following Remove the cause of poor following
following performance and the actual performance in the positioning opera- performance in the positioning opera-
motion is slower than the command. tion. Or increase the Following Error tion as best you can.
Over Value within the range that will
not create problems.
Attached None
information
Precautions/ None
Remarks

Event name Immediate Stop Input Event code 64490000 hex


Meaning The immediate stop input turned ON.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation According to the Immediate Stop Input Stop Method.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
An immediate stop input signal was Turn OFF the immediate stop input (The goal is to detect the immediate
detected. signal. stop input. Preventative measures are
not required.)
The immediate stop input signal is not If the error occurs even when the Make sure that the immediate stop
connected correctly or the logic set- immediate stop input signal is OFF, signal connection and logic setting for
ting for the immediate stop input is correct the immediate stop signal the immediate stop input are correct.
wrong. connection and logic setting for the Check the logic settings both in the
immediate stop input. Check the logic axis parameters and in the slave set-
settings both in the axis parameters tings.
and in the slave settings.
Attached None
information
Precautions/ You must turn OFF the immediate stop input signal before you reset the error.
Remarks

11-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Positive Limit Input Detected Event code 644A0000 hex
Meaning The positive limit input turned ON.
Source Motion Control Function Module Source details Axis Detection Continuously

11-2 Troubleshooting
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation According to the Limit Input Stop Method.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
A positive limit input signal was Reset the error and move the axis The goal is to detect the positive limit
detected. back in the negative direction before it input. Preventative measures are not
exceeds the limit in the positive direc- required. However, be sure not to 11
tion. If the error occurred during an exceed the positive limit input when
axes group motion control instruc- making programs.
tion, disable the axes group and then

11-2-2 Error Descriptions


perform the above operation. Find the
reason the limit was exceeded and
make suitable corrections.
The positive limit input signal is not If a positive limit input signal does not Make sure that the positive limit signal
connected correctly or the logic set- occur, correct the connection of the connection and logic setting for the
ting for the positive limit input is positive limit signal and the logic set- positive limit input are correct. Check
wrong. ting for the positive limit input. Check the logic settings both in the axis
the logic settings both in the axis parameters and in the slave settings.
parameters and in the slave settings.
Attached None
information
Precautions/ None
Remarks

Event name Negative Limit Input Detected Event code 644B0000 hex
Meaning The negative limit input turned ON.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation According to the Limit Input Stop Method.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
A negative limit input signal was Reset the error and move the axis The goal is to detect the negative limit
detected. back in the positive direction before it input. Preventative measures are not
exceeds the limit in the negative required. However, be sure not to
direction. If the error occurred during exceed the negative limit input when
an axes group motion control instruc- making programs.
tion, disable the axes group and then
perform the above operation. Find the
reason the limit was exceeded and
make suitable corrections.
The negative limit input signal is not If a negative limit input signal does Make sure that the negative limit sig-
connected correctly or the logic set- not occur, correct the connection of nal connection and logic setting for
ting for the negative limit input is the negative limit signal and the logic the negative limit input are correct.
wrong. setting for the negative limit input. Check the logic settings both in the
Check the logic settings both in the axis parameters and in the slave set-
axis parameters and in the slave set- tings.
tings.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-31


11 Troubleshooting

Event name Illegal Following Error Event code 64560000 hex


Meaning The difference between the command position and the actual current position exceeds the range of 30-bit data when
converted to pulses.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The command current position was Correct the program or correct the Write the program or set the elec-
restricted so that the axis velocity of electronic gear ratio so that the slave tronic gear ratio so that the slave axis
the slave axis would not exceed the axis does not exceed the maximum does not exceed the maximum veloc-
axis maximum velocity for the speci- velocity. ity.
fied travel distance.
Performance of slave axis positioning Remove the cause of poor slave axis Remove the cause of poor slave axis
operation is poor and the actual following performance in the position- following performance in the position-
motion is slower than the command. ing operation. ing operation as best you can.
Attached None
information
Precautions/ None
Remarks

Event name Servo OFF Error Event code 64570000 hex


Meaning The Servo was turned OFF for an axis due to an axes group error.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The Servo was turned OFF for an Find the cause of the error and take None
axis due to an axes group error. suitable measures.
Attached None
information
Precautions/ This error occurs for axes for which the Servos are turned OFF for an axes group error to interlock the axes so that the
Remarks Servos cannot be turned ON with the MC_Power (Power Servo) instruction. This error occurs only when an immediate
stop of the command value and turning OFF Servo at same time (free-run stop) is specified for the Axes Group Stop
Method Selection.

11-32 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Absolute Encoder Current Position Calculation Failed Event code 64580000 hex
Meaning It was not possible to correctly restore the current position from the absolute encoder information that was saved when
power was interrupted.

11-2 Troubleshooting
Source Motion Control Function Module Source details Axis Detection At power ON, at
timing Controller reset,
when download-
ing, when starting
Servo ON status,
or when changing
an unused axis to
a used axis
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant axes.
11
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence

11-2-2 Error Descriptions


Cause and Assumed cause Correction Prevention
correction
• The unit conversion settings, the Reset the error and perform homing. Perform homing again if you changed
ring counter setting in the Control- Perform homing near the position any parameters related to position,
ler, or the ring counter setting in the where the absolute encoder is set up such as the modulo maximum posi-
Servo Drive settings was changed. so that the position to restore does tion setting value. Perform homing
• The position to restore when con- not exceed the range of signed 40-bit near the position where the absolute
verted to pulses exceeded the data. encoder is set up so that the position
range of signed 40-bit data. to restore does not exceed the range
of signed 40-bit data.
Also, do not execute the MC_Power
(Power Servo) instruction, change an
unused axis to a used axis, or cycle
the power supply when the encoder
position exceeds the range of signed
40-bit data.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-33


11 Troubleshooting

Event name Home Undefined during Coordinated Motion Event code 64590000 hex
Meaning Home of the logical axis became undefined during axes group motion or while decelerating to a stop.
Source Motion Control Function Module Source details Axes group Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axes group decelerates to a stop.
System-defined Variable Data type Name
variables _MC_GRP[*].MFaultLvl.Active BOOL Axes Group Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The command position or actual posi- Correct the program so that the axis Write the program so that the axis
tion overflowed or underflowed for a operates within ranges that do not operates within ranges that do not
logical axis in an axes group motion cause overflows or underflows in the cause overflows or underflows in the
or a logical axis that was decelerating command position or actual position. command position or actual position.
to a stop and the home definition was
lost.
A slave communications error Correct the slave communications None
occurred for a logical axis and home error and define home.
became undefined during axes group
motion or while decelerating to a stop.
A slave for a logical axis left the net- Connect the disconnected or disabled Do not disconnect or disable the slave
work or was disabled and home Slave to the network again and define of a logical axis during axes group
became undefined during axes group home. motion or while decelerating to a stop.
motion or while decelerating to a stop.
Attached None
information
Precautions/ None
Remarks

Event name Servo Main Circuit Power OFF Event code 74210000 hex
Meaning The main circuit power of the Servo Drive turned OFF while the Servo was ON.
Source Motion Control Function Module Source details Axis Detection Whenever Servo
timing is ON
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The main circuit power of the Servo Turn ON the main circuit power of the Turn OFF the Servo, then turn OFF
Drive was interrupted while the Servo Servo Drive for the axis where the the main circuit power of the Servo
was ON. error occurred, reset the error, and Drive.
then turn ON the Servo.
Attached None
information
Precautions/ None
Remarks

11-34 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Interrupt Feeding Interrupt Signal Missing Event code 74230000 hex
Meaning An interrupt input was not received during execution of an MC_MoveFeed (Interrupt Feeding) instruction.
Source Motion Control Function Module Source details Axis Detection During instruc-

11-2 Troubleshooting
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis decelerates to a stop.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The latch enabled range specification If an invalid latch enabled range is Specify a correct latch enabled range
is invalid. specified to the instruction, correct it. based on the relationship between
the motion and sensor position. 11
There is a problem with the wiring of Correct any problems with the wiring Make sure that the wiring of the inter-
the interrupt signal. for the interrupt signal for the instruc- rupt signal is correct.

11-2-2 Error Descriptions


tion.
The sensor that outputs the interrupt If neither of the two causes listed None
signal has failed. above are applicable, the sensor that
outputs the interrupt signal has failed.
Replace the sensor that outputs the
interrupt signal for the instruction
where this error occurred.
Attached None
information
Precautions/ None
Remarks

Event name Homing Opposite Direction Limit Input Detected Event code 74240000 hex
Meaning The limit signal in the direction opposite to the homing direction was detected during a homing operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The Operation Selection at Negative To prevent errors at the limit inputs, Check to see if any of the conditions
Limit Input or Operation Selection at set the Operation Selection at Nega- that are given as causes exist in
Positive Limit Input parameter is set to tive Limit Input and Operation Selec- advance.
No reverse turn. tion at Positive Limit Input parameters
to Reverse turn.
The location of the homing input sig- Correct the location of the input signal
nal sensors, homing settings, and sensors, homing settings, and homing
homing start position cause a limit start position so that a limit input is
input to be reached. not reached.
The input signal sensor wiring is Correct the wiring of the input signal
incorrect or the sensor is faulty. sensor or replace the sensor.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-35


11 Troubleshooting

Event name Homing Direction Limit Input Detected Event code 74250000 hex
Meaning The limit signal in the homing direction was detected during a homing operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The Operation Selection at Negative To prevent errors at the limit inputs, Check to see if any of the conditions
Limit Input or Operation Selection at set the Operation Selection at Nega- that are given as causes exist in
Positive Limit Input parameter is set to tive Limit Input and Operation Selec- advance.
No reverse turn. tion at Positive Limit Input parameters
to Reverse turn.
The location of the homing input sig- Correct the location of the input signal
nal sensors, homing settings, and sensors, homing settings, and homing
homing start position cause a limit start position so that a limit input is
input to be reached. not reached.
The input signal sensor wiring is Correct the wiring of the input signal
incorrect or the sensor is faulty. sensor or replace the sensor.
Attached None
information
Precautions/ None
Remarks

Event name Homing Limit Inputs Detected in Both Directions Event code 74260000 hex
Meaning The limit signals in both directions were detected during a homing operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The wiring of the limit signal is incor- Correct the wiring of the limit signal. Check to see if any of the conditions
rect. that are given as causes exist in
advance.
The limit sensor is installed in the Correct the installation locations of
wrong location. the limit sensors so that they do not
turn ON at the same time.
The contact logic of the limit signal is Correct the contact logic (N.C./N.O.)
not correct. of the limit signal.
The limit sensor failed. Replace the limit sensor.
Attached None
information
Precautions/ None
Remarks

11-36 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Home Proximity/Homing Opposite Direction Limit Input Event code 74270000 hex
Detected
Meaning The home proximity input and the limit signal in the direction opposite to the homing direction were detected during a
homing operation.

11-2 Troubleshooting
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
11
The wiring of the home proximity sig- Correct the wiring of the home prox- Check to see if any of the conditions
nal or limit signal is incorrect. imity signal or limit signal. that are given as causes exist in
advance.

11-2-2 Error Descriptions


The home proximity sensor or limit Correct the installation location of the
sensor is installed in the wrong loca- home proximity sensor or limit sensor
tion. so that they do not turn ON at the
same time.
The contact logic of the home proxim- Correct the contact logic (N.C./N.O.)
ity signal or limit signal is not correct. of the home proximity sensor or limit
sensor.
The home proximity sensor or limit Replace the home proximity sensor or
sensor failed. limit sensor.
Attached None
information
Precautions/ None
Remarks

Event name Home Proximity/Homing Direction Limit Input Detected Event code 74280000 hex
Meaning The home proximity input and the limit signal in the homing direction were detected at the same time during a homing
operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The wiring of the home proximity sig- Correct the wiring of the home prox- Check to see if any of the conditions
nal or limit signal is incorrect. imity signal or limit signal. that are given as causes exist in
advance.
The home proximity sensor or limit Correct the installation location of the
sensor is installed in the wrong loca- home proximity sensor or limit sensor
tion. so that they do not turn ON at the
same time.
The contact logic of the home proxim- Correct the contact logic (N.C./N.O.)
ity signal or limit signal is not correct. of the home proximity sensor or limit
sensor.
The home proximity sensor or limit Replace the home proximity sensor or
sensor failed. limit sensor.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-37


11 Troubleshooting

Event name Home Input/Homing Opposite Direction Limit Input Event code 74290000 hex
Detected
Meaning The home input and the limit signal in the direction opposite to the homing direction were detected at the same time
during a homing operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The wiring of the home input signal or Correct the wiring of the home input Check to see if any of the conditions
limit signal is incorrect. signal or limit signal. that are given as causes exist in
advance.
The home input sensor or limit sensor Correct the installation location of the
is installed in the wrong location. home input sensor or limit sensor so
that they do not turn ON at the same
time.
The contact logic of the home input Correct the contact logic (N.C./N.O.)
signal or limit signal is not correct. of the home input signal or limit sen-
sor.
The home input signal output device Replace the home input signal output
or limit sensor failed. device or limit sensor.
Attached None
information
Precautions/ None
Remarks

Event name Home Input/Homing Direction Limit Input Detected Event code 742A0000 hex
Meaning The home input and the limit signal in the homing direction were detected at the same time during a homing operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The wiring of the home input signal or Correct the wiring of the home input Check to see if any of the conditions
limit signal is incorrect. signal or limit signal. that are given as causes exist in
advance.
The home input sensor or limit sensor Correct the installation location of the
is installed in the wrong location. home input sensor or limit sensor so
that they do not turn ON at the same
time.
The contact logic of the home input Correct the contact logic (N.C./N.O.)
signal or limit signal is not correct. of the home input signal or limit sen-
sor.
The home input signal output device Replace the home input signal output
or limit sensor failed. device or limit sensor.
Attached None
information
Precautions/ None
Remarks

11-38 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Invalid Home Input Mask Distance Event code 742B0000 hex
Meaning The setting of the home input mask distance is not suitable for the MC_Home or MC_HomeWithParameter instruction.
Source Motion Control Function Module Source details Axis Detection During instruc-

11-2 Troubleshooting
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
The set value of the home input mask Check the home input mask distance, Check the operating specifications for
distance when the operating mode of homing velocity, and homing the MC_Home or MC_HomeWithPa- 11
the MC_Home instruction is set to approach velocity. Change the set- rameter instruction, then set the home
Proximity Reverse Turn/Home Input tings so that they provide sufficient input mask distance, homing velocity,
Mask Distance is insufficient to decel- travel distance to decelerate based on and homing approach velocity so that

11-2-2 Error Descriptions


erate from the homing velocity to the the operating specifications of the they provide sufficient travel distance
homing approach velocity. MC_Home or MC_HomeWithParam- to decelerate.
eter instruction.
Attached None
information
Precautions/ None
Remarks

Event name No Home Input Event code 742C0000 hex


Meaning There was no home signal input during the homing operation. Or, a limit signal was detected before there was a home
input.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction • There was no home signal input Check the home input settings and Set the system so that the home sig-
during the homing operation. wiring and correct them so that the nal is input during the homing opera-
• A limit signal was detected before home signal is input during homing tion. Make sure that the home signal
there was a home input. based on the operation specifications is detected before a limit signal. Also
of the MC_Home or MC_HomeWith- check to make sure there are no wir-
Parameter instruction. Also, set the ing problems with the home input.
system so that the home signal is
detected before the limit signals.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-39


11 Troubleshooting

Event name No Home Proximity Input Event code 742D0000 hex


Meaning There was no home proximity signal input during the homing operation.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis stops with the stop method for the homing execu-
tion status.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
There was no home proximity signal Check the home proximity input set- Set the system so that the home prox-
input during the homing operation tings and wiring and correct them so imity signal is input during the homing
when a home proximity input signal that the home proximity signal is input operation. Also check to make sure
was specified. during homing based on the operation there are no wiring problems with the
specifications of the MC_Home or home proximity input.
MC_HomeWithParameter instruction.
Attached None
information
Precautions/ None
Remarks

Event name Slave Error Detected Event code 742F 0000 hex
Meaning An error was detected for the EtherCAT slave or NX Unit that is allocated to an axis.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction An error was detected for the Ether- Check the error at the slave and None
CAT slave or NX Unit that is allocated check the slave error code reported in
to an axis. Slave Error Code Report (94220000
hex) and perform the required correc-
tions.
Attached None
information
Precautions/ None
Remarks

11-40 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Axes Group Composition Axis Error Event code 74300000 hex
Meaning An error occurred for an axis in an axes group.
Source Motion Control Function Module Source details Axes group Detection Continuously

11-2 Troubleshooting
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation If an immediate stop is performed for one of the composi-
tion axes, operation will follow the setting of the Axes
Group Stop Method Selection. Otherwise, an interpolated
path stop is performed.
System-defined Variable Data type Name
variables _MC_GRP[*].MFaultLvl.Active BOOL Axes Group Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
11
An error occurred for an axis in an Check the error code of the axes in None
axes group that was in motion. the axes group and remove the cause
of the error.

11-2-2 Error Descriptions


Attached None
information
Precautions/ When an axis error occurs, any axes group that contains that axis will not operate.
Remarks

Event name MC Common Error Occurrence Event code 74330000 hex


Meaning An MC common error occurred.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant axis.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
Partial fault level MC common error Check the MC common error that None
occurred. occurred and remove the cause of the
error.
Attached None
information
Precautions/ When a partial fault level MC common error occurs, the axis and axis group do not operate.
Remarks

Event name Latch Position Overflow Event code 74340000 hex


Meaning An overflow occurred for the latched position for the MC_TouchProbe (Enable External Latch) instruction.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis decelerates to a stop. The Enable External Latch
instruction cannot retrieve the latch position.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction An overflow occurred for the latched Correct the program so that the axis Write the program so that the axis
position for the MC_TouchProbe position does not overflow. position does not overflow.
(Enable External Latch) instruction.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-41


11 Troubleshooting

Event name Latch Position Underflow Event code 74350000 hex


Meaning An underflow occurred for the latched position for the MC_TouchProbe (Enable External Latch) instruction.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis decelerates to a stop. The Enable External Latch
instruction cannot retrieve the latch position.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
An underflow occurred for the latched Correct the program so that the axis Write the program so that the axis
position for the MC_TouchProbe position does not underflow. position does not underflow.
(Enable External Latch) instruction.
Attached None
information
Precautions/ None
Remarks

Event name Master Sync Direction Error Event code 74360000 hex
Meaning The master axis continued to move in the direction opposite to the sync direction.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis decelerates to a stop.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction The master axis continued to move in Correct the program so that the move- Write the program so that the move-
the direction opposite to the sync ment direction and travel distance of ment direction and travel distance of
direction of the master and slave the master axis are in the sync direc- the master axis is the sync direction
axes, resulting in an overflow. tion after the start of synchronization. after the start of synchronization.
Attached None
information
Precautions/ None
Remarks

11-42 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Slave Disconnection during Servo ON Event code 74370000 hex
Meaning One of the following occurred while the Servo was ON for the EtherCAT slave or NX Unit that is allocated to an axis.
• Disconnection or replacement

11-2 Troubleshooting
• Disablement
• Restart of the NX bus on the NX-series CPU Unit
Source Motion Control Function Module Source details Axis Detection Whenever Servo
timing is ON
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention 11
correction
One of the following occurred while Reconnect the EtherCAT slave or NX Turn OFF the Servo before you per-
the Servo was ON for the EtherCAT Unit that is allocated to the axis to the form any of the following for the Ether-

11-2-2 Error Descriptions


slave or NX Unit that is allocated to an network. CAT slave or NX Unit.
axis. • Disconnection or replacement
• Disconnection or replacement • Disablement
• Disablement • Restart of the NX bus on the NX-
• Restart of the NX bus on the NX- series CPU Unit
series CPU Unit
Attached None
information
Precautions/ None
Remarks

Event name Feed Distance Overflow Event code 74380000 hex


Meaning The target position after the interrupt input was received for the MC_MoveFeed (Interrupt Feeding) instruction over-
flowed or underflowed.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The axis decelerates to a stop.
System-defined Variable Data type Name
variables
_MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction The target position after the interrupt Correct the input value for the com- Write the program correctly. The input
input was received for the MC_Move- mand position in the program. The value for the command position must
Feed (Interrupt Feeding) instruction target value after the interrupt input is not cause the target value after the
exceeded the range of signed 40-bit received must not exceed the valid interrupt input is received to exceed
data when converted to pulses. range for the number of pulses when the valid range. The valid range is
it is converted to pulses. signed 40-bit data for the number of
pulses when the target value is con-
verted to pulses.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-43


11 Troubleshooting

Event name Error in Changing Servo Drive Control Mode Event code 74390000 hex
Meaning Changing the Control Mode was not completed within the specified time.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
When the MC_SyncMoveVelocity Adjust the commands and load so Adjust the commands and load so
instruction was stopped, the actual that an error does not occur. that an error does not occur.
current velocity was not reduced to
10% or less of the maximum velocity
within 10 seconds for three consecu-
tive periods after a command velocity
of 0 was output.
For an OMRON 1S-series Servo
Drive or G5-series Servo Drive, the
actual current velocity was not
reduced to 10% or less of the maxi-
mum velocity within 10 seconds for
three consecutive periods when the
MC_TorqueControl instruction was
stopped.
Changing the Control Mode of the Check to see if there is an error in the Make sure that there are no errors in
Servo Drive between CSP, CSV, and Servo Drive and to see if settings are the Servo Drives and make sure that
CST was not completed within one correct. Correct any problems that are the settings are correct.
second after the command was exe- found. When changing the control mode to
cuted. When changing the control mode to perform control operations, set the
perform control operations, set the PDO map to reference positions for
PDO map to reference positions for CSP.
CSP.
Attached None
information
Precautions/ None
Remarks

11-44 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Master Axis Position Read Error Event code 743A0000 hex
Meaning The synchronized control instruction was not executed because an error occurred in the position of the master axis of
the synchronized control instruction.

11-2 Troubleshooting
Source Motion Control Function Module Source details Axis Detection At or during
timing instruction execu-
tion
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant slave axis. Relevant
slave axis decelerates to a stop if it is in motion.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
11
EtherCAT process data communica- If the _EC_PDSlavTbl (Process Data If you execute synchronized control
tions are not established for the mas- Communicating Slave Table) system- instructions after you turn ON the
ter axis of the synchronized control defined variable for the EtherCAT power supply, download data, or reset

11-2-2 Error Descriptions


instruction or the I/O data of the NX master of the master axis is FALSE, slave communications error, make
Unit cannot be used for control. investigate the error in the master sure that the _EC_PDSlavTbl (Pro-
axis and remove the cause. If the cess Data Communicating Slave
master axis is assigned to an NX Unit, Table) system-defined variable for the
perform the same correction for the EtherCAT master is TRUE for the
process data communicating status of node of the master axis before you
the NX Unit. execute the synchronized control
instruction. If the master axis is
assigned to an NX Unit, perform the
same correction for the process data
communicating status of the NX Unit.
The slave of the master axis for the Check the slave of the master axis Make sure that the slave of the mas-
synchronized control instruction was and reconnect if it was disconnected ter axis is not disconnected or dis-
disconnected or disabled. or enable it if it was disabled. abled during execution of the
synchronized control instruction.
An Absolute Encoder Current Position See if an Absolute Encoder Current Do not use an axis with an Absolute
Calculation Failed error (64580000 Position Calculation Failed error Encoder Current Position Calculation
hex) was detected for the master axis (64580000 hex) occurred for the mas- Failed error (64580000 hex) as the
of the synchronized control instruc- ter axis and make suitable corrections master axis in the synchronized con-
tion. to restore operation. trol instruction.
The master axis for the synchronized Set the master axis to a Used Axis. Do not change the master axis to an
control instruction is an unused axis. unused axis when executing synchro-
nized control instructions.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-45


11 Troubleshooting

Event name Auxiliary Axis Position Read Error Event code 743B0000 hex
Meaning The synchronized control instruction was not executed because an error occurred in the position of the auxiliary axis of
the synchronized control instruction.
Source Motion Control Function Module Source details Axis Detection At or during
timing instruction execu-
tion
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation Operation is not possible for relevant slave axis. Relevant
slave axis decelerates to a stop if it is in motion.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
EtherCAT process data communica- If the _EC_PDSlavTbl (Process Data If you execute synchronized control
tions are not established for the auxil- Communicating Slave Table) system- instructions after you turn ON the
iary axis of the synchronized control defined variable for the EtherCAT power supply, download data, or reset
instruction or the I/O data of the NX master of the auxiliary axis is FALSE, slave communications error, make
Unit cannot be used for control. investigate the error in the auxiliary sure that the _EC_PDSlavTbl (Pro-
axis and remove the cause. If the aux- cess Data Communicating Slave
iliary axis is assigned to an NX Unit, Table) system-defined variable for the
perform the same correction for the EtherCAT master is TRUE for the
process data communicating status of node of the auxiliary axis before you
the NX Unit. execute the synchronized control
instruction. If the auxiliary axis is
assigned to an NX Unit, perform the
same correction for the process data
communicating status of the NX Unit.
The slave of the auxiliary axis for the Check the slave of the auxiliary axis Make sure that the slave of the auxil-
synchronized control instruction was and reconnect if it was disconnected iary axis is not disconnected or dis-
disconnected or disabled. or enable it if it was disabled. abled during execution of the
synchronized control instruction.
An Absolute Encoder Current Position See if an Absolute Encoder Current Do not use an axis with a Absolute
Calculation Failed error (64580000 Position Calculation Failed error Encoder Current Position Calculation
hex) was detected for the auxiliary (64580000 hex) occurred for the aux- Failed error (64580000 hex) as the
axis of the synchronized control iliary axis and make suitable correc- auxiliary axis in a synchronized con-
instruction. tions to restore operation. trol instruction.
The auxiliary axis for the synchro- Set the auxiliary axis to a Used Axis. Do not change the auxiliary axis to an
nized control instruction is an unused unused axis when executing synchro-
axis. nized control instructions.
Attached None
information
Precautions/ None
Remarks

11-46 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name EtherCAT Slave Communications Error Event code 84400000 hex
Meaning A communications error occurred for the EtherCAT slave or NX Unit that is allocated to an axis.
Source Motion Control Function Module Source details Axis Detection Continuously

11-2 Troubleshooting
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation The Servo for the axis turns OFF.
System-defined Variable Data type Name
variables _MC_AX[*].MFaultLvl.Active BOOL Axis Minor Fault Occurrence
Cause and Assumed cause Correction Prevention
correction
A communications error occurred for Check the event log for the error that None
the EtherCAT slave or NX Unit that is occurred in the EtherCAT Master
allocated to an axis. Function Module or NX Bus Function 11
Module. Remove the cause of the
error and clear the relevant error.

11-2-2 Error Descriptions


Attached None
information
Precautions/ Even if this error is reset, the error in the EtherCAT Master Function Module or NX Bus Function Module that is con-
Remarks nected with the slave or NX Unit allocated to an axis is not reset. This error can be reset without resetting the error in
the EtherCAT Master Function Module or NX Bus Function Module, but the axis will still be disabled.

Event name Too Many Reset Motion Control Error Instructions Event code 571D0000 hex*
Meaning There are more than 100 instances of the ResetMCError (Reset Motion Control Error) instruction.
Source Motion Control Function Module Source details MC Common Detection At power ON,
timing Controller reset,
download, or
online editing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _MC_COM.Obsr.Active BOOL MC Common Observation Active
Cause and Assumed cause Correction Prevention
correction
There are more than 100 instances of Correct the user program so that Write the user program so that there
the ResetMCError (Reset Motion there are not more than 100 are not more than 100 instances of
Control Error) instruction declared in instances of the ResetMCError the ResetMCError (Reset Motion
the user program. Instances inside (Reset Motion Control Error) instruc- Control Error) instruction.
function blocks are included. tion. Use the same instances, or use
the MC_Reset (Reset Axis Error)
instruction or the MC_GroupReset
(Group Reset) instruction depending
on the error.
Attached None
information
Precautions/ None
Remarks

* This event occurs for a CPU Unit with unit version between 1.02 and 1.09.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-47


11 Troubleshooting

Event name Following Error Warning Event code 644C0000 hex


Meaning The following error exceeded the Following Error Warning Value.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
Performance of positioning operation Remove the cause of poor following Remove the cause of poor following
is poor and the actual motion is performance in the positioning opera- performance in the positioning opera-
slower than the command. tion. Or increase the Following Error tion much as possible.
Warning Value within the range that
will not create problems.
Attached None
information
Precautions/ None
Remarks

Event name Velocity Warning Event code 644D0000 hex


Meaning The command velocity exceeded the velocity warning value.
Source Motion Control Function Module Source details Axis/axes group Detection During instruc-
timing tion execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
_MC_GRP[*].Obsr.Active BOOL Axes Group Observation Occurrence
Cause and Assumed cause Correction Prevention
correction The command velocity exceeded the Find the reason the velocity warning (The goal is to enable detecting when
velocity warning value. value was exceeded and make suit- the velocity warning value is
able corrections. Or increase the exceeded. Preventative measures are
Velocity Warning Value within the not required.)
range that will not create problems.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

11-48 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Acceleration Warning Event code 644E0000 hex


Meaning The command acceleration exceeded the acceleration warning value.
Source Motion Control Function Module Source details Axis/axes group Detection During instruc-

11-2 Troubleshooting
timing tion execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
_MC_GRP[*].Obsr.Active BOOL Axes Group Observation Occurrence
Cause and Assumed cause Correction Prevention
correction The command acceleration rate Find the reason the acceleration (The goal is to enable detecting when
exceeded the acceleration warning warning value was exceeded and the acceleration warning value is 11
value. make suitable corrections. Or exceeded. Preventative measures are
increase the Acceleration Warning not required.)

11-2-2 Error Descriptions


Value within the range that will not
create problems.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

Event name Deceleration Warning Event code 644F0000 hex


Meaning The command deceleration exceeded the deceleration warning value.
Source Motion Control Function Module Source details Axis/axes group Detection During instruc-
timing tion execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
_MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
_MC_GRP[*].Obsr.Active BOOL Axes Group Observation Occurrence
Cause and Assumed cause Correction Prevention
correction The command deceleration rate Find the reason the deceleration (The goal is to enable detecting when
exceeded the deceleration warning warning value was exceeded and the deceleration warning value is
value. make suitable corrections. Or exceeded. Preventative measures are
increase the Deceleration Warning not required.)
Value within the range that will not
create problems.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-49


11 Troubleshooting

Event name Positive Torque Warning Event code 64500000 hex


Meaning The torque command value exceeded the positive torque warning value.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
The torque command value exceeded Find the reason the torque warning (The goal is to enable detecting when
the positive torque warning value. value was exceeded and make suit- the torque warning value is exceeded.
able corrections. Or increase the Pos- Preventative measures are not
itive Torque Warning Value within the required.)
range that will not create problems.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

Event name Negative Torque Warning Event code 64510000 hex


Meaning The torque command value exceeded the negative torque warning value.
Source Motion Control Function Module Source details Axis Detection During instruc-
timing tion execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
_MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
The torque command value exceeded Find the reason the torque warning (The goal is to enable detecting when
the negative torque warning value. value was exceeded and make suit- the torque warning value is exceeded.
able corrections. Or increase the Neg- Preventative measures are not
ative Torque Warning Value within the required.)
range that will not create problems.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

11-50 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Command Position Overflow Event code 64520000 hex


Meaning The number of pulses for the command position overflowed.
Source Motion Control Function Module Source details Axis Detection Continuously

11-2 Troubleshooting
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation The position is not updated, but motion continues.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
In Linear Mode, the command posi- Correct the program so that the input Check the gear ratio setting and the
tion when converted to pulses value for the command position does target position setting value, and
exceeded the upper limit of signed not exceed the range for the number make sure that the converted number 11
40-bit data. of pulses for the instruction. Or, of pulses does not exceed the range
change the electronic gear ratio set- of signed 40-bit data.
tings. To recover from the overflow,

11-2-2 Error Descriptions


change the current position or per-
form the homing operation.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

Event name Command Position Underflow Event code 64530000 hex


Meaning The number of pulses for the command position exceeded the valid range. (It underflowed.)
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation The position is not updated, but motion continues.
System-defined Variable Data type Name
variables
_MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
In Linear Mode, the command posi- Correct the program so that the input Check the gear ratio setting and the
tion when converted to pulses value for the command position does target position setting value, and
exceeded the lower limit of signed 40- not exceed the pulse number limit for make sure that the converted number
bit data. the instruction. Or, change the elec- of pulses does not exceed the range
tronic gear ratio settings. To recover of signed 40-bit data.
from the underflow, change the cur-
rent position or perform the homing
operation.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-51


11 Troubleshooting

Event name Actual Position Overflow Event code 64540000 hex


Meaning The number of pulses for the actual position overflowed.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation The position is not updated, but motion continues.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
The actual position when converted to Correct the program so that the target Check the gear ratio setting and the
pulses exceeded the upper limit of position is well within the pulse num- target position setting value, and
signed 40-bit data. ber limit so that the actual position make sure that the converted number
does not exceed the pulse number of pulses does not exceed the range
limit for the instruction. Or, change the of signed 40-bit data. Allow some lee-
electronic gear ratio settings. To way.
recover from the overflow, change the
current position or perform the hom-
ing operation.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

Event name Actual Position Underflow Event code 64550000 hex


Meaning The number of pulses for the actual position underflowed.
Source Motion Control Function Module Source details Axis Detection Continuously
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation The position is not updated, but motion continues.
System-defined Variable Data type Name
variables
_MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
The actual position when converted to Correct the program so that the target Check the gear ratio setting and the
pulses exceeded the lower limit of position is well within the pulse num- target position setting value, and
signed 40-bit data. ber limit so that the actual position make sure that the converted number
does not exceed the pulse number of pulses does not exceed the range
limit for the instruction. Or, change the of signed 40-bit data. Allow some lee-
electronic gear ratio settings. To way.
recover from the underflow, change
the current position or perform the
homing operation.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

11-52 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Slave Observation Detected Event code 74320000 hex


Meaning A warning was detected for an EtherCAT slave or NX Unit.
Source Motion Control Function Module Source details Axis Detection Continuously

11-2 Troubleshooting
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
A warning was detected for the Ether- Check the warning code for the Ether- None
CAT slave or NX Unit that is allocated CAT slave and remove the cause of
to an axis. the warning. 11
Attached Attached information 1: Drive warning code
information

11-2-2 Error Descriptions


Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

Event name Cannot Execute Save Cam Table Instruction Event code 743C0000 hex
Meaning You cannot save a cam table to a file when non-volatile memory is being accessed by another operation.
Source Motion Control Function Module Source details MC Common Detection At instruction
timing execution
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
_MC_COM.Obsr.Active BOOL MC Common Observation Active
Cause and Assumed cause Correction Prevention
correction An attempt was made to execute the Execute the MC_SaveCamTable None
MC_SaveCamTable instruction when instruction again.
another operation was accessing the
non-volatile memory (e.g., transfer or
data trace operation from the Sysmac
Studio).
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-53


11 Troubleshooting

Event name Notice of Insufficient Travel Distance to Achieve Blending Event code 94200000 hex
Transit Velocity
Meaning There is not sufficient travel distance to accelerate or decelerate to the transit velocity during blending operation.
Source Motion Control Function Module Source details Axis/axes group Detection At multi-execution
timing of instructions
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
_MC_AX[*].Obsr.Active BOOL Axis Observation Occurrence
_MC_GRP[*].Obsr.Active BOOL Axes Group Observation Occurrence
Cause and Assumed cause Correction Prevention
correction
When the Acceleration/Deceleration Set the Acceleration/Deceleration Set the Acceleration/Deceleration
Over parameter was set to Use rapid Over parameter to a value other than Over parameter to a value other than
acceleration/deceleration (Blending is Use rapid acceleration/deceleration Use rapid acceleration/deceleration
changed to Buffered), the results of (Blending is changed to Buffered) if (Blending is changed to Buffered) if
profile creation caused the accelera- you do not want to change to Buffered you do not want to change to Buffered
tion/deceleration rate to be exceeded operation. operation.
when blending was specified, so buff-
ered was used.
Blending was specified, but the target If unanticipated operation occurs from If unanticipated operation would occur
position was already reached, so it the switch to Buffered operation, cor- from the switch to Buffered operation,
was changed to Buffered because the rect the program so that the causes write the program so that the causes
profile could not be created. given at the left do not occur. given at the left do not occur.
Attached None
information
Precautions/ You can change the event level to the minor fault level. If you change the level to the minor fault level, the Recovery col-
Remarks umn above will be changed to “Error reset” and the Operation column will be “The axis/axes group decelerates to a
stop.”

Event name Error Clear from MC Test Run Tab Page Event code 94210000 hex
Meaning An error was cleared from the MC Test Run Pane of the Sysmac Studio.
Source Motion Control Function Module Source details MC common Detection When MC Test
timing Run error is reset
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction An error was cleared from the MC --- ---
Test Run Pane of the Sysmac Studio.
Attached Attached information 1: Execution results (0000_0000 hex: All errors reset, 0000_0001 hex: Resetting all errors failed)
information
Precautions/ None
Remarks

11-54 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Event name Slave Error Code Report Event code 94220000 hex
Meaning The error code was reported by the slave when a Slave Error Detected error occurred.
Source Motion Control Function Module Source details Axis Detection After Slave Error

11-2 Troubleshooting
timing Detected error
(742F0000 hex)
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
The error code was reported by the This error accompanies a Slave Error None
slave when a Slave Error Detected Detected error (742F0000 hex). 11
error (742F0000 hex) occurred. Check the slave error code in the
attached information and make the
required corrections.

11-2-2 Error Descriptions


Attached Attached information 1: Slave error code
information
Precautions/ For an OMRON 1S-series Servo Drive or G5-series Servo Drive, the error code (the main part of the error display num-
Remarks ber) from the Servo Drive is included in the lower two digits of the attached information.
For example, if the attached information is displayed as FF13, the error with display number 13 (Main Circuit Power
Supply Undervoltage) occurred in the Servo Drive.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-55


11 Troubleshooting

11-2-3 Error Causes and Remedies


This section describes remedial actions to take when problems occur the first time you use the MC
Function Module or after starting operation.

Preliminary Check Items


If an error occurs, check the items below to investigate the problem.
Category Item to check
Installation conditions Is there dust in the ambient environment?
Are there conductive foreign matters (metal, carbon, etc.) in the ambient
environment that might enter the Controller?
Is the ambient temperature higher than the ambient operating temperature
in the specifications?
Is the ambient area humid (due to moisture in the air, use of water, etc.)?
Does the ambient air contain corrosive gases (acid, salt, sulfur, etc.)?
Are there sources of noise around the Controller (welders, inverters, etc.)?
Wiring Are power supply lines wired in the same duct as the signal lines?
Is the Controller grounded properly?
Is there a noise filter in the power supply?
Changes Was any extension work (welding work) done lately?
Was any power supply facility added lately?
Was the system (including its program) modified in any way (including addi-
tions)?
Accidents Was there a lightning strike nearby?
Was there a ground-fault accident or was the earth leakage breaker tripped?
Was there a power outage?

11-56 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Problems and Countermeasures


This section describes troubleshooting when the MC Function Module is used in combination with an

11-2 Troubleshooting
OMRON 1S-series Servo Drive or G5-series Servo Drive. If an unexpected operation is performed,
data such as parameter settings or cam data may not have been transferred properly to the CPU Unit
from the Sysmac Studio. Furthermore, variables may not be working properly between the user pro-
gram and the MC Function Module. Use the data tracing function of Sysmac Studio to check if variables
are exchanged at the correct timings.
Problem Cause Item to check Countermeasure
Motor does not lock. The MC Function Module Make sure that you exe- Correct the program.
does not output operation cute the MC_Power
commands to the Servo instruction. 11
Drive.
Servo Drive setting error Check the Servo Drive Set the Servo Drives cor-

11-2-3 Error Causes and Remedies


settings. rectly.
Motor does not run. The drive prohibit input of Use the Servo Drive soft- Cancel the drive prohibit
the Servo Drive is ware to check the drive input of the Servo Drive.
enabled. prohibit input. Change the setting so that
you do not use the drive
prohibit input of the Servo
Drive.
Servo Drive error Check for a Servo Drive If there is an error, follow
error. troubleshooting proce-
dures for it.
Mechanical axis is locked. Check for contact with Manually release the
mechanical limits and locked mechanical axis.
check to see if mechanical
parts are caught on some-
thing.
CPU Unit failure --- Replace the CPU Unit.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-57


11 Troubleshooting

Problem Cause Item to check Countermeasure


Homing cannot be per- Error Check the nature of the If there is an error, follow
formed. error. troubleshooting proce-
dures for it.
Incorrect wiring of the Check the axis input infor- Wire all connections cor-
home proximity input. mation in the Axis Vari- rectly.
ables to see if the home
proximity input sensor
turns ON/OFF.
Incorrect wiring of the Check the wiring of the Wire all connections cor-
home input. home input. rectly.
The rotation direction and If the axis moves to the Wire the limit inputs cor-
limit input direction are mechanical limit without rectly.
inconsistent. reversing at the limit,
check the axis input infor-
mation in the Axis Vari-
ables to see if the limit
input turns ON and OFF.
Incorrect wiring of the limit Check the wiring of the Wire all connections cor-
input limit inputs. rectly.
InPosWaiting does not Check to see if the Servo Increase the Servo Drive
change to FALSE Drive gain is too low. gain.
Check to see if the in-posi- Increase the in-position
tion range is too narrow. range.
Homing approach velocity Check the homing Lower the homing
is too high. approach velocity. approach velocity of the
MC Function Module.
Axis parameters are not Check the axis parame- After setting the axis
set correctly. ters in the Sysmac Studio. parameters correctly,
download them to the MC
Function Module.
CPU Unit failure --- Replace the CPU Unit.
The position of home Loose mechanical parts, Use a marker pen to mark Securely tighten the con-
defined with homing such as couplings the motor shafts, cou- nections that shifted.
changes occasionally. plings, and other mechani-
cal connections to check
for shifting.
Insufficient leeway for Z If the value is close to the Remove the motor cou-
phase setting per Servomotor pling and shift the position
Insufficient leeway for rotation (number of pulses by around one-quarter of a
home input signal per encoder rotation) or turn so that the Z phase
near zero, the home may pulse occurs at around
be shifted by one motor one half of a Servomotor
rotation due to slight rotation (number of pulses
changes in the timing of per encoder rotation), and
reading the sensor input. then perform homing
again.

11-58 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Problem Cause Item to check Countermeasure


Unstable motor rotation Incorrect wiring of Servo- Check the wiring of the Wire all connections cor-
motor power line/encoder motor power line and rectly.
line, missing phase, etc. encoder line.

11-2 Troubleshooting
Load torque variation due Check the machine. Turn Review and adjust the
to gear meshing or not the coupling under a no- machine.
tightening the coupling load condition (with the
eccentric screw connect- mechanical part after the
ing the motor axis with the coupling removed).
mechanical system
Insufficient gain adjust- --- Perform auto-tuning of the
ment Servomotor. Manually
adjust the Servomotor 11
gain.
Incorrect Servomotor Select another motor Change to an optimal

11-2-3 Error Causes and Remedies


selection (adjustment not (check the torque and motor.
possible) inertia ratio).
Damaged Servomotor Turn OFF the Servo Drive Replace the Servomotor.
bearings power supply, and also
turn ON the brake power
supply and release the
brake if the motor comes
with a brake. Then manu-
ally turn the motor output
shaft with the motor power
line disconnected
(because the dynamic
brake may be applied).
Broken Servomotor wind- Use a tester to check the Replace the Servomotor.
ing resistance between
phases U, V, and W of the
motor power line. If the
balance is off, there is a
problem.
Rotation direction is The Servo Drive is set to Jog the machine. If the Set the rotation direction
reversed. the opposite rotation direc- rotation direction of the of the Servo Drive cor-
tion. Servo Drive is opposite rectly.
the jogging direction, the
rotation direction of the
Servo Drive is reversed.
Also check for reversed
feedback signals (phases
A and B) and reverse rota-
tion setting of the parame-
ter.
(During homing) Check the axis parame- Set the correct axis
The axis parameters that ters and sensor polarity parameters.
set the polarity of the again.
home proximity sensor
and the polarity of the
home proximity input do
not match.
(During homing) Check the axis input infor- Wire the home proximity
Incorrect wiring of the mation in the Axis Vari- input correctly.
home proximity input ables to see if the home
proximity input sensor
turns ON/OFF.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-59


11 Troubleshooting

Problem Cause Item to check Countermeasure


Operation cannot be The in-position range of --- Increase the in-position
started, positioning is not the Servo Drive is too nar- range.
completed, or positioning row, and thus the current
takes too much time to position does not enter the
complete. in-position range. (The
current operation does not
complete until the current
position enters the in-posi-
tion range, so you cannot
start the next motion.)
Servo Drive gain is low. --- Adjust the Servo Drive
gain.
The axis does not remain Check the axis input infor- If you stop the axis so that
in the in-position range mation for the Axis Vari- a position inside the in-
due to an external force. ables to see if the position range is not
difference between the achieved, such as holding
command current position control, you can use the
and the actual current following error reset output
position is within the in- to forcibly achieve the in-
position range. position range.
Abnormal noise Mechanical vibration Check the moving parts of Correct the problem.
the machine for intrusion
of foreign matter, dam-
age, deformation, and
loosening.
Insufficient adjustment of --- Perform auto-tuning. Man-
the Servo Drive gain (high ually lower the gain.
gain)
Incorrect Servomotor Select another motor Change to an optimal
selection (adjustment not (check the torque and motor.
possible). inertia ratio).
Misalignment of the cou- --- Adjust the motor and
pling that connects the machine installation.
motor shaft and machine
Motor shaft shakes. Insufficient adjustment of --- Perform auto-tuning. Man-
the gain (low gain) ually increase the gain.
Gain cannot be adjusted In particular, this condi- Increase the machine
due to low machine rigid- tion occurs on vertical rigidity. Readjust the gain.
ity. axes, SCARA robots, pal-
letizers, and other sys-
tems whose axes are
subject to bending or ten-
sional loads.
Mechanical configuration --- Perform auto-tuning. Man-
prone to stick slip (highly ually adjust the gain.
sticky static friction)
Incorrect Servomotor Select an appropriate Change to an optimal
selection (adjustment not motor (check the torque motor.
possible) and inertia ratio).
Failure --- Replace the Servo Drive.
Replace the Servomotor.

11-60 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


11 Troubleshooting

Problem Cause Item to check Countermeasure


Position shift The home position was Refer to The position of Refer to The position of
already shifted before home defined with hom- home defined with hom-
positioning. ing changes occasionally. ing changes occasionally.

11-2 Troubleshooting
Malfunction due to noise Check if a welder, inverter, Isolate the Controller from
from a welder, inverter, or other similar device is any nearby welders,
etc. located nearby. inverters, etc.
Mechanical shift Check if dimensional shifts Securely tighten the
accumulated. (Mark the mechanical tightening
mechanical connections to points.
check for shifting.)
An MC Test Run is not An MC Test Run is being Check to see if there is End all MC Test Run oper-
possible from the Sysmac executed from another another installation of the ation for other installa- 11
Studio. installation of the Sysmac Sysmac Studio connected tions of the Sysmac
Studio to the same CPU Unit. Studio.

11-2-3 Error Causes and Remedies

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) 11-61


11 Troubleshooting

11-62 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices
A
This section describes settings and connection methods for OMRON 1S-series Servo
Drive or G5-series Servo Drive objects.

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-22
A-3-1 Wiring to Encoder Input Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-22
A-3-2 Settings for Encoder Input Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-22
A-4 Connecting to NX Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-28
A-5 PDS State Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-29
A-5-1 PDS State Control Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-30
A-5-2 Main Circuit Power Supply OFF Detection . . . . . . . . . . . . . . . . . . . . . . . . . . A-31
A-6 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-32
A-6-1 NJ/NX-series Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-32
A-6-2 Motion Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-33
A-6-3 EtherCAT Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-35
A-7 Version Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-36

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-1


Appendices

A-1 Connecting the 1S-series Servo


Drive
This appendix describes connections to an OMRON 1S-series Servo Drive with built-in EtherCAT com-
munications.

A-1-1 Wiring the Servo Drive


Servo Drives are connected using EtherCAT communications.
Refer to the NJ/NX-series CPU Unit Built-in EtherCAT Port User’s Manual (Cat. No. W505) for informa-
tion on the connection methods.

A-1-2 Servo Drive Settings


This section outlines the Servo Drive settings that are used when connected to OMRON 1S-series
Servo Drives with built-in EtherCAT communications (i.e., the applicable Servo Drives for the MC Func-
tion Module).
For details on the Servo Drives, refer to the AC Servomotors/Servo Drives 1S-series with Built-in Ether-
CAT Communications User’s Manual (Cat. No. I586).

Assigning External Input Signals


The MC Function Module uses the general-purpose inputs of the Servo Drive for the following input sig-
nals.
• Immediate stop input
• Positive limit input
• Negative limit input
• Home proximity input
• External latch trigger signals (latch input 1 and latch input 2)

 Assigning Positive Limit Inputs, Negative Limit Inputs, and Home Proximity
Input
The default settings of the input signals of an OMRON 1S-series Servo Drive are listed in the follow-
ing table.

Signal name Input signal


Immediate stop input Servo Drive general-purpose input 1 (IN1: pin 12 on connector CN1, NC) *1
Positive limit input Servo Drive general-purpose input 2 (IN2: pin 32 on connector CN1, NC) *2
Negative limit input Servo Drive general-purpose input 3 (IN3: pin 13 on connector CN1, NC) *3
Home Proximity Input Servo Drive general-purpose input 4 (IN4: pin 33 on connector CN1, NO)

*1 The signal name for the Servo Drive is the error stop input.
*2 The signal name for the Servo Drive is the positive drive prohibit input.
*3 The signal name for the Servo Drive is the negative drive prohibit input.

A-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

 Trigger Signal Assignments for External Latches

A-1 Connecting the 1S-series Servo Drive


The input signals in the following table are assigned to external latch trigger signals by default for the
OMRON 1S-series Servo Drive.

Settings for the TriggerInput (Trigger Input Condition)


input variable of the MC_TouchProbe instruction External latch trigger signal
Mode InputDrive LatchID
0: mcDrive 0: mcEncoderMark --- Encoder Z phase
1: mcEXT 1: mcLatch1 Servo Drive general-purpose input 7
(IN7: pin 15 on connector CN1, NO) *1
2: mcLatch2 Servo Drive general-purpose input 8
(IN8: pin 35 on connector CN1, NO)*2
1: mcController --- --- Variable specified by TriggerVariable

*1 The signal name for the Servo Drive is the external latch input 1. A
*2 The signal name for the Servo Drive is the external latch input 2.

A-1-2 Servo Drive Settings


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 compen-
Selection sation in the position control, and the operation direc-
tion for the compensation. *1
0: Backlash compensation disabled
1: Compensate at the first positive operation after servo
ON
2: Compensate at the first negative operation after
servo ON
03 hex Backlash Compensation Sets the backlash compensation amount in the position
Amount 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).

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-3


Appendices

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.

The following PDOs are mapped by default 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), Max
Mapping (1704 Profile Velocity (607F hex), Positive Torque Limit Value (60E0 hex), and Negative Torque
hex) 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

• If you use the recommended OMRON Servo Drives (R88D-1SN-ECT), then it is not nec-
essary to change the default PDO map on the Sysmac Studio.

A-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Relationships between MC Function Module and Process Data

A-1 Connecting the 1S-series Servo Drive


The functions of the MC Function Module are related to the information in the process data objects.
Depending on the EtherCAT slave configuration and functions that are used by the MC Function Mod-
ule, you sometimes must change the relationships between the MC Function Module and the PDOs.

To access the settings, click the Detailed Settings Button on the Axis Basic Settings Display in the
Sysmac Studio.

A-1-2 Servo Drive Settings


Additional Information

If you use the recommended OMRON Servo Drives (R88D-1SN-ECT), then it is not neces-
sary to change the default relationships between MC Function Module functions and the PDOs
on the Sysmac Studio.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-5


Appendices

 Output Settings (Controller to Servo Drive)


The input settings apply to the command data that is sent from the MC Function Module to the
Servo Drive.
The default settings in the Sysmac Studio are listed in the following table. (Required objects are
marked with a star.)

Function name Process data Description


 Control word 6040 hex-00.0 This data is used to control the status of the Servo Drive.
(Controlword) Set 6040 hex: Controlword.
 Target posi- 607A hex-00.0 The target position for position control.
tion (Target position) Set 607A hex: Target position.
Target veloc- 60FF hex-00.0 The target velocity for velocity control.
ity (Target velocity) This object is necessary to output to the Servo Drive in Cyclic
Synchronous Velocity Control Mode by the MC_SyncMoveVe-
locity (Cyclic Synchronous Velocity Control) and other instruc-
tions.
Normally set 60FF hex: Target velocity.
Target torque 6071 hex-00.0 The target torque for torque control.
(Target torque) This object is necessary to output to the Servo Drive in Cyclic
Synchronous Torque Control Mode by the MC_TorqueControl
(Torque Control) and other instructions.
Normally set 6071 hex: Target torque.
Max profile 607F hex-00.0 The velocity limit value for torque control.
velocity (Max profile velocity) This object is necessary for velocity control in Cyclic Synchro-
nous Torque Control Mode by the MC_TorqueControl (Torque
Control) and other instructions.
Normally set 607F hex: Max profile velocity.
Modes of 6060 hex-00.0 This data is required to change the control mode.
operation (Modes of operation) This object is necessary to change to a control mode other
than Cyclic Synchronous Position Control Mode for the
MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control),
MC_TorqueControl (Torque Control), and other instructions.
Normally set 6060 hex: Modes of operation. *1
Positive 60E0 hex-00.0 This is the torque limit value in the positive direction.
torque limit (Positive torque limit This object is necessary to control the output torque of the
value value) Servo Drive by the MC_SetTorqueLimit and other instructions.
Normally set 60E0 hex: Positive torque limit value.
Negative 60E1 hex-00.0 This is the torque limit value in the negative direction.
torque limit (Negative torque limit This object is necessary to control the output torque of the
value value) Servo Drive by the MC_SetTorqueLimit and other instructions.
Normally set 60E1 hex: Negative torque limit value.
Touch probe 60B8 hex-00.0 This data is used to control the touch probe function.
function (Touch probe function) It is required for the touch probe function for the MC_Home,
MC_HomeWithParameter, MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch), MC_MoveLink (Syn-
chronous Positioning), and other instructions.
Normally set 60B8 hex: Touch probe function.

*1 If you set 6060 hex (Modes of Operation), also set 6061 hex (Modes of Operation Display). Normal operation
is not possible if only one of these two is set.

A-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Precautions for Correct Use

A-1 Connecting the 1S-series Servo Drive


• 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 communications
or G5-series Servo Drive with built-in EtherCAT communications, always set the Modes of
Operation (6060 hex).

 Input Settings (Servo Drive to Controller)


This is the status data from the Servo Drive to the MC Function Module.
The default settings in the Sysmac Studio are listed in the following table. (Required objects are
marked with a star.)

Function name Process data Description


 Statusword 6041 hex-00.0 The status of the Servo Drive. Set 6041 hex: Statusword.
A
(Statusword)

A-1-2 Servo Drive Settings


 Position 6064 hex-00.0 Shows the actual position. Set 6064 hex: Position actual value.
actual value (Position actual value)
Velocity Not set. *1 Shows the actual velocity. If you use it, normally set 606C hex:
actual value Velocity actual value.
Torque actual 6077 hex Shows the actual torque.
value (Torque actual value) This object is necessary to output to the Servo Drive in Cyclic
Synchronous Torque Control Mode by the MC_TorqueControl
(Torque Control) and other instructions.
Normally set 6077 hex: Torque actual value.
Modes of 6061 hex-00.0 Shows the operation mode.
operation dis- (Modes of operation dis- This object is necessary to change to a control mode other
play play) than Cyclic Synchronous Position Control Mode for the
MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control),
MC_TorqueControl (Torque Control), and other instructions.
Normally set 6061 hex: Modes of operation display. *2
Touch probe 60B9 hex-00.0 Shows the status of the touch probe function.
status (Touch probe status) It is required for the touch probe function for the MC_Home,
MC_HomeWithParameter, MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch), MC_MoveLink (Syn-
chronous Positioning), and other instructions.
Normally set 60B9 hex: Touch probe status.
Touch probe 60BA hex-00.0 The latched position for touch probe 1.
pos1 pos (Touch probe pos1 pos It is required for the touch probe function for the MC_Home,
value value) MC_HomeWithParameter, MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch), MC_MoveLink (Syn-
chronous Positioning), and other instructions. Normally set
60BA hex: Touch probe pos1 pos value.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-7


Appendices

Function name Process data Description


Touch probe 60BC hex-00.0 The latched position for touch probe 2.
pos2 pos (Touch probe pos2 pos It is required for the touch probe function for the MC_Home,
value value) MC_HomeWithParameter, MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch), MC_MoveLink (Syn-
chronous Positioning), and other instructions. Normally set
60BC hex: Touch probe pos2 pos value.
Error code 603F hex-00.0 The error code in the Servo Drive.
(Error code) Normally set 603F hex: Error code.
Reference Not set. The reference position for changing the csp mode. This data is
position for accessed by instructions that are used in Velocity Control Mode
csp (CSV) or Torque Control Mode (CST).
This object is supported for OMRON 1S-series Servomo-
tors/Servo Drives. *3

*1 If required, map the selected process data to a PDO before setting it. The standard setting is 606C hex-00.0
(Velocity actual value).
*2 If you set 6061 hex (Modes of operation display), also set 6060 hex (Modes of operation). Normal operation is
not possible if only one of these two is set.
*3 Map 3010-87 hex (Reference Position for CSP) to a PDO when you use an OMRON 1S-series
Servomoter/Servo Drive.

Precautions for Correct Use


• 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 communications
or G5-series Servo Drive with built-in EtherCAT communications, 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.

 Digital Input Settings


The MC Function Module uses the following input signals of the Servo Drive.

Function name Process data Description


Positive drive 60FD hex-00.1 This signal is used for the positive limit input.
prohibit input (Digital inputs) Normally set Bit 1: Positive limit switch of 60FD hex-00: Digital inputs.
Negative 60FD hex-00.0 This signal is used for the negative limit input.
drive prohibit (Digital inputs) Normally set Bit 0: Negative limit switch of 60FD hex-00: Digital inputs.
input
Error stop 60FD hex-00.25 This signal is used for the immediate stop input.
input (Digital inputs) Set Bit 25: Error stop input of 60FD hex-00: Digital inputs for an
OMRON 1S-series Servo Drive.
Encoder Z- 60FD hex-00.16 Shows the status of detecting the Z-phase input.
phase detec- (Digital inputs) Set Bit 16: Encoder phase Z detection of 60FDhex-00: Digital inputs for
tion an OMRON 1S-series Servomotor/Servo Drive.

A-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Function name Process data Description

A-1 Connecting the 1S-series Servo Drive


Home prox- 60FD hex-00.2 This signal is used for the home proximity input.
imity input (Digital inputs) Normally set Bit 2: Home switch of 60FD hex-00: Digital inputs.
External 60FD hex-00.17 Shows the status of the signal that is used for external latch input 1.
latch input 1 (Digital inputs) Set Bit 17: External latch input 1 of 60FD hex-00: Digital inputs for an
OMRON 1S-series Servo Drive.
External 60FD hex-00.18 Shows the status of the signal that is used for external latch input 2.
latch input 2 (Digital inputs) Set Bit 18: External latch input 2 of 60FD hex-00: Digital inputs for an
OMRON 1S-series Servo Drive.

Precautions for Correct Use


• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.
A

A-1-2 Servo Drive Settings


Version Information
• If you are using a CPU Unit with unit version 1.09 or earlier and you are not using an OMRON
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.
• If you are using a CPU Unit with unit version 1.10 or later, operation is as described in the fol-
lowing table depending on whether Modes of Operation (6060 hex) and Modes of Operation
Display (6061 hex) are mapped.

Modes of Operation Display


(6061 hex) mapped (6061 hex) not mapped
• You can execute instructions that use • You can execute instructions that use
CSP,*1 CSV,*2 or CST.*3 CSP. If you execute any instruction
• The servo is OFF in any control mode that uses any other control mode, a
Modes of Oper- other than CSP, CSV, or CST. Process Data Object Setting Missing
ation (6060 hex) error (error code 3461 hex) occurs.
mapped • The MC Function Module assumes
that the CSP Servo Drive control
mode is used. Command the Servo
Drive to use CSP.
• You can execute instructions that use You can execute instructions that use
CSP. If you execute any instruction CSP. If you execute any instruction that
Modes of Oper- that uses any other control mode, a uses any other control mode, a Process
ation (6060 hex) Process Data Object Setting Missing Data Object Setting Missing error (error
not mapped error (error code 3461 hex) occurs. code 3461 hex) occurs.
• The servo is OFF in any control mode
other than CSP.

*1 CSP is the Cyclic Synchronous Position Control Mode of the Servo Drive.
*2 CSV is the Cyclic Synchronous Velocity Control Mode of the Servo Drive.
*3 CST is the Cyclic Synchronous Torque Control Mode of the Servo Drive.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-9


Appendices

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-
Sub-
Index Name mended Description
index
setting
3001 hex --- Machine --- The gear ratio on the Servo is 1:1. Set the user
05 hex Electronic Gear Ratio Numerator 1 unit on the Controller. *1
06 hex Electronic Gear Ratio Denominator 1
3330 hex --- Torque Limit --- Use 60E0 hex and 60E1 hex as the torque limit
01 hex Switch Selection 2 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.

3B11 hex --- Software Limits --- Disable both the positive and negative soft-
01 hex Enable Selection 0 ware 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
signal 2.
3B31 hex --- Touch Probe Function 2 --- Set this as follows: Touch probe1 = External
01 hex Latch 2 Trigger Selection 2 latch signal 1, Touch probe2 = External latch
signal 2.
4020 hex --- Warning Customization --- Set this to automatically reset warnings when
04 hex Warning Hold Selection 0 the cause is removed.

4510 hex --- Encoder --- Use as absolute encoders.


01 hex Absolute Encoder Operation Selec- 2 Ignore multi-rotation counter overflow.
tion
4630 hex --- Positive Drive Prohibit --- Assign the Positive Drive Prohibit to the gen-
01 hex Port Selection 2 eral-purpose input 2 (IN2) as a negative logic
(NC input).
02 hex Logic Selection 1
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
(NC input).
02 hex Logic Selection 1
4632 hex --- External Latch Input 1 --- Assign the External Latch Input 1 to the gen-
01 hex Port Selection 7 eral-purpose input 7 (IN7) as a positive logic
(NO input).
02 hex Logic Selection 0
4633 hex --- External Latch Input 2 --- Assign the External Latch Input 2 to the gen-
01 hex Port Selection 8 eral-purpose input 8 (IN8) as a positive logic
(NO input).
02 hex Logic Selection 0
4634 hex --- Home Proximity Input --- Assign the Home Proximity Input to the gen-
01 hex Port Selection 4 eral-purpose input 4 (IN4) as a positive logic
(NO input).
02 hex Logic Selection 0

*1 With a CPU Unit of unit version 1.10 or earlier, you cannot operate OMRON 1S-series Servomotors in the maximum rota-
tion speed. To operate the 1S-series Servomotors in the maximum rotation speed, set the electronic gear ratio to 2:1 or
greater.

A-10 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

A-2 Connecting the G5-series Servo

A-2 Connecting the G5-series Servo Drive


Drive
This appendix describes connections to an OMRON G5-series Servo Drive with built-in EtherCAT com-
munications.

A-2-1 Wiring the Servo Drive


Servo Drives are connected using EtherCAT communications.
Refer to the NJ/NX-series CPU Unit Built-in EtherCAT Port User’s Manual (Cat. No. W505) for informa-
tion on the connection methods.

A
A-2-2 Servo Drive Settings

A-2-1 Wiring the Servo Drive


This section outlines the Servo Drive settings that are used when connected to OMRON G5-series
Servo Drives with built-in EtherCAT communications (i.e., the applicable Servo Drives for the MC Func-
tion Module). For details on the Servo Drives, 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).

Recommended Servo Drives


All of the functions of the MC Function Module can be used for Servo Drives with the unit versions that
are given in the following table.
Manufacturer Compatible models Applicable unit versions
OMRON R88D-KN  -ECT Unit version 2.1 or later
R88D-KN  -ECT-L Unit version 1.1 or later

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 dictio-
nary 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 appli-
cations 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 Servomo-
tor/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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-11


Appendices

Assigning External Input Signals


The MC Function Module uses the general-purpose inputs of the Servo Drive for the following input
signals.
• Immediate stop input
• Positive limit input
• Negative limit input
• Home proximity input
• External latch trigger signals (latch input 1 and latch input 2)

 Assigning Positive Limit Inputs, Negative Limit Inputs, and Home Proximity
Input
The default settings of the input signals of an OMRON G5-series Servo Drive are listed in the follow-
ing table.
Signal name Input signal
Immediate stop input Servo Drive general-purpose input 1 (IN1: pin 5 on connector CN1, NC)
Positive limit input Servo Drive general-purpose input 2 (IN2: pin 7 on connector CN1, NC)*1
Negative limit input Servo Drive general-purpose input 3 (IN3: pin 8 on connector CN1, NC)*2
Home proximity input Servo Drive general-purpose input 4 (IN4: pin 9 on connector CN1, NO)

*1 The signal name for the Servo Drive is the positive drive prohibit input.
*2 The signal name for the Servo Drive is the negative drive prohibit input.

 Trigger Signal Assignments for External Latches


The input signals in the following table are assigned to external latch trigger signals by default for the
OMRON G5-series Servo Drive.
Settings for the TriggerInput (Trigger Input Condition)
input variable of the MC_TouchProbe instruction External latch trigger signal
Mode InputDrive LatchID
0:mcDrive 0:mcEncoderMark --- Encoder Z phase
1:mcEXT 1:mcLatch1 Servo Drive general-purpose input 7 (IN7: pin 12
on connector CN1, NO)*1
2:mcLatch2 Servo Drive general-purpose input 6 (IN6: pin 11
on connector CN1, NO)*2
1:mcController --- --- Variable specified by TriggerVariable

*1 The signal name for the Servo Drive is the external latch input 1.
*2 The signal name for the Servo Drive is the external latch input 2.

A-12 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Backlash Compensation

A-2 Connecting the G5-series Servo Drive


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.
Index Name Description
3704 hex Backlash Compensation This object is used to select whether to enable or disable back-
Selection lash compensation during position control, and to set the com-
pensation direction.
The default value is to disable compensation.
3705 hex Backlash Compensation Set the backlash compensation amount during position control.
Amount
3706 hex Backlash Compensation Set the backlash compensation time constant during position
Time Constant control.

For details on the backlash function, refer to the AC Servomotors/Servo Drives G5-series with Built-in A
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-2-2 Servo Drive Settings

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-13


Appendices

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.

The following PDOs are mapped by default in the Sysmac Studio.


Controlword (6040 hex), Target Position (607A hex), Target Velocity (60FF hex), Target
RxPDO: 261th
Torque (6071 hex), Modes of Operation (6060 hex), Touch Probe Function (60B8 hex),
Receive PDO Map-
Max Profile Velocity (607F hex), Positive Torque Limit Value (60E0 hex), and Negative
ping (1704 hex)
Torque Limit Value (60E1 hex)
Error Code(603F hex), Status Word (6041 hex), Position Actual Value (6064 hex),
TxPDO: 259th Trans-
Torque Actual Value (6077 hex), Modes of Operation Display (6061 hex), Touch Probe
mit PDO Mapping
Status (60B9 hex), Touch Probe Pos1 Pos Value (60BA hex), Touch Probe Pos2 Pos
(1B02 hex)
Value (60BC hex), and Digital Inputs (60FD hex)

Additional Information

• If you use the recommended OMRON Servo Drives (R88D-KN-ECT, 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 ver-
sion 2.1 or later).

A-14 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Relationships between MC Function Module and Process Data

A-2 Connecting the G5-series Servo Drive


The functions of the MC Function Module are related to the information in the process data objects.
Depending on the EtherCAT slave configuration and functions that are used by the MC Function Mod-
ule, you sometimes must change the relationships between the MC Function Module and the PDOs.
To access the settings, click the Detailed Settings Button on the Axis Basic Settings Display in the
Sysmac Studio.

A-2-2 Servo Drive Settings


Additional Information

If you use the recommended OMRON Servo Drives (R88D-KN-ECT, 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
relationships between MC Function Module functions and the PDOs on the Sysmac Studio.

 Output Settings (Controller to Servo Drive)


The input settings apply to the command data that is sent from the MC Function Module to the
Servo Drive. The default settings in the Sysmac Studio are listed in the following table. (Required
objects are marked with a star.)
Function name Process data Description
 Control word 6040 hex-00.0 (Controlword) This data is used to control the status of the Servo
Drive.
Set 6040 hex: Controlword.
 Target position 607A hex-00.0 (Target posi- The target position for position control.
tion) Set 607A hex: Target position.
Target velocity 60FF hex-00.0 (Target veloc- The target velocity for velocity control.
ity) This object is necessary to output to the Servo
Drive in Cyclic Synchronous Velocity Control
Mode by the MC_SyncMoveVelocity (Cyclic Syn-
chronous Velocity Control) and other instructions.
Normally set 60FF hex: Target velocity.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-15


Appendices

Function name Process data Description


Target torque 6071 hex-00.0 (Target torque) The target torque for torque control.
This object is necessary to output to the Servo
Drive in Cyclic Synchronous Torque Control Mode
by the MC_TorqueControl (Torque Control) and
other instructions.
Normally set 6071 hex: Target torque.
Maximum profile 607F hex-00.0 (Max profile The velocity limit value for torque control.
velocity velocity) This object is necessary for velocity control in
Cyclic Synchronous Torque Control Mode by the
MC_TorqueControl (Torque Control) and other
instructions.
Normally set 607F hex: Max profile velocity.
Modes of operation 6060 hex-00.0 (Modes of This data is required to change the control mode.
operation) This object is necessary to change to a control
mode other than Cyclic Synchronous Position
Control Mode for the MC_SyncMoveVelocity
(Cyclic Synchronous Velocity Control),
MC_TorqueControl, and other instructions.
Normally set 6060 hex: Modes of operation.*
Positive torque limit 60E0 hex-00.0 (Positive This is the torque limit value in the positive direc-
value torque limit value) tion.
This object is necessary to control the output
torque of the Servo Drive by the MC_SetTorque-
Limit and other instructions.
Normally set 60E0 hex: Positive torque limit value.
Negative torque limit 60E1 hex-00.0 (Negative This is the torque limit value in the negative direc-
value torque limit value) tion.
This object is necessary to control the output
torque of the Servo Drive by the MC_SetTorque-
Limit and other instructions.
Normally set 60E1 hex: Negative torque limit
value.
Touch probe function 60B8 hex-00.0 (Touch probe This data is used to control the touch probe func-
function) tion.
It is required for the touch probe function for the
MC_Home, MC_HomeWithParameter, MC_Move-
Feed (Interrupt Feeding), MC_TouchProbe
(Enable External Latch), MC_MoveLink (Synchro-
nous Positioning), and other instructions.
Normally set 60B8 hex: Touch probe function.

* If you set 6060 hex (Modes of Operation), also set 6061 hex (Modes of Operation Display). Normal operation is
not possible if only one of these two are set.

Precautions for Correct Use


• Some functions may not be supported if you a connect unit versions 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 1S-series Servo Drive with built-in EtherCAT communications
or G5-series Servo Drive with built-in EtherCAT communications, 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.

A-16 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

 Input Settings (Servo Drive to Controller)

A-2 Connecting the G5-series Servo Drive


This is the status data from the Servo Drive to the MC Function Module. The default settings in the
Sysmac Studio are listed in the following table. (Required objects are marked with a star.)
Function name Process data Description
 Status word 6041 hex-00.0 (Statusword) The status of the Servo Drive.
Set 6041 hex: Statusword.
 Position actual value 6064 hex-00.0 (Position actual Shows the actual position.
value) Set 6064 hex: Position actual value.
Velocity actual value Not set.*1 Shows the actual velocity.
Normally set 606C hex: Velocity actual
value.
Torque actual value 6077 hex (Torque actual value) Shows the actual torque.
This object is necessary to output to the
Servo Drive in Cyclic Synchronous Torque
Control Mode by the MC_TorqueControl A
(Torque Control) and other instructions.
Normally set 6077 hex: Torque actual

A-2-2 Servo Drive Settings


value.
Modes of operation display 6061 hex-00.0 (Modes of oper- Shows the operation mode.
ation display) This object is necessary to change to a
control mode other than Cyclic Synchro-
nous Position Control Mode for the
MC_SyncMoveVelocity (Cyclic Synchro-
nous Velocity Control), MC_TorqueControl,
and other instructions.
Normally set 6061 hex: Modes of operation
display.*2
Touch probe status 60B9 hex-00.0 (Touch probe Shows the status of the touch probe func-
status) tion.
It is required for the touch probe function for
the MC_Home, MC_HomeWithParameter,
MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch),
MC_MoveLink (Synchronous Positioning),
and other instructions.
Normally set 60B9 hex: Touch probe sta-
tus.
Touch probe position 1 posi- 60BA hex-00.0 (Touch probe The latched position for touch probe 1.
tion value pos1 pos value) It is required for the touch probe function for
the MC_Home, MC_HomeWithParameter,
MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch),
MC_MoveLink (Synchronous Positioning),
and other instructions.
Normally set 60BA hex: Touch probe pos1
pos value.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-17


Appendices

Function name Process data Description


Touch probe position 2 posi- 60BC hex-00.0 (Touch probe The latched position for touch probe 2.
tion value pos2 pos value) It is required for the touch probe function for
the MC_Home, MC_HomeWithParameter,
MC_MoveFeed (Interrupt Feeding),
MC_TouchProbe (Enable External Latch),
MC_MoveLink (Synchronous Positioning),
and other instructions.
Normally set 60BC hex: Touchprobe pos2
pos value.
Error code 603F hex-00.0 (Error code) The error code in the Servo Drive.
Normally set 603F hex: Error code.
Reference position for csp Not set. The reference position for changing the csp
mode. This data is accessed by instruc-
tions that are used in Velocity Control Mode
(CSV) or Torque Control Mode (CST).
This object is supported for OMRON G5-
series Cylinder-type Servomotors/Servo
Drives with unit version 2.1 or later. *3
OMRON G5-series Linear Motor Type
Servo Drives do not support this object.

*1 If required, map the selected process data to a PDO before setting it. The standard setting is 606Ch-00.0
(Velocity actual value).
*2 If you set 6061 hex (Modes of Operation Display), also set 6060 hex (Modes of Operation). Normal operation is
not possible if only one of these two are set.
*3 Map 4020 hex (Reference Position for CSP) to a PDO when you use an OMRON 1S-series Servomotor/Servo
Drive.

Precautions for Correct Use


• Some functions may not be supported if you a connect unit versions 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 1S-series Servo Drive with built-in EtherCAT communications
or G5-series Servo Drive with built-in EtherCAT communications, 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 when you use Reference Position for CSP for an OMRON G5-
series Servo Drive. Also, set the electronic gear ratio to 1:1.
For details, refer to the AC Servomotors/Servo Drives G5-series with Built-in EtherCAT Com-
munications 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-18 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

 Digital Input Settings

A-2 Connecting the G5-series Servo Drive


The MC Function Module uses the following input signals of the Servo Drive.
Function name Process data Description
Positive limit switch 60FD hex-00.1 (Digital This signal is used for the positive limit input.
(positive drive prohibit inputs) Normally set Bit 1: Positive limit switch of 60FD
input) hex-00: Digital inputs.
Negative limit switch 60FD hex-00.0 (Digital This signal is used for the negative limit input.
(negative drive prohibit inputs) Normally set Bit 0: Negative limit switch of 60FD
input) hex-00: Digital inputs.
Immediate stop input 60FD hex-00.25 (Digital This signal is used for the immediate stop input.
inputs) Set Bit 25: Immediate Stop Input of 60FD hex-00:
Digital inputs for an OMRON G5-series Servo
Drive.
Encoder Phase Z 60FD hex-00.16 (Digital Shows the status of detecting the Z-phase input.
Detection (encoder Z- inputs) For OMRON G5-series Cylinder-type Servomo- A
phase detection) tors/Servo Drives with unit version 2.1 or later, set
bit 16 (Encoder Phase Z Detection) of 60FD hex-00

A-2-2 Servo Drive Settings


(Digital Inputs).
G5-series Linear Motor Type Servo Drives do not
support this object.
Home switch (home 60FD hex-00.2 (Digital This signal is used for the home proximity input.
proximity input) inputs) Normally set Bit 2: Home switch of 60FD hex-00:
Digital inputs.
External Latch Input 1 60FD hex-00.17 (Digital Shows the status of the signal that is used for
inputs) external latch input 1.
Set Bit 17: External Latch Input 1 of 60FD hex-00:
Digital inputs for an OMRON G5-series Servo
Drive.
External Latch Input 2 60FD hex-00.18 (Digital Shows the status of the signal that is used for
inputs) external latch input 2.
Set Bit 18: External Latch Input 2 of 60FD hex-00:
Digital inputs for an OMRON G5-series Servo
Drive.

Precautions for Correct Use


• Some functions may not be supported if you a connect unit versions of the G5-series Servo
Drives with built-in EtherCAT communications other than the recommended unit versions.
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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-19


Appendices

Version Information

• If you are using a CPU Unit with unit version 1.09 or earlier and you are not using an OMRON
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.
• If you are using a CPU Unit with unit version 1.10 or later, operation is as described in the fol-
lowing table depending on whether Modes of Operation (6060 hex) and Modes of Operation
Display (6061 hex) are mapped.
Modes of Operation Display Modes of Operation Display
(6061 hex) mapped (6061 hex) not mapped
• You can execute instructions • You can execute instructions
that use CSP,*1 CSV,*2 or that use CSP. If you execute
any instruction that uses any
CST.*3
other control mode, a Process
• The servo is OFF in any control Data Object Setting Missing
mode other than CSP, CSV, or error (error code 3461 hex)
Modes of Operation
CST. occurs.
(6060 hex) mapped
• The MC Function Module
assumes that the CSP Servo
Drive control mode is used.
Command the Servo Drive to
use CSP.
• You can execute instructions • You can execute instructions
that use CSP. If you execute that use CSP. If you execute
any instruction that uses any any instruction that uses any
other control mode, a Process other control mode, a Process
Modes of Operation Data Object Setting Missing Data Object Setting Missing
(6060 hex) not mapped error (error code 3461 hex) error (error code 3461 hex)
occurs. occurs.
• The servo is OFF in any control
mode other than CSP.
*1 CSP is the Cyclic Synchronous Position Control Mode of the Servo Drive.
*2 CSV is the Cyclic Synchronous Velocity Control Mode of the Servo Drive.
*3 CST is the Cyclic Synchronous Torque Control Mode of the Servo Drive.

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.
Recom-
Index Subindex Name mended Description
setting
3013 hex 00 hex No. 1 External 1388 hex Default setting = 500.0%
Torque Limit*1
3015 hex*2 00 hex Operation Switch 0002 hex Use absolute values and ignore multi-rotation
for Using Absolute counter overflow.
Encoder
3317 hex 00 hex Speed Limit Selec- 0001 hex The velocity limit method used during torque
tion control is either 607F: Max profile velocity or
3321h: Velocity limit value setting, whichever
value is smaller.
3323 hex 00 hex External Feedback 0000, 0001, Set the type of external scale to use. The
Pulse Type Selec- or 0002 default value is 0000 hex (90° Phase Difference
tion hex*3 Output).

A-20 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Recom-

A-2 Connecting the G5-series Servo Drive


Index Subindex Name mended Description
setting
3324 hex*2 00 hex External Feedback 00000000 Set the encoder resolution per motor rotation
Pulse Dividing hex [pulses]. Set to 0 for automatic setting.
Numerator
3401 hex 00 hex Input Signal Selec- 00818181 Positive Drive Prohibit Input (NC)
tion 2 hex
3402 hex 00 hex Input Signal Selec- 00828282 Negative Drive Prohibit Input (NC)
tion 3 hex
3403 hex 00 hex Input Signal Selec- 00222222 Home proximity input (NO)
tion 4 hex
3404 hex 00 hex Input Signal Selec- 002B2B2B External Latch Signal 3 (NO)
tion 5 hex
3405 hex 00 hex Input Signal Selec- 00212121 External Latch Signal 2 (NO)
tion 6 hex A
3406 hex 00 hex Input Signal Selec- 00202020 External Latch Signal 1 (NO)
tion 7 hex

A-2-2 Servo Drive Settings


3504 hex 00 hex Drive Prohibit Input 0001 hex The drive prohibit input is disabled at the Servo.
Selection This is performed by the MC Function Module
instead.
3508 hex 00 hex Undervoltage Error 0001 hex Operation is stopped for an insufficient main
Selection power voltage.
3521 hex 00 hex Torque Limit Selec- 0006 hex There are two limit values, one for positive and
tion*1 one for negative. Switch between them by using
PCL and NCL.
3522 hex 00 hex No. 2 External 1388 hex Default setting = 500.0%
Torque Limit*1
3703 hex 00 hex Torque Limit Output 0001h hex Output turns ON for the torque limit value
Setting*1 excluding the torque command value.
3801 hex 00 hex Software Limit 0003 hex Disable the software limits in both directions.
Function
3758 hex 00 hex Latch Trigger 0100 hex Touch probe1 = External latch signal 1
Selection Touch probe2 = External latch signal 2
3759 hex 00 hex Warning Hold 0000 hex The warnings are automatically cleared when
Selection the cause of the warning is eliminated.
607C hex 00 hex Encoder Home Off- 00000000 An offset value of 0 is used by the Servo Drive.
set hex
6091 hex 01 hex Electronic Gear 00000001 The gear ratio on the Servo Drive is 1:1. A simi-
Ratio Numerator hex lar function is set in the MC Function Module.
02 hex Electronic Gear 00000001
Ratio Denominator hex

*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 Servomo-
tor/Servo Drive with built-in EtherCAT communications.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-21


Appendices

A-3 Connecting to Encoder Input


Terminals
This appendix describes connections to an OMRON GX-series EtherCAT Slave Encoder Input Termi-
nals.

A-3-1 Wiring to Encoder Input Terminals


Encoder Input Terminals are connected using EtherCAT communications. Refer to the NJ/NX-series
CPU Unit Built-in EtherCAT Port User’s Manual (Cat. No. W505) for information on the connection
methods.

A-3-2 Settings for Encoder Input Terminals


This section outlines the Encoder Input Terminal settings that are used when connected to OMRON
GX-series GX-EC0211/EC0241 Encoder Input Terminals (i.e., the applicable Encoder Input Terminals
for the MC Function Module). Refer to the GX-series EtherCAT Slave Units User’s Manual (Cat. No.
W488) for detailed information on the Encoder Input Terminals.

Recommended Encoder Input Terminals


All of the functions of an encoder axis of the MC Function Module can be used for Encoder Input Termi-
nals with the unit versions that are given in the following table.

Manufacturer Compatible models Applicable unit versions


OMRON GX-EC0211 Unit version 1.1 or later
OMRON GX-EC0241 Unit version 1.1 or later

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 GX-
series EtherCAT Slave Units User’s Manual (Cat. No. W488) for detailed information on func-
tions.
Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details on
Sysmac devices.

External Input Signals


When all of the functions of an encoder axis are used for an Encoder Input Terminal, the following input
signals are used at the Encoder Input Terminal.
• Counter A phase
• Counter B phase
• Counter Z phase
• Latch Inputs (A/B)

A-22 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

There are two counter channels, and there are two external latches for each channel. Wire the input

A-3 Connecting to Encoder Input Terminals


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.

A-3-2 Settings for Encoder Input Terminals


The following PDOs are mapped by default in the Sysmac Studio.

Channel 1 Instruction Bits (4020 hex-01 hex) and Channel 2 Instruction Bits
RxPDO (1700 hex)
(4020 hex-02 hex)
Channel 1 Preset Value (4011 hex-01 hex) and Channel 2 Preset Value (4011
RxPDO (1701 hex)
hex-02 hex)
Channel 1 Position Value (4010 hex-01 hex) and Channel 2 Position Value
TxPDO (1B00 hex)
(4010 hex-02 hex)
Channel 1 Latch Value A (4012 hex-01 hex) and Channel 2 Latch Value A (4012
TxPDO (1B01 hex)
hex-02 hex)
Channel 1 Latch Value B (4013 hex-01 hex) and Channel 2 Latch Value B (4013
TxPDO (1B02 hex)
hex-02 hex)
Channel 1 Status Bits (4030 hex-01 hex) and Channel 2 Status Bits (4030 hex-
TxPDO (1B03 hex)
02 hex)
TxPDO (1BFF hex) Sysmac Error Status (2002 hex -01 hex)

Additional Information

If you use the recommended Encoder Input Terminals (GX-EC0211/EC0241, version 1.1 or
later), then it is not necessary to change the default PDO map on the Sysmac Studio.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-23


Appendices

Relationships between MC Function Module and Process Data


The functions of the MC Function Module are related to the information in the process data objects.
Depending on the EtherCAT slave configuration and functions that are used by the MC Function Mod-
ule, you sometimes must change the relationships between the MC Function Module and the PDOs.
To access the settings, click the Detailed Settings Button on the Axis Basic Settings Display in the
Sysmac Studio.

Additional Information

If you use the recommended Encoder Input Terminals (GX-EC0211/EC0241, version 1.1 or
later), then it is not necessary to change the default relationships between the functions and pro-
cess data on the Sysmac Studio.

 Output Settings (Controller to Servo Drive)


The input settings apply to the command data that is sent from the MC Function Module to the
Encoder Input Terminal. The default settings in the Sysmac Studio are listed in the following table.
(Required objects are marked with a star.)

Process data
Function name Description
Channel 1 Channel 2
 Software Switch of 4020 hex-01.0 4020 hex-02.0 Set the instruction bits. Set the
Encoder’s Input Slave (Instruction Bits) (Instruction Bits) objects given at the left for each
channel.

Precautions for Correct Use


• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.

A-24 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

 Input Settings (Servo Drive to Controller)

A-3 Connecting to Encoder Input Terminals


This is the status data from the Encoder Input Terminal to the MC Function Module. The default set-
tings in the Sysmac Studio are listed in the following table. (Required objects are marked with a
star.)

Process data
Function name Description
Channel 1 Channel 2
 Position actual 4010 hex-01.0 4010 hex-02.0 Store the current values from the counters.
value (Position Value) (Position Value) Set the objects given at the left for each
channel.
Touch probe posi- 4012 hex-01.0 4012 hex-02.0 This is the latched position for latch 1.
tion 1 position value (Latch Value A) (Latch Value A) Store the values of latch positions A. You
must map these objects to use the touch
probe function, i.e., to use the MC_Touch-
Probe (Enable External Latch) instruction.
Set the objects given at the left for each
channel. A
Touch probe posi- 4013 hex-01.0 4013 hex-02.0 This is the latched position for latch 2.
tion 2 position value (Latch Value B) (Latch Value B) Store the values of latch positions B. You

A-3-2 Settings for Encoder Input Terminals


must map these objects to use the touch
probe function, i.e., to use the MC_Touch-
Probe (Enable External 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. You must map these
Input Slave (Status Bits) (Status Bits) objects to use the touch probe function,
i.e., to use the MC_TouchProbe (Enable
External Latch) instruction. Set the objects
given at the left for each channel.

Precautions for Correct Use


• If you change the settings, make sure that the desired operations are performed for the MC
Function Module and process data settings.

 Digital Input Settings


Settings are not required to use an encoder axis.

Object Settings in the Encoder Input Terminals


There are no objects that you must set at the Encoder Input Terminal.

Relationship between the MC Function Module and the Ring


Counter of an Encoder Input Terminal
The Modulo Minimum Position Setting Value and Modulo Maximum Position Setting Value in the Servo
Drive Settings in the axis parameters of the MC Function Module must agree with the maximum value
setting of the ring counter in the Encoder Input Terminal.

The Modulo Minimum Position Setting Value and Modulo Maximum Position Setting Value are set on
the Servo Drive Settings View on the Sysmac Studio.
The settings are as follows:

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-25


Appendices

Parameter Meaning Set value


Modulo Maximum Posi- Set the modulo maximum position that is set This setting must agree with the maxi-
tion Setting Value on the Servo Drive or the Encoder Input Ter- mum value that is set for the ring
minal. counter in the Encoder Input Terminal.
Modulo Minimum Posi- Set the modulo minimum position that is set Set this parameter to 0.
tion Setting Value on the Servo Drive or the Encoder Input Ter-
minal.

A-26 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

The maximum value of the ring counter for the Encoder Input Terminal is set on the EtherCAT Tab Page

A-3 Connecting to Encoder Input Terminals


in the Sysmac Studio.
The setting is as follows:

Index Object name Set value


0x4003 Max Count Setting (maxi- Set this parameter to the same value as the Modulo Maximum
mum value of the ring Position Setting Value in the Servo Drive Settings of the axis
counter) parameters of the MC Function Module.

A-3-2 Settings for Encoder Input Terminals

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-27


Appendices

A-4 Connecting to NX Units


Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on con-
necting to the NX-series Position Interface Units.

A-28 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

A-5 PDS State Transition


The PDS state transition is defined in CiA402 drive profile. Use the Controlword (6040 hex) process
data to command PDS state transitions. To check actual PDS states, use the Statusword (6041 hex)
process data.

A-5 PDS State Transition


The following diagram shows the state transition defined in CiA402 drive profile.
Each box indicates a state, while numbers indicate the state control commands.

Power turned OFF or Reset


Start

0: After the control power is turned ON


A
Not ready to switch on

1: After initialization is completed

Switch on 15: Fault reset


Fault
disabled

Shutdown: 2 7: Disable Voltage

Ready to
12 switch on

Switch on: 3
6: Shutdown
14: Error response
operation is completed
Switched on
Disable Voltage: 10

Enable operation: 4 Fault reaction


active
5: Disable
operation

Quick stop 16 Operation 8: Shut down 13: Error occurs


active enabled
11 9: Disable Voltage

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-29


Appendices

A-5-1 PDS State Control Method


This section describes the relationship between the setting values of the PDS State Control Method
axis parameter and the PDS states.

 When PDS State Control Method Is Set to 0


The following operation is performed when PDS State Control Method is set to 0: Switched on by
Servo OFF.

• 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 cor-
responds 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 (Opera-
tion enabled) state, the PDS state changes to Servo Ready (Switched on). This operation corre-
sponds to 5: Disable operation in the state transition diagram.

 When PDS State Control Method Is Set to 1


The following operation is performed when PDS State Control Method is set to 1: Ready to
switched on by Servo OFF.

• After communications with the Servo Drive is established, MC Function Module automatically
changes the PDS state to Main Power OFF (Ready to switch on).
• If Enable of the MC_Power (Power Servo) instruction changes to TRUE in the Main Power OFF
(Ready to switch on) state, the PDS state changes to Servo ON (Operation enabled). This opera-
tion corresponds to 3: Switch on and 4: Enable operation in the state transition diagram. The steps
3 and 4 are performed simultaneously.
• If Enable of the MC_Power (Power Servo) instruction changes to FALSE in the Servo ON (Opera-
tion enabled) state, the PDS state changes to Main Power OFF (Ready to switch on). This opera-
tion corresponds to 5: Disable operation and 6: Shutdown in the state transition diagram. The
steps 5 and 6 are performed simultaneously.

Version Information
• For a CPU Unit with unit version 1.09 or earlier, PDS State Control Method is set to 0. For a
CPU Unit with unit version 1.10 or later, PDS State Control Method is selectable.
• For a CPU Unit with unit version 1.10 or later, PDS State Control Method is set to 0 by
default.

A-30 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

A-5-2 Main Circuit Power Supply OFF Detection


You can select whether to detect the OFF state of the main circuit power supply while the Servo is ON.
Select the Do not detect option if a Servo Main Circuit Power OFF error occurs even after the
MC_Power (Power Servo) instruction is executed.

A-5 PDS State Transition


Precautions for Correct Use
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.

A
Version Information

A-5-2 Main Circuit Power Supply OFF Detection


• For a CPU Unit with unit version 1.09 or earlier, Main circuit power supply OFF detection is
set to Detect. For a CPU Unit with unit version 1.10 or later, Main circuit power supply OFF
detection is selectable.
• For a CPU Unit with unit version 1.10 or later, Main circuit power supply OFF detection is
set to Detect by default.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-31


Appendices

A-6 Terminology
This appendix provides definitions of terms related to motion control.

A-6-1 NJ/NX-series Controller

Term Description
main memory The memory inside the CPU Unit that is used by the CPU Unit to execute the OS
and user program.
periodic task Tasks for which user program execution and I/O refreshing are performed each
period.
primary periodic task The task with the highest priority.
task period The interval at which the primary periodic task or a periodic task is executed.
I/O refreshing Cyclic data exchange with external devices that is performed with predetermined
memory addresses.
program One of three POUs. The others are functions and function blocks. Programs are
assigned to tasks to execute them.
user program All of the programs in one project.
Inline ST ST programming that is included within a ladder diagram program.
system-defined variable A variable for which all attributes are defined by the system and cannot be
changed by the user.
global variable Reading and writing global variables are possible from all POUs (programs,
functions, and function blocks).
local variable A variable that can be accessed only from the POU in which it is defined. Local
variables include internal variables, input variables, output variables, in-out vari-
ables, and external variables.
download To transfer data from the Sysmac Studio to the Controller with the synchroniza-
tion operation of the Sysmac Studio.
upload To transfer data from the Controller to the Sysmac Studio with the synchroniza-
tion operation of the Sysmac Studio.
major fault level Control error An error for which all control operations from the NJ/NX-series Controller are not
possible. The CPU Unit stops user program execution immediately and turns
OFF the loads for all slaves and Units (including remote I/O).
partial fault level Controller error An error for which all control operations for one of the function modules in the
NJ/NX-series Controller are stopped.
The NJ/NX-series CPU Unit continues operation even after a partial fault level
Controller error occurs.
minor fault level Controller error An error for which some of the control operations for one of the function modules
in the NJ/NX-series Controller are stopped.
The NJ/NX-series CPU Unit continues operation even after a minor fault level
Controller error occurs.
observation One of the event levels for Controller information and user-defined information.
Observations represent minor errors that do not affect control operations. They
are recorded in an event log to inform the user.

A-32 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

A-6-2 Motion Control


Term Description
used real axis Axis of which axis type is set to Servo Axis or Encoder Axis and axis use is set to
Used Axis.
used virtual axis Axis of which axis type is set to Virtual Servo Axis or Virtual Encoder Axis and axis
use is set to Used Axis.

A-6 Terminology
Motion Control Function Module A software component that executes motion control. It performs motion control
based on commands from the motion control instructions that are executed in the
user program. (Abbreviation: MC Function Module)
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 specifically for the MC
Function Module.
motion control axes Axes for which all motion control functions can be used. A
single-axis position control axes Axes for which only single-axis position control can be used.
single-axis position control Controlling the position of one axis.

A-6-2 Motion Control


single-axis velocity control Controlling the velocity of one axis.
For single-axis velocity control, the MC Function Module sometimes outputs velocity
commands to the Servo Drive and sometimes outputs position commands to the
Servo Drive.
single-axis torque control Controlling the torque of one axis.
single-axis synchronized control Synchronizing the control of one slave axis with one master axis.
There are two types of single-axis synchronized control: gear operation, in which the
axes are synchronized with a gear ratio, and cam operation, in which the axes are
synchronized according to the relationship between phases and displacements in a
cam table.
single-axis manual operation Controlling an axis with manual operation, such as jogging.
auxiliary functions for single-axis Functions that aid in controlling an axis, such as override factor settings and reset-
control ting errors.
multi-axes coordinated control Controlling the motion of more than one axis, such as linear interpolation and circular
interpolation.
You specify an axes group to specify the axes to coordinate.
auxiliary functions for multi-axes Functions that aid in controlling an axes group, such as override factor settings and
coordinated control resetting errors.
motion control parameters Parameters that define the operation of the MC Function Module.
The motion control parameters include the MC common parameters, axis parame-
ters, and axes group parameters.
axis parameters Parameters that apply to a single axis.
axes group parameters Parameters that apply to an axes group.
system-defined variables for motion System-defined variables that provide status information for the MC Function Mod-
control ule.
The system-defined variables for motion control include the MC Common Variable,
Axis Variables, and Axes Group Variables.
MC common variable A system-defined variable that is defined as a structure and provides status informa-
tion for the overall operation of the MC Function Module.
axis variables System-defined variables that are defined as structures and provide status informa-
tion and some of the axis parameters for individual axes.
axes group variables System-defined variables that are defined as structures and provide status informa-
tion and some of the axes group parameters for individual axes groups.
homing The process of defining home.
Homing is also called home positioning, home searching, calibration, and datum.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-33


Appendices

Term Description
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 position.
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 remaining
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 oper-
ation.
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.

A-34 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

A-6-3 EtherCAT Communications


Term Description
CAN application protocol over Ether- A CAN application protocol service implemented on EtherCAT.
CAT(CoE)
CAN in Automation(CiA) CiA is the international users’ and manufacturers’ group that develops and supports
higher-layer protocols.

A-6 Terminology
EtherCAT Technology Group The ETG is a global organization in which OEM, End Users and Technology Provid-
ers join forces to support and promote the further technology development.
Object An abstract representation of a particular component within a device, which consists
of data, parameters, and methods.
Object Dictionary A data structure addressed by Index and Subindex that contains description of data
type objects, communications objects and application objects.
Process Data Collection of application objects designated to be transferred cyclically or acyclically
for the purpose of measurement and control. A
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 dictionary

A-6-3 EtherCAT Communications


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 consistency
between similar devices of the same device type.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-35


Appendices

A-7 Version Information


This section describes the functions that are supported for each unit version. Refer to the NJ/NX-series
CPU Unit Software User’s Manual (Cat. No. W501) for the relationship between the unit versions of
CPU Units and the Sysmac Studio versions. Refer to the NJ/NX-series Motion Control Instructions Ref-
erence 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 Outline
Changing the axes in an axes group You can use the MC_ChangeAxesInGroup (Change Axes in Group)
instruction to temporarily change the Composition Axes axes group
parameter for an axes group.
Reading axes group positions You can use the MC_GroupReadPosition (Read Axes Group Position)
instruction to read the command current positions and the actual cur-
rent positions of an axes group.
Axes group cyclic synchronous abso- You can use the MC_GroupSyncMoveAboslute (Axes Group Cyclic
lute positioning Synchronous Absolute Positioning) instruction to cyclically output the
specified target positions for the axes.
Controllable Servo Drives Support was added for OMRON G5-series Linear Motor Type Servo-
motors/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 instructions
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 positioning The MC_SyncMoveAbsolute (Cyclic Synchronous Absolute Posi-
tioning) instruction can be used to output a command position each
control period in Position Control Mode.
Homing with parameters The MC_HomeWithParameter (Home with Parameters) instruction
can be used to specify the homing parameters and operate the
motor to determine home. It uses the limit signals, home proximity
signal, and home signal.

A-36 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Motion Control Functions That Were Added for Unit Version 1.04
Version 1.05 or higher of the Sysmac Studio is required to use the functions that were added for unit
version 1.04 of the CPU Unit.

Function Overview

A-7 Version Information


Changing axis use You can use the MC_ChangeAxisUse (Change Axis Use) instruc-
tion to temporarily change the setting of the Axis Use axis parame-
ter.

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 A
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 input 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.

Motion Control Specifications That Were Added or Changed for Unit


Version 1.06
Version 1.07 or higher of the Sysmac Studio is required to use the performance specifications and func-
tion specifications that were added or changed for unit version 1.06 of the CPU Unit.

Item Overview
Maximum number of controlled axes The maximum number of controlled axes for NJ301- was
increased to 15 axes.
(No change in maximum number of used real axes.)
Maximum number of axes for single-axis The maximum number of axes for single-axis control for NJ301-
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) instruction to turn the digital outputs ON or OFF according
to the axis position.
Time stamp to axis position calculation You can use the MC_TimeStampToPos (Time Stamp to Axis Posi-
tion Calculation) instruction to calculate the position of the axis for
the specified time stamp.
Adding blending options to Start Cam The blending options were added to Buffer Mode Selection for the
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.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-37


Appendices

Motion Control Functions That Were Added or Changed for Unit


Version 1.08
Use Sysmac Studio version 1.09 or higher when you use the functions that were added or changed for
the CPU Unit with unit version 1.08.

Function Overview
Generating cam tables You can use the MC_GenerateCamTable (Generate Cam Table) instruction 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_WriteAxisParameter
(Write Axis Parameters) instruction and the MC_ReadAxisParameter (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 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.

Motion Control Functions That Were Added or Changed for Unit


Version 1.09
Version 1.10 or higher of the Sysmac Studio is required to use the functions that were added for unit
version 1.09 of the CPU Unit.
No motion control functions were added for unit version 1.09, but the specifications of some instructions
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 or Changed for Unit


Version 1.10
Version 1.12 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
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 operation is continued even if you set the Accelera-
tion/Deceleration Over parameter to Use rapid acceleration/decel-
eration. (Blending is changed to Buffered.) or Minor fault stop.
Home definition timing for absolute encod- In addition to the existing home definition timing, home is also
ers defined when EtherCAT slave process data communications
change from a non-established to an established state.
Current position when process data com- The actual current position and the command current position axis
munications are in a non-established state variables will contain the actual current position output that is just
before process data communications change to a non-established
state.
With or without Modes of Operation (6060 The operation depends on whether Modes of Operation (6060 hex)
hex) and Modes of Operation Display (6061 and Modes of Operation Display (6061 hex) are mapped.
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.

A-38 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Appendices

Function Overview
Main circuit power supply OFF detection You can select whether to detect the OFF state of the main circuit
power supply while the Servo is ON or when the Servo ON com-
mand is sent.

Version 1.13 or higher of the Sysmac Studio is required to use the following functions that were added

A-7 Version Information


for unit version 1.10 of the CPU Unit.

Function Overview
Synchronized control in multi-motion You can execute the synchronized control instructions between
axes assigned to different tasks in the multi-motion.

Motion Control Functions That Were Added or Changed for Unit


Version 1.11
Version 1.15 or higher of the Sysmac Studio is required to use the following functions that were added
A
for unit version 1.11 of the CPU Unit.

Function Overview
Adding the parameters for the unit conver- The following parameters were added: Reducer Use, Work Travel
sion 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.

Motion Control Functions That Were Added or Changed for Unit


Version 1.13
Version 1.17 or higher of the Sysmac Studio is required to use the following functions that were added
for unit version 1.13 of the CPU Unit.

Function Overview
Control Function Select the function of axis to control.
Commands to I/O devices during the down- The MC Function Module operation differs depending on the set-
load process ting that specifies to stop or continue sending commands to the I/O
devices when the download process starts.

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) A-39


Appendices

A-40 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Index

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) Index-1


Index

Index
A axes groups ................................................................. 3-20
enabling and disabling ........................................... 9-54
aborting .............................................................. 9-48, 9-65 introduction ............................................................ 3-20
absolute encoder specifying in user program ............................3-20, 3-24
Absolute Encoder Origin Position Offset ............... 8-15 Axis Basic Settings ...............................................5-7, 6-28
applicable Servomotors ......................................... 8-16 Axis Command Values ................................................ 6-27
homing ................................................................... 8-14 Axis Current Value ....................................................... 6-27
Rotary Mode .......................................................... 8-17 Axis Disabled ............................................................... 6-25
setup ...................................................................... 8-16 Axis Error ..................................................................... 11-7
absolute positioning ....................................................... 9-4 Axis Error Status ......................................................... 11-5
acceleration and deceleration ..................................... 9-35 axis following error monitoring ..................................... 9-78
acceleration and deceleration rates Axis Minor Fault ........................................................... 6-28
unit ......................................................................... 9-35 Axis Minor Fault Code ................................................. 6-28
acceleration rate Axis Minor Fault Occurrence ....................................... 6-28
changing ................................................................ 9-44 Axis Number ..................................................5-7, 5-8, 6-28
Acceleration Warning Value ........................................ 5-20 Axis Numbers ................................................................ 5-8
Acceleration/Deceleration Over ................................... 5-20 Axis Observation ......................................................... 6-28
Actual Current Position ................................................ 6-27 Axis Observation Code ................................................ 6-28
Actual Current Torque ................................................. 6-27 Axis Observation Occurrence ...................................... 6-28
Actual Current Velocity ................................................ 6-27 axis parameters ......................................................3-3, 5-5
actual position ....................................................6-17, 9-32 introduction .............................................................. 3-3
actual velocity .............................................................. 9-34 list ............................................................................ 5-5
Actual Velocity Filter Time Constant ............................ 5-21 Axis Ready-to-execute ................................................ 6-25
assumed causes ....................................................... 11-12 axis states ..................................................................... 6-6
axes ............................................................................... 3-2 Axis Disabled ........................................................... 6-6
specifying in user program ....................................... 3-3 Continuous Motion ................................................... 6-7
Axes Group Basic Settings ................................. 5-33, 6-33 Coordinated Motion ................................................. 6-7
Axes Group Command Values .................................... 6-33 Deceleration Stopping ............................................. 6-7
Axes Group Control Status .......................................... 6-32 Discrete Motion ........................................................ 6-7
Axes Group Disabled ................................................... 6-32 Error Deceleration Stopping .............................6-6, 6-7
Axes Group Error Status ............................................. 11-5 Homing .................................................................... 6-7
Axes Group Errors ....................................................... 11-7 Stopped ................................................................... 6-7
axes group errors Synchronized Motion ............................................... 6-7
resetting ................................................................. 9-55 Axis Status .................................................................. 6-25
Axes Group Minor Fault ............................................... 6-33 axis types ...............................................................5-7, 5-9
Axes Group Minor Fault Code ..................................... 6-33 Axis Use ...............................................................5-7, 6-28
Axes Group Minor Fault Occurrence ........................... 6-33 Axis Variables .......................................................3-3, 6-25
Axes Group Number .................................................... 6-33 names ...................................................................... 3-7
Axes Group Observation ............................................. 6-33 relationship to axis types ....................................... 6-30
Axes Group Observation Code ................................... 6-33
Axes Group Observation Occurrence ......................... 6-33 B
Axes Group Operation Settings ................................... 5-35
axes group parameters ....................................... 3-21, 5-32 basic data types .......................................................... 6-21
list .......................................................................... 5-32 blending ..............................................................9-49, 9-66
axes group states .......................................................... 6-8 Buffer Mode ................................................................. 9-47
Deceleration Stopping ............................................. 6-9 buffered ..............................................................9-48, 9-66
Error Deceleration Stopping ............................. 6-8, 6-9
Moving ..................................................................... 6-9 C
Standby .................................................................... 6-9
Axes Group Status ...................................................... 6-32 cam block .................................................................... 9-16
Axes Group Stop Method ............................................ 5-36 cam block end point ..................................................... 9-16
Axes Group Use .................................................5-33, 6-33 cam block start point ................................................... 9-16
Axes Group Variable Names ....................................... 3-22 cam curve .................................................................... 9-16
Axes Group Variables .........................................3-20, 6-32 cam data ...................................................................... 9-16
introduction ............................................................ 3-22 loading and saving ................................................. 9-20

Index-2 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Index

cam data index ............................................................ 9-16 deceleration rate


cam data variables ............................................. 6-35, 9-16 changing ................................................................ 9-44
cam end point ............................................................. 9-16 deceleration stop of command value .......................... 9-10
cam operation .................................................... 9-15, 9-16 Deceleration Stopping ........................................ 6-25, 6-32
cam profile curves .............................................. 6-35, 9-16 Deceleration Warning Value ........................................ 5-20
names ................................................................... 6-38 defined home
cam start point ............................................................ 9-16 loosing ..................................................................... 8-2
Cam table derivative data types ................................................... 6-22
Generate Cam Table ............................................. 9-22 Discrete Motion ........................................................... 6-25
cam table .................................................................... 9-16 displacement ............................................................... 9-16
Cam Table File Save Busy .......................................... 6-24 Displaying 3D Motion Monitor
cam table start position ............................................... 9-17 for User Coordinate System ..................................... 9-82
cam tables .......................................................... 6-35, 9-18 Drive Error Input .......................................................... 6-26
data type ............................................................... 9-19 Drive Error Reset Monitoring Time ............................. 5-24
names ................................................................... 6-38 Drive Internal Limiting ................................................. 6-26
saving .................................................................... 9-20 Drive Warning Input .................................................... 6-26
specifications ......................................................... 9-19
specifying in user program .................................... 6-38 E
switching ................................................................ 9-20
updating properties ............................................... 9-21 electronic gear ratio (unit conversion formula) ............ 5-15
CAN application protocol over EtherCAT (CoE) .......... 2-19 Enabling Digital Cam Switch ....................................... 9-81 I
circular interpolation .................................................... 9-57 encoder axis ........................................................... 3-2, 5-9
combining axes ........................................................... 9-25 Encoder Type ..................................................... 5-25, 5-27
Command Current Acceleration/Deceleration ............ 6-27 enumerated data types ............................................... 6-22
Command Current Jerk ............................................... 6-27 error confirmation ........................................................ 11-3
Command Current Position ......................................... 6-27 Error Deceleration Stopping ............................... 6-25, 6-32
Command Current Torque .......................................... 6-27 error status variables ................................................... 11-5
Command Current Velocity ......................................... 6-27 EtherCAT ....................................................................... 1-2
Command Direction .................................................... 6-26 EtherCAT communications and motion control ........... 2-19
Command Interpolation Acceleration/ Deceleration .... 6-33 EtherCAT Master Function Module ............................... 2-2
Command Interpolation Velocity ................................. 6-33 event codes ............................................................... 11-12
command position .............................................. 6-17, 9-32 event levels ................................................................. 11-7
Command Pulse Count Per Motor Rotation ....... 5-13, 6-28 event names .............................................................. 11-12
command velocity ....................................................... 9-34 events ............................................................... 11-2, 11-12
Command Velocity Saturation ..................................... 6-26 Execution ID ....................................................... 6-28, 6-33
Composition ....................................................... 5-33, 6-34 External Latch Input 1 ................................................. 6-26
Composition Axes ....................................................... 5-33 External Latch Input 2 ................................................. 6-26
Composition Axis for Axis A0 ...................................... 6-34
Composition Axis for Axis A1 ...................................... 6-34 F
Composition Axis for Axis A2 ...................................... 6-34
Composition Axis for Axis A3 ...................................... 6-34 finite length axis .......................................................... 5-25
connecting acceleration .............................................. 9-17 following error counter reset ........................................ 9-78
connecting velocity ...................................................... 9-17 following error monitoring ............................................ 9-77
Continuous Motion ...................................................... 6-25 Following Error Over Value ......................................... 5-25
Coordinated Motion ..................................................... 6-25 Following Error Warning Value .................................... 5-25
Correction Allowance Ratio ......................................... 5-36 function blocks for PLCopen® motion control ............... 6-4
Count Mode ................................................................ 5-25 function specifications ................................................. 1-10
Count mode ................................................................ 6-28
current position G
changing ................................................................ 9-73
Cyclic Synchronous Position (CSP) Control Mode ..... 6-26
gear operation ............................................................. 9-13
cyclic synchronous positioning ...................................... 9-6
Generating Cam Table ................................................ 6-24
Cyclic Synchronous Torque (CST) Control Mode ....... 6-26
Get Motion Control Error Status instruction ................ 11-5
Cyclic Synchronous Velocity (CSV) Control Mode ...... 6-26
GetMCError (Get Motion Control Error Status) ........... 11-5
cyclic synchronous velocity control ............................. 9-30
H
D
high-speed homing ..................................................... 8-18
data types ................................................................... 6-21 home ............................................................................. 8-2

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) Index-3


Index

Home Defined ............................................................. 6-26 Limit Settings ............................................................... 5-25


Home Input .................................................................. 6-26 linear interpolation ....................................................... 9-56
Home Input Detection Direction ...........................5-28, 8-8 Linear Mode ................................................................ 5-26
Home Input Mask Distance ................................5-29, 8-10
Home Input Signal ................................................5-28, 8-7 M
Home Offset .......................................................5-29, 8-10
Home Proximity Input .................................................. 6-26 Main Power .................................................................. 6-26
Homing ........................................................................ 6-25 major fault .................................................................... 11-7
homing ........................................................................... 8-2 manual operation ........................................................... 7-2
Homing Acceleration ............................................5-28, 8-9 master axis .................................................................. 9-16
Homing Approach Velocity ...................................5-28, 8-9 master axis phase shift ................................................ 9-26
Homing Compensation Value .............................5-29, 8-11 master following distance ............................................ 9-17
Homing Compensation Velocity ......................... 5-29, 8-11 Maximum Acceleration ................................................ 5-20
Homing Deceleration ............................................5-29, 8-9 Maximum Deceleration ................................................ 5-20
Homing Holding Time .........................................5-29, 8-11 Maximum Interpolation Acceleration ........................... 5-35
Homing Jerk .......................................................5-29, 8-10 Maximum Interpolation Deceleration ........................... 5-35
Homing Method ....................................................5-28, 8-6 Maximum Interpolation Velocity ................................... 5-35
homing parameters ....................................................... 8-5 Maximum Jog Velocity ................................................. 5-20
Homing Settings .......................................................... 5-28 Maximum Negative Torque Limit ................................. 5-24
Homing Start Direction .........................................5-28, 8-8 maximum number of cam data .................................... 9-16
Homing Velocity ....................................................5-28, 8-9 Maximum Positive Torque Limit ................................... 5-24
Maximum Velocity ........................................................ 5-20
I MC Common Error Status ........................................... 11-5
MC Common Errors .................................................... 11-7
Idle ...................................................................... 6-26, 6-32 MC Common Minor Fault ............................................ 6-24
Immediate Stop Input .................................................. 6-26 MC Common Minor Fault Code ................................... 6-24
Immediate Stop Input Stop Method ............................. 5-24 MC Common Minor Fault Occurrence ......................... 6-24
immediate stop of command value .............................. 9-10 MC Common Observation ........................................... 6-24
immediate stop of command value and error reset ..... 9-10 MC Common Observation Code ................................. 6-24
immediate stop of command value and servo OFF ..... 9-10 MC Common Observation Occurrence ....................... 6-24
In Home Position ......................................................... 6-26 MC Common Partial Fault ........................................... 6-24
indicators ..................................................................... 11-3 MC Common Partial Fault Code .................................. 6-24
infinite length axis ........................................................ 5-25 MC Common Partial Fault Occurrence ........................ 6-24
information ................................................................... 11-7 MC Common Status .................................................... 6-24
in-position check .......................................................... 9-79 MC Common Variable ................................................. 6-24
In-position Check Time ................................................ 5-21 MC Error Status ........................................................... 11-5
In-position Range ........................................................ 5-21 MC Run ....................................................................... 6-24
In-position Waiting ..............................................6-26, 6-32 MC Test Run .........................................................4-2, 6-24
Interpolation Acceleration Warning Value ................... 5-35 MC Test Run functions .................................................. 4-2
Interpolation Acceleration/Deceleration Over .............. 5-35 _MC_AX[*].Scale.CountMode ..................................... 6-28
Interpolation Deceleration Warning Value ................... 5-36 _MC_AX[*].Scale.MaxPos ........................................... 6-28
Interpolation Velocity Warning Value ........................... 5-35 _MC_AX[*].Scale.MinPos ............................................ 6-28
interrupt feeding ............................................................ 9-5 _MC_AX[0-63].Act.Pos (Actual Current Position) ........ 6-27
invalid cam data ........................................................... 9-16 _MC_AX[0-63].Act.TimeStamp (Time Stamp) ............ 6-27
_MC_AX[0-63].Act.Trq (Actual Current Torque) .......... 6-27
J _MC_AX[0-63].Act.Vel (Actual Current Velocity) ......... 6-27
_MC_AX[0-63].Cfg.AxEnable (Axis Use) .................... 6-28
jerk .......................................................................1-2, 9-37 _MC_AX[0-63].Cfg.AxNo (Axis Number) .................... 6-28
jerk unit ........................................................................ 9-37 _MC_AX[0-63].Cfg.AxType (Axis Type) ....................... 6-28
jogging ........................................................................... 7-5 _MC_AX[0-63].Cfg.NodeAddress (Node Address) ..... 6-28
_MC_AX[0-63].Cmd.AccDec
K (Command Current Acceleration/Deceleration) ........ 6-27
_MC_AX[0-63].Cmd.Jerk (Command Current Jerk) .... 6-27
Kinematics Transformation Settings ............................ 6-34 _MC_AX[0-63].Cmd.Pos
(Command Current Position) .................................... 6-27
L _MC_AX[0-63].Cmd.Trq (Command Current Torque) . 6-27
_MC_AX[0-63].Cmd.Vel (Command Current Velocity) 6-27
_MC_AX[0-63].Details.Homed (Home Defined) .......... 6-26
latching ........................................................................ 9-74
_MC_AX[0-63].Details.Idle (Idle) ................................. 6-26
Limit Input Stop Method .............................................. 5-24

Index-4 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Index

_MC_AX[0-63].Details.InHome (In Home Position) .... 6-26 _MC_AX[0-63].Status.Synchronized


_MC_AX[0-63].Details.InPosWaiting (Synchronized Motion) ............................................. 6-25
(In-position Waiting) ................................................. 6-26 _MC_AX_ErrSta (MC Error Status) ............................ 11-5
_MC_AX[0-63].Details.VelLimit _MC_COM (MC Common Variable) ............................ 6-24
(Command Velocity Saturation) ............................... 6-26 _MC_COM.MFaultLvl.Active
_MC_AX[0-63].Dir.Nega (Negative Direction) ............. 6-26 (MC Common Minor Fault Occurrence) ................... 6-24
_MC_AX[0-63].Dir.Posi (Positive Direction) ................ 6-26 _MC_COM.MFaultLvl.Code
_MC_AX[0-63].DrvStatus.CSP (MC Common Minor Fault Code) ............................. 6-24
(Cyclic Synchronous Position (CSP) Control Mode) 6-26 _MC_COM.Obsr.Active
_MC_AX[0-63].DrvStatus.CST (MC Common Observation Occurrence) .................. 6-24
(Cyclic Synchronous Torque (CST) Control Mode) .. 6-26 _MC_COM.Obsr.Code
_MC_AX[0-63].DrvStatus.CSV (MC Common Observation Code) ............................ 6-24
(Cyclic Synchronous Velocity (CSV) Control Mode) 6-26 _MC_COM.PFaultLvl.Active
_MC_AX[0-63].DrvStatus.DrvAlarm (MC Common Partial Fault Occurrence) .................. 6-24
(Drive Error Input) .................................................... 6-26 _MC_COM.PFaultLvl.Code
_MC_AX[0-63].DrvStatus.DrvWarning (MC Common Partial Fault Code) ............................ 6-24
(Drive Warning Input) ............................................... 6-26 _MC_COM.Status.CamTableBusy (Cam Table Busy) 6-24
_MC_AX[0-63].DrvStatus.Home (Home Input) ........... 6-26 _MC_COM.Status.RunMode (MC Run) ...................... 6-24
_MC_AX[0-63].DrvStatus.HomeSw _MC_COM.Status.TestMode (MC Test Run) .............. 6-24
(Home Proximity Input) ............................................ 6-26 _MC_ComErrSta (MC Common Error Status) ............ 11-5
_MC_AX[0-63].DrvStatus.ILA (Drive Internal Limiting) 6-26 _MC_ErrSta (Axis Error Status) .................................. 11-5 I
_MC_AX[0-63].DrvStatus.ImdStop _MC_GRP[0-31] (Axes Group Variable) ..................... 6-32
(Immediate Stop Input) ............................................. 6-26 _MC_GRP[0-31].Cfg.GrpEnable (Axes Group Use) ... 6-33
_MC_AX[0-63].DrvStatus.Latch1 _MC_GRP[0-31].Cfg.GrpNo (Axes Group Number) ... 6-33
(External Latch Input 1) ............................................ 6-26 _MC_GRP[0-31].Cmd.AccDec
_MC_AX[0-63].DrvStatus.Latch2 (Command Interpolation Acceleration/Deceleration) 6-33
(External Latch Input 2) ............................................ 6-26 _MC_GRP[0-31].Cmd.Vel
_MC_AX[0-63].DrvStatus.MainPower (Main Power) ... 6-26 (Command Interpolation Velocity) ............................ 6-33
_MC_AX[0-63].DrvStatus.N_OT _MC_GRP[0-31].Details.Idle (Idle) ............................. 6-32
(Negative Limit Input) ............................................... 6-26 _MC_GRP[0-31].Details.InPosWaiting
_MC_AX[0-63].DrvStatus.P_OT (Positive Limit Input) 6-26 (In-Position Waiting) ................................................. 6-32
_MC_AX[0-63].DrvStatus.Ready (Servo Ready) ........ 6-26 _MC_GRP[0-31].Kinematics.Axis[0]
_MC_AX[0-63].DrvStatus.ServoOn (Servo ON) ......... 6-26 (Composition Axis for Axis A0) ................................. 6-34
_MC_AX[0-63].MFaultLvl.Active _MC_GRP[0-31].Kinematics.Axis[1]
(Axis Minor Fault Occurrence) .................................. 6-28 (Composition Axis for Axis A1) ................................. 6-34
_MC_AX[0-63].MFaultLvl.Code _MC_GRP[0-31].Kinematics.Axis[2]
(Axis Minor Fault Code) ............................................ 6-28 (Composition Axis for Axis A2) ................................. 6-34
_MC_AX[0-63].Obsr.Active _MC_GRP[0-31].Kinematics.Axis[3]
(Axis Observation Occurrence) ................................ 6-28 (Composition Axis for Axis A3) ................................. 6-34
_MC_AX[0-63].Obsr.Code (Axis Observation Code) .. 6-28 _MC_GRP[0-31].Kinematics.GrpType (Composition) . 6-34
_MC_AX[0-63].Scale.Den _MC_GRP[0-31].MFaultLvl.Active
(Work Travel Distance Per Motor Rotation) .............. 6-28 (Axes Group Minor Fault Occurrence) ..................... 6-33
_MC_AX[0-63].Scale.Num _MC_GRP[0-31].MFaultLvl.Code
(Command Pulse Count Per Motor Rotation) ........... 6-28 (Axes Group Minor Fault Code) ............................... 6-33
_MC_AX[0-63].Scale.Units (Unit of Display) ............... 6-28 _MC_GRP[0-31].Obsr.Active
_MC_AX[0-63].Status.Continuous (Axes Group Observation Occurrence) .................... 6-33
(Continuous Motion) ................................................. 6-25 _MC_GRP[0-31].Obsr.Code
_MC_AX[0-63].Status.Coordinated (Axes Group Observation Code) .............................. 6-33
(Coordinated Motion) ............................................... 6-25 _MC_GRP[0-31].Status.Disabled
_MC_AX[0-63].Status.Disabled (Axis Disabled) ......... 6-25 (Axes Group Disabled) ............................................. 6-32
_MC_AX[0-63].Status.Discrete (Discrete Motion) ....... 6-25 _MC_GRP[0-31].Status.ErrorStop
_MC_AX[0-63].Status.ErrorStop (Error Deceleration Stopping) .................................. 6-32
(Error Deceleration Stopping) .................................. 6-25 _MC_GRP[0-31].Status.Moving (Moving) ................... 6-32
_MC_AX[0-63].Status.Homing (Homing) .................... 6-25 _MC_GRP[0-31].Status.Ready (Ready to Execute) ... 6-32
_MC_AX[0-63].Status.Ready _MC_GRP[0-31].Status.Standby (Standby) ................ 6-32
(Axis Ready-to-execute) ........................................... 6-25 _MC_GRP[0-31].Status.Stopping
_MC_AX[0-63].Status.Standstill (Standstill) ................ 6-25 (Deceleration Stopping) ........................................... 6-32
_MC_AX[0-63].Status.Stopping _MC_GRP_ErrSta (Axes Group Error Status) ............ 11-5
(Deceleration Stopping) ........................................... 6-25 minor fault ................................................................... 11-7

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) Index-5


Index

Modulo Maximum Position Setting Value ........... 5-25, 5-27 P


Modulo Minimum Position Setting Value ............5-25, 5-27
Motion Control Function Module ................................... 2-2 partial fault ................................................................... 11-7
motion control instructions ............................................. 6-4 performance specifications ............................................ 1-7
Enable variable ...................................................... 6-12 Periodic task .................................................................. 2-5
exclusiveness of outputs ........................................ 6-10 periodic tasks ................................................................ 2-5
Execute variable .................................................... 6-12 phase ........................................................................... 9-16
execution and status .............................................. 6-10 phase pitch .................................................................. 9-17
input parameters .................................................... 6-10 PLC Function Module .................................................... 2-2
multi-execution ..............................................9-47, 9-65 PLCopen® ..................................................................... 1-2
operation of output variable Busy .......................... 6-11 Position Count Settings ............................................... 5-25
operation of output variable CommandAborted ..... 6-11 positioning gear operation ........................................... 9-14
operation of output variable Done .......................... 6-11 positions .............................................................6-17, 9-32
output status .......................................................... 6-10 types ...................................................................... 9-32
output variable Active ............................................ 6-11 Positive Direction ......................................................... 6-26
re-executing .................................................. 9-42, 9-64 Positive Limit Input ...................................................... 6-26
timing chart for multi-execution .............................. 6-16 Positive Software Limit ................................................ 5-25
timing chart for re-execution .................................. 6-15 Positive Torque Warning Value .................................... 5-20
timing charts for enable-type instructions .............. 6-14 Primary period ............................................................. 2-22
timing charts for execute-type instructions ............ 6-13 primary period ......................................................2-7, 2-23
motion control period ................................................... 2-23 primary periodic task ..................................................... 2-5
motion control programs ................................................ 6-2 process data communications cycle ............................ 2-23
writing .................................................................... 6-39 process data objects (PDOs) ...................................... 2-19
Moving ......................................................................... 6-32 program-modified cam data ........................................ 9-16
multi-axes coordinated control ..................................... 9-53
multi-execution of instructions ............................ 9-47, 9-65 R
N Ready to Execute ........................................................ 6-32
re-executing instructions .............................................. 9-42
Negative Direction ....................................................... 6-26 re-execution of instructions .......................................... 9-64
Negative Limit Input ..................................................... 6-26 relative positioning ......................................................... 9-4
Negative Software Limit ............................................... 5-25 Rotary Mode ................................................................ 5-26
Negative Torque Warning Value .................................. 5-21
Node Address .............................................................. 6-28 S
node addresses ........................................................... 5-11
null cam data ............................................................... 9-17
S-curve ........................................................................ 9-37
number of valid cam data ............................................ 9-16
service data objects (SDOs) ........................................ 2-19
servo axis ...............................................................3-2, 5-9
O Servo Drive Settings .................................................... 5-27
Servo Drive Status ...................................................... 6-26
object dictionary .......................................................... 2-19 Servo ON ..............................................................6-26, 7-3
observation .................................................................. 11-7 Servo Ready ................................................................ 6-26
operation direction single-axis control
specifying ............................................................... 9-38 common functions .................................................. 9-32
current direction ............................................ 9-39 position control ......................................................... 9-3
negative direction .......................................... 9-39 synchronized control .............................................. 9-13
no direction specified .................................... 9-39
torque control ......................................................... 9-31
positive direction ........................................... 9-38
velocity control ....................................................... 9-29
shortest way .................................................. 9-38
Operation Selection at Negative Limit Input .........5-28, 8-8 slave axis ..................................................................... 9-16
Operation Selection at Positive Limit Input ...........5-28, 8-8 Software Limits ............................................................ 5-25
Operation Selection at Reversing ................................ 5-20 software limits .............................................................. 9-76
Operation Settings ....................................................... 5-20 sources ........................................................................ 11-7
original cam data ......................................................... 9-16 Standby ....................................................................... 6-32
Other Operation Settings ............................................. 5-24 Standstill ...................................................................... 6-25
overrides ............................................................. 9-12, 9-59 start mode ................................................................... 9-17
stop priorities ............................................................... 9-11
Stopping ........................................................................ 9-7

Index-6 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


Index

stopping W
due to errors or other problems ...................... 9-8, 9-58
immediate stop input ............................................... 9-7 Work Travel Distance Per Motor Rotation .......... 5-13, 6-28
limit inputs ............................................................... 9-7
MC_GroupImmediateStop instruction ................... 9-58 Z
MC_GroupStop instruction .................................... 9-58
MC_ImmediateStop instruction ............................... 9-8
Zero Position Range ................................................... 5-21
MC_Stop instruction ................................................ 9-8
zones .......................................................................... 9-75
Servo Drive input signals ......................................... 9-7
stop method .......................................................... 9-10
stopping under multi-axes coordinated control ........... 9-58
structure data types .................................................... 6-22
superimpose corners .................................................. 9-68
Synchronized Motion .................................................. 6-25
synchronous positioning ............................................. 9-24
system configuration ..................................................... 1-3
system-defined variables ................................... 6-19, 11-5
motion control ............................................... 6-19, 11-6
attributes ....................................................... 6-22
tables ............................................................ 6-24
I
T

target position
changing ................................................................ 9-42
excessive deceleration patterns ................... 9-43
triangular control patterns ............................. 9-43
when a reverse turn occurs
for the new command value ........... 9-42
target velocity
changing ................................................................ 9-44
task period .................................................................... 2-7
tasks .............................................................................. 2-5
torque command
changing ................................................................ 9-45
torque limit .................................................................. 9-74
transition disabled ....................................................... 9-68
Transition Modes ......................................................... 9-68
travel distance
changing ................................................................ 9-44
trial operation ................................................................ 4-2
Troubleshooter ............................................................ 11-4
troubleshooting ........................................................... 11-4

Unit Conversion Settings .................................... 5-13, 6-28


Unit of Display .................................................... 5-13, 6-28

valid cam data ............................................................. 9-16


velocities
types ...................................................................... 9-34
velocity control ....................................................... 9-29
velocity unit ............................................................ 9-34
Velocity Warning Value .......................................... 5-20
virtual encoder axis ................................................ 3-2, 5-9
virtual servo axis .................................................... 3-2, 5-9

NJ/NX-series CPU Unit Motion Control User’s Manual (W507) Index-7


Index

Index-8 NJ/NX-series CPU Unit Motion Control User’s Manual (W507)


OMRON Corporation Industrial Automation Company Authorized Distributor:
Kyoto, JAPAN
Contact: www.ia.omron.com
Regional Headquarters
OMRON EUROPE B.V. OMRON ELECTRONICS LLC
Wegalaan 67-69, 2132 JD Hoofddorp 2895 Greenspoint Parkway, Suite 200
The Netherlands Hoffman Estates, IL 60169 U.S.A.
Tel: (31)2356-81-300/Fax: (31)2356-81-388 Tel: (1) 847-843-7900/Fax: (1) 847-843-7787

OMRON ASIA PACIFIC PTE. LTD. OMRON (CHINA) CO., LTD. © OMRON Corporation 2011-2017 All Rights Reserved.
No. 438A Alexandra Road # 05-05/08 (Lobby 2), Room 2211, Bank of China Tower, In the interest of product improvement,
Alexandra Technopark, 200 Yin Cheng Zhong Road, specifications are subject to change without notice.
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-15 0117

You might also like