Omron Trajexia
Omron Trajexia
Omron Trajexia
I55E-EN-05
OPERATION MANUAL
Authorized Distributor:
Cat. No. I55E-EN-05 Note: Specifications subject to change without notice. Printed in Europe
Notice
OMRON products are manufactured for use by a trained operator and only for the purposes
described in this manual.
The following conventions are used to classify and explain the precautions in this manual.
Always heed the information provided with them.
!WARNING Indicates information that, if not heeded, could possibly result in serious injury or loss of life.
!Caution Indicates information that, if not heeded, could possibly result in minor or relatively serious injury,
damage to the product or faulty operation.
Visual aids
The following headings appear in the left column of the manual to help you locate different
types of information.
Note: Indicates information of particular interest for efficient and convenient operation of the product.
iii
Trademarks and copyrights
MECHATROLINK is a registered trademark of Yaskawa Corporation.
Trajexia is a registered trademark of OMRON.
All other product names, company names, logos or other designations mentioned herein are
trademarks of their respective owners.
Copyright
Copyright © 2011 OMRON
All rights reserved. No part of this publication may be reproduced, stored in a retrieval sys-
tem, 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. Nevertheless, 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.
iv
TABLE OF CONTENTS
Precautions vii
1 Intended audience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
2 General precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
3 Safety precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
4 Operating environment precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
5 Application precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
6 Conformance to EC Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
SECTION 1
Introduction 1
1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1-2 System philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-3 Motion control concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1-4 Servo system principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1-5 Trajexia system architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1-6 Cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1-7 Program control and multi-tasking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1-8 Motion sequence and axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1-9 Motion buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1-10 Mechanical system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1-11 Axis numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
SECTION 2
Installation and wiring 35
2-1 Unit components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2-2 Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2-3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2-4 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
SECTION 3
Data exchange 59
3-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3-2 Memory areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3-3 Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3-4 FINS commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
SECTION 4
BASIC commands 73
4-1 Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
4-2 All BASIC commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
SECTION 5
Examples 267
5-1 How-to’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
5-2 Practical examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
v
TABLE OF CONTENTS
SECTION 6
Troubleshooting 349
6-1 Items to Check First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
6-2 Error Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
6-3 Troubleshooting Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
6-4 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
vi
Intended audience Precautions
Precautions
1 Intended audience
This manual is intended for the following personnel, who must also have
knowledge of electrical systems (an electrical engineer or the equivalent).
• Personnel in charge of installing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of managing FA systems and facilities.
2 General precautions
The user must operate the product according to the performance
specifications described in the operation manuals.
Before using the product under conditions which are not described in the
manual or applying the product to nuclear control systems, railroad systems,
aviation systems, vehicles, combustion systems, medical equipment,
amusement machines, safety equipment, and other systems, machines, and
equipment that may have a serious influence on lives and property if used
improperly, consult your OMRON representative.
Make sure that the ratings and performance characteristics of the product are
sufficient for the systems, machines, and equipment, and be sure to provide
the systems, machines, and equipment with double safety mechanisms.
This manual provides information for using the CJ1W-MC@72. Be sure to read
this manual before attempting to use the Unit and keep this manual close at
hand for reference during operation.
!WARNING It is extremely important that the CJ1W-MC@72 and related devices be used for the
specified purpose and under the specified conditions, especially in applications that can
directly or indirectly affect human life. You must consult with your OMRON
representative before applying the CJ1W-MC@72 and related devices to the above
mentioned applications.
3 Safety precautions
!WARNING Never short-circuit the positive and negative terminals of the batteries, charge the
batteries, disassemble them, deform them by applying pressure, or throw them into a
fire.
The batteries may explode, combust or leak liquid.
!WARNING The CJ1W-MC@72 outputs will go off due to overload of the output transistors
(protection). As a countermeasure for such problems, external safety measures must
be provided to ensure safety in the system.
!WARNING The CJ1W-MC@72 will turn off the WDOG when its self-diagnosis function detects any
error. As a countermeasure for such errors, external safety measures must be provided
to ensure safety in the system.
!WARNING Never attempt to disassemble any Units while power is being supplied. Doing so may
result in serious electric shock.
!WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do so may
result in malfunction, fire, or electric shock.
!WARNING Never touch any of the terminals while power is being supplied. Doing so may result in
serious electric shock.
vii
Operating environment precautions Precautions
!WARNING Provide safety measures in external circuits (i.e., not in the Programmable Controller)
to ensure safety in the system if an abnormality occurs due to malfunction of the PLC,
malfunction of the CJ1W-MC@72, or external factors affecting the operation of the PLC
or CJ1W-MC@72. Not providing sufficient safety measures may result in serious
accidents.
• Emergency stop circuits, interlock circuits, limit circuits, and similar safety measures
must be provided in external control circuits.
• The PLC will turn OFF all outputs when its self-diagnosis function detects any error
or when a severe failure alarm (FALS) instruction is executed. As a countermeasure
for such errors, external safety measures must be provided to ensure safety in the
system.
• The PLC or CJ1W-MC@72 outputs may remain ON or OFF due to deposits on or
burning of the output relays, or destruction of the output transistors. As a
countermeasure for such problems, external safety measures must be provided to
ensure safety in the system.
• When the 24 V DC output (service power supply to the PLC) is overloaded or short-
circuited, the voltage may drop and result in the outputs being turned OFF. As a
countermeasure for such problems, external safety measures must be provided to
ensure safety in the system.
• External safety measures must also be taken to ensure safety in the event of
unexpected operation when connecting or disconnecting the connectors of the
CJ1W-MC@72.
!Caution User programs written to the CJ1W-MC@72 will not be automatically backed up in the
CJ1W-MC@72 flash memory (flash memory function).
!Caution Tighten the screws on the terminal block of the Power Supply Unit to the torque
specified in this manual. Loose screws may result in burning or malfunction.
!Caution When positioning to a position determined using the teaching function, set the position
designation setting in the positioning sequence to absolute positioning. If it is set to
relative positioning, positioning will be performed to a position other than the one
obtained with the teaching function.
!Caution Execute online edit only after confirming that no adverse effects will be caused by
extending the cycle time. Otherwise, the input signals may not be readable.
!Caution Confirm the safety of the destination node before transferring a program to the node or
changing the contents of I/O memory. Doing either of these without confirming safety
may result in injury.
!Caution Do not save data into the flash memory during memory operation or while the motor is
running. Otherwise, unexpected operation may be caused.
!Caution Take appropriate and sufficient countermeasures when installing systems in the
following locations:
• Locations subject to static electricity or other forms of noise.
• Locations subject to strong electromagnetic fields.
viii
Application precautions Precautions
!Caution The operating environment of the PLC System can have a large effect on the longevity
and reliability of the system. Improper operating environments can lead to malfunction,
failure, and other unforeseeable problems with the PLC System. Be sure that the
operating environment is within the specified conditions at installation and remains
within the specified conditions during the life of the system.
5 Application precautions
!WARNING Do not start the system until you check that the axes are present and of the correct
type. The numbers of the axis will change if MECHATROLINK-II network errors occur
during start-up or if the MECHATROLINK-II network configuration changes.
!WARNING Check the user program for proper execution before actually running it in the Unit. Not
checking the program may result in an unexpected operation.
!WARNING Observe the following precautions when using the CJ1W-MC@72 or the PLC. Failure to
abide by the following precautions could lead to serious or possibly fatal injury. Always
heed these precautions.
• Always connect to a ground of 100 or less when installing the Units. Not
connecting to a ground of 100 or less may result in electric shock.
• Always turn OFF the power supply to the PLC before attempting any of the
following. Not turning OFF the power supply may result in malfunction or electric
shock.
- Mounting or dismounting Power Supply Units, I/O Units, CPU Units, Memory
Cassettes, or any other Units.
- Assembling the Units.
- Setting DIP switches or rotary switches.
- Connecting cables or wiring the system.
- Connecting or disconnecting the connectors.
!Caution Be sure that all mounting screws, terminal screws, and cable connector screws are
tightened to the torque specified in this manual. Incorrect tightening torque may result
in malfunction.
!Caution Mount the Unit only after checking the terminal block completely.
!Caution Resume operation only after transferring to the new CJ1W-MC@72 Unit the contents of
the VR and table memory required for operation. Not doing so may result in an
unexpected operation.
!Caution When replacing parts, be sure to confirm that the rating of a new part is correct. Not
doing so may result in malfunction or burning.
!Caution Use the dedicated connecting cables specified in operation manuals to connect the
Units. Using commercially available RS-232C computer cables may cause failures in
external devices or the Unit.
!Caution Outputs may remain on due to a malfunction in the built-in transistor outputs or other
internal circuits. As a countermeasure for such problems, external safety measures
must be provided to ensure the safety of the system.
!Caution Failure to abide by the following precautions may lead to faulty operation of the PLC,
the CJ1W-MC@72 or the system, or could damage the PLC or CJ1W-MC@72. Always
heed these precautions.
ix
Application precautions Precautions
• Fail-safe measures must be taken by the customer to ensure safety in the event of
incorrect, missing, or abnormal signals caused by broken signal lines, momentary
power interruptions, or other causes.
• Interlock circuits, limit circuits, and similar safety measures in external circuits (i.e.,
not in the Programmable Controller) must be provided by the customer.
• Install external breakers and take other safety measures against short-circuiting in
external wiring. Insufficient safety measures against short-circuiting may result in
burning.
• Install the PLC Unit as far as possible from sources of strong harmonic noise.
• Lock the sliders securely until they click into place when connecting the Power
Supply Unit, CPU Unit, I/O Units, Special I/O Units, or CPU Bus Units. Functions
may not work correctly if the sliders are not locked properly.
• Always attach the End Cover provided with the CPU Unit to the Unit on the right end
of the PLC. The CJ-series PLC will not operate properly if the End Cover is not
attached.
• Always use the power supply voltages specified in the operation manuals. An
incorrect voltage may result in malfunction or burning.
• Take appropriate measures to ensure that the specified power with the rated
voltage and frequency is supplied in places where the power supply is unstable. An
incorrect power supply may result in malfunction.
• Use crimp terminals for wiring. Do not connect bare stranded wires directly to
terminals. Connection of bare stranded wires may result in burning.
• Leave the label attached to the Unit when wiring. Removing the label may result in
malfunction if foreign matter enters the Unit.
• Remove the label after the completion of wiring to ensure proper heat dissipation.
Leaving the label attached may result in malfunction.
• Do not apply voltages to the Input Units in excess of the rated input voltage. Excess
voltages may result in burning.
• Do not apply voltages or connect loads to the Output Units in excess of the
maximum switching capacity. Excess voltage or loads may result in burning.
• Check the user program for proper execution before actually running it on the Unit.
Not checking the program may result in an unexpected operation.
• Be sure that the terminal blocks, Memory Units, expansion cables, and other items
with locking devices are properly locked into place. Improper locking may result in
malfunction.
• Double-check all wiring and switch settings before turning ON the power supply.
Incorrect wiring may result in burning.
• Disconnect the LR and GR terminals when performing insulation resistance or
withstand voltage tests. Not disconnecting the functional ground terminal may result
in burning.
!Caution Confirm that no adverse effect will occur in the system before attempting any of the
following. Not doing so may result in an unexpected operation.
• Changing the operating mode of the PLC (including the operating mode at power
up).
• Force-setting/force-resetting any bit in memory.
• Changing the present value of any word or any set value in memory.
!Caution Do not pull on the cables or bend the cables beyond their natural limit. Doing either of
these may break the cables.
!Caution Do not place objects on top of the cables or other wiring lines. Doing so may break the
cables.
!Caution Resume operation only after transferring the system parameter data to the CJ1W-
MC@72 and saving the data to flash memory. Not doing so may result in an unexpected
operation.
x
Conformance to EC Directives Precautions
!Caution Before touching a Unit, be sure to first touch a grounded metallic object in order to
discharge any static build-up. Not doing so may result in malfunction or damage.
!Caution Confirm the safety of the destination node before transferring a program to the node or
changing the contents of I/O memory. Doing either of these without confirming safety
may result in injury.
6 Conformance to EC Directives
6-1 Applicable directives
• EMC Directives
6-2 Concepts
OMRON devices that comply with EC Directives also conform to the related
EMC standards so that they can be more easily built into other devices or
machines. The actual products have been checked for conformity to EMC
standards (see the following note). 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 EC
Directives will vary depending on the configuration, wiring, and other
conditions of the equipment or control panel in which the OMRON devices are
installed. The customer must, therefore, perform final checks to confirm that
devices and the overall machine conform to EMC standards.
xi
Conformance to EC Directives Precautions
xii
Overview Section 1-1
SECTION 1
Introduction
1-1 Overview
The CJ1W-MCH72 and CJ1W-MC472 are Trajexia-style motion control unit
that can be connected to a CJ1-series PLC. It acts as an interface between
PLC systems and Trajexia-style motion control systems.
Trajexia is the OMRON motion platform that offers you the performance and
the ease of use of a dedicated motion system. It maximum flexibility and
scalability. At the heart of Trajexia lies the TJ1 multi-tasking motion
coordinator. Powered by a 32-bit DSP, it can do motion tasks such as e-cam,
e-gearbox, registration control and interpolation, all using simple motion
commands.
Note: The Trajexia system supports 3 kinds of MECHATROLINK-II slaves: Servo Drivers,
Inverters and I/Os.
The CJ1W-MC@72 only supports 2 kinds of MECHATROLINK-II slaves: Servo Drivers
and Inverters. It does not support I/Os.
1
System philosophy Section 1-2
ML
ENC
BASIC PROGRAMS
All other
Process 1
Servo
Process 2 Servo Driver Drivers
Process 3
Position
… Loop
Speed Loop MOTOR
Process 14
Torque
Comms Loop
I/O
ENC
1-2-1 Glossary
1-2-1-1 Motion sequence
The Motion Sequence is responsible for controlling the position of the axes.
2
System philosophy Section 1-2
1-2-1-5 Program
A program is a piece of BASIC code.
1-2-1-6 Process
Is a program in execution with a certain priority assigned. Process 0 to 12 are
Low priority processes and Process 13 and 14 are High priority processes.
First the process priority, High or Low, and then the process number, from high
to low, will define to which CPU task the process will be assigned.
3
Motion control concepts Section 1-3
This section introduces some of the commands and parameters used in the
BASIC programming of the motion control application.
Coordinate system
Positioning operations performed by the CJ1W-MC@72 are based on an axis
coordinate system. The CJ1W-MC@72 converts the position data from either
the connected Servo Driver or the connected encoder into an internal absolute
coordinate system.
The engineering unit that specifies the distances of travelling can be freely
defined for each axis separately. The conversion is performed through the use
of the unit conversion factor, which is defined by the UNITS axis parameter.
The origin point of the coordinate system can be determined using the
DEFPOS command. This command re-defines the current position to zero or
any other value.
MOVEABS(30)
MOVE(60)
MOVEABS(50)
MOVE(50)
MOVE(30)
0
A
50 100
4
Motion control concepts Section 1-3
B MOVEABS(100) AXIS(0)
MOVEABS(50) AXIS(1)
50
0 50 100
A
To move a single axis either the command MOVE for a relative move or the
command MOVEABS for an absolute move is used. Each axis has its own
move characteristics, which are defined by the axis parameters.
Suppose a control program is executed to move from the origin to an axis no.
0 (A) coordinate of 100 and axis no. 1 (B) coordinate of 50. If the speed
parameter is set to be the same for both axes and the acceleration and
deceleration rate are set sufficiently high, the movements for axis 0 and axis 1
will be as shown in the figure.
At start, both the axis 0 and axis 1 moves to a coordinate of 50 over the same
duration of time. At this point, axis 1 stops and axis 0 continues to move to a
coordinate of 100.
Parameter Description
UNITS Unit conversion factor
ACCEL Acceleration rate of an axis in units/s2
DECEL Deceleration rate of an axis in units/s2
SPEED Demand speed of an axis in units/s
Defining moves
B
ACCEL=10
10 DECEL=10
SPEED=10
MOVE(40)
0 1 2 3 4 5 6
A
5
Motion control concepts Section 1-3
The speed profile in this figure shows a simple MOVE operation. Axis A is the
time, axis B is the speed. The UNITS parameter for this axis has been defined
for example as meters. The required maximum speed has been set to 10 m/s.
In order to reach this speed in one second and also to decelerate to zero
speed again in one second, both the acceleration as the deceleration rate
have been set to 10 m/s2. The total distance travelled is the sum of distances
travelled during the acceleration, constant speed and deceleration segments.
Suppose the distance moved by the MOVE command is 40 m, the speed
profile is given by the figure.
B
ACCEL=5
10 DECEL=10
SPEED=10
MOVE(40)
0 1 2 3 4 5 6
A
The two speed profiles in these figures show the same movement with an
acceleration time respectively a deceleration time of 2 seconds. Again, Axis A
is the time, axis B is the speed.
B
ACCEL=10
10 DECEL=5
SPEED=10
MOVE(40)
0 1 2 3 4 5 6
A
Move calculations
The following equations are used to calculate the total time for the motion of
the axes.
• The moved distance for the MOVE command is D.
• The demand speed is V.
• The acceleration rate is a.
• The deceleration rate is d.
/i
Acceleration time =
Acceleration distance =
Deceleration time =
6
Motion control concepts Section 1-3
Deceleration distance =
Total time =
1-3-2 CP control
Continuous Path control enables to control a specified path between the start
and end position of a movement for one or multiple axes. The CJ1W-MC@72
supports the following operations:
• Linear interpolation
• Circular interpolation
• CAM control.
7
Motion control concepts Section 1-3
50
-50 0 50
It may be required that a tool travels from the starting point to the end point in
an arc of a circle. In this instance the motion of two axes is related via a
circular interpolated move using the MOVECIRC command.
Consider the diagram in the figure. It corresponds to the MOVECIRC(-100,0,-
50,0,0) command. The centre point and desired end point of the trajectory
relative to the start point and the direction of movement are specified. The
MOVECIRC command computes the radius and the angle of rotation. Like the
linearly interpolated MOVE command, the ACCEL, DECEL and SPEED
variables associated with the base axis determine the speed profile along the
circular move.
8
Motion control concepts Section 1-3
1-3-3 EG control
Electronic Gearing control allows you to create a direct gearbox link or a linked
move between two axes. The MC Unit supports the following operations.
• Electronic gearbox
• Linked CAM
• Linked move
• Adding axes
B
2:1
1:1
1:2
The CJ1W-MC@72 is able to have a gearbox link from one axis to another as
if there is a physical gearbox connecting them. This can be done using the
CONNECT command in the program. In the command the ratio and the axis to
link to are specified.
In the figure, A is the Master axis, and B is the CONNECT axis.
/i
9
Motion control concepts Section 1-3
Next to the standard CAM profiling tool the CJ1W-MC@72 also provides a tool
to link the CAM profile to another axis. The command to create the link is
called CAMBOX. The travelling speed through the profile is not determined by
the axis parameters of the axis but by the position of the linked axis. This is
like connecting two axes through a cam.
In the figure, A is the Master axis (0) position, and B is the CAMBOX Axis (1)
position.
C D
E
A
10
Motion control concepts Section 1-3
BASE(0)
B ADDAX(2)
FORWARD
MOVE(100) AXIS(2)
MOVE(-60) AXIS(2)
It is very useful to be able to add all movements of one axis to another. One
possible application is for instance changing the offset between two axes
linked by an electronic gearbox. The CJ1W-MC@72 provides this possibility by
using the ADDAX command. The movements of the linked axis will consists of
all movements of the actual axis plus the additional movements of the master
axis.
In the figure, A is the time axis and B is the speed axis.
11
Motion control concepts Section 1-3
B
MERGE=0
A
B
MERGE=1
1-3-4-5 Jogging
Jogging moves the axes at a constant speed forward or reverse by manual
operation of the digital inputs. Different speeds are also selectable by input.
Refer to the FWD_JOG, REV_JOG and FAST_JOG axis parameters.
12
Servo system principles Section 1-4
A B
2
3
C 1 E
D F G
4
I
H
J
Inferred closed loop systems occupy the mainstream in modern servo systems
applied to positioning devices for industrial applications. The figure shows the
basic principle of the servo system as used in the CJ1W-MC@72.
1 The CJ1W-MC@72 performs actual position control. The main input of the
controller is the Following Error, which is the calculated difference between
the demand position and the actual measured position.
2 The Position Controller calculates the required speed reference output
determined by the Following Error and possibly the demanded position and
the measured position. The speed reference is provided to the Servo
Driver.
3 The Servo Driver controls the rotational speed of the servo motor
corresponding to the speed reference. The rotational speed is proportional
to the speed reference.
4 The rotary encoder generates the feedback pulses for both the speed
feedback within the Servo Driver speed loop and the position feedback
within the CJ1W-MC@72 position loop.
13
Servo system principles Section 1-4
Kvff ∑
Kp
A B C
Ki ∑
Kd Δ
Kov Δ
The motion control algorithm uses the demand position (A), the measured
position (D) and the Following Error (B) to determine the speed reference. The
Following Error is the difference between the demanded and measured
position. The demand position, the measured position and the Following Error
are represented by the axis parameters MPOS, DPOS and FE. Five gain
values have been implemented for the user to be able to configure the correct
control operation for each application.
C is the output signal.
• Proportional gain
The proportional gain Kp creates an output Op that is proportional to the
Following Error E.
Op = Kp · E
All practical systems use proportional gain. For many just using this gain
parameter alone is sufficient. The proportional gain axis parameter is called
P_GAIN.
• Integral gain
The integral gain Ki creates an output Oi that is proportional to the sum of
the Following Errors that have occurred during the system operation.
Oi = Ki · ÓE
Integral gain can cause overshoot and so is usually used only on systems
working at constant speed or with slow accelerations. The integral gain axis
parameter is called I_GAIN.
• Derivative gain
The derivative gain Kd produces an output Od that is proportional to the
change in the Following Error E and speeds up the response to changes in
error while maintaining the same relative stability.
Od = Kd · ÄE
Derivative gain may create a smoother response. High values may lead to
oscillation. The derivative gain axis parameter is called D_GAIN.
• Output speed gain
The output speed gain Kov produces an output Oov that is proportional to
the change in the measured position Pm and increases system damping.
Oov = Kov · ÄPm
14
Trajexia system architecture Section 1-5
The output speed gain can be useful for smoothing motions but will
generate high Following Errors. The output speed gain axis parameter is
called OV_GAIN.
• Speed feed forward gain
The speed feedforward gain Kvff produces an output Ovff that is
proportional to the change in demand position Pd and minimizes the
Following Error at high speed.
Ovff = Kvff · ÄPd
The parameter can be set to minimise the Following Error at a constant
machine speed after other gains have been set. The speed feed forward
gain axis parameter is called VFF_GAIN.
The default settings are given in the table along with the resulting profiles.
Fractional values are allowed for gain settings.
/i
15
Cycle time Section 1-6
1-5-4 Communication
The CJ1W-MC@72 can exchange data with memory areas in the PLC. This
enables the CJ1W-MC@72 to use the inputs and outputs connected to the
PLC. Also, programs in the CJ1W-MC@72 and PLC programs can exchange
control and status data.
For more information on communication and data exchange, refer to chapter
3.
1-5-5 Peripherals
All inputs and outputs are used with the set of parameters (IN, OP, AIN,
AOUT). The inputs and outputs are automatically detected and mapped in
Trajexia. Inverters are considered a peripheral device and have a set of
BASIC commands to control them.
250μs
1 2 3 4
Cycle time = 1ms
500 μs
1 2 3 4
Cycle time = 2 ms
1 ms
1 2 3 4
Cycle time = 4 ms
The processes that can be carried out in each time interval depends on the
SERVO_PERIOD that is set.
16
Cycle time Section 1-6
Note: The Motion sequence execution depends on setting of the SERVO_PERIOD parame-
ter.
Note: Only the Sigma-III Servo Driver and the Sigma-V Servo Driver support the 0.5 ms trans-
mission cycle.
17
Cycle time Section 1-6
18
Cycle time Section 1-6
You should comply with the most restrictive rules when you set the
SERVO_PERIOD parameter. An incorrect value of the SERVO_PERIOD
parameter results in an incorrect detection of the MECHATROLINK-II slaves.
The most restrictive rules are given in the tables below. For each unit the table
lists the maximum number of slaves the unit can control at the given
SERVO_PERIOD setting.
/i
Servo Driver
Terminator
19
Cycle time Section 1-6
Servo Driver
Axis 16
Terminator
• 1x CJ1W-MCH72
• 16x Sigma-II Servo Driver
• 1x Encoder (Axis 16)
• SERVO_PERIOD = 4ms
20
Program control and multi-tasking Section 1-7
1-7-2 Processes
The low-priority process 0 is reserved for the Terminal window of Trajexia
Studio. This terminal window is used to write direct BASIC commands to the
CJ1W-MC@72 independent to other programs. These commands are
executed after you press the Enter button.
1-7-3 Multi-tasking
LT HT #1 HT #2 COMS.
Cycle time
Each cycle time is divided into 4 time slices called CPU tasks. Processes run
in the first 3 CPU tasks according to the priority of the process.
Motion sequence and low-priority processes (A) are executed in the Low Task
(LT) period.
High priority processes (B) are executed in the high Task (HT) periods.
A B
LT HT #1 HT #2 COMS.
Cycle time
External communication that are not related to the motion network are
updated in the communications (COMS) period in the fourth CPU task.
Trajexia can control up to 14 programs at the same time.
In contrast to low priority processes, a high priority process is always available
for execution during two of the four CPU tasks. The high-priority tasks are
executed faster than the low-priority tasks, it is that they have more time
available for their execution. All the low-priority tasks must share one slot of
time and the high-priority task have their own two slots of time.
21
Program control and multi-tasking Section 1-7
1ms
1 1ms 1ms 1ms
In the example 1, there are two high-priority processes, 13 and 14. The two HT
periods are reserved for these processes, one for processes 13 and one for
processes 14. The low-priority processes 3, 2, 1 and 0 are executed in the LT
period, one process per Cycle time here set to 1.0ms.
In the middle example, there is only one high-priority process, 14. Both HT
periods are reserved for this process. The low-priority processes, 3, 2, 1 and 0
are executed in the LT period, one process per cycle time.
In the lower example, there are no high-priority processes. Therefore, the HT
periods can be used for the low-priority processes. The LT period is also used
for the low-priority processes.
22
Motion sequence and axes Section 1-8
Measured
position
E
Motion sequence is the part of the CJ1W-MC@72 that controls the axes. The
actual way that the motion sequence operates depends on the axis type. The
axis type can be set and read by the parameter ATYPE. At start-up the
Trajexia system automatically detects the configuration of the axes.
• The default value for the parameter ATYPE for MECHATROLINK-II axes is
40 (MECHATROLINK-II position).
• The default value for the parameter ATYPE for the Encoder Interface is 44
(incremental encoder).
All non allocated axes are set as a virtual axis. The value for the parameter
ATYPE is 0.
Every axis has the general structure as shown in the illustration above .
The motion sequence which will be executed at the beginning of each servo
period will contain the following elements:
1 Transfer any moves from BASIC process buffers to motion buffers (see
section 1-9).
2 Read digital inputs.
3 Load moves. (See note.)
4 Calculate speed profile. (See note.)
5 Calculate axis positions. (See note.)
6 Execute position servo. For axis 0 this also includes the Servo Driver
communications. (See note.)
7 Update outputs.
Note: Each of these items will be performed for each axis in turn before moving on to the next
item.
23
Motion sequence and axes Section 1-8
Demand Position
The profile generator is the algorithm that calculates the demanded position
for each axis. The calculation is made every motion sequence.
The profile is generated according to the motion instructions from the BASIC
programs.
24
Motion sequence and axes Section 1-8
25
Motion sequence and axes Section 1-8
Profile generator
MEASURED = DEMAND
POSITION POSITION
You can split a complex profile into two or more simple movements, each
assigned to a virtual axis. These movements can be added together with the
BASIC command ADDAX then assigned to a real axis.
CJ1W-MC_72 SERVO
Torque Loop
Position loop
Position Loop is +
deactivated
(Gains are not _
used!) Demanded Following Speed
position error command
Measured
position
E M
With SERVO = ON, the position loop is closed in the Servo Driver. Gain
settings in the CJ1W-MC@72 have no effect. The position reference is sent to
the Servo Driver.
Note: Although MPOS and FE are updated, the real value is the value in the Servo Driver.
The real Following Error can be monitored by the DRIVE_MONITOR parameter by set-
ting DRIVE_CONTROL = 2.
26
Motion sequence and axes Section 1-8
CJ1W-MC_72 SERVO
Measured
position
E M
Measured
position
E M
With SERVO = ON, only the torque loop is closed in the Servo Driver. The
torque reference in the Servo Driver depends on the FE and the gain.
With SERVO = OFF, the torque reference is sent directly via the T_REF
command. 0x40000000 is the maximum torque of the servo motor.
27
Motion sequence and axes Section 1-8
CJ1W-MC_72
Measured
Position
With SERVO = OFF, the position of the external incremental encoder is read.
CJ1W-MC_72
Profile generator
AXIS 1 Demanded
ATYPE = 45 position
The position profile is generated and the output from the system is an
incremental encoder pulse. This is useful to control a motor via pulses or as a
position reference for another motion controller.
28
Motion sequence and axes Section 1-8
CJ1W-MC_72 INVERTER
Measured
position
DPRAM
REFRESH
EVERY 5ms
E M
The Speed command to the Inverter and the feedback from the encoder is
refreshed in the Inverter with a few milliseconds delay. This is an inverter
limitation. This means that the use of the Inverter is similar to the use of a
Servo Driver, but the performance is lower.
29
Motion sequence and axes Section 1-8
30
Motion buffers Section 1-9
AXIS BUFFER
(one per axis)
BASIC PROGRAM
Waiting to be executed
....... CONNECT(1,1) AXIS(2) NTYPE MOTION COMMAND
MOVE(-500)
....... PROCESS BUFFER
MOVE(1000)
....... MTYPE Currently executed
CONNECT(1,1) MOTION COMMAND
....... DEMAND
POSITION
Profile generator
The motion buffer is a temporary store of the motion instruction from the
BASIC program to the profile generator.
The BASIC program continues while the instruction waits in the buffer.
There are three types of buffer:
• MTYPE. The current movement that is being executed. MTYPE relates to
the axis and not to the process.
• NTYPE. The new movement that waits for execution. NTYPE relates to the
axis and not to the process.
• Process Buffer. The third buffered movement cannot be monitored. The
process buffer relates to the process and not to the axis.
Axis 15
Process 14 Program Buffer NTYPE MTYPE
Each process has its own Each Axis has its own
“Process Buffer” 2 buffers: NTYPE & MTYPE
31
Motion buffers Section 1-9
EXAMPLE:
BASIC PROGRAM
.......
MOVE(-500)
.......
BUFFER
MOVE(1000)
.......
DATUM(3) ---------------------------------
....... NTYPE IDLE 1.- All buffers are empty
MOVE(200) ---------------------------------
....... MTYPE MOVE(-500)
MOVE -500
and a movement is
----
loaded. The movement
BASIC PROGRAM starts to execute.
.......
MOVE(-500)
.......
BUFFER
MOVE(1000)
....... ----
DATUM(3)
.......
---------------------------------
NTYPE MOVE(1000)
2.- A second movement is
MOVE(200)
.......
--------------------------------- MOVE -500 loaded while the first one
MTY PE MOVE(-500)
is not finished.
The new movement waits in the
BASIC PROGRAM
....... second buffer.
MOVE(-500)
.......
BUFFER
MOVE(1000)
.......
DATUM(3)
DATUM(3)
---------------------------------
3.- A third movement can
.......
MOVE(200)
NTYPE MOVE(1000)
---------------------------------
still be stored in the process buffer.
MOVE -500
....... MTYPE MOVE(-500) If the basic program reaches
‘MOVE(200)’ it will wait.
BASIC PROGRAM
.......
MOVE(-500)
.......
BUFFER
MOVE(1000)
....... MOVE(200) 4.- The first movement has
DATUM(3)
.......
---------------------------------
NTYPE DATUM(3) finished. The buffer moves
MOVE(200)
.......
---------------------------------
MTYPE MOVE(1000)
MOVE -500 by one position .
The next movement starts to
MOVE 1000
execute.
BASIC PROGRAM
.......
MOVE(-500)
.......
BUFFER
MOVE(1000)
....... ------ 5.- As the sent
DATUM(3) ---------------------------------
....... NTYPE MOVE(200)
DATUM (3)
movements are finished,
MOVE(200)
.......
---------------------------------
MTYPE DATUM(3)
MOVE -500
the buffer empties.
MOVE 1000
BASIC PROGRAM
.......
MOVE(-500) BUFFER
.......
MOVE(1000)
6.- If no new movements
.......
DAT UM(3)
------ are executed,finally, the
---------------------------------
.......
MOVE(200)
NT YPE IDLE
DAT UM (3) MOVE 200
buffer will become empty
---------------------------------
....... MT YPE MOVE(200)
MOVE -500
and the profile generator
MOVE 1000 becomes inactive.
32
Mechanical system Section 1-10
1-10-2 Rigidity
If a machine is more rigid and less elastic, you can set higher gains without
vibration, and you can reach higher dynamic and lower Following Error.
33
Axis numbers Section 1-11
34
Unit components Section 2-1
SECTION 2
Installation and wiring
2-1 Unit components
The CJ1W-MC@72 Motion Control Unit has the following components:
MCH72 0
RUN
ERC
1
2
A
F ERH 3
WDOG 4
BF 5
6
7
OPEN
BATTERY
UNIT
No. B
C
MLK
E
I/O
D
Enc.
Label Description
A Status LED indicators
B Unit number selector switch
C MECHATROLINK-II connector
D Encoder connector
E I/O connector
F Battery compartment
35
Unit components Section 2-1
RUN
ERC
ERH
WDOG
BF
Status LEDs
/i
36
Unit components Section 2-1
UNIT
No.
2-1-3 Battery
The battery makes sure that the following RAM data is preserved when the
power supply is off:
• User programs
• VR variables
• Table memory
If the battery is not installed, or the battery voltage is too low, the RAM data is
lost when the power supply is off.
User programs, VR variables and TABLE memory can be stored into flash
memory, which do not need battery back up, on user request using the BASIC
commands EPROM and FLASHVR.
37
Unit components Section 2-1
When a low-battery error occurs, the battery can continue to function for 5
days if the ambient temperature is 25°C and if power is supplied to the PLC
system at least one time per day. If the power is not turned off until the battery
is replaced, the battery failure and the resulting loss of RAM data can be
delayed.
If the ambient temperature is more than 25°C, the battery can only continue for
less than 5 days. If the ambient temperature is 40°C, the battery can continue
for 4 days. If the ambient temperature is 55°C, the battery can continue for 2
days.
CJ1W-BAT01
08-03
Production date of the battery: March 2008.
• Make sure that the sensitive internal components of the CJ1W-MC@72
cannot be damaged by static electricity when the battery is replaced. This
can be done in two ways:
1 Turn the power off. (This is the recommended way.)
2 Leave the power on, and touch a grounded piece of metal to discharge
static electricity before replacing the battery.
• Make sure that an experienced technician is in charge when the battery is
replaced. This is required by UL standards.
Note: You must perform the following steps within 5 minutes. If you do not perform the steps
within 5 minutes, the RAM can be deleted.
3 Open the battery compartment.
4 Remove the old battery (A) from the battery compartment.
38
Unit components Section 2-1
B
A
!WARNING These actions can cause the battery to leak, burn or rupture, which can lead to fire,
injury, loss of property and death.
• Do not short-circuit the battery terminals.
• Do not charge the battery.
• Do not disassemble the battery.
• Do not heat the battery or set fire to the battery.
!WARNING Do not use a battery that is dropped on the floor or that is subjected to a shock. The
battery can leak.
39
Wiring Section 2-2
2-2 Wiring
2-2-1 I/O connector
The I/O connector is a 28-pin connector. Input 0 and input 1 can also be used
as registration inputs.
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
40
Wiring Section 2-2
2-2-1-1 Specifications
The table below shows the digital input specifications of input 0 to input 3 for
the I/O.
/i
Item Specification
Type NPN/PNP
Maximum voltage 24 VDC +10%
See footnote1
Input current 8 mA at 24 VDC
ON voltage 17 VDC min.
OFF voltage 5 VDC max.
Maximum response time 1250 s if the servo period equals 0.5 ms or 1.0 ms
2500 s if the servo period equals 2.0 ms
Registration response time 1 s typical
(Inputs 0 and 1)
Ambient operating temperature 0C to 55C
When all digital inputs are on: max. 45C
When max. 8 digital inputs are on: max. 55C
CJ1W-MCH72
I0 3
External power
supply 24V
COM 1
The table below shows the digital input specifications of input 4 to input 15 for
the I/O.
/i
Item Specification
Type NPN/PNP
Maximum voltage 24 VDC +10%
See footnote1
Input current 3.2 mA at 24 VDC
ON voltage 12 VDC min.
OFF voltage 5 VDC max.
Maximum response time 1250 s if the servo period equals 0.5 ms or 1.0 ms
2500 s if the servo period equals 2.0 ms
41
Wiring Section 2-2
Item Specification
Ambient operating temperature 0C to 55C
When all digital inputs are on: max. 45C
When max. 8 digital inputs are on: max. 55C
CJ1W-MCH72
I4 7
External power
supply 24V
COM 1
The table below shows the digital output specifications of output 8 to output 15
for the I/O.
/i
Item Specification
Type PNP
Maximum voltage 24 VDC +10%
See footnote1
Current capacity 100 mA for each output
800 mA in total for the group of 8 outputs
Protection Over current
Over temperature
2 A fuse on common
Maximum response time 250 s for ON, 350 s for OFF, if the servo period equals
0.5 ms or 1.0 ms
500 s for ON, 600 s for OFF, if the servo period equals
2.0 ms
150 s when the HW_PSWITCH is used
CJ1W-MCH72
Internal circuits (galvanically
2A Fuse
isolated from the system)
circuit
27 0Voutput
42
Wiring Section 2-2
5
9
4
8
3
7
2
6
1
1. With the VERIFY parameter the input type can be changed from phase
differential (VERIFY=ON, default) to Step (Channel A) and Direction
(Channel B) (VERIFY=OFF).
2-2-2-1 Specifications
The table below shows the specifications.
/i
Item Specification
Signal level EIA RS-422A Standards
Input impedance 48 k min.
Current capacity 20 mA
Termination None
Maximum response time registration 0.5 s
43
Wiring Section 2-2
CJ1W-MCH72
A+ /
STEP+ / 2
...
A- / 3
STEP- /
...
B+ /
DIR+ / 4
...
B- / 5
DIR- /
...
Z+ /
ENA+ / 7
...
Z- / 8
ENA- /
...
6
+5V +5V
0V 9 0V
By monitoring the relative phase of the 2 signals, you can easily detect the
rotation direction. If signal A leads signal B, the movement is clockwise and
the counter increments. If channel B leads channel A, the movement is
counterclockwise and the counter decrements.
Most rotary encodes also provide an additional Z marker. This Z marker is a
reference pulse within each revolution. With these 3 signals, you can
determine the direction, the speed and the relative position.
D E
A
0 1 2 3 4 5 6 7 7 6 5 4 3 2 1 0
C
Encoder edges
The figure shows phase A (A), phase B (B) and the number of counts (C) for
forward or clockwise rotation (D) and reverse or counterclockwise rotation (E).
The signals A, B and Z appear physically as A+ and A-, B+ and B- and Z+ and
Z-. They appear as differential signals on twisted-pair wire inputs. This makes
sure that common mode noise is rejected. When you use an encoder from
other manufacturers, check the encoder specification for the phase
44
Wiring Section 2-2
Note: The encoder interface of the CJ1W-MC@72 does not have termination inside. In case
of long distances or disturbed communication, add external termination to the interface.
2-2-3-2 Registration
When using the incremental encoder interface of the CJ1W-MC@72, the
CJ1W-MC@72 can capture the position of the Flexible Axis in a register when
an event occurs. The event is called the print registration input. On the rising
or falling edge of an input signal (either the Z marker or one of the first 2 digital
inputs), the CJ1W-MC@72 captures the position of the axis in the hardware.
You can use this position to correct possible errors between the actual position
and the desired position.
To set up the print registration, you can use the REGIST command. The
position is captured in the hardware, which means that there is no software
overhead. Therefore, you do not have to deal with timing issues.
For more information on how to use the registration inputs, refer to the
REGIST command in section 4-2-197.
CJ1W-MCH72
A+
2
A-
3
B+
4
B-
5
Z+
7
Z-
8
0 V (COM)
9
5 VDC
6
45
Wiring Section 2-2
0 1 2 3 4 5 6 7
Encoder edges
The CJ1W-MC@72 can generate encoder-type pulses. For each internal count
(C), the CJ1W-MC@72 produces one encoder edge for phase A (A) or phase
B (B).
46
Wiring Section 2-2
C
A
D E F
B 32 μs
G G
SSI pulses
When the data is clocked into the CJ1W-MC@72, the position value is
interpreted. With this position value, it produces a value for MPOS and a
position error that is used to close the control loop.
The connections for SSI are:
/i
Pin Signal
2 Clock+
3 Clock-
6 5V
7 Data+
8 Data-
9 0V
Note: The CJ1W-MC@72 encoder interface does not have a termination inside. In case of
long distances or disturbed communication, add an external termination to the inter-
face.
The table below and the figure give an example of how to connect the
Stegmann ATM 60-A encoder to the CJ1W-MC@72.
/i
47
Wiring Section 2-2
CJ1W-MCH72
2
7
10
8
3
2
11
3
1
9
8
24 V
0V
24 VDC Power Supply
2-2-4-2 EnDat
You can configure the CJ1W-MC@72 to interface directly to EnDat absolute
encoders. EnDat absolute encoders respond on a dedicated Clock and Data 1
MHz RS485 serial interface when their position is requested by the controller.
When you set the encoder to the relevant encoder mode, the axis transmits an
information request to the encoder on a fixed 250 μs cycle.
The connections for EnDat are:
/i
Pin Signal
2 Clock+
3 Clock-
6 5V
7 Data+
8 Data-
9 0V
Note: The CJ1W-MC@72 encoder interface does not have a termination inside. In case of
long distances or disturbed communication, add an external termination to the inter-
face.
The table below and the figure give an example of the connection of the
Heidenhain ROC 425 2048 5XS08-C4 encoder to the CJ1W-MC@72.
/i
48
Wiring Section 2-2
CJ1W-MCH72
3
7
4
8
7
2
6
3
5
9
2
1
5V
0V
5 VDC Power Supply
2-2-4-3 Stepper
The CJ1W-MC@72 can generate pulses to drive an external stepper motor
amplifier. You can use single step, half step and microstepping drivers with this
interface. The applicable signals are:
• Enable
• Step
• Direction
ENABLE
STEP
DIRECTION
WDOG=ON MOVE(4) MOVE(-4)
49
Installation Section 2-3
2-3 Installation
2-3-1 Hardware installation
!Caution Obey the following precautions when you install the CJ1W-MC@72 in a PLC system:
• Turn off the power supply to the PLC before the installation or connection of the
CJ1W-MC@72.
• Use separate conduits or ducts for the I/O lines. This prevents noise from high-
tension lines or power lines.
• Do not remove the label on top of the CJ1W-MC@72 during the installation and
wiring. The label makes sure that no foreign matter can enter the unit.
• Remove the label on top of the CJ1W-MC@72 after the installation and wiring of the
unit. This makes sure that the unit cannot become overheated.
End cover
PLC CPU rack 10 Units max.
P C I
S P C
U
End cover
Expansion Backplane 10 Units max.
P I
S I
End cover
Expansion Backplane 10 Units max.
P I
S I
P I
S I
Expansion racks
50
Installation Section 2-3
Note: The maximum current consumption of the CJ1W-MC@72 is 680 mA. Make sure that
the total current consumption of all units connected to the same CPU backplane or
expansion backplane is not greater than the output capacity of the Power Supply Unit.
To connect the CJ1W-MC@72 to the PLC, perform the following steps:
1 Align the connectors of the units.
Connector
P A205R
P OWE R SYSMAC R UN
E R R /ALM MCH72 R UN
CJ1G-C PU44 IN H ERC
0
1
P R OG R AMMAB LE ERH 2
P R P HL 3
C ONT R OLLE R WDOG
C OMM BF 4
5
6
7
OP E N
3 45 6 UNIT
EF 2
78 9A
01
NO.
B CD
MC P WR
L1 B US Y
AC 100-240V
IN P UT
L2/N
P E R IP HE R AL
R UN
OUT P UT
AC 240V
DC 24V
PORT
2 Move the yellow sliders at the top and bottom of the unit to the front.
3 Attach the CJ1W-MC@72 to the PLC.
4 Push the yellow sliders at the top and bottom of the unit to the rear to lock
them.
Note: If the sliders are not properly locked, it is possible that the unit does not operate cor-
rectly.
Note: Communication errors can occur in the Encoder Interface when Contact Output Units
are installed close to the CJ1W-MC@72. This is caused by noise generated by the Con-
tact Outputs.
If Contact Output Units and a CJ1W-MC@72 are installed on the same rack and com-
munication errors occur, do one of the following:
• Install the Contact Output Units at maximum distance from the CJ1W-MC@72.
• Use surge absorbers for the Contact Outputs.
2-3-2 Setup
After the installation of the unit in a PLC system, the following initial setup
procedure must be executed:
• A unique unit number must be set. Refer to section 2-3-2-1.
• An I/O table must be created in the PLC, to register the unit on the PLC
CPU. Refer to section 2-3-2-2.
This initial setup procedure makes sure that the unit can start up properly and
can be configured for operation.
51
Installation Section 2-3
Note: The unit reads the unit number during the initialization after a power up. It does not read
the unit number after a software reset. Thus, the power must always be turned off
before the unit number is set.
Note: If the unit number is set for the first time, or if the unit number is changed, an I/O table
must be created for the PLC system.
52
Installation Section 2-3
Initial screen
CH
SHIFT
*DM
CHG
WRIT ????
WRITE
Password
000000CPU BU ST?
0:CLR 1:KEEP
WRIT OK
Note: The Trajexia system supports 3 kinds of MECHATROLINK-II slaves: Servo Drivers,
Inverters and I/Os.
The CJ1W-MC@72 only supports 2 kinds of MECHATROLINK-II slaves: Servo Drivers
and Inverters. It does not support I/Os.
To connect MECHATROLINK-II slaves, use a MECHATROLINK-II cable for W-
series with ring core and USB connector on both ends. These cables are not
included.
The table below lists the MECHATROLINK-II cables.
/i
53
Installation Section 2-3
Note: For more details, refer to the Yaskawa Sigma-II Series SGDH MECHATROLINK-II
Application Module User Manual for model JUSP-NS115 (manual number
SIEPC71080001.
MECHATROLINK-II slaves can have a station address that ranges from 41
hex to 5F hex. These station addresses correspond to axis numbers 0 to 29.
54
Specifications Section 2-4
2-4 Specifications
2-4-1 Unit dimensions
48.75
90
65.3
70.7
Item Specification
Ambient operating temperature 0C to 55C
When all digital inputs are on: max. 45C
When max. 8 digital inputs are on: max. 55C
Ambient storage temperature 20C to 70C
Ambient operating humidity 10% to 90%RH
Ambient storage humidity 90% max. (without condensation)
Atmosphere No corrosive gases
Vibration resistance 10 to 57 Hz (0.075 mm amplitude)
57 to 100 Hz (Acceleration: 9,8 m/s2, in X, Y and
Z directions for 80 minutes)
Shock resistance 143 m/s2, 3 times each, X, Y and Z directions
Insulation resistance 20 M
Dielectric strength 500 V
Protective structure IP20
International standards CE, EN61131-2, RoHS compliant
Power supply 5 V (Supplied via PLC bus)
Current consumption 450 mA max. without external load
680 mA max. with maximum external load
55
Specifications Section 2-4
Item Specification
Maximum current ratings Incremental: 150 mA
Encoder Interface 5 V output SSI: 100 mA
EnDat: 80 mA
Stepper: 80 mA
Weight 180 gr
Item Specification
CJ1W-MCH72 CJ1W-MC472
Number of axes 32 4
Number of inverters Max. 8
Cycle time Selectable: 0.5 ms, 1 ms, 2 ms, 4 ms
Programming language BASIC-like motion language
Multi-tasking Max. 14 tasks running simultaneously
Built-in digital I/O 16 Inputs, 2 with registration functionality
8 Outputs, 1 with hardware position switch func-
tionality
Measurement units User-definable
Available memory for user pro- 756 - 1006 KB1
grams
Data storage capacity RAM memory: 1024 KB minus the size of the
user programs
VR memory: 4 KB
Saving program data (unit) SRAM with battery backup and Flash-ROM
Saving program data (PC) Trajexia Studio manages a backup on the hard
disk of the PC
Firmware update Via CX-Motion Pro/ / Trajexia Studio
1. The available memory for user programs depends on the size of the
Table memory, which is minimum 0 KB and maximum 250 KB.
Item Specification
CJ1W-MCH72 CJ1W-MC472
Electrical characteristics Conforms to the MECHATROLINK standard
Communication ports 1 MECHATROLINK-II master port
Transmission speed 10 Mbps
Communication cycle 0.5 ms, 1 ms, 2 ms, 4 ms
Slave types Servo Drivers
Frequency Inverters
Maximum number of nodes / cycle 30 nodes / 4 ms 12 nodes / 4 ms
time 16 nodes / 2 ms 12 nodes / 2 ms
8 nodes / 1 ms 8 nodes / 1 ms
56
Specifications Section 2-4
Item Specification
CJ1W-MCH72 CJ1W-MC472
Number of inverters in position 8 nodes / 4 ms 4 nodes / 4 ms
mode / Cycle time 8 nodes / 2 ms 4 nodes / 2 ms
8 nodes / 1 ms 4 nodes / 1 ms
Transmission distance Max. 50 meters without using repeater
Item Specification
Number of axes 1
Electrical characteristics EIA RS-422-A Standards (line-driver)
Control method Pulse Train output (open loop only)
Encoder position/speed feedback Incremental and absolute
Absolute encoder standards sup- SSI 200 kHz
ported EnDat 1 MHz
Encoder input maximum edge rate 6 M-edges/s
Encoder/pulse output maximum 2 M-edges/s
edge rate
Maximum cable length SSI 100 m max.
EnDat 40 m max.
Encoder input 100 m max.
Encoder/stepper output 100 m max.
57
Specifications Section 2-4
58
Introduction Section 3-1
SECTION 3
Data exchange
3-1 Introduction
The CJ1W-MC@72 can exchange data with memory areas in the PLC. This
enables the CJ1W-MC@72 to use the inputs and outputs connected to the
PLC. Also, programs in the CJ1W-MC@72 and PLC programs can exchange
control and status data.
Because the CJ1W-MC@72 can only access the input and output data via the
PLC, the data exchange requires an extra PLC cycle.
This section describes the issues related to cyclic data exchange.
59
Memory areas Section 3-2
EM VR IN
CIO OP
HR AOUT
WR
The PLC CPU uses the following memory areas for data exchange with the
CJ1W-MC@72:
• EM (Expanded Memory)
• CIO (Common I/O memory)
• DM (Data Memory)
• WR memory
• HR memory
The CJ1W-MC@72 uses the following memory areas to exchange data with
the PLC CPU:
• VR memory
• IN array (for digital inputs)
• OP array (for digital outputs)
• AIN array (for analogue inputs)
• AOUT array (for analogue outputs)
• Axis Status array (see section 3-3-2-1)
The mapping of memory areas for cyclic data exchange in the PLC CPU to
memory areas in the CJ1W-MC@72 can be freely configured. This can be
done in the PLC program or in the CJ1W-MC@72. It is recommended to
configure the memory mapping either in the startup program of the PLC or in
the startup program of the CJ1W-MC@72.
The memory mapping is not stored permanently and will be lost after a restart
of the CJ1W-MC@72 or a power cycle of the PLC system.
Note: Data exchange with the Table memory of the CJ1W-MC@72 is not possible. However,
with the FINS Write command you can write the Table memory of the CJ1W-MC@72.
60
Memory areas Section 3-2
61
Data Section 3-3
3-3 Data
Two types of data are exchanged during a data exchange:
• Control and status data
• Configurable data
62
Data Section 3-3
Status words n+3..n+13 return the status of the axes and processes of the
CJ1W-MC@72.
/i
63
Data Section 3-3
Digital and analogue inputs and outputs may not be physically present, which
makes them virtual and as such they can still be used in cyclic data exchange.
64
FINS commands Section 3-4
The FINS communications can be issued from a PLC CPU or a host computer,
and they can also be sent to any of these. The specific commands that can be
sent depend on the destination.
A FINS command is defined by its command code and its response code. A
command code is a 2-byte hexadecimal code. FINS commands always begin
with a 2-byte command code. The required parameters come after the
command code.
The response code is a 2-byte hexadecimal code that indicates the results of
the command execution. The first byte provides the main response code
(MRES), which classifies the results. The table below lists the MRES codes.
The second byte provides the sub-response code (SRES), which contains
details about the results.
/i
Note: If the FINS command was not completed normally, the 2-byte response code is not
equal to 0000. Also, the response frame does not contain any additional data. Data can
only be returned - depending on the command - when the response code is 0000.
The CJ1W-MC@72 supports the following FINS commands:
• Read (0101)
• Write (0102)
• Parameter Area Read (0201)
• Parameter Area Write (0202)
• Run (0401)
• Stop (0402)
65
FINS commands Section 3-4
01 01 .. .. .. 00 .. ..
command_code var_type start_address fixed element_count
01 01 00 00
command_code response_code word_1 word_2 ...
01 01 00 00
command_code response_code dword_1 ...
66
FINS commands Section 3-4
01 02 .. .. .. 00 .. .. .. .. .. ..
command_code var_ start_ fixed total_words word 1 ..
type address
• If var_type is C2 or F0:
/i
01 02 .. .. .. 00 .. .. .. .. .. .. ..
command_code var_type start_ fixed total_ dwords dword 1 ..
address
• If var_type is 30:
/i
01 02 30 .. .. 00 .. .. .. .. ..
command_code var_ start_ bit_ total_bits bit ..
type address num
Parameter Values
command_code 01 02
var_type • 82 (Table memory in 16-bit integer format)
• C2 (Table memory in 32-bit IEEE floating-point format)
• B0 (VR memory in 16-bit integer format)
• F0 (VR memory in 32-bit IEEE floating-point format)
• 30 (VR memory in bit format)
start_address 0 start_address memory size 1 FFFF
total_words 1 total_words memory size - start_address + 1
total_dwords 1 total_dwords memory size - start_address + 1
total_bits 1
bit 00 or 01
67
FINS commands Section 3-4
02 01 .. .. 00 00 00 08
command_code area_code start_address byte_count
If the response code is 0000, the CJ1W-MC@72 responds with the data
configured previously:
/i
02 01 00 00 .. .. 00 00 00 08 .. .. .. .. .. .. .. ..
command_ response_ area_ start_ byte_ plc_ plc_ tj_ tj_ total_
code code code address count area start area start items
Refer to section 3-4-4 for more information on the fields plc_area, plc_start,
tj_area, tj_start and total_items.
02 02 00 00 .. .. 00 00 00 08 .. .. .. .. .. .. .. ..
command_ response_ area_ start_ byte_ plc_ plc_ tj_ tj_ total_
code code code address count area start area start items
68
FINS commands Section 3-4
If the response code is 0000, the cyclic area number specified in area_code is
configured to exchange data between the PLC CPU and the CJ1W-MC@72.
Note: The first 16 entries in the IN array cannot be addressed in the memory
mapping. These first 16 entries map to the inputs available on the I/O
connector.
69
FINS commands Section 3-4
04 01 00 .. 01 .. ..
command_code process mode program_name
04 01 00 .. 00
command_code process mode
Parameter Values
mode • 00 (Stop)
• 01 (Start)
process 01..0E (Process number)
program_name A string that represents the program name
(The string does not have zero termination)
70
FINS commands Section 3-4
04 02 00 ..
command_code process
Parameter Values
process 01..0E (Process number)
Note: The FINS Stop command (0402) is equal to the FINS Run command (0401) where
mode is equal to 00.
21 10 00 ..
command_code process
Parameter Values
process 01..0E (Process number)
If the response code is 0000, the CJ1W-MC@72 responds with the error data:
/i
21 01 00 00 .. .. .. ..
command_code response_code error_line error_code
71
FINS commands Section 3-4
72
Categories Section 4-1
SECTION 4
BASIC commands
4-1 Categories
This section lists all BASIC commands divided by categories. The categories
are:
• Axis commands.
• Axis parameters.
• Communication commands and parameters.
• Constants.
• I/O commands, functions and parameters.
• Mathematical functions and operations.
• Program commands.
• Program control commands.
• Slot parameters and modifiers.
• System commands and functions.
• System parameters.
• Task commands and parameters.
The lists are quick reference guides only. A complete description of the
commands is given in alphabetical order in the next section.
Name Description
ACC Changes the ACCEL and DECEL at the same time.
ADD_DAC Sum to the S_REF value of one axis to the analogue out-
put of the base axis.
ADDAX Sets a link to a superimposed axis. All demand position
movements for the superimposed axis will be added to any
moves that are currently being executed.
B_SPLINE Expands the profile stored in TABLE memory using the B-
Spline mathematical function.
BACKLASH Allows the backlash compensation to be loaded.
BASE Used to set the base axis to which the commands and
parameters are applied.
CAM Moves an axis according to values of a movement profile
stored in the TABLE variable array.
CAMBOX Moves an axis according to values of a movement profile
stored in the TABLE variable array. The motion is linked to
the measured motion of another axis to form a continu-
ously variable software gearbox.
CANCEL Cancels the move on an axis.
CONNECT Connects the demand position of an axis to the measured
movements of the axis specified for driving_axis to pro-
duce an electronic gearbox.
DATUM Performs one of 7 origin search sequences to position an
axis to an absolute position or reset a motion error.
DEFPOS Defines the current position as a new absolute position.
73
Categories Section 4-1
Name Description
DISABLE_GROUP Groups axes together for error disabling.
DRIVE_ALARM Monitors the current alarm.
DRIVE_CLEAR Clears the alarm status of the Servo Driver.
DRIVE_READ Reads the specified parameter of the Servo Driver.
DRIVE_RESET Resets the Servo Driver.
DRIVE_WRITE Writes a specific value to the specified parameter of the
Servo Driver.
FORWARD Moves an axis continuously forward at the speed set in the
SPEED parameter.
HW_PSWITCH Sets on and off the hardware switch on output 0 of the
Encoder Interface when predefined positions are reached.
MECHATROLINK Initializes MECHATROLINK-II bus and performs various
operations on MECHATROLINK-II stations connected to
the bus.
MHELICAL Interpolates 3 orthogonal axes in a helical move.
MOVE Moves one or more axes at the demand speed, accelera-
tion and deceleration to the position specified as increment
from the current position.
MOVEABS Moves one or more axes at the demand speed, accelera-
tion and deceleration to the position specified as absolute
position.
MOVECIRC Interpolates 2 orthogonal axes in a circular arc.
MOVELINK Creates a linear move on the base axis linked via a soft-
ware gearbox to the measured position of a link axis.
MOVEMODIFY Changes the absolute end position of the current single-
axis linear move (MOVE or MOVEABS).
RAPIDSTOP Cancels the current move on all axes.
REGIST Captures an axis position when a registration input or the Z
mark on the encoder is detected.
REVERSE Moves an axis continuously in reverse at the speed set in
the SPEED parameter.
STEP_RATIO Sets the ratio for the axis stepper output.
Name Description
ACCEL Contains the axis acceleration rate.
ADDAX_AXIS Contains the number of the axis to which the base axis is
currently linked to by ADDAX.
ATYPE Contains the axis type.
AXIS_ENABLE Enables and disables particular axis independently of other
axis.
AXISSTATUS Contains the axis status.
BACKLASH_DIST Defines the amount of backlash compensation.
74
Categories Section 4-1
Name Description
CLOSE_WIN Defines the end of the window in which a registration mark
is expected.
CLUTCH_RATE Defines the change in connection ratio when using the
CONNECT command.
CREEP Contains the creep speed.
D_GAIN Contains the derivative control gain.
DATUM_IN Contains the input number to be used as the origin input.
DECEL Contains the axis deceleration rate.
DEMAND_EDGES Contains the current value of the DPOS axis parameter in
encoder edges.
DPOS Contains the demand position generated by the move
commands.
DRIVE_CONTROL Selects data to be monitored using DRIVE_MONITOR for
axes connected via the MECHATROLINK-II bus. For axes
connected via the Encoder Interface, DRIVE_CONTROL
sets outputs of the Encoder Interface.
DRIVE_INPUTS Holds I/O data of the driver connected to MECHA-
TROLINK-II bus. Data is updated every servo cycle.
DRIVE_MONITOR Monitors data of the Servo Driver connected to MECHA-
TROLINK-II bus. Data are updated every servo cycle.
DRIVE_STATUS Contains the current status of the Servo Driver.
ENCODER Contains a raw copy of the encoder hardware register.
ENCODER_BITS Sets the number of bits for the absolute encoder con-
nected to the Encoder Interface.
ENCODER_CONTROL Controls operating mode of the EnDat absolute encoder.
ENCODER_RATIO Sets scaling value for incoming encoder counts.
ENCODER_TURNS Returns the multi-turn count of the absolute encoder.
ENDMOVE Holds the position of the end of the current move.
ERRORMASK Contains the mask value that determines if
MOTION_ERROR occurs depending on the axis status.
FAST_JOG Contains the input number to be used as the fast jog input.
FASTDEC Defines ramp to zero deceleration ratio when an axis limit
switch or position is reached.
FE Contains the Following Error.
FE_LATCH Contains the FE value which caused the axis to put con-
troller in MOTION_ERROR state.
FE_LIMIT Contains the maximum allowable Following Error.
FE_LIMIT_MODE Defines how FE influences MOTION_ERROR state.
FE_RANGE Contains the Following Error warning range limit.
FHOLD_IN Contains the input number to be used as the feedhold
input.
FHSPEED Contains the feedhold speed.
75
Categories Section 4-1
Name Description
FS_LIMIT Contains the absolute position of the forward software
limit.
FWD_IN Contains the input number to be used as a forward limit
input.
FWD_JOG Contains the input number to be used as a jog forward
input.
I_GAIN Contains the integral control gain.
INVERT_STEP Switches a hardware Inverter into the stepper output cir-
cuit.
JOGSPEED Sets the jog speed.
MARK Detects the primary registration event on a registration
input.
MARKB Detects the secondary registration event on a registration
input.
MERGE Is a software switch that can be used to enable or disable
the merging of consecutive moves.
MPOS Is the position of the axis as measured by the encoder.
MSPEED Represents the change in the measured position in the last
servo period.
MTYPE Contains the type of move currently being executed.
NTYPE Contains the type of the move in the Next Move buffer.
OFFPOS Contains an offset that will be applied to the demand posi-
tion without affecting the move in any other way.
OPEN_WIN Defines the beginning of the window in which a registration
mark is expected.
OUTLIMIT Contains the limit that restricts the speed reference output
from the CJ1W-MC@72.
OV_GAIN Contains the output velocity control gain.
P_GAIN Contains the proportional control gain.
REG_POS Contains the position at which a registration event
occurred.
REG_POSB Contains the position at which the secondary registration
event occurred.
REMAIN Is the distance remaining to the end of the current move.
REP_DIST Contains or sets the repeat distance.
REP_OPTION Controls the application of the REP_DIST axis parameter.
REV_IN Contains the input number to be used as a reverse limit
input.
REV_JOG Contains the input number to be used as a jog reverse
input.
RS_LIMIT Contains the absolute position of the reverse software
limit.
S_REF Contains the speed reference value which is applied when
the axis is in open loop.
76
Categories Section 4-1
Name Description
S_REF_OUT Contains the speed reference value being applied to the
Servo Driver for both open as closed loop.
SERVO Determines whether the axis runs under servo control or
open loop.
SPEED Contains the demand speed in units/s.
SPEED_SIGN Configures the voltage range of the analogue speed refer-
ence output of the Encoder Interface.
SRAMP Contains the S-curve factor.
T_REF Contains the torque reference value which is applied to the
servo motor.
TRANS_DPOS Contains axis demand position at output of frame transfor-
mation.
UNITS Contains the unit conversion factor.
VERIFY Selects different modes of operation on a stepper output
axis.
VFF_GAIN Contains the speed feed forward control gain.
VP_SPEED Contains the speed profile speed.
Name Description
FINS_COMMS Sends FINS Read Memory and Write Memory to a desig-
nated FINS server unit.
4-1-4 Constants
/i
Name Description
FALSE Equal to the numerical value 0.
OFF Equal to the numerical value 0.
ON Equal to the numerical value 1.
PI Equal to the numerical value 3.1416.
TRUE Equal to the numerical value -1.
77
Categories Section 4-1
Name Description
AIN Holds the value of the analogue channel.
AOUT Holds the value of the analogue channel.
GET Waits for the arrival of a single character and assigns the
ASCII code of the character to variable.
IN Returns the value of digital inputs.
OP Sets one or more outputs or returns the state of the first 24
outputs.
PRINT Outputs a series of characters to a serial port.
PSWITCH Turns on an output when a predefined position is reached,
and turns off the output when a second position is reached.
READ_OP Returns the value of the digital outputs.
Name Description
+ (ADDITION) Adds two expressions.
- (SUBTRACTION) Subtracts two expressions.
* (MULTIPLICATION) Multiplies two expressions.
/ (DIVISION) Divides two expressions.
^ (POWER) Takes the power of one expression to the other expres-
sion.
= (IS EQUAL TO) Checks two expressions to see if they are equal.
= (ASSIGNMENT) Assigns an expression to a variable.
<> (IS NOT EQUAL Checks two expressions to see if they are different.
TO)
> (IS GREATER THAN) Checks two expressions to see if the expression on the left
is greater than the expression on the right.
>= (IS GREATER Checks two expressions to see if the expression on the left
THAN OR EQUAL TO) is greater than or equal to the expression on the right.
< (IS LESS THAN) Checks two expressions to see if the expression on the left
is less than the expression on the right.
<= (IS LESS THAN OR Checks two expressions to see if the expression on the left
EQUAL TO) is less than or equal to the expression on the right.
ABS Returns the absolute value of an expression.
ACOS Returns the arc-cosine of an expression.
AND Performs an AND operation on corresponding bits of the
integer parts of two expressions.
ASIN Returns the arc-sine of an expression.
ATAN Returns the arc-tangent of an expression.
ATAN2 Returns the arc-tangent of the non-zero complex number
made by two expressions.
78
Categories Section 4-1
Name Description
COS Returns the cosine of an expression.
EXP Returns the exponential value of an expression.
FRAC Returns the fractional part of an expression.
IEEE_IN Returns floating point number in IEEE format, represented
by 4 bytes.
IEEE_OUT Returns single byte extracted from the floating point num-
ber in IEEE format.
INT Returns the integer part of an expression.
LN Returns the natural logarithm of an expression.
MOD Returns the modulus of two expressions.
NOT Performs a NOT operation on corresponding bits of the
integer part of the expression.
OR Performs an OR operation between corresponding bits of
the integer parts of two expressions.
SGN Returns the sign of an expression.
SIN Returns the sine of an expression.
SQR Returns the square root of an expression.
TAN Returns the tangent of an expression.
XOR Performs an XOR function between corresponding bits of
the integer parts of two expressions.
Name Description
' (COMMENT FIELD) Enables a line not to be executed.
: (STATEMENT SEPARATOR) Enables more statements on one line.
AUTORUN Starts all the programs that have been set to run at
start-up.
COMPILE Compiles the current program.
COPY Copies an existing program in the motion control-
ler to a new program.
DEL Deletes a program from the motion controller.
DIR Displays a list of the programs in the motion con-
troller, their size and their RUNTYPE on the stand-
ard output.
EDIT Allows a program to be modified using a VT100
Terminal.
EPROM Stores a program in the flash memory.
LIST Prints the program on the standard output.
NEW Deletes all lines of the program in the motion con-
troller.
PROCESS Returns the running status and task number for
each current task.
79
Categories Section 4-1
Name Description
RENAME Changes the name of a program in the motion
controller.
RUN Executes a program.
RUNTYPE Determines if a program is run at start-up, and
which task it is to run on.
SELECT Specifies the current program.
STEPLINE Executes a single line in a program.
STOP Halts program execution.
TROFF Suspends a trace at the current line and resumes
normal program execution.
TRON Creates a breakpoint in a program.
Name Description
FOR..TO..STEP..NEXT Loop allows a program segment to be repeated with
increasing/decreasing variable.
GOSUB..RETURN Jumps to a subroutine at the line just after label. The pro-
gram execution returns to the next instruction after a
“RETURN” on page 235 is given.
GOTO Jumps to the line containing the label.
IF..THEN..ELSE..ENDIF Controls the flow of the program base on the results of the
condition.
ON.. GOSUB or ON.. Enables a conditional jump to one of several labels.
GOTO
REPEAT..UNTIL Loop allows the program segment to be repeated until the
condition becomes “TRUE” on page 257.
WHILE..WEND Loop allows the program segment to be repeated until the
condition becomes FALSE.
Name Description
ALL Is a modifier that specifies that all items in the controller
are concerned.
FPGA_VERSION Returns the FPGA version.
80
Categories Section 4-1
Name Description
$ (HEXADECIMAL INPUT) Assigns a hexadecimal number to a variable.
AXIS Sets the axis for a command, axis parameter read, or
assignment to a particular axis.
BASICERROR Is used to run a specific routine when an error occurs in
a BASIC command.
CLEAR Clears all global variables and the local variables on
the current task.
CLEAR_BIT Clears the specified bit of the specified VR variable.
CLEAR_PARAMS Clears all parameter sand variables stored in flash
EPROM to their default values.
CONSTANT Declares a constant for use in BASIC program.
DATE$ Prints the current date as a string.
EX Resets the controller.
FLAG Sets and reads a bank of 32 bits.
FLAGS Read and sets FLAGS as a block.
FLASHVR Stores TABLE variable data in the flash memory.
FREE Returns the amount of available memory.
GLOBAL Declares a reference to one of VR variables.
HALT Stops execution of all programs currently running.
INITIALISE Sets all axes and parameters to their default values.
INTEGER_READ Splits a 32 bit variable in 2 16 bit values and copies
these values to 2 other variables.
INVERT_IN Inverts input channels 0 - 31 in the software.
INVERTER_COMMAND Reads I/O and clears alarm of the Inverter.
INVERTER_READ Reads parameter, alarm, speed and torque reference
of the Inverter.
INVERTER_WRITE Writes to parameter, speed and torque reference of the
Inverter.
LIST_GLOBAL Shows all GLOBAL and CONSTANT variables.
LOCK Prevents the programs from being viewed or modified.
PLC_EXCHANGE Reads or sets the mapping of PLC memory to CJ1W-
MC@72 memory.
READ_BIT Returns the value of the specified bit in the specified
VR variable.
RESET Resets all local variables on a task.
SCOPE Programs the system to automatically store up to 4
parameters every sample period to the TABLE variable
array.
SET_BIT Sets the specified bit in the specified VR variable to
one.
81
Categories Section 4-1
Name Description
TABLE Writes and reads data to and from the TABLE variable
array.
TABLEVALUES Returns list of values from the TABLE memory.
TIME$ Prints the current time as a string.
TRIGGER Starts a previously set SCOPE command.
VR Writes and reads data to and from the global (VR) vari-
ables.
VRSTRING Combines VR memory values so they can be printed
as a string.
WA Holds program execution for the number of millisec-
onds specified.
WAIT IDLE Suspends program execution until the base axis has
finished executing its current move and any buffered
move.
WAIT LOADED Suspends program execution until the base axis has
no moves buffered ahead other than the currently exe-
cuting move.
WAIT UNTIL Repeatedly evaluates the condition until it is TRUE.
Name Description
BATTERY_LOW Returns the current status of the battery condition.
CHECKSUM Contains the checksum for the programs in RAM.
CONTROL Contains the type of controller in the system.
D_ZONE_MAX Controls the S_REF output in conjunction with the Follow-
ing Error value.
D_ZONE_MIN Controls the S_REF output in conjunction with the Follow-
ing Error value.
DATE Sets or returns the current date held by the real time clock.
ERROR_AXIS Contains the number of the axis which caused the motion
error.
FRAME Specifies operating frame for frame transformations.
LAST_AXIS Contains the number of the last axis processed by the sys-
tem.
MOTION_ERROR Contains an error flag for axis motion errors.
NEG_OFFSET Applies a negative offset to the S_REF signal from the
servo loop.
PLC_STATUS Contains the PLC status.
POWER_UP Determines whether programs should be read from flash
EPROM on power up or reset.
POS_OFFSET Applies a positive offset to the S_REF signal from the
servo loop.
82
Categories Section 4-1
Name Description
SCOPE_POS Contains the current TABLE position at which the SCOPE
command is currently storing its first parameter.
SERVO_PERIOD Sets the servo cycle period of the CJ1W-MC@72.
SYSTEM_ERROR Contains the system errors since the last initialization.
TIME Returns the current time held by the real time clock.
TSIZE Returns the size of the currently defined Table.
VERSION Returns the version number of the controller firmware.
WDOG The software switch that enables Servo Drivers.
Name Description
ERROR_LINE Contains the number of the line which caused the last
BASIC program error.
PMOVE Contains the status of the task buffers.
PROC Lets a process parameter from a particular process to be
accessed.
PROC_STATUS Returns the status of the process specified.
PROCNUMBER Contains the number of the task in which the currently
selected program is running.
RUN_ERROR Contains the number of the last BASIC error that occurred
on the specified task.
TICKS Contains the current count of the task clock pulses.
83
All BASIC commands Section 4-2
4-2-2 - (Subtraction)
/i
4-2-3 * (Multiplication)
/i
84
All BASIC commands Section 4-2
4-2-4 / (Division)
/i
4-2-5 ^ (Power)
/i
85
All BASIC commands Section 4-2
4-2-7 = (Assignment)
/i
86
All BASIC commands Section 4-2
87
All BASIC commands Section 4-2
88
All BASIC commands Section 4-2
4-2-16 #
/i
4-2-17 ABS
/i
4-2-18 ACC
/i
89
All BASIC commands Section 4-2
4-2-19 ACCEL
/i
4-2-20 ACOS
/i
4-2-21 ADD_DAC
/i
DAC
AXIS m
SERVO = OFF
ADD_DAC(n) AXIS(m):
Position loop
Final speed reference in AXIS(n) =
+ + DAC_OUT AXIS(m) + DAC_OUT AXIS(n)
_ SERVO = ON +
Demanded Following Speed
position error command
Measured
position
DAC
AXIS n
SERVO = OFF
Position loop
+
_ SERVO = ON
Measured
position
90
All BASIC commands Section 4-2
/i
Description The ADD_DAC command adds the S_REF_OUT value of axis to the
S_REF_OUT value of the base axis. Use ADD_DAC(-1) to cancel the
sum.
ADD_DAC works on the default basis axis (set with BASE) unless
AXIS is used to specify a temporary base axis.
Note:
1 Be aware that the control loop gains for both axes need to be deter-
mined with care. As different encoders with different resolutions are
used, the gains are not identical.
2 Set the OUTLIMIT parameter to the same value for both linked
axes.
3 This command has no meaning for a MECHATROLINK-II axis in
position mode (ATYPE=40), because the value of S_REF_OUT is
ignored.
Arguments • axis
The axis from which to sum the speed reference output to the base
axis. Set the argument to -1 to cancel the link and return to normal
operation.
Example No example.
See also AXIS, S_REF_OUT, OUTLIMIT
4-2-22 ADDAX
/i
91
All BASIC commands Section 4-2
/i
R AXIS 0
MOTOR
AXIS 0
ENCODER
AXIS 2
92
All BASIC commands Section 4-2
/i
Example Pieces are placed randomly onto a belt that moves continuously. Fur-
ther along the line they are transferred to a second flighted belt. A
detection system indicates if a piece is in front of or behind its nominal
position, and how far.
expected=2000 ' sets expected position
BASE(0)
ADDAX(1)
CONNECT(1,2) ' continuous geared connection to flighted belt
REPEAT
GOSUB getoffset ' get offset to apply
MOVE(offset) AXIS(1) ' make correcting move on virtual axis
UNTIL IN(2)=OFF ' repeat until stop signal on input 2
RAPIDSTOP
ADDAX(-1) ' clear ADDAX connection
STOP
getoffset: ' sub routine to register the position of the
' piece and calculate the offset
BASE(0)
REGIST(3)
WAIT UNTIL MARK
seenat=REG_POS
offset=expected-seenat
RETURN
Axis 0 in this example is connected to the encoder of the second con-
veyor. A superimposed MOVE on axis 1 is used to apply offsets.
AXIS 0 AXIS 1
R AXIS 0
ENCODER
AXIS 2
93
All BASIC commands Section 4-2
/i
Example An X-Y marking machine must mark boxes as they move along a con-
veyor. Using CONNECT enables the X marking axis to follow the con-
veyor. A virtual axis is used to program the marking absolute positions;
this is then superimposed onto the X axis using ADDAX.
ATYPE AXIS(3)=0 'set axis 3 as virtual axis
SERVO AXIS(3)=ON
DEFPOS(0) AXIS(3)
ADDAX (3)AXIS(0) 'connect axis 3 requirement to axis 0
WHILE IN(2)=ON
REGIST(3) 'registration input detects a box on the conveyor
WAIT UNTIL MARK OR IN(2)=OFF
IF MARK THEN
CONNECT(1,2) AXIS(0)'connect axis 0 to the moving belt
BASE(3,1) 'set the drawing motion to axis 3 and 1
'Draw the M
MOVEABS(1200,0)'move A > B
MOVEABS(600,1500)'move B > C
MOVEABS(1200,3000)' move C > D
MOVEABS(0,0)'move D > E
WAIT IDLE
BASE(0)
CANCEL 'stop axis 0 from folowing the belt
WAIT IDLE
MOVEABS(0) 'move axis 0 to home position
ENDIF
WEND
CANCEL
See also ADDAX_AXIS, AXIS, OUTLIMIT
!WARNING Beware that giving several ADDAX commands in a system can create a dangerous
loop when for instance one axis is linked to another and vice versa. This may cause
instability in the system.
4-2-23 ADDAX_AXIS
/i
94
All BASIC commands Section 4-2
4-2-24 AIN
/i
4-2-25 ALL
/i
95
All BASIC commands Section 4-2
4-2-26 AND
/i
4-2-27 AOUT
/i
96
All BASIC commands Section 4-2
4-2-28 ASIN
/i
4-2-29 ATAN
/i
4-2-30 ATAN2
/i
97
All BASIC commands Section 4-2
4-2-31 ATYPE
/i
The ATYPE parameters are set by the system at start-up. For axes con-
trolled by the Servo Drivers connected to the system via MECHA-
TROLINK-II bus, the default ATYPE value is 40 (MECHATROLINK-II
Position) for all Servo Driver types. For axes controlled by the Servo
Drivers connected to the system via the Encoder Interface, the default
ATYPE value is 44 (Encoder Interface In).
Arguments N/A
Example ATYPE AXIS(1) = 45
This command will set axis 1 as Flexible axis encoder output axis.
See also AXIS
4-2-32 AUTORUN
/i
Note: This command should only be used on the Command Line Termi-
nal.
Arguments N/A
Example No example.
See also RUNTYPE
98
All BASIC commands Section 4-2
4-2-33 AXIS
/i
4-2-34 AXIS_ENABLE
/i
99
All BASIC commands Section 4-2
4-2-35 AXISSTATUS
/i
Arguments N/A
Example IF (AXISSTATUS AND 16)>0 THEN PRINT "In forward limit"
See also AXIS, ERRORMASK
100
All BASIC commands Section 4-2
4-2-36 B_SPLINE
/i
101
All BASIC commands Section 4-2
4-2-37 BACKLASH
/i
4-2-38 BACKLASH_DIST
/i
102
All BASIC commands Section 4-2
4-2-39 BASE
/i
Note: If the BASE command does not specify all the axes, the BASE
command will “fill in” the remaining values automatically. Firstly it will fill
in any remaining axes above the last declared value, then it will fill in
any remaining axes in sequence.
So BASE(2,6,10) sets the internal array of 32 axes to:
2,6,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
31,0,1,3,4,5,7,8,9.
Note: The BASE command without any arguments should only be used
on the Command Line Terminal.
Arguments The command can take up to 32 arguments.
• axis_i
The number of the axis set as the base axis and any subsequent
axes in the group order for multi-axis moves.
Example BASE(1)
UNITS = 2000 ' Set unit conversion factor for axis 1
SPEED = 100 ' Set speed for axis 1
ACCEL = 5000 ' Set acceleration rate for axis 1
BASE(2)
UNITS = 2000 ' Set unit conversion factor for axis 2
SPEED = 125 ' Set speed for axis 2
ACCEL = 10000 ' Set acceleration rate for axis 2
It is possible to program each axis with its own speed, acceleration and
other parameters.
Example BASE(0)
MOVE(100,-23.1,1250)
In this example, axes 0, 1 and 2 will move to the specified positions at
the speed and acceleration set for axis 0. BASE(0) sets the base axis to
axis 0, which determines the three axes used by MOVE and the speed
and acceleration rate.
103
All BASIC commands Section 4-2
4-2-40 BASICERROR
/i
4-2-41 BATTERY_LOW
/i
104
All BASIC commands Section 4-2
4-2-42 BREAK_RESET
/i
4-2-43 CAM
/i
105
All BASIC commands Section 4-2
Arguments • start_point
The address of the first element in the TABLE array to be used.
Being able to specify the start point allows the TABLE array to hold
more than one profile and/or other information.
• end_point
The address of the end element in the TABLE array.
• table_multiplier
The Table multiplier value used to scale the values stored in the
TABLE. As the Table values are specified in encoder edges, use this
argument to set the values for instance to the unit conversion factor
(set by UNITS parameter).
• distance
A factor given in user units that controls the speed of movement
through the Table. The time taken to execute CAM depends on the
current axis speed and this distance. For example, assume the sys-
tem is being programmed in mm and the speed is set to 10 mm/s
and the acceleration sufficiently high. If a distance of 100 mm is
specified, CAM will take 10 seconds to execute.
The SPEED parameter in the base axis allows modification of the
speed of movement when using the CAM move.
106
All BASIC commands Section 4-2
/i
107
All BASIC commands Section 4-2
OP(15)
TRIGGER
LASER
MOTOR
/i
Example A masked wheel is used to create a stencil for a laser to shine through
for use in a printing system for the ten numerical digits. The required
digits are transmitted through port 1 serial port to the controller as ASCII
text.
The encoder used has 4000 edges per revolution and so must move
400 between each position. The cam table goes from 0 to 1, which
means that the CAM multiplier needs to be a multiple of 400 to move
between the positions.
The wheel is required to move to the pre-set positions every 0.25 sec-
onds. The speed is set to 10000 edges/second, and we want the profile
to be complete in 0.25 seconds. So multiplying the axis speed by the
required completion time (10000 x 0.25) gives the distance parameter
equals 2500.
GOSUB profile_gen
WHILE IN(2)=ON
WAIT UNTIL KEY#1 'Waits for character on port 1
GET#1,k
IF k>47 AND k<58 THEN 'check for valid ASCII character
position=(k-48)*400 'convert to absolute position
multiplier=position-offset 'calculate relative movement
'check if it is shorter to move in reverse direction
IF multiplier>2000 THEN
multiplier=multiplier-4000
ELSEIF multiplier<-2000 THEN
multiplier=multiplier+4000
ENDIF
CAM(0,200,multiplier,2500) 'set the CAM movment
WAIT IDLE
OP(15,ON) 'trigger the laser flash
WA(20)
OP(15,OFF)
offset=(k-48)*400 'calculates current absolute position
ENDIF
WEND
108
All BASIC commands Section 4-2
profile_gen:
num_p=201
scale=1.0
FOR p=0 TO num_p-1
TABLE(p,((-SIN(PI*2*p/num_p)/(PI*2))+p/num_p)*scale)
NEXT p
RETURN
Example A suction pick and place system must vary its speed depending on the
load carried. The mechanism has a load cell which inputs to the control-
ler on the analogue channel (AIN).
The move profile is fixed, but the time taken to complete this move must
be varied depending on the AIN. The AIN value varies from 100 to 800,
which must result in a move time of 1 to 8 seconds. If the speed is set to
10000 units per second and the required time is 1 to 8 seconds, then the
distance parameter must range from 10000 to 80000. (distance = speed
x time).
The return trip can be completed in 0.5 seconds and so the distance
value of 5000 is fixed for the return movement. The Multiplier is set to -1
to reverse the motion.
GOSUB profile_gen 'loads the cam profile into the table
SPEED=10000:ACCEL=SPEED*1000:DECEL=SPEED*1000
WHILE IN(2)=ON
OP(15,ON) 'turn on suction
load=AIN(0) 'capture load value
distance = 100*load 'calculate the distance parameter
CAM(0,200,50,distance) 'move 50mm forward in time calculated
WAIT IDLE
OP(15,OFF) 'turn off suction
WA(100)
CAM(0,200,-50,5000) 'move back to pick up position
WEND
profile_gen:
num_p=201
scale=400 'set scale so that multiplier is in mm
FOR p=0 TO num_p-1
TABLE(p,((-SIN(PI*2*p/num_p)/(PI*2))+p/num_p)*scale)
NEXT p
RETURN
See also ACCEL, AXIS, CAMBOX, SPEED, TABLE.
109
All BASIC commands Section 4-2
4-2-44 CAMBOX
/i
link_option Description
value
1 Link starts when registration event occurs on link axis.
2 Link starts at an absolute position on link axis (see link_position).
110
All BASIC commands Section 4-2
link_option Description
value
4 CAMBOX repeats automatically and bidirectionally. This option is
cancelled by setting bit 1 of REP_OPTION parameter
(REP_OPTION = REP_OPTION OR 2).
5 Combination of options 1 and 4.
6 Combination of options 2 and 4.
/i
• link_position
The absolute position where CAMBOX will start when link_option
is set to 2.
Note: When the CAMBOX command is executing, the ENDMOVE
parameter is set to the end of the previous move. The REMAIN axis
parameter holds the remainder of the distance on the link axis.
/i
111
All BASIC commands Section 4-2
MOTOR
AXIS 0
/i
Example A pair of rollers feeds plastic film into a machine. The feed is synchro-
nised to a master encoder and is activated when the master reaches a
position held in the variable start. This example uses the table points
0...30 generated in the example above:
start=1000
FORWARD AXIS(1)
WHILE IN(2)=OFF
CAMBOX(0,30,800,80,15,2,start)
WA(10)
WAIT UNTIL MTYPE=0 OR IN(2)=ON
WEND
CANCEL
CANCEL AXIS(1)
WAIT IDLE
The arguments of the CAMBOX command are:
• 0 is the start of the profile shape in the TABLE
• 30 is the end of the profile shape in the TABLE
• 800 scales the TABLE values. Each CAMBOX motion therefore
totals 800*2000 encoder edges steps.
• 80 is the distance on the product conveyor to link the motion to. The
units for this parameter are the programmed distance units on the
link axis.
• 15 specifies the axis to link to.
• 2 is the link option setting. It means: Start at absolute position on the
link axis.
• The variable start holds a position. The motion will execute when
this position is reached on axis 15.
112
All BASIC commands Section 4-2
/i
113
All BASIC commands Section 4-2
/i
114
All BASIC commands Section 4-2
AXIS 0
AXIS 1
115
All BASIC commands Section 4-2
/i
Example A quilt stitching machine runs a feed cycle that stitches a plain pattern
before it starts a patterned stitch. The plain pattern must run for 1000
cycles. Then, it must runs a pattern continuously, until requested to stop
at the end of the pattern. The cam profile controls the motion of the nee-
dle bar between moves. The pattern table controls the distance of the
move to make the pattern.
The same shape is used for the initialisation cycles and the pattern. This
shape is held in TABLE values 100..150. The running pattern sequence
is held in TABLE values 1000..4999. The initialisation pattern is a single
value held in TABLE(160). The initialisation control block is held in
TABLE(200)..TABLE(206). The running control block is held in
TABLE(300)..TABLE(306).
' Set up Initialisation control block:
TABLE(200,160,-1,160,160,0,1000,300)
' Set up running control block:
TABLE(300,1000,-1,1000,4999,0,-1,-1)
' Run whole lot with single CAMBOX:
' Third parameter is pointer to first control block
CAMBOX(100,150,200,5000,1,20)
WAIT UNTIL IN(7)=OFF
TABLE(305,0) ' Set zero repeats: This will stop at end of pattern
Note: The axis to which the CAMBOX is linked can run in a positive or
negative direction. In the case of a negative direction link, the pattern
executes in reverse. In the case where a certain number of pattern
repeats is specified with a negative direction link, the first control block
produces one repeat less than expected. This is because the CAMBOX
loads a zero link position which immediately goes negative on the next
servo cycle triggering a REPEAT COUNT. This effect only occurs when
the CAMBOX is loaded, not on transitions from CONTROL BLOCK to
CONTROL BLOCK. This effect can easily be compensated for: either
increase the required number of repeats, or set the initial value of
REPEAT POSITION to 1.
See also AXIS, CAM, REP_OPTION, TABLE
116
All BASIC commands Section 4-2
4-2-45 CANCEL
/i
/i
Example FORWARD
WA(10000)
CANCEL ' Stop movement after 10 seconds
Example MOVE(1000)
MOVEABS(3000)
CANCEL ' Cancel the move to 3000 and move to 4000 instead.
MOVEABS(4000)
Note that the command MOVEMODIFY is a better solution for modifying
end points of moves in this case.
117
All BASIC commands Section 4-2
/i
Example Two axes are connected with a ratio of 1:2. Axis 0 is cancelled after 1
second, then axis 1 is cancelled when the speed drops to a specified
level. After the first cancel axis 1 decelerates at the DECEL rate. When
the CONNECT of axis 1 is cancelled, axis 1 stops instantly.
BASE(0)
SPEED=10000
FORWARD
CONNECT(0.5,0) AXIS(1)
WA(1000)
CANCEL
WAIT UNTIL VP_SPEED<=7500
CANCEL AXIS(1)
See also AXIS, MTYPE, NTYPE, PMOVE, RAPIDSTOP
4-2-46 CHECKSUM
/i
118
All BASIC commands Section 4-2
4-2-47 CHR
/i
4-2-48 CLEAR
/i
4-2-49 CLEAR_BIT
/i
119
All BASIC commands Section 4-2
4-2-50 CLEAR_PARAMS
/i
4-2-51 CLOSE_WIN
/i
4-2-52 CLUTCH_RATE
/i
120
All BASIC commands Section 4-2
4-2-53 COMPILE
/i
4-2-54 CONNECT
/i
Arguments • ratio
The connection ratio of the gearbox. The ratio is specified as the
encoder edge ratio (not units). It holds the number of edges the base
axis is required to move per edge increment of the driving axis. The
ratio value can be either positive or negative and has sixteen bit
fractional resolution.
• driving_axis
The Master axis which will drive the base axis.
Note: To achieve an exact connection of fractional ratio’s of values
such as 1024/3072 the MOVELINK command can be used with the
continuous repeat link option set to ON.
121
All BASIC commands Section 4-2
/i
Example A machine has an automatic feed on axis 1 that must move at a set ratio
to axis 0. This ratio is selected using inputs 0-2 to select a particular
“gear”. This ratio can be updated every 100 ms. Combinations of inputs
select the intermediate gear ratios. For example, 1 ON and 2 ON gives
a ratio of 6:1.
BASE(1)
FORWARD AXIS(0)
WHILE IN(3)=ON
WA(100)
gear = IN(0,2)
CONNECT(gear,0)
WEND
RAPIDSTOP cancel the FORWARD and the CONNECT
122
All BASIC commands Section 4-2
/i
4-2-55 CONSTANT
/i
123
All BASIC commands Section 4-2
Arguments • name
Any user-defined name containing lower case alpha, numerical or
underscore characters.
• value
The value assigned to name.
Example CONSTANT "nak", $15
CONSTANT "start_button", 5
IF IN(start_button)=ON THEN OP(led1, ON)
IF key_char=nak THEN GOSUB no_ack_received
See also LIST_GLOBAL
4-2-56 CONTROL
/i
Note: When the Motion Controller is locked, 1000 is added to the value,
so a locked CJ1W-MCH72 will return 1264.
Arguments N/A
Example No example.
See also N/A
4-2-57 COPY
/i
4-2-58 COS
/i
124
All BASIC commands Section 4-2
Arguments • expression
Any valid BASIC expression.
Example >> PRINT COS(0)
1.0000
See also N/A
4-2-59 CREEP
/i
4-2-60 D_GAIN
/i
4-2-61 D_ZONE_MAX
/i
125
All BASIC commands Section 4-2
4-2-62 D_ZONE_MIN
/i
4-2-63 DATE
/i
126
All BASIC commands Section 4-2
4-2-64 DATE$
/i
4-2-65 DATUM
/i
sequence Description
value
0 The DATUM(0) command will clear the motion error. The currently
measured position is set as the demand position (this is especially use-
ful on stepper axes with position verification). DATUM(0) also clears the
Following Error that exceeded the FE_LIMIT condition in the
AXISSTATUS register for ALL axes. It sets these bits in AXXISSTATUS
to zero:
Bit 1 : Following Error Warning.
Bit 2 : Remote Driver Comms Error.
Bit 3 : Remote Driver Error.
Bit 8 : Following Error Limit Exceeded.
Bit 11 : Cancelling Move.
Note that the status can not be cleared if the cause of the problem is still
present. DATUM(0) must only be used after the WDOG is set to OFF,
otherwise there will be unpredictable errors on the motion.
127
All BASIC commands Section 4-2
sequence Description
value
1 The axis moves at creep speed forward until the Z marker is encoun-
tered. The demand position is then reset to 0 and the measured position
corrected so as to maintain the Following Error.
2 The axis moves at creep speed in reverse until the Z marker is encoun-
tered. The demand position is then reset to 0 and the measured position
corrected so as to maintain the Following Error.
3 The axis moves at the demand speed forward until the datum switch is
reached. The axis then moves reverse at creep speed until the datum
switch is reset. The demand position is then reset to 0 and the meas-
ured position corrected so as to maintain the Following Error.
4 The axis moves at the demand speed in reverse until the datum switch
is reached. The axis then moves forward at creep speed until the datum
switch is reset. The demand position is then reset to 0 and the meas-
ured position corrected so as to maintain the Following Error.
5 The axis moves at demand speed forward until the datum switch is
reached. The axis then reverses at creep speed until the datum switch
is reset. The axis continues in reverse at creep speed until the Z marker
of the encoder is encountered. The demand position is then reset to 0
and the measured position corrected so as to maintain the Following
Error.
6 The axis moves at demand speed reverse until the datum switch is
reached. The axis then moves forward at creep speed until the datum
switch is reset. The axis continues forward at creep speed until the Z
marker of the encoder is encountered. The demand position is then
reset to 0 and the measured position corrected so as to maintain the
Following Error.
128
All BASIC commands Section 4-2
/i
Example A production line must stop if something blocks the product belt, which
causes a motion error. The obstacle must be removed, and a reset but-
ton must be pressed to restart the line.
FORWARD 'start production line
WHILE IN(2)=ON
IF MOTION_ERROR=0 THEN
OP(8,ON) 'green light on; line is in motion
ELSE
OP(8, OFF)
GOSUB error_correct
ENDIF
WEND
CANCEL
STOP
error_correct:
REPEAT
OP(10,ON)
WA(250)
OP(10,OFF) 'flash red light to show crash
WA(250)
UNTIL IN(1)=OFF
DATUM(0) 'reset axis status errors
SERVO=ON 'turn the servo back on
WDOG=ON 'turn on the watchdog
OP(9,ON) 'sound siren that line will restart
WA(1000)
OP(9,OFF)
FORWARD 'restart motion
RETURN
/i
Example The position of an axis must be defined by the Z marker. This position
must be set to zero. Then the axis must move to this position. Using the
datum 1 the zero point is set on the Z mark. But the axis starts to decel-
erate at this point, and therefore it stops after the mark. A move is used
to bring it back to the Z position.
SERVO=ON
WDOG=ON
CREEP=1000 'set the search speed
SPEED=5000 'set the return speed
DATUM(1) 'register on Z mark and sets this to datum
WAIT IDLE
MOVEABS (0) 'moves to datum position
129
All BASIC commands Section 4-2
/i
Example A machine must return to its home position defined by the limit switch
which is found at the rear of the move before operation. This can be
achieved through using DATUM(4) which moves in reverse to find the
switch.
SERVO=ON
WDOG=ON
REV_IN=-1 'temporarily turn off the limit switch function
DATUM_IN=5 'sets input 5 for registration
SPEED=5000 'set speed, for quick location of limit switch
CREEP=500 'set creep speed for slow move to find edge of switch
DATUM(4) 'find edge at creep speed and stop
WAIT IDLE
DATUM_IN=-1
REV_IN=5 'restore input 5 as a limit switch again
130
All BASIC commands Section 4-2
/i
Example A machine similar to the machine in the example above must locate a
home switch, which is at the forward end of the move. The machine
then moves backwards to the next Z marker, and set this Z marker as
the
datum. This is done with DATUM(5), which moves forward at SPEED to
locate the switch, then reverses at CREEP to the Z marker. If required,
a move is made to the datum Z marker.
SERVO=ON
WDOG=ON
DATUM_IN=7 'sets input 7 as home switch
SPEED=5000 'set speed, for quick location of switch
CREEP=500 'set creep speed for slow move to find edge of switch
DATUM(5) 'start the homing sequence
WAIT IDLE
See also ACCEL, AXIS, AXISSTATUS, CREEP, DATUM_IN, DECEL,
MOTION_ERROR, SPEED.
4-2-66 DATUM_IN
/i
131
All BASIC commands Section 4-2
4-2-67 DECEL
/i
4-2-68 DEFPOS
/i
132
All BASIC commands Section 4-2
/i
/i
Example Set the axis position to 10, then start an absolute move, but make sure
the
axis has updated the position before loading the MOVEABS.
DEFPOS(10.0)
WAIT UNTIL OFFPOS=0
' Makes sure that DEFPOS is complete before next line
MOVEABS(25.03)
133
All BASIC commands Section 4-2
BEFORE AFTER
/i
Example From the Command Line of the Terminal window, quickly set the DPOS
values of the first four axes to 0.
>>BASE(0)
>>DP(0,0,0,0)
See also AXIS, DATUM, DPOS, OFFPOS, MPOS, UNITS.
4-2-69 DEL
/i
4-2-70 DEMAND_EDGES
/i
134
All BASIC commands Section 4-2
4-2-71 DIR
/i
4-2-72 DISABLE_GROUP
/i
135
All BASIC commands Section 4-2
AXIS 0
AXIS 1
136
All BASIC commands Section 4-2
/i
Example Two conveyors operated by the same Motion Coordinator are required
to run independently, to make sure that the second conveyor does not
stop if the first conveyor is blocked.
DISABLE_GROUP(0) 'put axis 0 in its own group
DISABLE_GROUP(1) 'put axis 1 in another group
GOSUB group_enable0
GOSUB group_enable1
WDOG=ON
FORWARD AXIS(0)
FORWARD AXIS(1)
WHILE TRUE
IF AXIS_ENABLE AXIS(0)=0 THEN
PRINT "motion error axis 0"
reset_0_flag=1
ENDIF
IF AXIS_ENABLE AXIS(1)=0 THEN
PRINT "motion error axis 1"
reset_1_flag=1
ENDIF
IF reset_0_flag=1 AND IN(0)=ON THEN
GOSUB group_enable0
FORWARD AXIS(0)
reset_0_flag=0
ENDIF
IF reset_1_flag=1 AND IN(1)=ON THEN
GOSUB group_enable1
FORWARD AXIS(1)
reset_1_flag=0
ENDIF
WEND
group_enable0:
BASE(0)
DATUM(0) ' clear motion error on axis 0
WA(10)
AXIS_ENABLE=ON
RETURN
group_enable1:
BASE(1)
DATUM(0) ' clear motion error on axis 0
WA(10)
AXIS_ENABLE=ON
SERVO=ON
RETURN
137
All BASIC commands Section 4-2
Example One group of axes in a machine must be reset if a motion error occurs,
without affecting the remaining axes. This must be done manually by
clearing the cause of the error, pressing a button to clear the error flags
of the controllers and re-enabling the motion.
DISABLE_GROUP(-1) 'remove any previous axis groupings
DISABLE_GROUP(0,1,2) 'group axes 0 to 2
GOSUB group_enable 'enable the axes and clear errors
WDOG=ON
SPEED=1000
FORWARD
WHILE IN(2)=ON
check axis 0, but all axes in the group will disable together
IF AXIS_ENABLE =0 THEN
PRINT "Motion error in group 0"
PRINT "Press input 0 to reset"
IF IN(0)=0 THEN 'checks if reset button is pressed
GOSUB group_enable 'clear errors and enable axis
FORWARD 'restarts the motion
ENDIF
ENDIF
WEND
STOP 'stop program running into sub routine
group_enable: 'Clear group errors and enable axes
DATUM(0) 'clear any motion errors
WA(10)
FOR axis_no=0 TO 2
AXIS_ENABLE AXIS(axis_no)=ON 'enable axes
SERVO AXIS(axis_no)=ON 'start position loop servo
NEXT axis_no
RETURN
See also N/A
4-2-73 DPOS
/i
138
All BASIC commands Section 4-2
4-2-74 DRIVE_ALARM
/i
4-2-75 DRIVE_CLEAR
/i
139
All BASIC commands Section 4-2
!Caution Be sure that no Parameter Unit or Personal Computer Software is connected to the
Servo Driver when executing this command. Otherwise the program task will be paused
until the connection of the other device to the Servo Driver is removed.
4-2-76 DRIVE_CONTROL
/i
Code Description
2 Following error (this is the real FE when ATYPE=40 is used)
8 Feedback speed (With ATYPE=41 Units=Max Speed/40000000H, with other
ATYPE Units= reference units/s)
9 Command speed (units same as in Feedback Speed)
10 Target speed (units same as in Feedback Speed)
11 Torque (Force) reference (With ATYPE=42 Units=Max Torque/40000000H,
with other ATYPE Units= % over nominal Torque
14 Monitor selected with Pn813.0 Useful to monitor servo monitors (Unxxx)
15 Monitor selected with Pn813.1 Useful to monitor servo monitors (Unxxx)
/i
4-2-77 DRIVE_INPUTS
/i
140
All BASIC commands Section 4-2
/i
141
All BASIC commands Section 4-2
/i
4-2-78 DRIVE_MONITOR
/i
4-2-79 DRIVE_READ
/i
142
All BASIC commands Section 4-2
Arguments • parameter
The number of the parameter to be read. Note that the parameter
numbers are hexadecimal. The format of the data can be found in
the Servo Driver manual.
• size
SIze of the parameter is specified in bytes. For most parameters the
size is normally 2 bytes. Some special parameters may be 4 bytes
long. Sizes for each parameter can be found in the Servo Driver
manual.
• VR
The VR address where the read parameter is stored upon success-
ful execution.
Example IF DRIVE_READ($100,2,1) THEN
PRINT "The Speed loop gain is: ";VR(1)
ELSE
PRINT "The speed loop gain could not be read"
ENDIF
See also DRIVE_WRITE, HEX, $ (HEXADECIMAL INPUT).
!Caution Be sure that no Parameter Unit or Personal Computer Software is connected to the
Servo Driver when executing this command. Otherwise the program task will be paused
until the connection of the other device to the Servo Driver is removed.
4-2-80 DRIVE_RESET
/i
!Caution Be sure that no Parameter Unit or Personal Computer Software is connected to the
Servo Driver when executing this command. Otherwise the program task will be paused
until the connection of the other device to the Servo Driver is removed.
4-2-81 DRIVE_STATUS
/i
143
All BASIC commands Section 4-2
/i
NOTE: For Flexible Axis axes, this parameter holds the status of registration
and auxiliary inputs, as well as registration selection. The explanation of
each bit is given in the second table below. (Note: Only bits relevant to
Flexible axis are listed.)
/i
Arguments N/A
Example PRINT DRIVE_STATUS AXIS(4)
This command will print the current value of DRIVE_STATUS for
axis(4).
Example BASE(3)
ATYPE = 44
IF (DRIVE_STATUS AND 32)= 32 THEN
PRINT "REG 0 input is ON for axis(3)"
ENDIF
See also AXIS, MARK, MARKB, REGIST.
144
All BASIC commands Section 4-2
4-2-82 DRIVE_WRITE
/i
!Caution Be sure that no Parameter Unit or Personal Computer Software is connected to the
Servo Driver when executing this command. Otherwise the program task will be paused
until the connection of the other device to the Servo Driver is removed.
145
All BASIC commands Section 4-2
4-2-83 EDIT
/i
4-2-84 ELSE
See IF..THEN..ELSE..ENDIF.
4-2-85 ELSEIF
See IF..THEN..ELSE..ENDIF.
4-2-86 ENCODER
/i
146
All BASIC commands Section 4-2
4-2-87 ENCODER_BITS
/i
4-2-88 ENCODER_CONTROL
/i
147
All BASIC commands Section 4-2
4-2-89 ENCODER_RATIO
/i
Note: Large ratios should be avoided as they will lead to either loss of
resolution or much reduced smoothness in the motion. The actual phys-
ical encoder count is the basic resolution of the axis and the use of this
command may reduce the ability of the Motion Controller to accurately
achieve all positions.
Note: ENCODER_RATIO does not replace UNITS. Only use
ENCODER_RATIO where absolutely necessary. For all other axis scal-
ing use UNITS.
Arguments • numerator
A number between 0 and 16777215 that is used to define the
numerator in the above equation.
• denominator
A number between 0 and 16777215 that is used to define the
denominator in the above equation.
Example A rotary table has a servo motor connected directly to its centre of rota-
tion. An encoder is mounted to the rear of the servo motor and returns a
value of 8192 counts per revolution. The application requires the table
to be calibrated in degrees, but so that one degree is an integer number
of counts.
' 7200 is the closest to the encoder resolution that can be devided
' by an integer to give degrees. (7200/20=360)
ENCODER_RATIO(8192,7200)
UNITS=20 ' axis calibrated in degrees, resolution is 0.05 deg.
See also N/A
4-2-90 ENCODER_TURNS
/i
148
All BASIC commands Section 4-2
4-2-91 ENDIF
See IF..THEN..ELSE..ENDIF.
4-2-92 ENDMOVE
/i
149
All BASIC commands Section 4-2
4-2-93 EPROM
/i
4-2-94 ERROR_AXIS
/i
4-2-95 ERROR_LINE
/i
150
All BASIC commands Section 4-2
4-2-96 ERRORMASK
/i
!Caution It is up to the user to define in which cases a motion error is generated. For safe
operation it is strongly recommended to generate a motion error when the Following
Error has exceeded its limit in all cases. This is done by setting bit 8 of ERRORMASK
4-2-97 EX
/i
4-2-98 EXP
/i
151
All BASIC commands Section 4-2
4-2-99 FALSE
/i
4-2-100 FAST_JOG
/i
4-2-101 FASTDEC
/i
152
All BASIC commands Section 4-2
4-2-102 FE
/i
4-2-103 FE_LATCH
/i
4-2-104 FE_LIMIT
/i
153
All BASIC commands Section 4-2
4-2-105 FE_LIMIT_MODE
/i
4-2-106 FE_RANGE
/i
154
All BASIC commands Section 4-2
4-2-107 FHOLD_IN
/i
4-2-108 FHSPEED
/i
155
All BASIC commands Section 4-2
4-2-109 FINS_COMMS
/i
156
All BASIC commands Section 4-2
Arguments • type
The type of the FINS command. 0 means FINS 0101, read memory
from remote FINS server. 1 means FINS 0102, write memory to the
remote server.
• network
The destination network. For more details, see the Communication
Commands Reference Manual, cat. num. W342-E1, Section 3.
• node
The node of the destination FINS server. For more details, see the
Communication Commands Reference Manual, cat. num. W342-E1,
Section 3.
• unit
The unit number of the destination FINS server. For more details,
see the Communication Commands Reference Manual, cat. num.
W342-E1, Section 3.
• remote_area
The area of memory accessed on the destination FINS server.
Range: 128..255. Note that this area must be one of the following
values if the destination is another Trajexia system: 0xB0: Integer
VR value; 0xF0: float VR value; 0x82: Integer TABLE value; 0xC2:
float TABLE value.
• remote_offset
The memory offset on the destination FINS server. Range: 0..65535.
Note that this range will be more limited to the maximum TABLE or
VR addresses if the destination is another Trajexia system.
• length
The number of items to be transferred. The range will depend upon
the FINS frame length and the capabilities of the client and remote
servers. The range for a Trajexia system is from 1 to 700 integer val-
ues, or 1 to 350 floating point values.
• local_area
The local (source) memory area. Note that this area must be one of
the following values: 0x00: Integer VR value; 0x01: Integer TABLE
value; 0x02 : float TABLE value.
• local_offset
The offset of the first value in the local (source) memory area. The
range depends upon the VR or TABLE array size and value for the
length argument.
• timeout
The number of milliseconds to wait for a response from the destina-
tion FINS server, before timing out.
Note: Be aware that data types from both remote_area and local_area
have to match (both floating point or both integers).
Example FINS_COMMS(0, 0, 0, 0, $82, 1000, 20, 0, 500, 5000)
This command reads 20 words (length=20) of DM PLC memory area
(remote_area=$82), starting from DM1000 (remote_offset=1000), and
writes it in the CJ1W-MC@72 VR memory in integer format
(local_area=0), starting from VR(500) (local_offset=500). Thus, values
in PLC memory range DM1000 to DM1019 are placed in CJ1W-MC@72
memory VR(500) to VR(519). The timeout is set to 5 seconds.
157
All BASIC commands Section 4-2
4-2-110 FLAG
/i
4-2-111 FLAGS
/i
158
All BASIC commands Section 4-2
4-2-112 FLASHVR
/i
159
All BASIC commands Section 4-2
Arguments • option
Depending of the value of this argument, either the whole, or just a
part of the TABLE memory is stored. The valid values for the argu-
ment are:
-1: The whole TABLE memory content is written to flash
memory. On power-up the RAM TABLE data are replaced by the
data saved in flash memory.
-2: Stop using data stored in flash to replace RAM TABLE data
during start-up.
-3: Write a page of TABLE data into flash memory.
-4: Read a page of flash memory into TABLE data.
• flashpage
The index number in range [0…31] of a 16k page (512k in total) of
the flash memory where the table data is to be stored (option = -3) or
retrieved from (option = -4)
• tablepage
The index number in range [0…3] of a 16k page it TABLE memory
where the table data is to be copied from (option = -3) or restored to
(option = -4).
Note: When the FLASHVR(-1) is executed, the whole range (all 64000
slots) of the TABLE memory is written to the flash memory and restored
from flash memory on start-up. If, for example, only 1000 TABLE mem-
ory in range [0…999] are defined, in which case an attempt to read
TABLE(1000) would result in "Index range error", executing
FLASHVR(-1) would write already defined values of TABLE memory in
range [0...999] into the flash memory, but also all other TABLE memory
slots in range [1000…63999] will be written to the flash memory with
undefined values. On start-up, the whole range of TABLE memory
[0…63999] would be restored from flash memory, so for example an
attempt to read previously undefined slot TABLE(1000) would succeed,
but the value is undefined. The similar behaviour applies to executing
FLASHVR(-4, flashpage, tablepage). It the current defined range of
the TABLE memory is narrower that the one of the retrieved data, the
range of TABLE memory will be extended automatically.
Note: FLASHVR(-1) writes the whole range (all 64000 slots) of the
TABLE memory in flash memory starting from flashpage 0. Once
FLASHVR(-2) is executed, the RAM TABLE data are not replaced on
start-up by the data saved in flash memory, but that data is still available
in flash memory, and can be retrieved in any tablepage by using
FLASHVR(-3, flashpage, tablepage) command.
160
All BASIC commands Section 4-2
TABLE FLASH
.
48000 - 63999 tablepage 3
.
.
tablepage 3
Example FLASHVR(-1)
Store whole TABLE memory to flash memory.
Example FLASHVR(-3,20,3)
Store table page 3 (TABLE(48000) - TABLE(63999)) into flash page
20.FLASHVR(-4,20,3)
Restore table page 0 (TABLE(0) - TABLE(15999)) from flash page 20.
This effectively copies data in range TABLE(48000) - TABLE(63999)
into range TABLE(0) - TABLE(15999).
See also TABLE
4-2-113 FOR..TO..STEP..NEXT
/i
161
All BASIC commands Section 4-2
4-2-114 FORWARD
/i
162
All BASIC commands Section 4-2
IN(12)
NC
AXIS 0
/i
Example Run an axis forwards. When an input signal is detected on input 12,
bring the axis to a stop.
FORWARD
' wait for stop signal
WAIT UNTIL IN(12)=ON
CANCEL
WAIT IDLE
IN(7)
NC
AXIS 3
/i
Example Move an axis forward until it hits the end limit switch, then move it in the
reverse direction for 25 cm.
BASE(3)
FWD_IN=7 limit switch connected to input 7
FORWARD
WAIT IDLE ' wait for motion to stop on the switch
MOVE(-25.0)
WAIT IDLE
163
All BASIC commands Section 4-2
Example A machine that applies lids to cartons uses a simulated line shaft. This
example sets up a virtual axis running forward to simulate the line shaft.
Axis 0 is then connected, with the CONNECT command, to this virtual
axis to run the conveyor. Axis 1 controls a vacuum roller that feeds the
lids on to the cartons using the MOVELINK control.
BASE(4)
ATYPE=0 'Set axis 4 to virtual axis
REP_OPTION=1
SERVO=ON
FORWARD 'starts line shaft
BASE(0)
CONNECT(-1,4) 'Connects base 0 to virtual axis in reverse
WHILE IN(2)=ON
BASE(1)
'Links axis 1 to the shaft in reverse direction
MOVELINK(-4000,2000,0,0,4,2,1000)
WAIT IDLE
WEND
RAPIDSTOP
See also AXIS, CANCEL, RAPIDSTOP, REVERSE, UNITS.
4-2-115 FPGA_VERSION
/i
4-2-116 FRAC
/i
164
All BASIC commands Section 4-2
4-2-117 FRAME
/i
4-2-118 FREE
/i
165
All BASIC commands Section 4-2
4-2-119 FS_LIMIT
/i
4-2-120 FWD_IN
/i
4-2-121 FWD_JOG
/i
166
All BASIC commands Section 4-2
Example No example.
See also AXIS, FAST_JOG, JOGSPEED, REV_JOG.
4-2-122 GET
/i
• variable
The name of the variable to receive the ASCII code.
Example GET#5, k
This line stores the ASCII character received on the Trajexia Studio port
channel 5 in k.
See also N/A
167
All BASIC commands Section 4-2
4-2-123 GLOBAL
/i
4-2-124 GOSUB..RETURN
/i
168
All BASIC commands Section 4-2
Example main:
GOSUB routine
GOTO main
routine:
PRINT "Measured position=";MPOS;CHR(13);
RETURN
See also GOTO
4-2-125 GOTO
/i
4-2-126 HALT
/i
4-2-127 HEX
/i
169
All BASIC commands Section 4-2
Example PRINT#5,HEX(IN(8,16))
See also N/A
4-2-128 HW_PSWITCH
/i
170
All BASIC commands Section 4-2
4-2-129 I_GAIN
/i
4-2-130 IDLE
See WAIT IDLE.
4-2-131 IEEE_IN
/i
4-2-132 IEEE_OUT
/i
171
All BASIC commands Section 4-2
Arguments • value
Any BASIC floating point variable or parameter.
• n
The byte number (0 - 3) to be extracted.
Example a=MPOS AXIS(2)
byte0 = IEEE_OUT(a, 0)
byte1 = IEEE_OUT(a, 1)
byte2 = IEEE_OUT(a, 2)
byte3 = IEEE_OUT(a, 3)
See also N/A
4-2-133 IF..THEN..ELSE..ENDIF
/i
172
All BASIC commands Section 4-2
4-2-134 IN
/i
173
All BASIC commands Section 4-2
4-2-135 INITIALISE
/i
4-2-136 INT
/i
4-2-137 INTEGER_READ
/i
174
All BASIC commands Section 4-2
4-2-138 INVERT_IN
/i
4-2-139 INVERT_STEP
/i
175
All BASIC commands Section 4-2
4-2-140 INVERTER_COMMAND
/i
176
All BASIC commands Section 4-2
/i
If with function 8 the mode parameter is set to 1, the Inverter is set into
servo axis mode. The corresponding axis number is assigned by the
CJ1W-MC@72 using the formula:
AxisNo = MECHATROLINK-II Station Number - 0x21
Therefore the calculated AxisNo must not be occupied by another axis
connected.
177
All BASIC commands Section 4-2
4-2-141 INVERTER_READ
/i
Make you sure that the Inverter firmware supports the MECHA-
TROLINK-II board.
The command returns -1 if successfully executed and 0 if failed. The
result (if any) is returned in the selected VR.
Arguments • station
The MECHATROLINK-II station number of the Inverter.
• param_number
The number of the parameter to read. See the Inverter manual.
• param_size
The size of the parameter to read, 2 or 4 bytes. Most of the Inverter
parameters are 2 bytes long. See the Inverter manual.
• VR
The address in the VR memory of the CJ1W-MC@72 where the read
information is put. When the function is 4, the result is returned as a
bitwise value. See the table below.
/i
178
All BASIC commands Section 4-2
• vr_mode
By default the INVERTER_READ command writes to a single VR
entry. To support 32 bit values with full precision, this can be spread
over multiple VR entries.
0: to single VR (default)
1: to multiple VR when param_size > 2 (in pieces of 16 bits)
• alarm_number
The number of the alarm to read. See the Inverter manual.
• from
The start address of the input to read.
• length
The length of the input to read.
Example No example.
See also N/A
4-2-142 INVERTER_WRITE
/i
Make you sure that the Inverter firmware supports the MECHA-
TROLINK-II board.
The command returns -1 if successfully executed and 0 if failed. The
result (if any) is returned in the selected VR.
179
All BASIC commands Section 4-2
Arguments • station
The MECHATROLINK-II station number of the Inverter
• param_number
The number of the parameter to write. See the Inverter manual.
• param_size
The size of the parameter to write, 2 or 4 bytes. Most of the Inverter
parameters are 2 bytes long. See the Inverter manual.
• VR
The address in the VR memory of the CJ1W-MC@72 where the new
value for the parameter is.
• vr_mode
By default the INVERTER_WRITE command reads from a single
VR entry. To support 32 bit values with full precision, this can be
spread over multiple VR entries.
0: from single VR (default)
1: from multiple VR when param_size > 2 (in pieces of 16 bits)
• mode
0 = just write; 1= write and enter; 2 = write and config.
• value
The new value that is written.
Example >>INVERTER_WRITE(1,$23,2,3500)
>>INVERTER_READ(1,$23,2,100)
>>PRINT VR(100)
3500.0000
See also N/A
Note: If you have to transfer many parameters at the same time, the most efficient way is to
use MODE 0 for all but the last parameter, and MODE 1 for the last parameter.
MODE 0 is executed faster than MODE 1.
4-2-143 JOGSPEED
/i
4-2-144 LAST_AXIS
/i
180
All BASIC commands Section 4-2
Description The LAST_AXIS parameter contains the number of the last axis pro-
cessed by the system.
Most systems do not use all the available axes. It would therefore be a
waste of time to task the idle moves on all axes that are not in use. To
avoid this to some extent, the CJ1W-MC@72 will task moves on the
axes from 0 to LAST_AXIS, where LAST_AXIS is the number of the
highest axis for which an AXIS or BASE command has been pro-
cessed, whichever of the two is larger.
Arguments N/A
Example No example.
See also AXIS.
4-2-145 LIST
/i
4-2-146 LIST_GLOBAL
/i
181
All BASIC commands Section 4-2
>>LIST_GLOBAL
Global VR
---------------- ----
conveyor 5
Constant Value
---------------- -------
cutter 23.0000
See also CONSTANT, GLOBAL
182
All BASIC commands Section 4-2
4-2-147 LN
/i
4-2-148 LOCK
/i
!Caution The security code must be remembered; it will be required to unlock the system.
Without the security code the system can not be recovered.
4-2-149 MARK
/i
183
All BASIC commands Section 4-2
Example loop:
WAIT UNTIL IN(punch_clr)=ON
MOVE(index_length)
REGIST(3)
WAIT UNTIL(MARK)
MOVEMODIFY(REG_POS + offset)
WAIT IDLE
GOTO loop
See also AXIS, REGIST, REG_POS.
4-2-150 MARKB
/i
184
All BASIC commands Section 4-2
4-2-151 MECHATROLINK
/i
185
All BASIC commands Section 4-2
4-2-152 MERGE
/i
When merging multi-axis moves, only the base axis MERGE axis
parameter needs to be set.
Note: If the moves are short, a high deceleration rate must be set to
avoid the CJ1W-MC@72 decelerating in anticipation of the end of the
buffered move.
Arguments N/A
Example MERGE = OFF ' Decelerate at the end of each move
MERGE = ON ' Moves will be merged if possible
See also AXIS.
4-2-153 MHELICAL
/i
186
All BASIC commands Section 4-2
Arguments • end1
Position on BASE axis to finish at.
• end2
Position on next axis in BASE array to finish at.
• centre1
Position on BASE axis about which to move.
• centre2
Position on next axis in BASE array about which to move.
• direction
The direction is a software switch which determines whether the
arc is interpolated in a clockwise or anti- clockwise direction. The
parameter is set to 0 or 1. See MOVECIRC.
• distance3
The distance to move on the third axis in the BASE array axis in
user units.
• mode
0 = Interpolate the third axis with the main two axis when calculating
path speed (true helical path).
1 = Interpolate only the first two axes for path speed, but move the
third axis in coordination with the other 2 axes (circular path with fol-
lowing third axis).
r3
187
All BASIC commands Section 4-2
/i
Example The command sequence follows a rounded rectangle path with axis 1
and 2. Axis 3 is the tool rotation so that the tool is always perpendicular
to the product. The UNITS for axis 3 are set such that the axis is cali-
brated in degrees.
REP_DIST AXIS(3)=360
REP_OPTION AXIS(3)=ON
' all 3 axes must be homed before starting
MERGE=ON
MOVEABS(360) AXIS(3) point axis 3 in correct starting direction
WAIT IDLE AXIS(3)
MOVE(0,12)
MHELICAL(3,3,3,0,1,90)
MOVE(16,0)
MHELICAL(3,-3,0,-3,1,90)
MOVE(0,-6)
MHELICAL(-3,-3,-3,0,1,90)
MOVE(-2,0)
MHELICAL(-3,3,0,3,1,90)
START
188
All BASIC commands Section 4-2
/i
Example A PVC cutter uses 2 axes similar to a X-Y plotter. The third axis is used
to control the cutting angle of the knife. To keep the resultant cutting
speed for the x and y axis equal when cutting curves, mode 1 is applied
to the helical command.
BASE(0,1,2) : MERGE=ON
'merge moves into one continuous movement
MOVE(50,0)
MHELICAL(0,-6,0,-3,1,180,1)
MOVE(-22,0)
WAIT IDLE
MOVE(-90) AXIS(2) 'rotate the knife after stopping at corner
WAIT IDLE AXIS(2)
MOVE(0,-50)
MHELICAL(-6,0,-3,0,1,180,1)
MOVE(0,50)
WAIT IDLE 'pause again to rotate the knife
MOVE(-90) AXIS(2)
WAIT IDLE AXIS(2)
MOVE(-22,0)
MHELICAL(0,6,0,3,1,180,1)
WAIT IDLE
See also MOVECIRC.
4-2-154 MOD
/i
189
All BASIC commands Section 4-2
4-2-155 MOTION_ERROR
/i
Arguments N/A
Example INTEGER_READ(MOTION_ERROR,VR(100),VR(101))
This example will copy the first 16 bits of MOTION_ERROR to VR(100)
and the rest to VR(101).
See also AXIS, AXISSTATUS, DATUM, ERROR_AXIS, ERRORMASK, WDOG,
INTEGER_READ
190
All BASIC commands Section 4-2
4-2-156 MOVE
/i
191
All BASIC commands Section 4-2
Example Axes 3, 4 and 5 must move independently, that is, without interpolation.
Each axis moves at its own programmed SPEED, ACCEL and DECEL
etc.
'setup axis speed and enable
BASE(3)
SPEED=5000
ACCEL=100000
DECEL=150000
SERVO=ON
BASE(4)
SPEED=5000
ACCEL=150000
DECEL=560000
SERVO=ON
BASE(5)
SPEED=2000
ACCEL=320000
DECEL=352000
SERVO=ON
WDOG=ON
MOVE(10) AXIS(5) 'start moves
MOVE(10) AXIS(4)
MOVE(10) AXIS(3)
WAIT IDLE AXIS(5) 'wait for moves to finish
WAIT IDLE AXIS(4)
WAIT IDLE AXIS(3)
B D
A E
/i
Example An X-Y plotter can write text at any position within its working envelope.
Individual characters are defined as a sequence of moves relative
to a start point. Therefore, the same commands can be used regardless
of the plot origin. The command subroutine for the letter M is:
write_m:
MOVE(0,12) 'move A > B
MOVE(3,-6) 'move B > C
MOVE(3,6) 'move C > D
MOVE(0,-12)'move D > E
RETURN
192
All BASIC commands Section 4-2
4-2-157 MOVEABS
/i
193
All BASIC commands Section 4-2
/i
1
AXIS
0,0
AXIS
0
194
All BASIC commands Section 4-2
/i
Example A pallet consists of a 6 by 8 grid in which gas canisters are inserted 185
mm apart by a packaging machine. The canisters are picked up from a
fixed point. The first position in the pallet is defined as position 0,0 with
the DEFPOS command. The part of the program to position the canis-
ters in the pallet is:
FOR x=0 TO 5
FOR y=0 TO 7
MOVEABS(-340,-516.5) 'move to pick-up point
WAIT IDLE
GOSUB pick 'call pick up subroutine
PRINT Move to Position: ;x*6+y+1
MOVEABS(x*185,y*185) 'move to position in grid
WAIT IDLE
GOSUB place 'call place down subroutine
NEXT y
NEXT x
See also AXIS, MOVE, MOVEABS, UNITS.
4-2-158 MOVECIRC
/i
195
All BASIC commands Section 4-2
DIRECTION = 1
2
1 1
DIRECTION = 0
/i
Arguments • end_1
The end position for the BASE axis.
• end_2
The end position for the next axis.
• centre_1
The position around which the BASE axis is to move.
• centre_2
The position around which the next axis is to move.
• direction
A software switch that determines whether the arc is interpolated in
a clockwise or counterclockwise direction. Value: 0 or 1.
If the two axes involved in the movement form a right-hand axis, set
direction to 0 to produce positive motion about the third (possibly
imaginary) orthogonal axis. If the two axes involved in the move-
ment form a left-hand axis. set direction to 0 to produce negative
motion about the third (possibly imaginary) orthogonal axis. See the
table below.
/i
196
All BASIC commands Section 4-2
/i
Note: In order for the MOVECIRC to be correctly executed, the two axes
generating the circular arc must have the same number of encoder
pulses versus linear axis distance. If this is not the case it is possible to
adjust the encoder scales in many cases by using ENCODER_RATIO
parameter.
Note: The MOVECIRC computes the radius and the total angle of rota-
tion from the centre, and end-point. If the end point is not on the calcu-
lated path, the move simply ends at the computed end and not the
specified end point. It is the responsibility of the programmer to ensure
that the two points correspond to correct points on a circle.
Note: Neither axis may cross the set absolute repeat distance
REP_DIST during a MOVECIRC. Doing so may cause one or both
axis to jump or for their FE value to exceed FE_LIMIT.
C D
B E
A F
H G
197
All BASIC commands Section 4-2
/i
END
AXIS 1
(0,5)
0
AXIS
/i
Example A machine is required to drop chemicals into test tubes. The nozzle can
move up and down and also along its rail. The most efficient motion for
the nozzle is to move in an arc between the test tubes.
BASE(0,1)
MOVEABS(0,5) 'move to position above first tube
MOVEABS(0,0) 'lower for first drop
WAIT IDLE
OP(15,ON) 'apply dropper
WA(20)
OP(15,OFF)
FOR x=0 TO 5
MOVECIRC(5,0,2.5,0,1) 'arc between the test tubes
WAIT IDLE
OP(15,ON) 'Apply dropper
WA(20)
OP(15,OFF)
NEXT x
MOVECIRC(5,5,5,0,1) 'move to rest position
See also AXIS, ENCODER_RATIO, UNITS
198
All BASIC commands Section 4-2
4-2-159 MOVELINK
/i
199
All BASIC commands Section 4-2
/i
Arguments • distance
The incremental distance in user units to move the BASE axis, as a
result of the measured link_distance movement on the link axis.
• link_distance
The positive incremental distance in user units that is required to be
measured on the link axis to result in the distance motion on the
BASE axis.
• link_acceleration
The positive incremental distance in user units on the link axis over
which the base axis will accelerate.
• link_deceleration
The positive incremental distance in user units on the link axis over
which the base axis will decelerate.
Note: If the sum of parameter 3 and parameter 4 is greater than
parameter 2, they are both reduced in proportion until their sum
equals parameter 2.
• link axis
The axis to link to.
• link_option
See the table below.
/i
link_option Description
1 Link starts when registration event occurs on link axis.
2 Link starts at an absolute position on link axis (see link_position).
4 MOVELINK repeats automatically and bidirectionally. This option is
cancelled by setting bit 1 of REP_OPTION parameter (that is,
REP_OPTION = REP_OPTION OR 2).
5 Combination of options 1 and 4.
6 Combination of options 2 and 4.
/i
• link_position
The absolute position where MOVELINK will start when link_option
is set to 2
Note: The command uses the BASE and AXIS, and unit conversion fac-
tors in a similar way to other MOVE commands.
Note: The “link” axis may move in either direction to drive the output
motion. The link distances specified are always positive.
200
All BASIC commands Section 4-2
LEAD SCREW
SERVO MOTOR
(AXIS 0)
ENCODER (AXIS 7)
/i
Example A flying shear that moves at the speed of the material cuts a long sheet
of paper into cards every 160 m. The shear can move up to 1.2 metres,
of which 1m is used in this example. The paper distance is measured by
an encoder. The unit conversion factor is set to give units of metres on
both axes. Note that axis 7 is the link axis.
WHILE IN(2)=ON
MOVELINK(0,150,0,0,7) ' dwell (no movement) for 150m
MOVELINK(0.3,0.6,0.6,0,7) ' accelerate to paper speed
MOVELINK(0.7,1.0,0,0.6,7) ' track the paper then decelerate
WAIT LOADED ' wait until acceleration movelink is finished
OP(8,ON) ' activate cutter
MOVELINK(-1.0,8.4,0.5,0.5,7) retract cutter back to start
WAIT LOADED
OP(8,OFF) ' deactivate cutter at end of outward stroke
WEND
In this program, the controller waits for the roll to feed out 150 m in the
first
line. After this distance the shear accelerates to match the speed of the
paper, moves at the same speed, and then decelerates to a stop within
the 1 m stroke. This movement is specified using two separate
MOVELINK commands. This allows the program to wait for the next
move buffer to be clear, NTYPE=0, which indicates that the acceleration
phase is complete. Note that the distances on the measurement axis
(the link distance in each MOVELINK command), 150, 0.8, 1.0 and 8.2,
add up to 160 m. To make sure that the speed and the positions of the
cutter and paper match during the cut process, the parameters of the
MOVELINK command must be correct. The easiest way to do this is to
consider the acceleration, constant speed and deceleration phases sep-
arately, and then combine them as required, according to these 2 rules:
201
All BASIC commands Section 4-2
NON-SERVO
SPINDLE MOTOR
ENCODER
AXIS 1
SERVO MOTOR
AXIS 0
202
All BASIC commands Section 4-2
/i
Example In this example on coil winding the unit conversion factors UNITS are
set so that the payout movements are in mm and the spindle position is
measured in revolutions. The payout eye therefore moves 50 mm over
25 revolutions of the spindle with the command
MOVELINK(50,25,0,0,linkax). To accelerate over the first spindle revo-
lution and decelerate over the final 3 use the command
MOVELINK(50,25,1,3,linkax).
OP(motor,ON) ' Switch spindle motor on
FOR layer=1 TO 10
MOVELINK(50,25,0,0,1)
MOVELINK(-50,25,0,0,1)
NEXT layer
WAIT IDLE
OP(motor,OFF)
See also AXIS, UNITS, REP_OPTION.
4-2-160 MOVEMODIFY
/i
SHEET GLASS
SENSOR
250mm
203
All BASIC commands Section 4-2
250mm
ORIGINAL MOVE
SENSOR SEEN
/i
SENSOR
/i
Example A paper feed system slips. To counteract this, a proximity sensor is posi-
tioned one third of the way into the movement. This detects at which
position the paper passes, and thus how much slip has occurred. The
move is then modified to account for this variation.
paper_length=4000
DEFPOS(0)
REGIST(3)
MOVE(paper_length)
WAIT UNTIL MARK
slip=REG_POS-(paper_length/3)
offset=slip*3
MOVEMODIFY(paper_length+offset)
204
All BASIC commands Section 4-2
/i
Example A satellite receiver sits on top of a van. It must align correctly to the sat-
ellite from data processed in a computer. This information is sent to the
controller through the serial link and sets VR(0) and VR(1). This infor-
mation is used to control the two axes.
MOVEMODIFY is used so that the position can be continuously
changed even if the previous set position is not achieved.
bearing=0 'set lables for VRs
elevation=1
UNITS AXIS(0)=360/counts_per_rev0
UNITS AXIS(1)=360/counts_per_rev1
WHILE IN(2)=ON
MOVEMODIFY(VR(bearing))AXIS(0) 'adjust bearing to match VR0
MOVEMODIFY(VR(elevation))AXIS(1)'adjust elevation to match
VR1
WA(250)
WEND
RAPIDSTOP 'stop movement
WAIT IDLE AXIS(0)
MOVEABS(0) AXIS(0) 'return to transport position
WAIT IDLE AXIS(1)
MOVEABS(0) AXIS (1)
4-2-161 MPOS
/i
205
All BASIC commands Section 4-2
4-2-162 MSPEED
/i
4-2-163 MTYPE
/i
206
All BASIC commands Section 4-2
/i
4-2-164 NEG_OFFSET
/i
4-2-165 NEW
/i
4-2-166 NEXT
See FOR..TO..STEP..NEXT.
207
All BASIC commands Section 4-2
4-2-167 NOT
/i
Bit Result
0 1
1 0
/i
Arguments • expression.
Any valid BASIC expression.
Example >> PRINT 7 AND NOT 1
6.0000
See also N/A
4-2-168 NTYPE
/i
4-2-169 OFF
/i
208
All BASIC commands Section 4-2
4-2-170 OFFPOS
/i
209
All BASIC commands Section 4-2
/i
Example A conveyor transports boxes. Labels must be applied onto these boxes.
The REGIST function can capture the position at which the leading
edge of the box is seen. Then, the OFFPOS command can adjust the
measured position of the axis to make it 0 at that point. Thus, after the
registration event has occurred, the measured position (seen in MPOS)
reflects the absolute distance from the start of the box. The mechanism
that applies the label can take advantage of the absolute position start
mode of the MOVELINK or CAMBOX commands to apply the label.
BASE(conv)
REGIST(3)
WAIT UNTIL MARK
OFFPOS = -REG_POS ' Leading edge of box is now zero
See also AXIS, DEFPOS, DPOS, MPOS, UNITS.
4-2-171 ON
/i
210
All BASIC commands Section 4-2
4-2-174 OP
/i
211
All BASIC commands Section 4-2
Example OP(12,1)
OP(12,ON)
These two lines are equivalent.
Example OP(18*256)
This line sets the bit pattern 10010 on the first 5 physical outputs, out-
puts 13 to 17 would be cleared. The bit pattern is shifted 8 bits by multi-
plying by 256 to set the first available outputs as outputs 0 to 7 do not
exist.
Example VR(0) = OP
VR(0) = VR(0) OR $FF00
OP(VR(0))
This routine sets outputs 8 to 15 ON and all others off.
The above programming can also be written as follows:
OP(OP OR $FF00)
Example val = 8 ' The value to set
mask = OP AND NOT(15*256) ' Get current status and mask
OP(mask OR val*256) ' Set val to OP(8) to OP(11)
This routine sets value val to outputs 8 to 11 without affecting the other
outputs by using masking.
See also IN.
4-2-175 OPEN_WIN
/i
212
All BASIC commands Section 4-2
4-2-176 OR
/i
Arguments • expression1
Any valid BASIC expression.
• expression2
Any valid BASIC expression.
Example result = 10 OR (2.1*9)
The parentheses are evaluated first, but only the integer part of the
result, 18, is used for the operation. Therefore, this expression is equiv-
alent to the following:
result = 10 OR 18
The OR is a bit operator and so the binary action taking place is:
01010 OR 10010 = 11010
Therefore, result will contain the value 26.
Example IF VR(0) = 1 OR VR(0) = 2 THEN GOTO label
See also N/A
4-2-177 OUTLIMIT
/i
213
All BASIC commands Section 4-2
4-2-178 OV_GAIN
/i
4-2-179 P_GAIN
/i
4-2-180 PI
/i
214
All BASIC commands Section 4-2
4-2-181 PLC_EXCHANGE
/i
215
All BASIC commands Section 4-2
4-2-182 PLC_STATUS
/i
4-2-183 PMOVE
/i
216
All BASIC commands Section 4-2
4-2-184 POS_OFFSET
/i
4-2-185 POWER_UP
/i
217
All BASIC commands Section 4-2
4-2-186 PRINT
/i
Value Description
0 Programming port 0 (default)
5 Trajexia Studio port 0 user channel 5
6 Trajexia Studio port 0 user channel 6
7 Trajexia Studio port 0 user channel 7
/i
• expression
The expression to be printed.
Example PRINT "CAPITALS and lower case CAN BE PRINTED"
Example Consider VR(1) = 6 and variab = 1.5, the print output will be as follows:
PRINT 123.45, VR(1)-variab
123.4500 4.5000
Example length:
PRINT "DISTANCE = ";mpos
DISTANCE = 123.0000
In this example, the semi-colon separator is used. This does not tab into
the next column, allowing the programmer more freedom in where the
print items are placed.
Example PRINT VR(1)[ 4,1 ]; variab[ 6,2 ]
6.0 1.50
218
All BASIC commands Section 4-2
Example params:
PRINT "DISTANCE = ";mpos[ 0 ];" SPEED = ";v[ 2 ];
DISTANCE = 123 SPEED = 12.34
Example PRINT "ITEM ";total" OF ";limit;CHR(13);
Example >> PRINT HEX(15),HEX(-2)
F FFFFA
See also $ (HEXADECIMAL INPUT)
4-2-187 PROC
/i
4-2-188 PROC_STATUS
/i
Value Description
0 Process stopped
1 Process running
2 Process stepping
3 Process paused
/i
Arguments N/A
Example WAIT UNTIL PROC_STATUS PROC(3)=0
See also PROCNUMBER, PROC.
219
All BASIC commands Section 4-2
4-2-189 PROCESS
/i
4-2-190 PROCNUMBER
/i
4-2-191 PSWITCH
/i
220
All BASIC commands Section 4-2
Arguments • switch
The switch number. Range: [0,15].
• enable
The switch enable. Range: [on, off].
• axis
The number of the axis providing the position input.
• output_number
The physical output to set. Range: [8,31].
• output_state
The state to output. Range: [on, off].
• set_position
The absolute position in user units at which output is set.
• reset_position
The absolute position in user units at which output is reset.
Example A rotating shaft has a cam operated switch which has to be changed for
different size work pieces. There is also a proximity switch on the shaft
to indicate the TDC of the machine. With a mechanical cam, the change
from job to job is time consuming. This can be eased by using
PSWITCH as a software cam switch. The proximity switch is wired to
input 7 and the output is output 11. The shaft is controlled by axis 0. The
motor has a 900ppr encoder. The output must be on from 80 units.
PSWITCH uses the unit conversion factor to allow the positions to be
set in convenient units. First the unit conversion factor must be calcu-
lated and set. Each pulse on an encoder gives four edges for the CJ1W-
MC@72 to count. There are thus 3,600 edges/rev or 10 edges/degree. If
you set the unit conversion factor to 10, you can work in degrees.
Next you have to determine a value for all the PSWITCH arguments.
sw: The switch number can be any switch that is not in use. In this
example, you will use number 0.
en: The switch must be enabled to work; set the enable to 1.
axis: The shaft is controlled by axis 0.
opno: The output being controlled is output 11.
opst: The output must be on so set to 1.
setpos: The output is to produced at 80 units.
rspos: The output is to be on for a period of 120 units.
This can all be put together in the following lines of BASIC code:
switch:
UNITS AXIS(0) = 10 ' Set unit conversion factor
REP_DIST = 360
REP_OPTION = ON
PSWITCH(0,ON,0,11,ON,80,200)
This program uses the repeat distance set to 360 degrees and the
repeat option on so that the axis position will be maintained between 0
and 360 degrees.
See also HW_PSWITCH, OP, UNITS.
221
All BASIC commands Section 4-2
4-2-192 RAPIDSTOP
/i
/i
Example This example shows the implementation of a stop override button that
cuts out all motion.
CONNECT (1,0) AXIS(1) 'axis 1 follows axis 0
BASE(0)
REPAEAT
MOVE(1000) AXIS (0)
MOVE(-100000) AXIS (0)
MOVE(100000) AXIS (0)
UNTIL IN (2)=OFF 'stop button pressed?
RAPIDSTOP
WA(10) 'wait to allow running move to cancel
RAPIDSTOP 'cancel the second buffered move
WA(10)
RAPIDSTOP 'cancel the third buffered move
222
All BASIC commands Section 4-2
/i
Example This example shows the use of RAPIDSTOP to cancel a MOVE on the
main axis and a FORWARD on the second axis. When the axes have
stopped, a MOVEABS is applied to re-position the main axis.
BASE(0)
REGIST(3)
FORWARD AXIS(1)
MOVE (100000) 'apply a long move
WAIT UNTIL MARK
RAPIDSTOP
WAIT IDLE 'for MOVEABS to be accurate, the axis must stop
MOVEABS(3000)
223
All BASIC commands Section 4-2
/i
Example This example shows the use of RAPIDSTOP to break a CONNECT and
stop the motion. The connected axis stops immediately on the
RAPIDSTOP command. The forward axis decelerates at the DECEL
value.
BASE(0)
CONNECT(1,1)
FORWARD AXIS(1)
WAIT UNTIL VPSPEED=SPEED 'let the axis get to full speed
WA(1000)
RAPIDSTOP
WAIT IDLE AXIS(1) 'wait for axis 1 to decel
CONNECT(1,1) 're-connect axis 0
REVERSE AXIS(1)
WAIT UNTIL VPSPEED=SPEED
WA(1000)
RAPIDSTOP
WAIT IDLE AXIS(1)
See also CANCEL, MTYPE, NTYPE.
4-2-193 READ_BIT
/i
224
All BASIC commands Section 4-2
4-2-194 READ_OP
/i
225
All BASIC commands Section 4-2
4-2-195 REG_POS
/i
4-2-196 REG_POSB
/i
226
All BASIC commands Section 4-2
4-2-197 REGIST
/i
Note: For the mapping of the registration signals of the specific Servo Drivers, refer to section
5-1-6.
/i
227
All BASIC commands Section 4-2
Arguments • mode
The mode parameter specifies the registration input and event for
use and the signal edge the registration event occurs. The mode
parameter also specifies the use of the windowing function and filter-
ing.
The mode parameter differs between MECHATROLINK-II and
Encoder Interface. The function of each bit in the mode parameter is
explained in the tables below.
/i
228
All BASIC commands Section 4-2
Z MARK
SERVO MOTOR
/i
SENSOR BEAM
SENSOR
RAM
229
All BASIC commands Section 4-2
/i
Example Components are placed on a flighted belt. The flights are 120 mm apart.
The components are on the belt 30 mm from the flights. When a compo-
nent is found, an actuator pushes it off the belt. To prevent that the sen-
sor finds a flight instead of a component, registration with windowing is
used.
REP_DIST=120 ‘sets repeat distance to pitch of belt flights
REP_OPTION=ON
OPEN_WIN=30 ' sets window open position
CLOSE_WIN=90 ' sets window close position
REGIST(4+256) ' R input registration with windowing
FORWARD ' start the belt
box_seen=0
REPEAT
WAIT UNTIL MPOS<60 ' wait for centre point between flights
WAIT UNTIL MPOS>60 ' so that actuator is fired between flights
IF box_seen=1 THEN ' was a box seen on the previous cycle?
OP(8,ON) ' fire actuator
WA(100)
OP(8,OFF) ' retract actuator
box_seen=0
ENDIF
IF MARK THEN box_seen=1 ' set “box seen” flag
REGIST(4+256)
UNTIL IN(2)=OFF
CANCEL ' stop the belt
WAIT IDLE
GLUE APPLICATOR
SENSOR
ENCODER
230
All BASIC commands Section 4-2
/i
Example A machine adds glue to the top of a box. To do this, it must switch output
8. It must detect the rising edge (appearance) and the falling edge (end)
of a box. Also, the MPOS must be set to zero when the Z position is
detected.
reg=6 'select registration mode 6 (rising edge R, rising edge Z)
REGIST(reg)
FORWARD
WHILE IN(2)=OFF
IF MARKB THEN 'on a Z mark mpos is reset to zero
OFFPOS=-REG_POSB
REGIST(reg)
ELSEIF MARK THEN 'on R input output 8 is toggled
IF reg=6 THEN
'select registration mode 8 (falling edge R, rising edge Z)
reg=8
OP(8,ON)
ELSE
reg=6
OP(8,OFF)
ENDIF
REGIST(reg)
ENDIF
WEND
CANCEL
See also AXIS, MARK, MARKB, REG_POS, REG_POSB, OPEN_WIN,
CLOSE_WIN.
231
All BASIC commands Section 4-2
4-2-198 REMAIN
/i
232
All BASIC commands Section 4-2
4-2-199 RENAME
/i
4-2-200 REP_DIST
/i
233
All BASIC commands Section 4-2
4-2-201 REP_OPTION
/i
Bit Description
0 The repeated distance range is controlled by bit 0 of the REP_OPTION param-
eter.
• If REP_OPTION bit 0 is off, the range of the demanded and measured posi-
tions will be between -REP_DIST and REP_DIST.
• If REP_OPTION bit 0 is on, the range of the demanded and measured posi-
tions will be between 0 and REP_DIST.
1 The automatic repeat option of the CAMBOX and MOVELINK commands are
controlled by bit 1 of the REP_OPTION parameter. The bit is set on to request
the system software to end the automatic repeat option. When the system soft-
ware has set the option off it automatically clears bit 1 of REP_OPTION.
/i
Arguments N/A
Example No example.
See also AXIS, CAMBOX, MOVELINK, REP_DIST.
234
All BASIC commands Section 4-2
4-2-202 REPEAT..UNTIL
/i
4-2-203 RESET
/i
4-2-204 RETURN
See GOSUB..RETURN.
235
All BASIC commands Section 4-2
4-2-205 REV_IN
/i
4-2-206 REV_JOG
/i
4-2-207 REVERSE
/i
236
All BASIC commands Section 4-2
/i
Example Run an axis in reverse. When it reaches a certain position, slow down.
DEFPOS(0) ' set starting position to zero
REVERSE
WAIT UNTIL MPOS<-129.45
SPEED=slow_speed
WAIT UNTIL VP_SPEED=slow_speed ' wait until the axis slows
OP(11,ON) ' turn on an output to show that speed is now slow
237
All BASIC commands Section 4-2
/i
4-2-208 RS_LIMIT
/i
238
All BASIC commands Section 4-2
4-2-209 RUN
/i
239
All BASIC commands Section 4-2
4-2-210 RUN_ERROR
/i
240
All BASIC commands Section 4-2
241
All BASIC commands Section 4-2
Arguments N/A
Example >> PRINT RUN_ERROR PROC(5)
9.0000
See also BASICERROR, ERROR_LINE, PROC.
242
All BASIC commands Section 4-2
4-2-211 RUNTYPE
/i
4-2-212 S_REF
/i
243
All BASIC commands Section 4-2
4-2-213 S_REF_OUT
/i
4-2-214 SCOPE
/i
244
All BASIC commands Section 4-2
Arguments • control
Set on or off to control SCOPE execution. If turned on the SCOPE is
ready to run as soon as the TRIGGER command is executed.
• period
The number of servo periods between data samples.
• table_start
The address of the first element in the TABLE array to start storing
data.
• table_stop
The address of the last element in the TABLE array to be used.
• P0
First parameter to store.
• P1
Optional second parameter to store.
• P2
Optional third parameter to store.
• P3
Optional fourth parameter to store.
Example SCOPE(ON,10,0,1000,MPOS AXIS(1),DPOS AXIS(1))
This example programs the SCOPE function to store the MPOS param-
eter for axis 1 and the DPOS parameter for axis 1 every 10 servo
cycles. The MPOS parameter will be stored in TABLE locations 0 to
499; the DPOS parameters, in TABLE locations 500 to 999. The
SCOPE function will wrap and start storing at the beginning again
unless stopped. Sampling will not start until the TRIGGER command is
executed.
Example SCOPE(OFF)
This above line turns the scope function off.
See also SCOPE_POS, TABLE, TRIGGER.
4-2-215 SCOPE_POS
/i
245
All BASIC commands Section 4-2
4-2-216 SELECT
/i
4-2-217 SERVO
/i
246
All BASIC commands Section 4-2
4-2-218 SERVO_PERIOD
/i
Value Description
500 0.5 ms
1000 1.0 ms
2000 2.0 ms
4000 4.0 ms
/i
Arguments N/A
Example No example.
See also EX.
!Caution When the parameter has been set, a power down or software reset (using EX) must be
performed for the complete system. Not doing so may result in undefined behaviour.
4-2-219 SET_BIT
/i
247
All BASIC commands Section 4-2
4-2-220 SGN
/i
4-2-221 SIN
/i
4-2-222 SPEED
/i
248
All BASIC commands Section 4-2
4-2-223 SPEED_SIGN
/i
4-2-224 SQR
/i
249
All BASIC commands Section 4-2
4-2-225 SRAMP
/i
4-2-226 STEP
See FOR..TO..STEP..NEXT.
4-2-227 STEP_RATIO
/i
250
All BASIC commands Section 4-2
Example Two axes are set up as X and Y but the axes ' steps per mm are not the
same. Interpolated moves require identical UNITS values on both axes
in order to keep the path speed constant and for MOVECIRC to work
correctly. The axis with the lower resolution is changed to match the
higher step resolution axis so as to maintain the best accuracy for both
axes.
' Axis 0: 500 counts per mm (31.25 steps per mm)
' Axis 1: 800 counts per mm (50.00 steps per mm)
BASE(0)
STEP_RATIO(500,800)
UNITS = 800
BASE(1)
UNITS = 800
See also N/A
4-2-228 STEPLINE
/i
4-2-229 STOP
/i
251
All BASIC commands Section 4-2
Arguments • program_name
The name of the program to be stopped.
• task_number
The number of the task with the program to be stopped. Range:
[1,14].
Example >> STOP progname
Example The lines from label on will not be executed in this example.
STOP
label:
PRINT var
RETURN
See also HALT, RUN, SELECT.
4-2-230 SYSTEM_ERROR
/i
Bit Description
0 SRAM error
1 Battery low error
2 - 17 Reserved for future use
18 MECHATROLINK-II device lost error (Any device in the system)
/i
Arguments N/A.
Example No example.
See also N/A
4-2-231 T_REF
/i
252
All BASIC commands Section 4-2
4-2-232 TABLE
/i
253
All BASIC commands Section 4-2
/i
Example The following line will print the value at location 1000.
>> PRINT TABLE(1000)
See also CAM, CAMBOX, DEL, NEW, SCOPE, TSIZE, VR.
4-2-233 TABLEVALUES
/i
4-2-234 TAN
/i
4-2-235 THEN
See IF..THEN..ELSE..ENDIF.
254
All BASIC commands Section 4-2
4-2-236 TICKS
/i
4-2-237 TIME
/i
4-2-238 TIME$
/i
255
All BASIC commands Section 4-2
4-2-239 TO
See FOR..TO..STEP..NEXT.
4-2-240 TRANS_DPOS
/i
4-2-241 TRIGGER
/i
4-2-242 TROFF
/i
256
All BASIC commands Section 4-2
4-2-243 TRON
/i
4-2-244 TRUE
/i
4-2-245 TSIZE
/i
257
All BASIC commands Section 4-2
Example The following example assumes that no location higher than 1000 has
been written to the TABLE array.
>> TABLE(1000,3400)
>> PRINT TSIZE
1001.0000
See also DEL, NEW, TABLE.
4-2-246 UNITS
/i
4-2-247 UNLOCK
See LOCK.
4-2-248 UNTIL
See REPEAT..UNTIL.
258
All BASIC commands Section 4-2
4-2-249 VERIFY
/i
4-2-250 VERSION
/i
4-2-251 VFF_GAIN
/i
259
All BASIC commands Section 4-2
Example No example.
See also D_GAIN, I_GAIN, OV_GAIN, P_GAIN.
4-2-252 VP_SPEED
/i
4-2-253 VR
/i
260
All BASIC commands Section 4-2
Example A transfer gantry has 10 put down positions in a row. Each position may
at any time be full or empty. VR(101) to VR(110) are used to hold an
array of ten 1 ' s and 0 ' s to signal that the positions are full (1) or empty
(0). The gantry puts the load down in the first free position. Part of the
program to achieve this would be as follows:
movep:
MOVEABS(115) ' Move to first put down position
FOR VR(0) = 101 TO 110
IF (VR(VR(0)) = 0) THEN GOSUB load
MOVE(200) ' 200 is spacing between positions
NEXT VR(0)
PRINT "All positions are full"
WAIT UNTIL IN(3) = ON
GOTO movep
4-2-254 VRSTRING
/i
261
All BASIC commands Section 4-2
4-2-255 WA
/i
Note: WAIT IDLE is a command specifically designed to wait until the previous movement
has been finished so, it handles the delay from when the previous command is exe-
cuted in the program until the command is correctly loaded in the motion buffer.
262
All BASIC commands Section 4-2
263
All BASIC commands Section 4-2
4-2-259 WDOG
/i
4-2-260 WHILE..WEND
/i
264
All BASIC commands Section 4-2
4-2-261 XOR
/i
Arguments • expression1
Any valid BASIC expression.
• expression2
Any valid BASIC expression.
Example VR(0)=10 XOR 18
The XOR is a bit operator and so the binary action taking place is as fol-
lows: 01010 XOR 10010 = 11000. The result is therefore 24.
See also N/A
265
All BASIC commands Section 4-2
266
How-to’s Section 5-1
SECTION 5
Examples
This chapter gives 2 categories of examples and tips:
• How-to’s.
• Practical examples.
5-1 How-to’s
5-1-1 Startup program
The purpose of this program is to compare the detected MECHATROLINK-II
configuration with the expected one (the expected configuration is the
configuration existing in the moment you create the program).
The STARTUP program does these actions:
• Checks the number of nodes in the system.
• Checks that the node numbers agrees.
• Checks if all slaves are connected and have power.
• Any non agreement, the program stops.
• Sets the correct ATYPE as selected in the intelligent axis window.
• Sets the mode, Run or Commisioning.
To set the program to run at power up, select the Run at Power Up check box
and select a priority in the list. Possible priority values are Default or 1 (lowest
priority) to 14 (highest priority).
To set the program not to run at startup, clear the Run at Power Up check
box.
Note: OMRON recommends that the statement RUN “your_program” is used at the end of
the Startup program to start your application program. The application program starts
when the startup program is executed successfully and without errors.
If you set an application program to “Run at startup” there is a risk that the machine
starts if there is an error on the MECHATROLINK-II bus.
267
How-to’s Section 5-1
If the associated Basic Execution Enable flag is set in the PLC during program
transfer with Trajexia Studio, programs in the CJ1W-MC@72 may be
corrupted. When the PLC is not in Program Mode, it is strongly recommended
that the PLC is switched to Program Mode before program transfer and that
the mode is not changed until transfer is completed.
5-1-1-2 Example
'================================================
'THE FIRST PART OF THE PROGRAM
'CONSISTS OF A CHECK SEQUENCE TO
'VERIFY THAT THE DETECTED AXIS CONFIGURATION IS THE
'EXPECTED ONE.
'IF YES, THE PROGRAM FINISHES AND STARTS "APPLICATION".
'IF NOT, THE PROGRAM STOPS AND NO OTHER PROGRAM STARTS.
'THIS PROGRAM MUST BE SET TO RUN AT POWER UP IN 'A LOW
'PRIORITY TASK (1 IN THIS EXAMPLE)
'================================================
'Start MECHATROLINK Section
' Check detected slaves
' Unit 0
IF NOT MECHATROLINK(0,3,0) THEN
PRINT "Error getting slave count for unit 0"
STOP
ELSE
IF VR(0) <> 3 THEN
PRINT "Incorrect slave count for unit 0"
STOP
ENDIF
ENDIF
IF NOT MECHATROLINK(0,4,0,0) THEN
PRINT "Error getting address for unit 0, station 0"
STOP
ELSE
IF VR(0) <> 65 THEN
PRINT "Incorrect address for unit 0, station 0"
STOP
ENDIF
ENDIF
IF NOT MECHATROLINK(0,4,1,0) THEN
PRINT "Error getting address for unit 0, station 1"
STOP
ELSE
IF VR(0) <> 66 THEN
PRINT "Incorrect address for unit 0, station 1"
STOP
ENDIF
ENDIF
IF NOT MECHATROLINK(0,4,2,0) THEN
PRINT "Error getting address for unit 0, station 2"
STOP
ELSE
IF VR(0) <> 67 THEN
PRINT "Incorrect address for unit 0, station 2"
STOP
ENDIF
ENDIF
268
How-to’s Section 5-1
The example values for the program and motion parameters in the Trajexia
system are given below. Note that they are appropriate for 13-bit encoders
and Sigma-II Servo Drivers.
/i
269
How-to’s Section 5-1
/i
CJ1W-MC_72 DRIVE
_ 10V
+
Position loop
SERVO = OFF SERVO = OFF
+
Profile generator _
Measured
Position
Encoder Signal
E M
In this mode the position loop is closed in Trajexia and the Speed loop is
closed in the Servo Driver. The Speed axis parameter is sent to the Servo
Driver, and reads the position feedback.
BASE(0)
ATYPE=44 'Servo axis encoder mode
SERVO=1
WDOG=1
DEFPOS(0)
loop:
MOVE(81920)
WAIT IDLE
WA(100)
DEFPOS(0)
GOTO loop
270
How-to’s Section 5-1
Example 1
Only proportional gain has a set value, the Following Error is proportional to
the speed.
The parameter values for the example are:
/i
Note: The colours and scale of the oscilloscope for speed mode are as follows:
Red: MSPEED (Measured Axis speed). Units is 50 units/ms/division
Blue: FE (Following Error). Units is depending on the graph
Green: MPOS (Measured Axis position). 50000 units/division
271
How-to’s Section 5-1
Example 2
The value for rigidity is increased. The error magnitude remains the same but
the ripple, the speed stability and overshoot are better.
The parameter values for the example are:
/i
272
How-to’s Section 5-1
Example 3
273
How-to’s Section 5-1
Example 4
The value of the parameter P_GAIN two times the value in example 1. The
Following Error is half, but there is vibration due to the excessive gains.
The parameter values for the example are:
/i
274
How-to’s Section 5-1
Example 5
The value of the parameter P_GAIN is set to the value in example 1. The
value of VFF_GAIN is increased. The Following Error is reduced without a
reduction to the stability. The Following Error is not proportional to the speed.
The parameter values for the example are:
/i
275
How-to’s Section 5-1
Example 6
276
How-to’s Section 5-1
Example 7
277
How-to’s Section 5-1
Example 8
Opposite to the P_GAIN, where the higher, the better (the limit is when the
mechanical system starts vibrating), for the VFF_GAIN there is an optimum
value (the one in test 6), values higher than this value has an error
proportional to the speed/acceleration but with different sign. The required
correction is too large.
The parameter values for the example are:
/i
278
How-to’s Section 5-1
CJ1W-MC_72 SERVO
Torque Loop
Position loop
Position Loop is +
deactivated
(Gains are not _
used!) Demanded Following Speed
position error command
Measured
position
E M
In this mode the position and speed loop are closed in the Servo Driver. The
CJ1W-MC@72 sends the position command through the MECHATROLINK-II
network to the Servo Driver, and reads the position feedback.
Note that this system has no sample delay as compared to the position loop in
the Servo Driver, the Demanded Position in cycle "n" with the Measured
Position in cycle "n".
The CJ1W-MC@72, for the internal handling, continues to use its own position
loop, so the Following Error that read in the Axis parameter in the CJ1W-
MC@72 is not the real one in the Servo Driver. To read the correct Following
Error use DRIVE_MONITOR.
Adjust the rigidity of the servo, the speed loop gain and the position loop gain
at the same time using just proportional position gain. The results are similar
to the MECHATROLINK-II Speed mode with the advantages:
• The tuning is more simple, only the rigidity (Fn001) and, if necessary, the
feedforward gain (Pn109) needs to be set.
• The position loop in the servo is faster (250μs) than in the CJ1W-MC@72
and it is turned together with the speed loop.
• There is no sample time delay between "Target position" and "Measured
position”.
279
How-to’s Section 5-1
Example 1
The Following Error is proportional to the speed. There is a "soft profile" due to
the low rigidity setting (low gain).
Note: The colours and scale of the oscilloscope for position mode are as follows:
Red: MSPEED (Measured Axis speed). Units is 50 units/ms/division
Blue: DRIVE_MONITOR (set as Following Error in the Servo Driver). Units is depend-
ing on the graph
Green: MPOS (Measured Axis position). 50000 units/division
The parameter values for the example are:
/i
280
How-to’s Section 5-1
Example 2
281
How-to’s Section 5-1
Example 3
With high gain the motor starts to vibrate but the profile is more stable that in
MECHATROLINK-II Speed mode.
The parameter values for the example are:
/i
282
How-to’s Section 5-1
Example 4
The effect of the Feedforward gain is that the Following Error is reduced and
the effect is proportional to the acceleration.
The parameter values for the example are:
/i
283
How-to’s Section 5-1
Example 5
With the feedforward set to 100%, the Following Error is very small and
proportional to the acceleration. The optimum value of 100% correction is the
maximum value that can be set. The parameter value of Pn109 is easier to set
than the parameter value of VFF_GAIN.
The parameter values for the example are:
/i
284
How-to’s Section 5-1
However, the user must be aware that not only the UNITS axis parameter
matters in the conversion between encoder counts and user defined units.
Certain Servo Driver parameters and some characteristics of the mechanical
system are also important. The following sections describe which Servo Driver
parameters are important for this conversion. We also give examples of how to
set those parameters and the UNITS axis parameter, taking the characteristics
of the mechanical system into account.
Note: The remainder of this section uses the parameters of the Sigma-II Servo Driver, that is,
Pn202 and Pn203. If you use a Sigma-V, a Junma or G-series Servo Driver, you must
use the corresponding parameters.
If a servo motor with an absolute encoder is used, setting parameter Pn205
(Multiturn limit) is also necessary.
MOVE(x)
encoder_counts,
reference_units, the ultimate minimum distance
the minimum unit you can set you can recognize and
internally to the servo depends on the encoder
driver
*Pn202/Pn203 Motor
* UNITS
encoder
285
How-to’s Section 5-1
The UNITS axis parameter effectively expresses the ratio between user units
that the user wants to use in the program and the position sent to the Servo
Driver via the MECHATROLINK-II bus. Taking the electronic gear setting into
account, the equation expressing the relation between user units, the UNITS
parameter, parameters Pn202 and Pn203, encoder pulses and mechanical
measurement units is:
where y is the number of encoder counts and x is the amount in user units.
5-1-3-2 Example 1
13-bit
incremental 1:10 Gear
encoder
The mechanical system consists of a simple rotary table. A servo motor with
13-bit incremental encoder is used. The gear ratio of the gearbox is 1:10.
The desired user units are degree of angle. This system can be described with
the following equations:
13
1 . motor_revolution = 2 . encoder_counts
10 . motor_revolution = 1 . machine_cycle
o
1 . machine_cycle = 360
13
Pn202 2 . encoder_counts 10 . motor_revolution 1 . machine_revolution
. UNITS = =
1 . motor_revolution 1 . machine_revolution
o
Pn203 360
13
2 .10 encoder_counts
360 degree
And therefore:
13
Pn202 2 .10
. UNITS =
Pn203 360
From this equation, we can derive the values for Pn202, Pn203 and UNITS,
given the following restrictions and recommendations:
286
How-to’s Section 5-1
Pn202 13 10
UNITS . =2
Pn203 360
13
UNITS = 2 = 8192
Pn202 = 10
Pn203 = 360
When we consider the third recommendation from the above list (avoid
situations where Pn202/Pn203 is less than 0.01 or greater than 100), we can
rewrite the last equation to:
5
Pn202 13 10 8 2 8 32
UNITS· =2 =2 =2
Pn203 360 36 36
8
UNITS = 2 =256
Pn202 = 32
Pn203 = 36
With these values, the command MOVE(28) rotates the table 28 degrees in
positive direction.
which makes it Pn205 complete turns, plus the position within one turn (the
fraction from 0 to and excluding 1). When the MECHATROLINK-II connection
is established with the drive, the absolute encoder position is read from the
drive and the value is written in MPOS (after the conversion: UNITS × Pn202/
Pn203). When the mechanical system has a limited travel distance to move,
like in a ball screw, the value of the parameter Pn205 should be set large
enough to have an overflow of the counter out of the effective position. This is
287
How-to’s Section 5-1
called limited axis or finite axis. A typical example of a limited axis is a ball
screw, as shown in . When the mechanical system always moves in the same
direction, it reaches the overflow of the multiturn counter. In this case, the
value of Pn205 must guarantee that the overflow always occurs in the same
position with respect to the machine. This is called unlimited axis and a typical
example of it is a turntable shown in . It can be achieved with the following
equation: the smallest value of m such that:
n . machine_cycles = m . motor_revolution
5-1-3-4 Example 2
60
16-bit
absolute 1:10 Gear
encoder
The mechanical system consists of simple rotary table shown in the figure. A
servo motor with 16-bit absolute encoder is used. The gear ratio of the
gearbox is 1:10. The desired user units are degree of angle. The rotary table is
divided in six sections of 60 degrees each. Therefore the machine_cycle is 60
degrees.
When we apply the last equation to the above, we get:
5 . motor_revolution = 3 . machine_cycle
Pn205 = 5-1 = 4
11
UNITS = 2 = 2048
Pn202 = 32
Pn203 = 36
288
How-to’s Section 5-1
To guarantee the correct overflow both in the CJ1W-MC@72 and in the Servo
Driver, we must set two additional axis parameters: REP_DIST = 60, and
REP_OPTION = 1. With these settings, the command MOVE(35) rotates the
table 35 degrees in positive direction. The range of possible MPOS and DPOS
values is from 0 degrees to 60 degrees.
!Caution You must initialize the absolute encoder before you use it for the first time, when the
battery is lost during power off and when the multiturn limit setting in the parameter
Pn205 is changed. The initialization can be done on the display of the Servo Driver or
with the software tool. For more detail on initialising absolute encoder, please see the
Sigma-II Servo Driver manual.
!Caution It is possible to reset the multiturn counter, but it is not possible to reset the position
within one turn (the fraction from 0 to and excluding 1). To adjust zero offset, use the
parameter Pn808. For more details see the NS115 MECHATROLINK-II Interface Unit
manual.
!Caution At power up, the absolute encoder position is read from the motor and written to MPOS
using the following conversion:
• For MPOS:
1 Pn203
Absolute_MPOS = abs_position_encoder . .
UNITS Pn202
• This is correct if
Pn203
(Pn205 + 1) . . encoder_counts < 224
Pn202
• If this value is greater than 224, MPOS can have incorrect values at start-up. To
avoid this problem, add the program code DEFPOS = ENCODER/UNITS after all
UNITS initializations.
!Caution To make sure that the absolute position is always correct, you must make sure that
and that
Pn203
(Pn205 + 1) . encoder_resolution . < 232
Pn202
Note that this is not obvious for the high-resolution encoders of the Sigma-V and G-
Series motors.
289
How-to’s Section 5-1
5-1-3-5 Example 3
M r
17-bit absolute 1:6.31
encoder Gear
r = 320/(2*PI)
1 turn = 320mm move
The mechanical system uses a servo motor with an 17-bit absolute encoder.
The mechanical gear ratio of the gearbox is 1:6.31. One rotation of the pulley
moves the moving part on the belt 320 mm. The total length of the belt, and
therefore the total moving range of the motion part, is 4160 mm.
The mechanical measurement units must be mm. This means that all axis
parameters and commands given to the CJ1W-MC@72 are expressed in mm.
Using the same procedure as in example 1, the equation expressing the
relationship between user units and encoder counts is:
17
Pn202 2 . encoder_counts 6.31 . motor_revolution 1 . pulley_revolution
UNITS = =
Pn203 1 . motor_revolution 1. pulley_revolution 320mm
17
2 . 6.31 encoder_counts
320 mm
Therefore:
17 17
Pn202 2 . 6.31 2 631 12 631 12 631 9 631
UNITS = = 5 =2 =2 3. =2
Pn203 320 2 1000 8.125 2 125 125
9
UNITS = 2 = 512
Pn202 = 631
Pn203 = 125
Note that we have not used the pulley radius in the calculation. This is to avoid
the use of , which cannot be expressed as a fractional number). In toothed
pulleys, the number of teeth and mm per tooth is commonly used.
The calculation of the multiturn limit setting is:
m . motor_revolution = n . machine_cycle
4160 . pulley_revolution
m . motor_revolution = n . machine_cycle = n . 13 . pulley_revolution
320 . machine_cycle
6 . 31 motor_revolution
= n . 13 = n . 82.03 . pulley_revolution
1 pulley_revolution
m = n . 82.03
The smallest integer m for which this equation is valid is 8203. This results in
Pn205 = 8202.
290
How-to’s Section 5-1
In addition, to limit the motion units range to the moving range of the motion
part, the following axis parameters must be set: REP_DIST = 4260, and
REP_OPTION = 1. With these settings, executing MOVE(38) moves the
moving part 38 mm in forward direction. The range of possible MPOS and
DPOS values is 0 mm to 4160 mm.
5-1-3-6 Example 4
M r
The mechanical system uses a servo motor with a 17-bit absolute encoder.
The mechanical gear ratio of the gearbox is 1:12.24. The mechanical
measurement units must be tenths of an angle degree. Therefore the total
repeat distance for the full turn of the moving part is 3600 tenths of an angle
degree.
With the same procedure as in example 1, we have:
17
Pn202 2 . encoder_counts 12.24 . motor_revolution 1 . pulley_revolution
UNITS = =
Pn203 1 . motor_revolution 1 . machine_revolution 3600 tenth of degree
17
2 . 12.24 encoder_counts
=
3600 tenth of degree
Therefore:
Pn202 17 1224
UNITS = =2
Pn203 360000
17
UNITS = 2 = 131072
Pn202 = 1224
Pn203 = 360000
Because the greatest common divisor of Pn202 and Pn203 must be 1, we get:
Pn202 = 17 and Pn203 = 500. Therefore, the parameters are:
UNITS = 131072
Pn202 = 17
Pn203 = 500
Pn205 = 16
REP_DIST = 3600
REP_OPTION = 1
291
How-to’s Section 5-1
The evident solution is: n = 100 and m = 1224. Or, when we simplify the
factors: n = 25 and m = 306. Therefore: Pn205 = m – 1 = 305. With these
settings, executing MOVE(180) moves the moving part 180 tenths of an angle
degree or 18 angle degrees in forward direction.
5-1-3-7 Example 5
M
17-bit absolute 1:10 Gear
encoder
Pulley: 12 teeth
50mm between teeth
Main Wheel: 144 stations
50 mm between stations
The mechanical system uses a servo motor with a 17-bit absolute encoder.
The mechanical gear ratio of the gearbox is 1:10. The pulley has got 12 teeth,
and each two are 50 mm apart. One complete turn of the pulley equals 144
stations on the main wheel. The distance between two stations is 50 mm. The
mechanical measurement units must mm. Total repeat distance must be the
distance between two stations, 50mm.
With the same procedure as in example 1, we have:
Pn202
UNITS =
Pn203
17
2 . encoder_counts 10 . motor_revolution 1 . pulley_revolution 1 . station
. . =
1 . motor_revolution 1 . pulley_revolution 12 . station 50mm
17
2 . 10 encoder_counts
=
12 . 50 mm
Therefore, if we use the mechanical system to set the electronic gear ratio, we
have:
17
Pn202 2 10
UNITS =
Pn203 50 12
17
2
UNITS =
50
Pn202 = 5
Pn203 = 6
Pn205 = 4
Pn202 17 10 17 10 17 1 17 1 15 1
UNITS =2 =2 =2 =2 2 =2
Pn203 50 . 12 600 60 2 .15 15
Therefore, the parameters are:
292
How-to’s Section 5-1
15
UNITS = 2 = 32768
Pn202 = 1
Pn203 = 15
Pn205 = 4
REP_DIST = 50
REP_OPTION = 1
With these settings, executing MOVE(50) moves the moving part 50 mm, or
one station.
5-1-3-8 Example 6
10mm
M
17-bit absolute 1:3 Gear
encoder
540mm
The mechanical system consists of a ball screw. It uses a servo motor with a
17-bit absolute encoder. The mechanical gear ratio of the gearbox is 1:3. The
screw pitch of the ball screw is 10mm per revolution. The total travel distance
of the ball screw is 540 mm. The mechanical measurement units must be mm.
With the same procedure as in example 1, we have:
17
Pn202 2 . encoder_counts 3 . motor_revolution 1 . ballscrew_revolution
UNITS = =
Pn203 1 . motor_revolution 1 . ballscrew_revolution 10mm
17
2 . 3 encoder_counts
=
10 mm
Therefore:
Pn202 17 3 17 3 16 3
UNITS = 2 =2 . =2
Pn203 10 2 5 5
16
UNITS = 2 = 65536
Pn202 = 3
Pn203 = 5
The calculation of the multiturn limit setting parameter Pn205 is not needed in
this case because the ball screw is a system with a fixed (limited) axis. It is
enough to set this value large enough to have the overflow of the counter out
of the effective position. Also, because of the axis is finite, it is not important to
set the REP_OPTION parameter, because REP_DIST must be set large
enough so it is outside of the maximum effective position (540 mm). One
solution is: REP_DIST = 1000 and REP_OPTION = 0.
With these setting, executing MOVE(17) moves the ball screw 17 mm in
forward direction.
293
How-to’s Section 5-1
All outputs are unique to the controller. They are not accessed per axis.
All inputs are unique to the controller. They are not accessed per axis.
294
How-to’s Section 5-1
The inputs in the table above are located on the CN1 I/O connector of the
respective Servo Driver. The pin arrangement of this connector is different for
the respective Servo Drivers. For the Sigma-II and Sigma-V Servo Drivers, the
input signals P_OT, N_OT, DEC, EXT1, EXT2, EXT3, BRK, IO12, IO13, IO14
and IO15 can be mapped to pins of the CN1 I/O connector. To do this, you
must set the appropriate parameter of the Servo Driver. The table below
shows the possible settings and parameter values.
295
How-to’s Section 5-1
/i
296
How-to’s Section 5-1
For the Junma Servo Driver, all input signals are mapped to a fixed location on
the CN1 I/O connector. The table below shows the input signals and pin
numbers.
/i
For the G-Series Servo Driver, all input signals are mapped to a fixed location
on the CN1 I/O connector. The table below shows the input signals and pin
numbers.
/i
For the Accurax G5 Servo Drivers, the CN1 input pins IN1 to IN8 can be
allocated to a specific function. To do this, you must set the appropriate
parameter of the Servo Driver. The table below shows the parameters to
allocate a function to a CN1 input pin.
/i
297
How-to’s Section 5-1
The table below lists the available functions which can be allocated to the CN1
input signals.
/i
For more information on the CN1 I/O connector pins on the Servo Drivers,
refer to the specific Servo Driver manuals.
Servo Driver inputs that are mapped into the CJ1W-MC@72 I/O space like this
are accessed within the program per axis and cannot be accessed in the usual
way with the IN command. The only way you can use these inputs in the
program is to assign them to the axis parameters DATUM_IN, FHOLD_IN,
FWD_IN and REV_IN. The inputs of the axis Servo Driver are used,
depending on the axis of which the parameters are set.
REV_IN AXIS(0) = 22
REV_IN AXIS(3) = 22
Note that even though REV_IN parameters for both axes have the same
value, the real inputs used are not the same. For axis 0 the input on CN1-44 of
the Sigma-II driver (assigned to axis 0) is used, but for axis 3 the input on
CN1-41 of the Junma driver (assigned to axis 3) is used. Therefore we say
that those inputs are accessed per axis, they are not unique for the whole
controller. In general, these two inputs have a different status at the same
time. Also note that neither of these two inputs can be accessed using the
command IN. For example the command IN(22) returns the status of controller
software input 22 (unique for all axes), which has a different status than Servo
298
How-to’s Section 5-1
Note: If a forward limit, reverse limit and origin input signal are used for an axis, it is strongly
recommended to use the following settings for the axis:
BASE(axis_number)
DAT_IN=18
' /DEC input in the corresponding Servo Driver is
' assigned
FWD_IN=16
INVERT_IN(16,ON)
' P_OT input in the corresponding Servo Driver is
‘ assigned. It is necessary to invert the signal
' because a Normally Closed input is expected.
REV_IN=17
INVERT_IN(17,ON)
' N_OT input in the corresponding Servo Driver is
‘ assigned. It is necessary to invert the signal
' because a Normally Closed input is expected
Also note that INVERT_IN inverts the selected input in all axes.
299
How-to’s Section 5-1
For more details on these pre-defined homing sequences, see section 4-2-65.
In some situations, more complex homing sequences are required:
• Absolute switch origin search plus limit switches.
• Origin search against limit switches.
• Origin search against hardware parts blocking movement.
300
How-to’s Section 5-1
moving part
encoder
min. limit switch ON OFF OFF ON max. limit switch
The figure shows a general origin search scenario. This simple origin search
sequence has 3 steps:
1 Search for a signal.
2 Search for another signal.
3 Move the axis to a predefined position.
Note: For safety reasons, limit switches are normally closed. For this reason, in this figure and
in the following figures in this section, the low signal level is indicated as ON, and the
high signal level is indicated as OFF.
It is important to note that, before any homing procedure is executed, it is
necessary to set the axis parameters UNITS, REP_DIST and REP_OPTION,
and Servo Driver parameters Pn202, Pn203 and Pn205 properly and in
accordance with the mechanical system and desired measurement units used
in programming. Those parameters have influence to the origin search,
especially if an absolute encoder is used. For more information on setting
these parameters, see section 5-1-2.
moving part
301
How-to’s Section 5-1
REVERSE FORWARD
The figure shows the possible scenarios for absolute origin search plus limit
switches. These scenarios depend on the position of the moving part when the
power comes on.
The program example that does this origin search sequence is given below.
302
How-to’s Section 5-1
moving part
REVERSE FORWARD
The possible scenarios for origin search against limit switches, depending on
the position of the moving part on power on, are shown in the figure.
The program example that does this origin search sequence is given below.
303
How-to’s Section 5-1
moving part
This origin search procedure performs origin search against a physical object
and mechanically blocks the movement. There are no limit switches, no
absolute position switch and no reference pulses. The origin position is
detected by detecting a particular amount of torque against the blocking
objects. An adequate torque limit is required in order not to damage the
mechanics during the origin search process. The example for this homing
procedure is shown in the figure.
The program example that does this origin search sequence is given below.
BASE(0)
DRIVE_CONTROL=11 'Monitor torque with DRIVE_MONITOR
SERVO=ON
WDOG=ON
SPEED=CREEP
REVERSE
WA(1)
WAIT UNTIL DRIVE_MONITOR < -100
'Wait for particular amount of applied torque
CANCEL
DEFPOS(0)
MOVEABS(10) 'This is necessary, otherwise the position
'is kept pushing the hardware limit of the
'machine and the motor trips by overload
moving part
encoder
min. limit switch ON OFF OFF ON max. limit switch
304
How-to’s Section 5-1
This origin search procedure performs origin search by searching for the "Zero
Mark" signal of the encoder. This signal is also known as "marker" or
"reference pulse". It appears one time per full encoder revolution. The
example for this homing procedure is shown in the figure.
encoder 2 pulses
REVERSE FORWARD
The possible scenarios for origin search using encoder reference pulse "Zero
Mark", depending on the position of the moving part on power on, are shown
in the figure.
The program example that does this origin search sequence is given below.
'Origin and left limit switch: IN0
'Right limit switch: IN1
REV_IN=-1
BASE(0)
DATUM_IN=0
SERVO=ON
WDOG=ON
DATUM(6)
WA(1)
WAIT IDLE
5-1-6 Registration
Registration, also called ‘latch’ or ‘print registration’, is about real-time storing
of the position of an axis when an external input is activated. The information
that is registered, i.e. stored, is processed later, not in real time, by the
application program.
Registration is different from processing an interrupt input or signal. With
registration, no event is generated when the registration input is activated.
Also, the normal execution of the application program is not disturbed or
305
How-to’s Section 5-1
The advantage of registration is that it is done very quickly. Therefore, the axis
position that is stored is very accurate. To achieve this speed and accuracy,
registration is implemented with hardware, and the registration input must be
on the same board as the encoder input that provides information on the axis
position.
Capturing and storing the axis position is done in real time by the hardware.
Processing this information is done not in real time by the application program.
306
How-to’s Section 5-1
The input used for registration is determined by the argument of the REGIST
command.
Latch input
Position
Interpolated
position
62.5μs
t
The delay in the capture in the Sigma-II Servo Driver is about 3 s. As the
encoder information is refreshed every 62.5 s, it is necessary to make
interpolation to obtain the right captured position value (see the picture). Since
the motor speed cannot change much during 62.5 s, the resulting accuracy is
very high.
The delays in transmission of the information are:
• Delay in triggering the registration: 0.625 ms to 4 ms.
• Delay in receiving the registration: 3.5 ms.
• Delay in capturing the registration: 3 s.
It is also possible to use the encoder Z-mark to register an axis position. This
is also done with the argument of the REGIST command.
In contrast with other types Servo Drivers, the G-series Servo Drivers do not
support executing registration while it is in base-block state. The registration
can be executed on G-Series Servo Drivers only when WDOG is set to ON. If
307
How-to’s Section 5-1
The table below lists the available settings to allocate EXT1, EXT2 and EXT3
to the CN1 input signals.
/i
In contrast with other types Servo Drivers, the Accurax G5 Servo Drivers do
not support executing registration while it is in base-block state. The
registration can be executed on Accurax G5 Servo Drivers only when WDOG
is set to ON. If registration is required when the Accurax G5 Servo Driver is in
base-block state, this workaround can be used: put the Accurax G5 Servo
Driver in torque mode with zero torque by executing:
• ATYPE=42
• T_REF=0
308
How-to’s Section 5-1
Position
t
The trigger is active The trigger is active
REGIST(0)
Registration Input
The picture gives the sequence of executing the commands and the
registrations of the sample program below.
BASE(N)
REGIST(0)
WAIT UNTIL MARK=0
loop:
WAIT UNTIL MARK=-1
PRINT "Position captured in: "; REG_POS
REGIST(0)
WAIT UNTIL MARK=0
GOTO loop
309
How-to’s Section 5-1
0 10 20 30 40
MARK=TRUE
REG_POS=27
310
How-to’s Section 5-1
Position
CLOSE_WIN
OPEN_WIN
t
No Registration, the position The trigger is active
REGIST(0) is outside the window
Registration Input
The figure shows the sequence of execution of the above commands and the
occurrence of registration events when you use inclusive windowing.
There are delays between these events:
• Trajexia receives the latch.
• Trajexia decides to trigger the latch again.
• The latch is triggered.
311
How-to’s Section 5-1
Vertical
sealer
External encoder
for slip compensation
Mark sensor
Feeder
The picture shows the vertical fill and seal machine for packaging products
into bags. The bag material comes from a plastic film coil that is unwinded,
then it is shaped into the tube by a mechanical mandrel and at the same time
the tube is sealed vertically. The feeder movement is intermittent and the feed
length corresponds with the bag length. Once the bag is fed, the horizontal
sealer closes the bag, so it can be filled with the product. After that, the
process starts again, feeding the new bag.
Δd
20Δd
100Δd
The feeder can work in two modes: without registration mark; and with
registration mark. Working without the registration mark is a simple point-to-
point incremental movement. In this case, there is no guarantee that the
feeder moves exactly the same distance as the design pattern. For example,
suppose the bag length that needs to be fed is 200 mm, but the real pattern is
200.1 mm. With simple point-to-point incremental movement without
312
How-to’s Section 5-1
t
1- The rising edge of The area below the graph
the registration captures (distance) is "D"
the feeder position
The motion profile and its modification due to the registration mark are shown
in .
The BASIC program for this example is:
DEFPOS(0)
REGIST(3) 'Trigger the mark registration
MOVE(bag_length) 'Move to the theoretical distance
WA(1)
WAIT UNTIL MARK OR MTYPE=0
IF MARK THEN
end_position=REG_POS+distance_after_mark
MOVEMODIFY(end_position)
'Correct the distance according to the mark
ENDIF
313
How-to’s Section 5-1
Transporting belt
Master axis
The picture shows a flying shear cutting the "head" of wood tables. When the
wood comes, the edge of the wood is detected by the photocell and, at the
exact moment, the movement of the flying shear starts to be synchronized with
the right position on the wood.
If the movement is started by the program, upon detecting a signal from the
photocell, there is always at least one SERVO_PERIOD of time of uncertainty.
Instead, the movement is started using the MOVELINK command with
link_option=1, which means that the link to the master axis starts when the
registration event occurs on link (master) axis.
The corresponding program sequence is:
REGIST(2) AXIS(master)
MOVELINK(dst,lnk_dst,lnk_acc,lnk_dec,master,1) AXIS(slave)
For more information on the MOVELINK command and the link_option
argument, refer to section 4-2-159.
The picture shows how the position of the slave axis is corrected using the
registration event on the master axis to start the movement of the slave axis.
The influence of SERVO_PERIOD and the fact that the registration event can
happen at any time inside the SERVO_PERIOD is completely eliminated.
314
How-to’s Section 5-1
5-1-7-3 Example
This section gives you a practical example on the use of the SCOPE and
TRIGGER commands, and how to use them in combination with the
oscilloscope to monitor axis parameters and troubleshoot the system. For
more information on the SCOPE and TRIGGER commands, refer to sections
4-2-214 and 4-2-241.
315
How-to’s Section 5-1
Suppose the motion system consists of two axis, AXIS(0) and AXIS(1).
AXIS(0) is the master axis. It makes a simple forward movement. AXIS(1) is
the slave axis. It must follow the master axis in accordance to cosine rule:
where x0 is the position of the master AXIS(0), and x1 is the position of the
slave AXIS(1). You can link the two axis with the CAMBOX command. For
more details, refer to section 4-2-44. Suppose furthermore that the parameter
end_pos is not constant, but it can change due to different conditions of the
motion system. The part of the program that creates the CAM table is:
'Initializations
FOR i=0 TO 1
BASE(i)
ATYPE=40
UNITS=8192
REP_DIST=20
REP_OPTION=1
FE_LIMIT=1
DRIVE_CONTROL=11
SPEED=8
ACCEL=50
DECEL=50
DEFPOS(0)
SERVO=ON
CANCEL
NEXT i
WDOG=ON
BASE(1)
'Scope settings:
316
How-to’s Section 5-1
317
How-to’s Section 5-1
In the example given above, the value of the UNITS parameter is set to
encoder counts. The position of the master axis MPOS AXIS(0) is given in red.
The position increases linearly, because the speed of the master axis is
constant.
The demanded position of the slave axis DPOS AXIS(1) is given in blue. This
graph is a cosine curve. It corresponds to the created CAM table.
The measured speed of the slave axis MSPEED AXIS(1) is given in yellow.
This graph is a sinusoidal curve, because the speed is a derivative of the
position, and the derivative of the cosine is the sine. At high speeds, there are
some ripples.
The green graph is the torque of the motor for the slave axis set with
DRIVE_COMMAND=11 as a percentage of the nominal torque. The torque is
proportional to the acceleration. Because the acceleration is a derivative of the
speed and the speed is sinusoidal curve, the acceleration (and also the
torque) is a cosine curve. There is one peak at the start and another peak at
the stop because there is a discontinuity in the acceleration. There is also a
high frequency oscillation in the torque curve, suggesting a resonance
frequency that can be eliminated using the notch filter settings in the Sigma-II
Servo Driver. The high frequency is reinforced, because it is also reflected in
the speed curve. For more information on notch-filter settings, refer to the
Sigma-II Servo Driver manual.
The parameter end_pos, which defines the values in the CAM table, depends
on external conditions of the system. Therefore a program that runs in another
task or even a controlling device using FINS communication, can change it
while the main program that links two axis runs. Suppose that these changes
in conditions, which result in a change of the end_pos parameter, happen
most of the time when the axes are not linked, i.e. when the CAMBOX
command is not executed. Suppose furthermore that very rarely the condition
changes when the axes are linked. The change of the end_pos parameter
triggers the recalculation of the CAM table while the CAMBOX command is
executed. The consequence is that the part of the demanded position of the
slave axis follows the profile before the change, and the other part follows the
profile after the change. In the end this leads to a discontinuation of the profile,
which causes an indefinite speed of the axis and ends up with this error: the
WDOG goes off, and all axes stop.
The scenario above is hard to analyze when you do not know what happens.
The only thing that the user sees is that the slave axis has an error once every
few hours or even less often. But the oscilloscope can clearly show where the
problem is. In order to be able to use the oscilloscope, all desired parameters
must be captured at the time of an error. This can be achieved by arranging
the application programs in a certain way. The good programming practice
suggests to have a separate start-up program that is set to run automatically
on power-up of the system and checks the integrity of the system, whether all
the expected slaves are connected and initialized. For an example of a start-
up program see section 5-1-1. It is recommended to let the start-up program,
when it is finished, start only one program that takes care of the safety and
318
How-to’s Section 5-1
This programming code causes all the programs and tracing to stop when an
error happens on any axis. The data is already captured in the Table memory,
and we can start using the oscilloscope to see the status of the desired
parameters at the moment the error occurred.
The measured position of the master axis, given in red, does not seem to be
the cause, because there is no discontinuity on it. We discard a mechanical
problem as well, because the torque, given in green, has low values. An the
moment of the problem the speed of the slave axis, given in yellow, was
smooth and low, therefore this is no problem either.
The next step is to analyze the CAM table, to see which values were used for
demanding the position of the slave axis. To do that, we change the data trace
to show a block of values from Table(0) to Table(999) in red, because these
entries are where the CAM table is created (see the part of the program that
creates the CAM table above). The changed configuration is shown in the
figure.
319
How-to’s Section 5-1
The result is given in the figure. The red graph clearly shows a discontinuity in
the position values that the slave axis must follow. Because the speed is a
derivative of the position, at the point of discontinuity of the position curve the
speed gets a high value. (This value equals infinity in theory, in practice the
value is just very big). This causes the error. The red graph shows where the
root of the problem is. The amplitude of the cosine curve, and therefore the
end_pos parameter, has been changed during the execution of the CAMBOX
command. The solution is simple: A change of the end_pos parameter during
CAMBOX execution must be prevented. To do this, either modify the
programs in Trajexia, or in some other controller (if the parameter is changed
outside of the scope of the application programs, for example by a FINS
message).
Note: The time base of the CAM TABLE points is not the same as the capture of the other sig-
nals. The discontinuity in the CAM (red graph) coincides in time with the interruption of
the movement. To analyze this, check the position values individually with a spread-
sheet program. To analyze the point values in detail, you can export the TABLE points
to a spreadsheet program for a more complex analysis.
320
Practical examples Section 5-2
System initialization
Stop Application
programs and
movements
loop
No Yes
Alarm?
Update of status
Other monitoring
321
Practical examples Section 5-2
When you define the hardware and set the parameters for the application, you
can select to add your changes to the SHELL program so, the user do not
have to type it manually.
Use the example SHELL program as a template to start, stop and reset your
machine and adjust the rest of the SHELL program according to the
requirements.
322
Practical examples Section 5-2
'ETHERNET Settings
ETHERNET(1,-1,12,9600) 'FINS port number
ETHERNET(1,-1,7,0) 'Modbus TCP Mode
ETHERNET(1,-1,9,0) 'Modbus TCP Data Configuration
323
Practical examples Section 5-2
res_bit=0
run_act=0
run_ant=0
run_bit=0
stop_act=0
stop_ant=0
stop_bit=0
'Omron Auto Generated - Local Variables End
VR(signal_state) = 0
This subroutine tests whether the detected hardware is the expected one
or not. If the right hardware is detected, it sets the right values to the
axes and servo drives
status_word=1
The main loop of the program handles the fault handling: run application
programs, stop application programs, reset the system and report the
status.
loop:
IF alarm_bit THEN
action=1 ' Alarm, push RESET to restart
IF status_word<>2 THEN
PRINT "Stop with Alarm"
GOSUB stop_all
status_word=2 'Programs stopped with error
ENDIF
IF res_bit=1 THEN
action=2 'Resetting
PRINT "Resetting"
GOSUB reset_all
status_word=1 'Programs stopped NO error
ENDIF
ELSE
action=3 'OK
IF run_bit=1 THEN
PRINT "Start application"
GOSUB start_app
status_word=3 'Application running
ENDIF
324
Practical examples Section 5-2
GOTO loop
'--------------------------------------------------------
sequence:
'RUN
run_ant=run_act
run_act=READ_BIT(0,signal_state)
run_bit=run_act AND NOT run_ant
'STOP
stop_ant=stop_act
stop_act=READ_BIT(1,signal_state)
stop_bit=stop_act AND NOT stop_ant
'RESET
res_ant=res_act
res_act=READ_BIT(2,signal_state)
res_bit=res_act AND NOT res_ant
RETURN
'--------------------------------------------------------
alarm_sequence:
'Alarm notification
325
Practical examples Section 5-2
sys_error=SYSTEM_ERROR
RETURN
'--------------------------------------------------------
stop_all:
STOP "APPLICATION"
WDOG=0
FOR i= 0 TO max_axis
BASE(i)
IF MARK=0 THEN REGIST(-1)
AXIS_ENABLE=0
SERVO=0
CANCEL(1) 'Cancel NTYPE
326
Practical examples Section 5-2
WA(1)
CANCEL(1) 'Cancel possible program buffer
NEXT i
'--------------------------------------------------------
start_app:
RUN "APPLICATION"
RETURN
'--------------------------------------------------------
reset_all:
327
Practical examples Section 5-2
RETURN
'--------------------------------------------------------
warning_seq:
IF READ_BIT(15,diag01) THEN
'Clear servodrive warning if any
IF res_bit=1 THEN
FOR i=0 TO max_axis
BASE(i)
IF ATYPE>=40 AND ATYPE<=42 THEN
IF (DRIVE_STATUS AND 2)>0 THEN DRIVE_CLEAR
ENDIF
NEXT i
ENDIF
ENDIF
RETURN
'--------------------------------------------------------
monitoring:
'--------------------------------------------------------
absencoder:
'To be implemented in the future
RETURN
'--------------------------------------------------------
system_detection:
status_word=0
action=0
VR(status_bits)=0
328
Practical examples Section 5-2
'Unit Detection
' ML04 Unit
IF COMMSTYPE SLOT(0) <> 36 THEN
PRINT "Error Comms Type for unit 0 is not ML04"
SET_BIT(0,diag03)
ENDIF
' FL Unit
IF COMMSTYPE SLOT(1) <> 33 THEN
PRINT "Error Comms Type for unit 1 is not FL"
SET_BIT(1,diag03)
ENDIF
ENDIF
329
Practical examples Section 5-2
'Detection OK
IF VR(diag01)=0 AND VR(diag02)=0 AND VR(diag03)=0 THEN
SET_BIT(15,diag01)
IF READ_BIT(15,diag01)=1 THEN
'Drive Parameters
BASE(2)
'Parameter data param_n/param_v/mask/size
TABLE(0,$20E,32,$FFFFFF,4)
TABLE(4,$210,45,$FFFFFF,4)
TABLE(8,$515,$800,$FFF0FF,2)
TABLE(12,-1)
MECHATROLINK(0,20,$43) 'SJDE-02ANA-OY
REGIST(-1)
VR(system01)=0
i=0
res=0
WHILE TABLE(i)<>-1
IF NOT DRIVE_READ(TABLE(i),TABLE(i+3),system01) THEN
SET_BIT(0,diag02)
ELSE
IF TABLE(i+2)=$FFFFFF THEN
IF VR(system01)<>TABLE(i+1) THEN
IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),TABLE(i+1),1) THEN
SET_BIT(1,diag02)
ELSE
res=1
ENDIF
ENDIF
ELSE 'Parameter set using Mask
IF (VR(system01) AND NOT TABLE(i+2))<>TABLE(i+1) THEN
VR(system01)=(VR(system01) AND TABLE(i+2)) OR TABLE(i+1)
IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),VR(system01),1)
THEN
SET_BIT(1,diag02)
ELSE
res=1
ENDIF
ENDIF
ENDIF
ENDIF
i=i+4
WEND
'Reset drive if necessary
330
Practical examples Section 5-2
IF res=1 THEN
IF NOT DRIVE_RESET THEN SET_BIT(0,diag02)
ENDIF
BASE(3)
'Parameter data param_n/param_v/mask/size
TABLE(0,$20E,32,$FFFFFF,4)
TABLE(4,$210,45,$FFFFFF,4)
TABLE(8,$50A,$8000,$FF0FFF,2)
TABLE(12,$50B,$8,$FFFFF0,2)
TABLE(16,$515,$800,$FFF0FF,2)
TABLE(20,-1)
MECHATROLINK(0,20,$44) 'SJDE-02ANA-OY
REGIST(-1)
VR(system01)=0
i=0
res=0
WHILE TABLE(i)<>-1
IF NOT DRIVE_READ(TABLE(i),TABLE(i+3),system01) THEN
SET_BIT(0,diag02)
ELSE
IF TABLE(i+2)=$FFFFFF THEN
IF VR(system01)<>TABLE(i+1) THEN
IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),TABLE(i+1),1) THEN
SET_BIT(1,diag02)
ELSE
res=1
ENDIF
ENDIF
ELSE 'Parameter set using Mask
IF (VR(system01) AND NOT TABLE(i+2))<>TABLE(i+1) THEN
VR(system01)=(VR(system01) AND TABLE(i+2)) OR TABLE(i+1)
IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),VR(system01),1)
THEN
SET_BIT(1,diag02)
ELSE
res=1
ENDIF
ENDIF
ENDIF
ENDIF
i=i+4
WEND
'Reset drive if necessary
IF res=1 THEN
IF NOT DRIVE_RESET THEN SET_BIT(0,diag02)
ENDIF
331
Practical examples Section 5-2
AXIS_ENABLE=0
DRIVE_CONTROL=0
P_GAIN=1.0000
I_GAIN=0.0000
D_GAIN=0.0000
OV_GAIN=0.0000
VFF_GAIN=0.0000
SPEED=50.0000
ACCEL=100.0000
DECEL=100.0000
CREEP=100.0000
JOGSPEED=100.0000
FE_LIMIT=10.0000
SERVO=0
FWD_IN=-1.0000
REV_IN=-1.0000
DATUM_IN=-1.0000
FHOLD_IN=-1.0000
FS_LIMIT=20000000.0000
RS_LIMIT=-20000000.0000
FASTDEC=0.0000
FHSPEED=1000.0000
OUTLIMIT=1.0000
FE_RANGE=0.0000
DAC=0.0000
332
Practical examples Section 5-2
FE_RANGE=0.0000
DAC=0.0000
333
Practical examples Section 5-2
ENDIF
' Variables
RETURN
Note: Refer to the Servo Driver and the motor data sheet for this information.
'================================================
'EXAMPLE OF INITIALIZATION PROGRAM
'THIS VERSION IS DESIGNED FOR MECHATROLINK-II SERVOS
'ADAPT THIS PROGRAM ACCORDING TO YOUR APPLICATION
'================================================
BASE(x)
restart=0
inertia_ratio=set_load_inertia_ratio
'----------------------------
'EXAMPLE 1
'SGMAH-01AAA61D-OY motor data
'----------------------------
enc_resolution=2^13 '13 bit encoder
max_speed=5000 '5000 rpm max. speed
'----------------------------
'EXAMPLE 2
'SGMAH-01A1A61D-OY motor data
'----------------------------
enc_resolution=2^16 '16 bit encoder
max_speed=5000 '5000 rpm max. speed
'----------------------------
'WRITE PARAMETERS IN THE SERVO
'----------------------------
DRIVE_WRITE($103,2,inertia_ratio) 'Write inertia ratio
DRIVE_READ($110,2,10)
IF VR(10)<>$0012 THEN
DRIVE_WRITE($110,2,$0012,1)
'Pn110=0012h (autotuning disabled)
restart=1
ENDIF
DRIVE_READ($202,2,10)
IF VR(10)<>1 THEN
DRIVE_WRITE($202,2,1,1)
'Pn202=1 (gear ratio numerator in the drive. Default
'is 4)
334
Practical examples Section 5-2
restart=1
ENDIF
DRIVE_READ($511,2,10)
IF VR(10)<>$6548 THEN
DRIVE_WRITE($511,2,$6548,1)
'Pn511 set the registration inputs in the Servo Driver
restart=1
ENDIF
DRIVE_READ($81E,2,10)
IF VR(10)<>$4321 THEN
DRIVE_WRITE($81E,2,$4321,1)
'Pn81E=$4321 To make the Digital inputs in the Servo
Driver
'available for reading through DRIVE_INPUTS word
restart=1
ENDIF
IF restart=1 THEN DRIVE_RESET
'----------------------------
'Initial gains For MECHATROLINK_SPEED
'----------------------------
'By experience this setting is a good starting point
P_GAIN=INT(214748.3648*max_speed/enc_resolution)
'This is the optimum value. Set if needed
VFF_GAIN=INT(60000*1073741824/enc_resolution/max_speed)
'----------------------------
'Initial gains For MECHATROLINK_POSITION mode
'----------------------------
'Change the rigidity (Fn001) according to the mechanical
'system
'Change feedforward gain Pn109 if required
'----------------------------
'Initial parameter of the AXIS
'----------------------------
'If set to 1 (and Pn202=Pn203=1) the UNITS are
'encoder counts
UNITS=1
'Theoretical FE we will have running the motor
'at "max_speed"
'without VFF_GAIN in MECHATROLINK SPEED
FE_LIMIT=1073741824/P_GAIN/UNITS
'SPEED is set to 1/3 of "max_speed
SPEED=(max_speed73)*enc_resolution/60/UNITS
'ACCEL in 200ms from 0 to "max_speed"
ACCEL=SPEED/0.2
'DECEL in 200ms from "max_speed" to 0
DECEL=SPEED/0.2
335
Practical examples Section 5-2
5-2-4-1 Example
'GOSUB homing
BASE(0)
DEFPOS(0)
WA(100)
loop:
MOVE(1440)
WAIT IDLE
WA(100)
GOTO loop
The units are degrees in this example, therefore:
• 13-bit encoder
• Pn202=32
• Pn203=45
• UNITS=32
The graph in the figure is typical for this point-to-point movement with linear
acceleration). Note the following:
• During linear acceleration, the graph of the position is parabolic (because
the speed is a derivative of the position).
• During constant speed, the graph of the position is straight.
• During linear deceleration, the graph of the position is counter-parabolic.
• During stop, the graph of the position is constant.
• When an overflow occurs (MPOS>=REP_DIST), the position jumps to 0 if
REP_OPTION=1 or to -REP_DIST if REP_OPTION=0.
336
Practical examples Section 5-2
A B C
IN(1)
IN(2)
speed
CANCEL
WAIT IDLE
Forward
t
Moveabs
SPEED=10
FORWARD
WAIT UNTIL IN(2)=ON
Start:
WAIT UNTIL IN(1)=ON
337
Practical examples Section 5-2
5-2-5-1 Example
start:
WAIT UNTIL IN(1)=ON
SPEED=10
FORWARD
WAIT UNTIL IN(2)=ON
prod_pos=MPOS
CANCEL
WAIT IDLE
PRINT "Product Position : "; prod_pos
SPEED=100
MOVEABS(0)
WAIT IDLE
GOTO start
A square palette has sides 1m long. It is divided into a 5 x 5 grid, and each of
the positions on the grid contains a box which must be filled using the same
square pattern of 100mm by 100mm. A dispensing nozzle controlled by digital
output 8 must be turned on when filling the box and off at all other times.
338
Practical examples Section 5-2
x
100 200
X=0
Y=0
X=1
Y=0
X=0
Y=1
X=0
Y=2
X=0
Y=3
X=4
Y=4
X=0
Y=4
x speed
y speed
Square_rel Square_rel
t
MOVEABS(0,200) MOVEABS(0,400)
OP(nozzle)
5-2-6-1 Example
nozzle = 8
start:
FOR x = 0 TO 4
FOR y = 0 TO 4
MOVEABS(x*200, y*200)
WAIT IDLE
OP(nozzle, ON)
GOSUB square_rel
OP(nozzle, OFF)
NEXT y
NEXT x
GOTO start
square_rel:
MOVE(0, 100)
MOVE(100, 0)
MOVE(0, -100)
MOVE(-100,0)
WAIT IDLE
WA(1000)
RETURN
339
Practical examples Section 5-2
A bag feeder machine feeds plastic film a fixed distance that is set by the
operator. The figure shows a typical bag feeder that is part of the machine.
The program in this section shows the typical code for a bag feeder machine.
5-2-7-1 Example
Position
Bag_distance-expected_pos+REG_POS
Bag_distance
REG_POS
Time
Speed MARK=FALSE
MARK=TRUE Mark not detected,
MOVEMODIFY no correction
MOVEABS
MOVEABS MOVEABS
REGIST(1) REGIST(1)
Time
IN(start_signal)
'================================================
'BAG FEEDER program
340
Practical examples Section 5-2
'================================================
'Working with marks, if any mark is missing, feed the
'theoretical distance. But if the mark is missing for
'a number of consecutive bags, stop the operation.
'A digital output is activated a certain time to cut
'the bag.
'================================================
'Variable initialisation
start_signal=7
max_fail=3
program_alarm=0
failed=0
feeder_axis=2
BASE(feeder_axis)
'Position counter (MPOS,DPOS) goes from 0 to 999999
'and 0 again
UNITS=27
SPEED=100
ACCEL=1000
DECEL=1000
REP_DIST=1000000
REP_OPTION=1
SERVO=ON
WDOG=ON
'Main program
loop:
'Define current position as zero
DEFPOS(0)
341
Practical examples Section 5-2
failed=0
342
Practical examples Section 5-2
5-2-8-1 Example
start:
GOSUB filltable
WDOG=1 'Set servos to RUN
BASE(1)
SERVO=1 'Enable position loop in axis 1
BASE(0)
SERVO=1 'Enable position loop in axis 0
'The position counter counts from 0 to 11999
'and then back to 0 again
REP_OPTION=1
REP_DIST=12000
SPEED=200
FORWARD
BASE(1)
loop:
CAMBOX(in_tbl,end_tbl,1,lnk_dst,master,opt,start)
WAIT IDLE
GOTO loop
filltable:
'The shape of the CAM is stored in TABLE(0) to
'TABLE(360)
npoints=360
in_tbl=0
end_tbl=in_tbl+npoints
'Distance of the master to make the CAM
lnk_dst=10000
'Master axis
master=0
'The CAM start exactly when the master reaches
'position "start"
opt=2
start=1000
k=100
'Fill the TABLE with the suitable waveform
FOR i= in_tbl TO end_tbl
TABLE(i,(k*(COS(PI*i/npoints)-1))^2)
NEXT i
RETURN
343
Practical examples Section 5-2
Axis 1
Axis 0
Axis 2
An example of the Flying shear program. In this application there are three
axes:
• Axis 0, shear_axis, the advancement of the shear.
• Axis 1, flying_axis, is the flying shear.
• Axis 2, line_axis, transports the material.
5-2-9-1 Example
ZERO POSITION
Initial situation: material to cut and shear both in the zero position
Just after synchronization (cut operation is done on the fly during synchronization)
Cut_length
3
l_acc / 2 + synch_dist
l_dec / 2
MOVELINK(–l_acc / 2 – synch_dist – l_dec / 2, cut_lenght – synch_dist – l_dec – l_acc, l_acc / 4, l_dec / 4, line_axis)
5
Cut_length-l_acc / 2
'=================================================
344
Practical examples Section 5-2
SERVO AXIS(line_axis)=ON
SERVO AXIS(flying_axis)=ON
SERVO AXIS(shear_axis)=ON
WDOG=ON
'FIRST CYCLE
loop:
345
Practical examples Section 5-2
SPEED AXIS(shear_axis)=cut_speed
MOVEABS(end_pos) AXIS(shear_axis)
MOVEABS(0) AXIS(shear_axis)
WAIT UNTIL NTYPE AXIS(shear_axis)=2
'Fast speed to return
WAIT LOADED AXIS(shear_axis)
SPEED AXIS(shear_axis)=return_speed
cut_counter=cut_counter+1inch
GOTO loop
SPEED
1 2 3 4 5 2
The speed-time graph shows the steps of the above example. The steps are:
1 The initial cycle: the slave waits for the right length in the product to cut
(cut_length – distance_to_accelerate / 2). It is necessary to divide
distance_to_accelerate when we use the MOVELINK command, because
when we synchronize, the master moves twice the distance of the slave.
2 The slave accelerates to synchronize with the master. When the
acceleration finishes, the relative distance between the edge of the product
and the shear is cut_length.
3 This is the synchronization part: the relative distance between the edge of
the product and the shear remains the same. The cut in the material is
made. This gives a new material edge.
4 The deceleration part: the material continues, and the shear stops.
5 Move back at high speed: the distances are calculated such that when the
slave reaches it original position, the edge of the product is in the correct
position to start a new cut.A
346
Practical examples Section 5-2
5-2-10-1 Example
OFFPOS
speed
0 0 0
correction labeller conveyor
conveyor=0
labeller=1
virtual=15
SERVO AXIS(conveyor)=1
SERVO AXIS(labeller)=1
WDOG=1
BASE(labeller)
CONNECT(1,conveyor)
ADDAX(virtual)
FORWARD AXIS(conveyor)
REGIST(1)
WAIT UNTIL MARK=0
loop:
WAIT UNTIL MARK
correction=REG_POS+expected_pos
MOVE(correction) AXIS(virtual)
WAIT IDLE AXIS(virtual)
OFFPOS=-label_length+correction
REGIST(1)
WAIT UNTIL MARK=0
GOTO loop
347
Practical examples Section 5-2
348
Items to Check First Section 6-1
SECTION 6
Troubleshooting
This section provides tables to refer to when a particular problem occurs. The
tables provide a general description of the nature of various potential
problems, the probable cause, items to check, and suggested
countermeasures.
349
Error Indicators Section 6-2
350
Troubleshooting Errors Section 6-3
Problem Solution
FLASH error, RAM error, CPU error, Turn off the PLC system and then turn it
System software error during initialization. back on. If the error persist, replace the
CJ1W-MC@72 unit.
Problem Solution
Error log has been detected to be corrupt Turn off the PLC system and then turn it
or error log cannot be written. back on. If the error persist, replace the
CJ1W-MC@72 unit.
Problem Solution
PLC CPU stalled, not servicing watchdog Turn off the PLC system and then turn it
timer. back on. If the error persist, replace the
PLC CPU unit.
6-3-4 Communication Error Between the PLC CPU unit and the CJ1W-
MC@72 unit
/i
Problem Solution
The communication on the backplane of Turn off the PLC system and then turn it
the PLC system has not been refreshed in back on.
a timely manner, backplane
communication signal failure.
Additional actions to take:
When this error happens during operation, a user can take any additional action if
necessary in BASIC program. The occurrence of this error during operation can be
checked by reading bit 0 of the value returned by the PLC_STATUS(0) BASIC
command and value returned by the PLC_STATUS(1) BASIC command (see section
4-2-182 for more details on PLC_STATUS BASIC command).
Problem Solution
Other error occurred in the units CPU. Turn off the PLC system and then turn it
back on. If the error persist, replace the
CJ1W-MC@72 unit.
351
Troubleshooting Errors Section 6-3
Problem Solution
Unit number set does not match setting in Set unit number according to the I/O table
the PLC I/O table configuration. configuration downloaded in the PLC
CPU.
Duplicate unit numbers in the PLC system Set the unit number using the rotary
switch on the front of the case so there
are no duplicated unit numbers in the
PLC system
Problem Solution
Unit types, unit numbers, their order on the Set the whole PLC system configuration,
PLC backplane or the total number of units including unit types, unit numbers, total
does not match setting in the PLC I/O table number of units and their order in the PLC
configuration. system so the configuration matches I/O
table configuration in the PLC CPU.
Problem Solution
The unit's battery level is low, or the battery Replace the battery.
is empty (bit 1 of the SYSTEM_ERROR
system parameter is high, see section
4-2-232 for more details on this
parameter).
Additional actions to take:
A user can always check whether the battery is low or empty using the
BATTERY_LOW system parameter or bit 1 of the SYSTEM_ERROR system
parameter (for more information on BATTERY_LOW BASIC command see section
4-2-41). The battery status can also be checked from the PLC ladder program by
checking "Battery Low" status bit in the allocated CIO memory area (see section 3-3-1
for more details).
Problem Solution
A fatal error (FALS) generated by the PLC Remove the cause of the problem in the
CPU, either by the system or PLC, if it wasn't generated
programmatically (from a PLC ladder programmatically on purpose.
program).
Additional actions to take:
352
Troubleshooting Errors Section 6-3
Problem Solution
When this error occurs, the WDOG goes automatically off and all current motion is
stopped. If necessary, a user can take additional actions in BASIC programs when this
error happen. The occurrence of this error can be checked for by reading bit 2 of the
value returned by the PLC_STATUS(0) BASIC command (see section 4-2-182 for
more details on PLC_STATUS BASIC command).
Problem Solution
A non-fatal error (FAL) generated by the Remove the cause of the problem in the
PLC CPU, either by the system or PLC, if it wasn't generated
programmatically (from a PLC ladder programmatically on purpose.
program).
Additional actions to take:
When this error occurs, the unit continues operation normally as no error has
occurred. If any action on this error is necessary, a user can take additional actions in
BASIC programs when this error happen. The occurrence of this error can be checked
for by reading bit 3 of the value returned by the PLC_STATUS(0) BASIC command
(see section 4-2-182 for more details on PLC_STATUS BASIC command).
Problem Solution
Cable failure on the MECHATROLINK-II Check MECHATROLINK-II cables
bus. between stations connected to the unit for
interruptions and irregularities (short
circuit between communication lines A
and B, short circuit of any communication
line with shielding).
MECHATROLINK-II bus terminator is Fit a MECHATROLINK-II bus terminator
missing or damaged (bit 17 of the on the last station in the chain or replace
SYSTEM_ERROR system parameter is it.
high, see section 4-2-230 for more details
on this parameter).
The MECHATROLINK-II station connected Check the power and MECHATROLINK-II
to the unit is lost due to power off or interface of the station that caused the
MECHATROLINK-II interface failure at the problem. Replace the station if necessary.
station (bit 18 of the SYSTEM_ERROR
system parameter is high, see section
4-2-230 for more details on this
parameter).
The MECHATROLINK-II The Replace the CJ1W-MC@72 unit.
CJ1W-MC@72 is defective.
353
Troubleshooting Errors Section 6-3
Problem Solution
BASIC program stopped working during Using BASIC command RUN_ERROR
operation due to runtime error (bit 0 of the determine the error type that caused
SYSTEM_ERROR system parameter is runtime error. Using BASIC command
high, see section 4-2-230 for more details ERROR_LINE find a line in the BASIC
on this parameter). program which caused runtime
error.Modify found line causing an error to
prevent it from happening in the future
(see section 4-2-210 for more details on
RUN_ERROR and section 4-2-95 for
more details on ERROR_LINE BASIC
commands).
BASIC program cannot be run due to Use Trajexia Studio Software to edit and
compilation or syntax error. compile BASIC programs. Editor of the
software will automatically highlight
locations of possible compile errors and
provide all necessary debugging
information while compiling the program.
Problem Solution
Not all physically present axes are Wrong setting of the SERVO_PERIOD
initialised. Some of them are virtual system parameter for a given number of
(ATYPE = 0) or have illegal axis number -1 MECHATROLINK-II stations and
assigned. axes.Correct the SERVO_PERIOD value
and restart the unit (see section 4-2-218
for more information on valid
SERVO_PERIOD value depending on
number of connected stations).
Present axis has illegal axis number (-1) Confliction axis number for
assigned to it, Encoder Interface axis is in MECHATROLINK-II axis and Encoder
error. Interface axis. This can happen if a new
MECHATROLINK-II axis is added to the
system and the MECHATROLINK-II bus
is reinitialized using BASIC command
MECHATROLINK(0, 0), but the unit is not
restarted.After adding new
MECHATROLINK-II axis to the system,
restart the unit.
354
Troubleshooting Errors Section 6-3
Problem Solution
Axis error due to a motion error, no error Using ERROR_AXIS and
signalization on servo drives. MOTION_ERROR system parameters
determine axis or axes which caused
motion error. Using AXISSTATUS axis
parameter determine the type of the axis
error (see section 4-2-94 for more
information on valid ERROR_AXIS,
section 4-2-155 for MOTION_ERROR
and section 4-2-35 for AXISSTATUS
BASIC commands).In necessary, modify
application or motion system so the axis
error doesn't happen in the future.
Axis error due to an error in the servo drive. Using ERROR_AXIS and
MOTION_ERROR system parameters
determine axis or axes which caused
motion error (see section 4-2-94 for more
information on ERROR_AXIS and section
4-2-155 for MOTION_ERROR basic
commands). Using DRIVE_ALARM and
DRIVE_STATUS axis parameter check
for alarm code. It can be also determined
by checking the operation panel of the
drive (see section 4-2-74 for more
information on DRIVE_ALARM and
section 4-2-81 for DRIVE_STATUS
BASIC commands).Remove the cause of
the alarm/error and restart the system if
necessary (for more details on alarm
codes and possible couse of the alarms,
see servo driver Operation Manual).
355
Miscellaneous Section 6-4
6-4 Miscellaneous
/i
Problem Solution
A connection with the unit from Trajexia Check connection cable between the PLC
Studio software cannot be established. and the Personal Computer running the
software.Check that configuration
settings (network type, IP address, unit
number, …) in the software matches the
one of the unit.Check there is no other
software or device using the same
connection.
There is no axis nor motion error in the Check the "Enable Watchdog" bit of the
system, but the WDOG cannot be set ON. unit status area in the allocated CIO
The command WDOG = ON is accepted, memory of the PLC (see section 3-3-1 for
but no changes. more details). If this bit is OFF, turning on
the WDOG is disabled.
Programs are correct and compiled Check the "Enable Program Run" bit of
correctly, but they cannot be started. the unit status area in the allocated CIO
memory of the PLC (see section 3-3-1 for
more details). If this bit is OFF, running
BASIC programs is disabled.
Outputs cannot be turned ON. Check the LOAD OFF bit (A500.15) of the
PLC. If this bit is set on, the setting ON
the unit's outputs is disabled.
356
Revision History
Revision history
A manual revision code appears as a suffix to the catalog number on the front cover of the manual.
/i
Revision code
The following table outlines the changes made to the manual during each revision.
/i
357
358