Omron trajexia CJ1W-MCH72 Operation Manual
Omron trajexia CJ1W-MCH72 Operation Manual

Omron trajexia CJ1W-MCH72 Operation Manual

Sysmac cj-series programmable controller
Hide thumbs Also See for trajexia CJ1W-MCH72:

Advertisement

Cat. No. I55E-EN-03
Programmable Controller
SYSMAC CJ-series
CJ1W-MCH72
Motion Control Unit
OPERATION MANUAL

Advertisement

Table of Contents
loading

Summary of Contents for Omron trajexia CJ1W-MCH72

  • Page 1 Cat. No. I55E-EN-03 Programmable Controller SYSMAC CJ-series CJ1W-MCH72 Motion Control Unit OPERATION MANUAL...
  • Page 2 OMRON product references All OMRON products are capitalized in this manual. The first letter of the word Unit is also capitalized when it refers to an OMRON product, regardless of whether it appears in the proper name of the product.
  • Page 3 Copyright Copyright © 2009 OMRON All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of OMRON.
  • Page 4: Table Of Contents

    1-4 Servo system principles ............................13 1-5 Trajexia system architecture ..........................16 1-6 Cycle time ................................17 1-7 Program control and multi-tasking .......................... 22 1-8 Motion sequence and axes ............................23 1-9 Motion buffers ............................... 31 1-10 Mechanical system..............................33 1-11 Axis numbers ................................
  • Page 5 TABLE OF CONTENTS SECTION 6 Troubleshooting 6-1 Items to Check First ............................... 348 6-2 Error Indicators ..............................349 6-3 Troubleshooting Errors ............................350 6-4 Miscellaneous ................................ 356 Revision history...
  • Page 6: Precautions

    !WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do so may result in malfunction, fire, or electric shock. Never touch any of the terminals while power is being supplied. Doing so may result in !WARNING serious electric shock.
  • Page 7: Operating Environment Precautions

    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-MCH72, or external factors affecting the operation of the PLC or CJ1W-MCH72.
  • Page 8: Application Precautions

    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.
  • Page 9 Do not pull on the cables or bend the cables beyond their natural limit. Doing either of !Caution these may break the cables. Do not place objects on top of the cables or other wiring lines. Doing so may break the !Caution cables.
  • Page 10: Conformance To Ec Directives

    Conformance to EC Directives Perform wiring according to specified procedures. !Caution Before touching a Unit, be sure to first touch a grounded metallic object in order to !Caution discharge any static build-up. Not doing so may result in malfunction or damage.
  • Page 11 Unnecessary clearance in cable inlet or outlet ports, operation panel mounting holes, or in the control panel door may cause electromagnetic wave leakage or interference. In this case, the product may fail to meet EC Directives. In order to prevent such interference, fill clearances in the control panel with conductive packing.
  • Page 12: Introduction

    The CJ1W-MCH72 has the following features: • A MECHATROLINK-II connection for a MECHATROLINK-II network with up to 30 axes. The motion cycle time is selectable: 0.5 ms, 1 ms, 2 ms or 4 • An Encoder Interface connection. It supports the main absolute encoder protocols allowing the connection of an external encoder to the system.
  • Page 13: System Philosophy

    MCH72. The cycle time is divided in 4 time slices of equal time length, called "CPU Tasks". The cycle time is 1ms if SERVO_PERIOD = 0.5 ms or SERVO_PERIOD = 1 ms, 2 ms if the SERVO_PERIOD = 2 ms and 4 ms if the SERVO_PERIOD = 4 ms...
  • Page 14 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...
  • Page 15: Motion Control Concepts

    A move is defined in either absolute or relative terms. An absolute move takes the axis (A) to a specific predefined position with respect to the origin point. A relative move takes the axis from the current position to a position that is defined relative to this current position.
  • Page 16 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.
  • Page 17 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.
  • Page 18 Both movements can be cancelled by using either the CANCEL or RAPIDSTOP command. The CANCEL command cancels the move for one axis and RAPIDSTOP cancels moves on all axes. The deceleration rate is set by DECEL. 1-3-2...
  • Page 19 A is the time axis, B is the speed axis. 1-3-2-2 Circular interpolation 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.
  • Page 20 Adding axes 1-3-3-1 Electronic gearbox The CJ1W-MCH72 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.
  • Page 21 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.
  • Page 22 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-MCH72 provides this possibility by using the ADDAX command.
  • Page 23 1-3-4-4 Merging moves MERGE=0 MERGE=1 If the MERGE axis parameter is set to 1, a movement is always followed by a subsequent movement without stopping. The figures show the transitions of two moves with MERGE value 0 and value 1.
  • Page 24: Servo System Principles

    The servo system of the CJ1W-MCH72 uses a semi-closed or inferred closed loop system. This system detects actual machine movements by the rotation of the motor in relation to a target value. It calculates the error between the target value and actual movement, and reduces the error through feedback.
  • Page 25 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.
  • Page 26 Following Error at high speed. · ∆P 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.
  • Page 27: Trajexia System Architecture

    1-5-1 Program control Programs make the system work in a defined way. The programs are written in a language similar to BASIC and control the application of the axes and modules. 14 Programs can be executed in parallel. The programs can be set to run at system power-up, started and stopped from other programs and executed from Trajexia Studio.
  • Page 28: Cycle Time

    1-6-1 Servo period The SERVO_PERIOD can be set at 0.5, 1, 2 or 4 ms. The processes that take place within the cycle time depend on the setting of the SERVO_PERIOD parameter. The SERVO_PERIOD parameter is a Trajexia parameter that must be set according to the system configuration.
  • Page 29 Cycle time Section 1-6 Note Only the Sigma-III Servo Driver and the Sigma-V Servo Driver support the 0.5 ms trans- mission cycle. 1-6-1-1 Servo period 0.5 ms CPU task 1 Motion sequence Low priority task (0,1,2,3...) CPU task 2 High priority task (13,14)
  • Page 30 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.
  • Page 31 1x Encoder (Axis 0) • SERVO_PERIOD = 0.5ms The CJ1W-MCH72 supports 0.5ms SERVO_PERIOD with 4 axes. If Sigma-II Servo Drivers were used in this example, the SERVO_PERIOD would be 1.0ms, since Sigma-II servo Drivers do not support the SERVO_PERIOD of 0.5ms.
  • Page 32 Axis 8 Axis 9 Axis 10 Axis 11 Axis 12 Axis 13 Axis 14 Axis 15 • 1x CJ1W-MCH72 • 16x Sigma-II Servo Driver • 1x Encoder (Axis 16) • SERVO_PERIOD = 4ms The CJ1W-MCH72 supports 4ms SERVO_PERIOD with 17 axes.
  • Page 33: Program Control And Multi-Tasking

    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.
  • Page 34: Motion Sequence And Axes

    (c/l) COMS. 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.
  • Page 35 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. 1-8-1 Profile generator...
  • Page 36 Motion sequence and axes Section 1-8 more information on the BASE command and the definition of the axis sequence in an axis array, refer to the Trajexia Programming Manual, chapter 3 (BASIC commands). • If SERVO=OFF for one axis, the motion commands for that axis are ignored.
  • Page 37 CJ1W-MCH72 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.
  • Page 38 With SERVO = ON, the position loop is closed in the CJ1W-MCH72. Speed reference is sent to the Servo Driver. For Mechatrolink Servo Drivers, this axis type is not recommended, since there is one cycle delay in the loop (DPOS(n) is compared with MPOS(n-1)).
  • Page 39 1-8-4-5 Stepper output ATYPE=43 The position profile is generated and the output from the system is a pulse train and direction signal. This is useful to control a motor via pulses or as a position reference for another motion controller.
  • Page 40 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.
  • Page 41 Mode Comment Speed Inverter (with built-in encoder interface) controlled on the MECHATROLINK-II bus as a servo axis. Set the speed with S_REF. Position Inverter (with built-in encoder interface) controlled on the MECHATROLINK-II bus as a servo axis. The position loop is...
  • Page 42: Motion Buffers

    • Process Buffer. The third buffered movement cannot be monitored. The process buffer relates to the process and not to the axis. It is possible to check if the process buffer is full by checking the PMOVE process parameter. WAITING...
  • Page 43 BUFFER ..MOVE(1000) ..DATUM(3) 3.- A third movement can DATUM(3) --------------------------------- ..still be stored in the process buffer. NTYPE MOVE(1000) MOVE(200) --------------------------------- MOVE -500 If the basic program reaches ..MTYPE MOVE(-500) ‘MOVE(200)’ it will wait. BASIC PROGRAM BASIC PROGRAM ..
  • Page 44: Mechanical System

    With a ratio of 1:30 for small Servo Drivers and a ratio of 1:5 for big Servo Drivers you can reach the maximum dynamic of the motor-driver combination.
  • Page 45: Axis Numbers

    1 Flexible axis (on the Encoder Interface) 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. The first non-assigned axis number, that is, the first axis number that is not assigned to a MECHATROLINK-II station address, is used for the flexible axis on the CJ1W-MCH72 encoder interface.
  • Page 46: Installation And Wiring

    Unit number selector switch MECHATROLINK-II connector Encoder connector I/O connector Battery compartment 2-1-1 Status LED indicators The CJ1W-MCH72 has 5 status LEDs. They indicate the operational mode and the status of the CJ1W-MCH72. The status LEDs are given in the table below.
  • Page 47 Also, the CJ1W-MCH72 has 8 general-purpose LEDs. The function of the general-purpose LEDs can be controlled with the DISPLAY system parameter. The table below lists the configuration for the LEDs and the DISPLAY=n command where n ranges from 0 to 7.
  • Page 48 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.
  • Page 49 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.
  • Page 50 Do not disassemble the battery. • Do not heat the battery or set fire to the battery. Do not use a battery that is dropped on the floor or that is subjected to a shock. The !WARNING battery can leak.
  • Page 51: Wiring

    Section 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. I/O connector pins The connections of the pins are given in the table below. Connection...
  • Page 52 Section 2-2 Connection Connection 0 V Output common 24 V Power supply input for the outputs 2-2-1-1 Specifications The table below shows the digital input specifications of input 0 to input 3 for the I/O. Item Specification Type NPN/PNP Maximum voltage...
  • Page 53 Class 2 power supply. CJ1W-MCH72 External power supply 24V Common for Input circuits Circuit configuration for input 4 to input 15 The table below shows the digital output specifications of output 8 to output 15 for the I/O. Item Specification Type Maximum voltage...
  • Page 54 Wiring Section 2-2 2-2-2 Encoder connector The connections of the pins are given in the table below. Encoder connector pins Incremental Incremental Stepper output SSI, EnDat encoder input encoder output Step+ Clock+ Step- Clock- Dir+ Dir- 5 V Encoder power supply...
  • Page 55 (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.
  • Page 56 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-MCH72 captures the position of the axis in the hardware.
  • Page 57 The SSI interface of the CJ1W-MCH72 accepts absolute values from an encoder if the data is in Gray Code format or in binary format and if the resolution is 25 bits or less. The number of bits, and therefore the number of clock pulses sent to the encoder in each frame, is programmable.
  • Page 58 The CJ1W-MCH72 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-MCH72. Encoder...
  • Page 59 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.
  • Page 60 5 VDC Power Supply Heidenhain ROC 425 2048 5XS08-C4 connection 2-2-4-3 Stepper The CJ1W-MCH72 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 •...
  • Page 61: Installation

    Remove the label on top of the CJ1W-MCH72 after the installation and wiring of the unit. This makes sure that the unit cannot become overheated. The CJ1W-MCH72 can be installed in any slot in a CJ-series CPU rack or in a CJ-series expansion CPU rack. The CJ-series PLC supports up to 4 expansion CPU racks.
  • Page 62 2 Move the yellow sliders at the top and bottom of the unit to the front. 3 Attach the CJ1W-MCH72 to the PLC. 4 Push the yellow sliders at the top and bottom of the unit to the rear to lock them.
  • Page 63 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. 2-3-2-2 Creating an I/O table The I/O table identifies the units connected to the PLC and allocates I/O to these units.
  • Page 64 The CJ1W-MCH72 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.
  • Page 65 When the MECHATROLINK-II slaves are connected up to 16 nodes (within 30 m) or up to 15 nodes (within 50 m), no repeater unit is required. For more nodes or longer distances, a repeater unit is required. You can use the OMRON FNY-REP2000 repeater or the Yaskawa JEPMC-REP2000 repeater.
  • Page 66: Specifications

    Item Specification Ambient operating temperature 0°C to 55°C When all digital inputs are on: max. 45°C When max. 8 digital inputs are on: max. 55°C −20°C to 70°C Ambient storage temperature Ambient operating humidity 10% to 90%RH Ambient storage humidity 90% max.
  • Page 67 Trajexia Studio manages a backup on the hard disk of the PC Firmware update Via 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. 2-4-4 MECHATROLINK-II specifications...
  • Page 68 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.
  • Page 69 Specifications Section 2-4...
  • Page 70: Data Exchange

    PLC. Also, programs in the CJ1W-MCH72 and PLC programs can exchange control and status data. Because the CJ1W-MCH72 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.
  • Page 71: Memory Areas

    • 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-MCH72 can be freely configured. This can be done in the PLC program or in the CJ1W-MCH72. It is recommended to configure the memory mapping either in the startup program of the PLC or in the startup program of the CJ1W-MCH72.
  • Page 72 3-2-1 Configuration of memory areas in the PLC program To configure the memory areas for cyclic data exchange in the PLC, you must use the FINS Parameter Area Write command. For more information on this FINS command, refer to section 3-4-4.
  • Page 73: Data

    Control and status data The CJ1W-MCH72 has 13 control and status words. The control and status data is in the PLC CIO memory at word location n, where n is equal to 1500 + 25 × unit_number. 3-3-1-1 Control data The PLC program can directly control the CJ1W-MCH72 with control word n.
  • Page 74 Data Section 3-3 3-3-1-2 Status data Status words n+1 and n+2 return the status of the CJ1W-MCH72. The table below lists the layout of these status words. Word Description Value Function Unit operational Unit not operational Unit operational Watchdog on...
  • Page 75 PLC cycle. A block is a continuous memory area or array area. The total size of all 16 blocks must be less than or equal to 2000 words. The configurable data can be exchanged between the VR, IN, OP, AIN, AOUT and Axis Status memory areas of the CJ1W-MCH72 and the CIO, DM and EM memory areas of the PLC CPU.
  • Page 76: Fins Commands

    Control various operations. 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.
  • Page 77 1103 Address range designation error Number of elements invalid 1104 Address out of range If var_type is 82 or B0, and the response code is 0000, the CJ1W-MCH72 responds with: command_code response_code word_1 word_2 If var_type is C2 or F0, and the response code is 0000, the CJ1W-MCH72...
  • Page 78 • F0 (VR memory in 32-bit IEEE floating-point format) • 30 (VR memory in bit format) 0 ≤ start_address ≤ memory size − 1 ≤ FFFF start_address 1 ≤ total_words ≤ memory size - start_address + 1 total_words 1 ≤ total_dwords ≤ memory size - start_address + 1...
  • Page 79 1104 Address out of range area_code not configured 2003 The registered table does not exist If the response code is 0000, the CJ1W-MCH72 responds with the data configured previously: 00 00 08 ..command_ response_...
  • Page 80 2103 Data has not been registered 2000 words 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-MCH72. Note The first 16 entries in the IN array cannot be addressed in the memory mapping.
  • Page 81 Program name does not exist Start BASIC program that is already 2201 Wrong mode (executing) running Stop BASIC program that is not run- 2202 Wrong mode (stopped) ning If the response code is 0000, the program is started or stopped.
  • Page 82 2202 Wrong mode (stopped) running Note The FINS Stop command (0402) is equal to the FINS Run command (0401) where mode is equal to 00. 3-4-7 Error Data Read (2110) The FINS Error Data Read command reads the error data (error line and error code) of a process.
  • Page 83 FINS commands Section 3-4...
  • Page 84: Basic Commands

    • 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. 4-1-1 Axis commands Name Description Changes the ACCEL and DECEL at the same time.
  • Page 85 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.
  • Page 86 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. Contains the Following Error.
  • Page 87 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.
  • Page 88 Categories Section 4-1 Name Description 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.
  • Page 89 Assigns an expression to a variable. <> (IS NOT EQUAL Checks two expressions to see if they are different. > (IS GREATER THAN) Checks two expressions to see if the expression on the left is greater than the expression on the right. >=...
  • Page 90 ' (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.
  • Page 91 “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.
  • Page 92 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.
  • Page 93 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.
  • Page 94 Sets the servo cycle period of the CJ1W-MCH72. 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.
  • Page 95: All Basic Commands

    Arguments • expression1 Any valid BASIC expression. • expression2 Any valid BASIC expression. Example result = 4 + 3 Assigns the value 7 to the variable result. See also 4-2-2 - (Subtraction) Type Mathematical function Syntax expression1 - expression2 Description The operator - subtracts expression2 from expression1.
  • Page 96 Any valid BASIC expression. • expression2 Any valid BASIC expression. Example IF a = 10 THEN GOTO label1 If variable a contains a value equal to 10, program execution continues at label label1. Otherwise, program execution continues with the next statement. See also...
  • Page 97 Any valid BASIC expression. Example IF a <> 10 THEN GOTO label1 If variable a contains a value not equal to 10, program execution contin- ues at label label1. Otherwise, program execution continues with the next statement. See also 4-2-9 >...
  • Page 98 Any valid BASIC expression. Example IF a >=10 THEN GOTO label1 If variable a contains a value greater than or equal to 10, program exe- cution continues at label label1. Otherwise, program execution contin- ues with the next statement. See also 4-2-11 <...
  • Page 99 Syntax Description ' marks all that follows it on a line as comment and not program code. Comment is not executed when the program is run. You can use ' at the beginning of a line or after a valid statement.
  • Page 100 4-2-16 # Type Special character Syntax Description The # symbol is used to specify a communications channel to be used for serial input/output commands. Note: Communications Channels greater than 3 will only be used when running the Trajexia Studio software. Arguments Example PRINT #5, "Communication port 1"...
  • Page 101 Syntax ACOS(expression) Description The ACOS function returns the arc-cosine of the expression. The expression value must be between -1 and 1. The result in radians is between 0 and PI. Input values outside the range will return 0. Arguments •...
  • Page 102 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.
  • Page 103 All BASIC commands Section 4-2 Example UNITS AXIS(0)=1000 UNITS AXIS(1)=20 ' Superimpose axis 1 on axis 0 ADDAX(1) AXIS(0) MOVE(1) AXIS(0) MOVE(2) AXIS(1) 'Axis 0 will move 1*1000+2*20=1040 edges R AXIS 0 MOTOR AXIS 0 ENCODER AXIS 2...
  • Page 104 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.
  • Page 105 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 Type...
  • Page 106 The material feed is via a lazy loop arrangement which is fitted with an ultra-sonic height sensing device. The output of the ultra- sonic sensor is in the range 0V to 4V where the output is at 4V when the loop is at its longest.
  • Page 107 18, is used for the AND operation. Therefore, this expression is equivalent to the following: VR(0) = 10 AND 18 The AND is a bit operator and so the binary action is as follows: 01010 AND 10010 = 00010 Therefore, VR(0) will contain the value 2.
  • Page 108 ASIN(expression) Description The ASIN function returns the arc-sine of the argument. The argument must have a value between -1 and 1. The result in radians is between - PI/2 and PI/2. Input values outside this range return 0. Arguments •...
  • Page 109 Syntax ATYPE = value Description The ATYPE axis parameter indicates the axis type for the axis. The valid values depend on the port the Servo Driver controlling the axis is connected to. See the table below. AXIS type ATYPE value...
  • Page 110 AXIS(axis_number) Description The AXIS modifier sets the axis for a single motion command or a single axis parameter read/write to a particular axis. AXIS is effective only for the command or axis parameter operation. If it is required to change the axis used to a particular axis in every subsequent command, use the BASE command instead.
  • Page 111 Syntax AXISSTATUS Description The AXISSTATUS axis parameter contains the axis status and is used for the motion error handling of the controller. The axis status consists of status bits, which definitions are shown in the table below. Description Value Character...
  • Page 112 10 the resulting profile will be 1000 point (100 * 10). Example BASE(1) B_SPLINE(1, 0, 10, 200, 10) This command expands a 10 point profile in TABLE locations 0 to 9 to a larger 100 points profile starting at TABLE location 200. See also...
  • Page 113 The backlash compensation is achieved as follows: • An offset move is applied when the motor demand is in one direc- tion. • The offset move is reversed when the motor demand is in the oppo- site direction.
  • Page 114 BA(axis_1 [ ,axis_2 [ , axis_3 [ , axis_4 [ , axis_...]]]]) Description The BASE command is used to set the default base axis or to set a specified axis sequence group. All subsequent motion commands and axis parameters will apply to the base axis or the specified axis group unless the AXIS command is used to specify a temporary base axis.
  • Page 115 On the command line the base group order can be shown by typing BASE. Example >> RUN "PROGRAM", 3 >> BASE PROC(3)(0,2,1) Use the PROC modifier to show the base group order of a certain task. Example >> BASE(2) >> PRINT BASE 2.0000 Printing BASE will return the current selected base axis.
  • Page 116 The TABLE array is specified with the TABLE command. The movement can be defined with any number of points from 3 to the maximum table size available (64000). The CJ1W-MCH72 moves con- tinuously between the values in the TABLE to allow a number of points to define a smooth profile.
  • Page 117 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.
  • Page 118 Example Motion is required to follow the POSITION equation: t(x) = x*25 + 10000(1-cos(x)), where x is in degrees. This example table provides a simple oscillation superimposed with a constant speed. To load the table and cycle it continuously the program would be:...
  • Page 119 MOTOR 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.
  • Page 120 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.
  • Page 121 TABLE array to be used to hold more than one profile and/or other information. The CJ1W-MCH72 moves continuously between the val- ues in the TABLE to allow a number of points to define a smooth profile. Two or more CAMBOX commands can be executed simultaneously using the same or overlapping values in the TABLE array.
  • Page 122 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. Example...
  • Page 123 AXIS 0 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:...
  • Page 124 Example A motor on Axis 0 is required to emulate a rotating mechanical CAM. The position is linked to motion on axis 3. The “shape” of the motion profile is held in TABLE values 1000..1035. The table values represent the mechanical cam but are scaled to range from 0-4000.
  • Page 125 • CONTROL BLOCK: This is pointed to by the third CAMBOX param- eter in this options mode only. It is of fixed length (7 table values). It is important to note that the control block is modified during the CAMBOX operation. It must therefore be re-initialised prior to each use.
  • Page 126 CAMBOX at the end of the current pat- tern. The axis the CAMBOX is linked to can run in a positive or negative direction. In the case of a negative direction link the pattern will execute in reverse. In the case...
  • Page 127 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.
  • Page 128 CANCEL[(1)] CA[(1)] Description The CANCEL command cancels the move on an axis or an interpolat- ing axis group. Speed-profiled moves (FORWARD, REVERSE, MOVE, MOVEABS, MOVECIRC, MHELICAL and MOVEMODIFY) will be decelerated at the deceleration rate as set by the DECEL parameter and then stopped.
  • Page 129 Section 4-2 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.
  • Page 130 The CLEAR command resets all global VR variables to 0 and sets local variables on the process on which the command is run to 0. When you use it in a program it resets all local variables defined to 0.
  • Page 131 CONNECT command. The rate is defined as amount of ratio per second. The default value is set to a high value (1000000) in order to ensure compatibility with other units. Note: The operation using CLUTCH_RATE is not deterministic in posi- tion.
  • Page 132 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.
  • Page 133 Section 4-2 Example In a press feed, a roller is required to rotate at a speed that is equal to one quarter of the measured rate from an encoder installed on the incoming conveyor. The roller is wired to the master axis 0. The refer- ence encoder is connected to axis 1.
  • Page 134 Section 4-2 Example Axis 0 is required to run a continuous forward. Axis 1 must connect to axis 0. If CONNECT is called, it results in a step change. Therefore, CLUTCH_RATE is used, together with an initial and final connect ratio of zero, to get the required motion.
  • Page 135 DEL, NEW, RENAME. 4-2-58 COS Type Mathematical function Syntax COS(expression) Description The COS function returns the cosine of the expression. Input values are in radians and may have any value. The result value will be in the range from -1 to 1.
  • Page 136 Following Error with D_GAIN. The default value is 0. Add the derivative gain to a system to produce a smoother response and to allow the use of a higher proportional gain that could not be used otherwise. High values can cause oscillation.
  • Page 137 With these 2 parameters set as above, the S_REF output will be clamped at zero when the movement is complete and the Following Error falls below 3. When a movement is restarted or if the Following Error rises above a value of 10, the servo loop will be reactivated.
  • Page 138 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,...
  • Page 139 The demand position is then reset to 0 and the measured position corrected so as to maintain the Following Error. 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.
  • Page 140 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.
  • Page 141 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.
  • Page 142 16 to 31. For more information on Servo Driver I/O mapping into the Trajexia I/O space, refer to section 5-1-4. Note: The origin input is active low, i.e., the origin switch is set when the input is OFF. The feedhold, reverse jog, forward jog, forward and reverse limit inputs are also active low.
  • Page 143 Following Error. DEFPOS is typically used after an origin search sequence (see DATUM command), as this sets the current position to 0. DEFPOS can be used at any time. As an alternative also the OFFPOS axis parameter can be used. This parameter can be used to perform a relative adjustment of the current position.
  • Page 144 BASE(1,3) ' set up the BASE array DEFPOS(-10,-35) ' define positions of the axes to be -10 and -35 Example Set the axis position to 10, then start an absolute move, but make sure axis has updated the position before loading the MOVEABS. DEFPOS(10.0)
  • Page 145 (using SELECT). The program name can also be specified without quotes. DEL ALL will delete all programs. DEL can also be used to delete the Table: DEL "TABLE". The name "TABLE" must be in quotes. Note: This command is implemented for the Command Line Terminal.
  • Page 146 The AXIS_ENABLE is used to create a group of axes which will be disa- bled if there is a motion error in any or more axes in the group. After the group is made, when an error occurs on one they will all have their AXIS_ENABLE set OFF and SERVO set OFF.
  • Page 147 All BASIC commands Section 4-2 AXIS 0 AXIS 1...
  • Page 148 Section 4-2 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...
  • Page 149 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.
  • Page 150 Servo Driver), and then turning it on again. Also, an alarm will not be cleared if the cause of the alarm is still present. The command is executed on the driver for the base axis set by BASE. The base axis can be changed with the AXIS modifier, as with all the other axis com- mands and parameters.
  • Page 151 Encoder Interface. Set bit 8 of this parameter to switch on OUT 0 for an axis. Set bit 9 of this parameter to switch on OUT 1 for an axis. Keep in mind that the same outputs are used by the HW_PSWITCH command.
  • Page 152 Pn81E=4321 & Pn511=654x. Refer to section 5-1-4 for more information about mapping Servo Driver inputs and outputs. The command is executed on the driver for the base axis set by BASE. The base axis can be changed with the AXIS modifier, as with all the other axis commands and parameters.
  • Page 153 0 is returned. The com- mand is executed on the driver for the base axis set with BASE. It can be changed using the AXIS modifier, like with all the other axis com- mands and parameters.
  • Page 154 Those bits can be seen in the drive configuration window in Trajexia Studio, and can be used in programs. The explana- tion of each bit is given in the table below. (Note: Only bits relevant to MECHATROLINK-II axes are listed.) For the detailed explanation for these status bits, see the MECHATROLINK-II manual.
  • Page 155 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.)
  • Page 156 -1. If the command cannot be executed, the value 0 is returned. The command is executed on the driver for the base axis set with BASE. It can be changed using the AXIS modifier, as with all other axis commands and parameters.
  • Page 157 EDIT [ line_number ] ED [ line_number ] Description The EDIT command starts the built in screen editor allowing a program in the controller to be modified using a Command Line Terminal. The currently selected program will be edited. The editor commands are as follows: •...
  • Page 158 EnDat axis with ATYPE value 47. The parameter controls the mode in which EnDat encoder return its position. The encoder can be set to either cyclically return its position, or it can be set to a parame- ter read/write mode. The default after initialization is cyclic position return mode.
  • Page 159 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.
  • Page 160 Bits 8 -15 of the address are the EnDat MRS field settings and bits 0 - 7 are the offset within the EnDat MRS block. If a CRC error occurs, this command will return -1.
  • Page 161 Bits 8 -15 of the address are the EnDat MRS field settings and bits 0 - 7 are the offset within the EnDat MRS block. If a CRC error occurs, this command will return 0.
  • Page 162 The ERROR_AXIS axis parameter contains the number of the axis which has caused the motion error. A motion error occurs when the AXISSTATUS state for one of the axes matches the ERRORMASK setting. In this case the enable switch (WDOG) will be turned off, the MOTION_ERROR parameter will have value different than 0 and the ERROR_AXIS parameter will contain the number of the first axis to have the error.
  • Page 163 No example. See also AXIS, AXISSTATUS, MOTION_ERROR, WDOG. It is up to the user to define in which cases a motion error is generated. For safe !Caution operation it is strongly recommended to generate a motion error when the Following Error has exceeded its limit in all cases.
  • Page 164 The FAST_JOG axis parameter contains the input number to be used as the fast jog input. The number can be from 0 to 31. As default the parameter is set to -1, no input is used for the fast jog.
  • Page 165 MOTION_ERROR. This value is only set when the FE exceeds the FE_LIMIT and the SERVO parameter has been set to OFF. FE_LATCH is reset to 0 when the SERVO parameter of the axis is set back to ON. Arguments Example No example.
  • Page 166 The FE_RANGE axis parameter contains the limit for the Following Error warning range in user units. When the Following Error exceeds this value on a servo axis, bit 1 in the AXISSTATUS axis parameter will be turned on. This range is used as a first indication for fault conditions in the applica- tion (compare FE_LIMIT).
  • Page 167 Description The FHOLD_IN axis parameter contains the input number to be used as the feedhold input. The valid input range is 0 to 31. Values 0 to 15 repre- sent physically present inputs of CJ1W-MCH72 I/O connector and are common for all axes.
  • Page 168 FINS communication protocol, see the Communication Com- mands Reference Manual, cat. num. W342-E1, Sections 3 and 5. Trajexia has built in FINS client capabilities, so it can initiate the FINS communications with FINS slave devices using FINS_COMMS. Only FINS 0101 (Read Memory) and FINS 0102 (Write Memory) commands are implemented.
  • Page 169 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.
  • Page 170 FLAG(flag_number [,value]) Description The FLAG command is used to set and read a bank of 24 flag bits. The FLAG command can be used with one or two parameters. With one parameter specified the status of the given flag bit is returned. With two parameters specified the given flag is set to the value of the second parameter.
  • Page 171 Normally, TABLE data are preserved in battery backed RAM memory. However, data can be lost if this battery is empty, or if the bat- tery replacement takes too long (longer than 5 minutes). In such cases it is advised to store TABLE memory to flash memory, since it is not affected by battery failure.
  • Page 172 -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...
  • Page 173 While variable is less than or equal to end, the block of commands is repeatedly executed until variable is greater than end, at which time program execution will continue after NEXT. Note: FOR ... NEXT statements can be nested up to 8 levels deep in a BASIC program. Arguments •...
  • Page 174 FOR l2 = 1 TO 6 MOVEABS(l1*100,l2*100) GOSUB 1000 NEXT l2 NEXT l1 FOR..TO..STEP..NEXT statements can be nested (up to 8 levels deep) provided the inner FOR and NEXT commands are both within the outer FOR..TO..STEP..NEXT loop. See also REPEAT..UNTIL, WHILE..WEND. 4-2-116 FORWARD Type...
  • Page 175 CANCEL WAIT IDLE IN(7) AXIS 3 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)
  • Page 176 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.
  • Page 177 Note: Each line takes a minimum of 4 characters (bytes) in memory. This is for the length of this line, the length of the previous line, number of spaces at the beginning of the line and a single command token.
  • Page 178 Description The FWD_IN axis parameter contains the input number to be used as a forward limit input. The valid input range is 0 to 31. Values 0 to 15 repre- sent physically present inputs of CJ1W-MCH72 I/O connector and are common for all axes.
  • Page 179 GET [#n,] variable Description The GET command assigns the ASCII code of a received character to a variable. If the serial port buffer is empty, program execution will be paused until a character has been received. Channels 5 to 7 are logical channels that are superimposed on the programming port 0 when using Trajexia Studio.
  • Page 180 Arguments • label A valid label that occurs in the program. An invalid label will give a compilation error before execution. Labels can be character strings of any length, but only the first 15 characters are significant. Alternatively line numbers may be used...
  • Page 181 Arguments • label A valid label that occurs in the program. An invalid label will give a compilation error before execution. Labels can be character strings of any length, but only the first 15 characters are significant. Alternatively line numbers may be used as labels.
  • Page 182 This command is applicable only to Flexible axis axes with ATYPE val- ues 43, 44 and 45. The command can be used with either 1 or 5 parameters. Only 1 param- eter is needed to disable the switch or clear FIFO queue. All five param- eters are needed to enable switch.
  • Page 183 The function will typically be called 4 times to extract each byte in turn. Note: Byte 0 is the high byte of the 32 bit IEEE floating point format.
  • Page 184 If all conditions are FALSE the commands following ELSE will be executed or the program will resume at the line after ENDIF in case no ELSE is included. The ENDIF is used to mark the end of the conditional block.
  • Page 185 0..255. Example The following lines can be used to move to the position set on a thumb wheel multiplied by a factor. The thumb wheel is connected to inputs 4, 5, 6 and 7, and gives output in BCD.
  • Page 186 The INT function returns the integer part of the expression. Note: To round a positive number to the nearest integer value take the INT function of the value added by 0.5. Similarly, to round for a negative value subtract 0.5 to the value before applying INT.
  • Page 187 WDOG=ON. Default is off. Note: If the setting is incorrect a stepper motor may lose position by one step when changing direction. Note: This parameter is applicable only to Flexible axis stepper output axes with ATYPE=46.
  • Page 188 • 7: Controls operation signals. • 8: Set an Inverter to Servo Driver mode, so it acts as a servo axis. This is possible only for Inverters with an encoder feedback option card connected. To use an Inverter via MECHATROLINK-II you must put the command and the reference via communication option: •...
  • Page 189 All BASIC commands Section 4-2 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-MCH72 using the formula: AxisNo = MECHATROLINK-II Station Number - 0x21 Therefore the calculated AxisNo must not be occupied by another axis connected.
  • Page 190 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. • The address in the VR memory of the CJ1W-MCH72 where the read information is put.
  • Page 191 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. • The address in the VR memory of the CJ1W-MCH72 where the new value for the parameter is.
  • Page 192 See also 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.
  • Page 193 LIST [ "program_name" ] TYPE [ "program_name" ] Description For use only with the Command Line Terminal interface. LIST is used as an immediate (command line) command only and must not be used in programs. The LIST command prints the current selected program or the program specified by program_name.
  • Page 194 The programs cannot be modified or seen. >> UNLOCK(561234) The system is now unlocked. See also The security code must be remembered; it will be required to unlock the system. !Caution Without the security code the system can not be recovered. 4-2-152 MARK...
  • Page 195 Axis parameter (read-only) Syntax MARKB Description The MARKB is set to FALSE when the REGIST command has been executed and is set to TRUE when the primary registration event occurs. Only when this parameter is TRUE, the REG_POSB value is correct.
  • Page 196 Returns the address of MECHATROLINK-II slave at that "station" number. The station numbers are a sequence 0..x for all the attached slaves. -1 is returned if no slave is allocated to that station. It is used by the STARTUP program to check that the number of detected MECHA- TROLINK-II stations corresponds with the expected.
  • Page 197 Performs a helical move, that is, moves 2 orthogonal axes in such a way as to produce a circular arc at the tool point with a simultaneous lin- ear move on a third axis. The first 5 parameters are similar to those of a MOVECIRC command. The sixth parameter defines the simultaneous linear move.
  • Page 198 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).
  • Page 199 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.
  • Page 200 Section 4-2 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.
  • Page 201 Description The MOTION_ERROR parameter contains a bit pattern showing the axes which have a motion error. For example. if axis 2 and 6 have the motion error the MOTION_ERROR value would be 68 (4+64). A motion error occurs when the AXISSTATUS state for one of the axes matches the ERRORMASK setting.
  • Page 202 The distance to move for every axis in user units starting with the base axis. Example A system works with a unit conversion factor of 1 and has a 1000 line encoder. Note that a 1000 line encoder gives 4000 edges/turn. MOVE(40000) ' move 10 turns on the motor.
  • Page 203 WAIT IDLE AXIS(4) WAIT IDLE AXIS(3) 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.
  • Page 204 The specified distances are scaled using the unit conversion factor in the UNITS axis parameter. If, for example, an axis has 4,000 encoder edges/mm, then the number of units for that axis would be set to 4000, and MOVEABS(12.5) would move to a position 12.5 mm from the ori- gin.MOVEABS works on the default basis axis group (set with BASE)
  • Page 205 2 switches. The options are home (if both switches are off), position 1 (if the first switch is on and the second switch is off) and posi- tion 2 (if the first switch is off and the second switch is on). Position 2 has priority over position 1.
  • Page 206 Section 4-2 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.
  • Page 207 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.
  • Page 208 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.
  • Page 209 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.
  • Page 210 MOVELINK works on the default basis axis group (set with BASE) unless AXIS is used to specify a temporary base axis. The axis set for link_axis drives the base axis. MOVELINK is designed for controlling movements such as: •...
  • Page 211 Section 4-2 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.
  • Page 212 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.
  • Page 213 But in the example above, the acceleration phase is kept separate: MOVELINK(0.3,0.6,0.6,0,1) MOVELINK(0.7,1.0,0,0.6,1) This allows the output to be switched on at the end of the acceleration phase. Example MOVELINK can be used to create an exact ratio gearbox between two axes.
  • Page 214 Section 4-2 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 revolutions...
  • Page 215 ORIGINAL MOVE SENSOR SEEN Example A sheet of glass is fed on a conveyor and is required to stop 250 mm after the leading edge is sensed by a proximity switch. The proximity switch is connected to the registration input:...
  • Page 216 Section 4-2 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.
  • Page 217 The MSPEED parameter contains the measured speed in units/s. It is calculated by taking the change in the measured position in user units in the last servo period and divide it by the servo period (in seconds). The servo period is set with the SERVO_PERIOD parameter.
  • Page 218 S_REF signal from the servo loop. An offset of 327 will represent an offset of 0.1 volts. It is suggested that as offset of 65% to 70% of the value required to make the stage move in an open loop situation is used.
  • Page 219 4-2-170 NOT Type Mathematical operation Syntax NOT expression Description The NOT operator performs the logical NOT function on all bits of the integer part of the expression. The logical NOT function is defined as in the table below. Result Arguments •...
  • Page 220 The measured position will be changed accordingly in order to keep the Following Error. OFFPOS can therefore be used to effectively datum a system at full speed. The value set in OFFPOS will be reset to 0 by the system as the offset is loaded.
  • Page 221 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.
  • Page 222 The expression is evaluated and then the integer part is used to select a label from the list. If the expression has the value 1 then the first label is used, 2 then the second label is used, and so on. If the value of the expression is less than 1 or greater than the number of labels then an error occurs.
  • Page 223 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.
  • Page 224 OUTLIMIT AXIS(1) = 1073741824 The above will limit the demand output to half of the maximum possible output. This will apply to the S_REF command if SERVO is off, or to the output by the servo loop if SERVO is on.
  • Page 225 Encoder Interface In (ATYPE = 44) is 1.0. The proportional gain sets the stiffness of the servo response. Values that are too high will cause oscillation. Values that are too low will cause large Following Errors. Note: In order to avoid any instability the servo gains should be changed only when the SERVO is off.
  • Page 226 • tj_start The tart address in CJ1W-MCH72 memory. Note: The validity depends on tj_area. Note: The first 16 entries in the IN array are invalid start addresses. • total_items The total number of items (words and dwords) to transfer Note: The validity depends on plc_area and tj_area.
  • Page 227 PLC cyclic service. This function allows you to monitor the PLC CPU using a shorter time than the default of 11 seconds. Arguments • mode 0 or 1, to return the status or the elapsed time since the last PLC cyclic service. Example No example. See also...
  • Page 228 0.1 volts for axis with servo output generated by a 16 bit S_REF. It is suggested that as offset of 65% to 70% of the value required to make the stage move in an open loop situation is used.
  • Page 229 The width of the field in which a number is printed can be set with the use of [w,x] after the number to be printed. The width of the column is given by w and the number of decimal places is given by x.
  • Page 230 Task command Syntax PROC(task_number) Description The PROC modifier allows a process parameter from a particular proc- ess to be read or written. If omitted, the current task will be assumed. Arguments • task_number The number of the task to access.
  • Page 231 Each switch has assigned its own ON and OFF positions and out- put number. The command can be used with 2 or all 7 arguments. With only 2 argu- ments a given switch can be disabled. PSWITCHes are calculated on each servo cycle and the output result applied to the hardware.
  • Page 232 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.
  • Page 233 (MTYPE). Moves for speed profiled move com- mands (MOVE, MOVEABS, MOVEMODIFY, FORWARD, REVERSE, MOVECIRC and MHELICAL) will decelerate to a stop with the deceler- ation rate as set by the DECEL parameter. Moves for other commands will be immediately stopped. Notes: •...
  • Page 234 All BASIC commands Section 4-2 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.
  • Page 235 VR variable, either 0 or 1. Arguments • bit_number The number of the bit to be read. Range: [0,23]. • vr_number The number of the VR variable for which the bit is read. Range: [0,1023]. Example No example. See also CLEAR_BIT, SET_BIT.
  • Page 236 In this example a single output is tested: WAIT UNTIL READ_OP(12) = ON GOSUB place Example Check a range of 8 outputs and call a routine if one of them has value 1: op_bits = READ_OP(16, 23) IF op_bits <> 0 THEN GOSUB check_outputs...
  • Page 237 Example A paper cutting machine uses a CAM profile shape to quickly draw paper through servo driven rollers, and stop the paper so it can be cut. The paper is printed with a registration mark. This mark is detected and...
  • Page 238 Driver. Unlike Flexible axis axes, only one registration position can be captured. When a registration event has occurred, the MARK axis parameter is set to ON and the position is stored in the REG_POS axis parameter. The registration signals EXT1, EXT2 and EXT3 must be allocated to CN1 inputs with the driver parameter Pn511.
  • Page 239 All BASIC commands Section 4-2 Note The mapping of the registration signals in the table above applies to the Sigma-II Servo Driver. For the mapping of the registration signals of the Sigma-V, Junma and G-Series Servo Drivers, refer to section 5-1-6.
  • Page 240 Example A disc used in a laser printing process requires registration to the Z marker before it can start to print. The example code locates to the Z marker, and then sets it as the zero position. REGIST(1) 'set registration point on Z mark...
  • Page 241 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.
  • Page 242 ENCODER 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.
  • Page 243 If a slave axis is moved by MOVELINK or CAMBOX, REMAIN is expressed in encoder counts. • If a master or a slave axis is moved by a motion command that is not MOVELINK or CAMBOX, REMAIN is expressed in user units set by UNITS.
  • Page 244 When measured position reaches REP_DIST, twice that distance is subtracted to ensure that the axis always stays in the range [- REP_DIST, REP_DIST], assuming that REP_OPTION=OFF, or in the range [0, REP_OPTION], assuming that REP_OPTION=ON.
  • Page 245 0 and REP_DIST. 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.
  • Page 246 • condition Any valid BASIC logical expression Example A conveyor is to index 100mm at a speed of 1000mm/s, wait for 0.5s and then repeat the cycle until an external counter signals to stop by turning on input 4. cycle:...
  • Page 247 Description The REV_IN parameter contains the input number to be used as a reverse limit input. The valid input range is 0 to 31. Values 0 to 15 repre- sent physically present inputs of CJ1W-MCH72 I/O connector and are common for all axes.
  • Page 248 All BASIC commands Section 4-2 Example Run an axis in reverse. When an input signal is detected on input 5, stop the axis. back: REVERSE WAIT UNTIL IN(0) = ON ' Wait for stop signal CANCEL Example Run an axis in reverse. When it reaches a certain position, slow down.
  • Page 249 All BASIC commands Section 4-2 Example A joystick is used to control the speed of a platform. A deadband is required to prevent oscillations from the joystick midpoint. This is done with the REVERSE command, which sets the correct direction relative to the operator.
  • Page 250 The task number specifies the task number on which the program will be run. If the task number is omitted, the program will run on the highest available task. RUN can be included in a program to run another pro- gram.
  • Page 251 Each task has its own RUN_ERROR parameter. Use the PROC modi- fier to access the parameter for a certain task. Without PROC the cur- rent task will be assumed. The table below gives an overview of error numbers and the associated error messages.
  • Page 252 All BASIC commands Section 4-2 Number Message Number Message LABEL must be at start of line Cannot nest one line IF LABEL not found LINE NUMBER cannot have decimal point Cannot have multiple Invalid use of $ instances of REMOTE...
  • Page 253 String expected expected Invalid MSPHERICAL input Too many labels Symbol table locked Incorrect symbol type Invalid mix of data types Command not allowed when running Trajexia Studio Parameter expected Firmware error: Device in use Device error: Timeout waiting Device error: Command not...
  • Page 254 The RUNTYPE command determines whether the program, specified by program_name, is run automatically at start-up or not and which task it is to run on. The task number is optional, if omitted the program will run at the highest available task.
  • Page 255 The sample period can be any multiple of the servo period. The param- eters are stored in the TABLE array and can then be read back to a computer and displayed on the Trajexia Studio data trace or written to a file for further analysis using the Create Table file option on the File menu.
  • Page 256 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.
  • Page 257 SELECT "program_name" Description The SELECT command specifies the current program for editing, run- ning, listing, etc. SELECT makes a new program if a program with the name entered does not exist. The program name can also be specified without quotes.
  • Page 258 I/O of the Unit are all depending on this setting. The parameter is defined in microseconds. The CJ1W- MCH72 can be set in either 0.5, 1.0, 2.0 or 4.0 ms servo cycle. See the table below. The controller must be reset before the new servo period will be applied.
  • Page 259 4-2-224 SGN Type Mathematical function Syntax SGN(expression) Description The SGN function returns the sign of a number. It returns value 1 for positive values (including 0) and value -1 for negative values. Arguments • expression Any valid BASIC expression. Example >>...
  • Page 260 During forward movements, the controller sets OUT1 to OFF. During reverse move- ments, the controller sets OUT1 to ON. This setting is to be used for Servo Drivers that require both speed and direction signals as a speed reference.
  • Page 261 Large ratios should be avoided as they will lead to either loss of res- olution or much reduced smoothness in the motion. The actual physical step size x 16 is the BASIC resolution of the axis and use of this command may reduce the ability of the Motion Controller to accurately achieve all positions.
  • Page 262 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.
  • Page 263 Syntax SYSTEM_ERROR Description The SYSTEM_ERROR parameter contains system errors that occurred in the Trajexia system since the last time it was initialized. The bits in the SYSTEM_ERROR parameter are given in the table below. Description BASIC error Battery low error...
  • Page 264 TABLE(address) returns the TABLE value at the entry specified by address. A value in the TABLE can be read-only if a value of that number or higher has been previously written to the TABLE. For example, printing TABLE(1001) will produce an error message if the highest TABLE loca- tion previously written to the TABLE is location 1000.
  • Page 265 Syntax TABLEVALUES(address, number_of_points, format) Description Returns a list of TABLE points starting at the number specified. There is only one format supported at the moment, and that is comma delimited text. Note: TABLEVALUES is provided mainly for Trajexia Studio to allow for fast access to banks of TABLE values.
  • Page 266 See also 4-2-242 TIME$ Type System command Syntax TIME$ Description Prints the current time as defined by the real time clock as a string in 24- hour format. Arguments Example When the time is 13:20:00 >> PRINT TIME$ >> 13:20:00...
  • Page 267 DPOS on each axis. The frame transformation is therefore equivalent to 1:1 for each axis. For some machinery configu- rations it can be useful to install a frame transformation which is not 1:1, these are typically machines such as robotic arms or machines with par- asitic motions on the axes.
  • Page 268 The TRON command creates a breakpoint in a program that will sus- pend program execution at the line following the TRON command. The program can then for example be executed one line at a time using the STEPLINE command. Notes: •...
  • Page 269 Example A leads crew arrangement has a 5mm pitch and a 1,000-pulse/rev encoder. The units must be set to allow moves to be specified in mm. The 1,000 pulses/rev will generate 1,000 x 4 = 4,000 edges/rev. One rev is equal to 5mm. Therefore, there are 4,000/5 = 800 edges/mm. UNITS is thus set as following.
  • Page 270 Note: On the Flexible Axis, when VERIFY=OFF, the encoder counting circuit is configured to accept STEP and DIRECTION signals hard wired to the encoder A and B inputs. If VERIFY=ON, the encoder circuit is configured for the usual quadrature input.
  • Page 271 VR(address) Description The VR command reads or writes the value of a global (VR) variable. These VR variables hold real numbers and can be easily used as an element or as an array of elements. The CJ1W-MCH72 has in total 1024 VR variables.
  • Page 272 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...
  • Page 273 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.
  • Page 274 The command can only be used in a program. This is useful for activating events at the beginning of a move, or at the end when multiple moves are buffered together.
  • Page 275 WDOG can be turned on and off under program con- trol, on Command Line Terminal. The WDOG is also controlled by the PLC CPU. The WDOG can only be control word switched on when the Enable Watchdog bit ( bit 1) is set.
  • Page 276 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...
  • Page 277 All BASIC commands Section 4-2...
  • Page 278: Examples

    SECTION 5 Examples This chapter gives 2 categories of examples and tips: • How-to’s. • Practical examples.
  • Page 279: How-To's

    StartUp Priority window shows. StartUp Priority window 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).
  • Page 280 '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) '================================================...
  • Page 281 'Start APPLICATION program RUN "APPLICATION",2 STOP 5-1-2 Gain settings The gain setting is related to the mechanical system to which the motor is attached. There are three main concepts: • Inertia ratio • Rigidity • Resonant frequency.
  • Page 282 Measured Position Encoder Signal 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)
  • Page 283 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: Motion Parameter values P_Gain=131072 VFF_GAIN=0 Fn001=4 Note The colours and scale of the oscilloscope for speed mode are as follows: Red: MSPEED (Measured Axis speed).
  • Page 284 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: Motion Parameter values P_Gain=131072 VFF_GAIN=0 Fn001=6...
  • Page 285 How-to’s Section 5-1 Example 3 The parameter P_GAIN is increased further. The Following Error decreases proportionally. The parameter values for the example are: Motion Parameter values P_Gain=200000 VFF_GAIN=0 Fn001=6...
  • Page 286 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: Motion Parameter values...
  • Page 287 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.
  • Page 288 (the scaling is 20 units/division). The Following Error approaches zero during constant speed. The negative effect of this set of values is the overshoot and undershoot when the acceleration changes; this can be reduced but not eliminated by increasing the speed loop gain, if the mechanical system can cope with a high gain.
  • Page 289 How-to’s Section 5-1 Example 7 The value of the rigidity is increased from 6 to 8. The overshoot/undershoot is smaller but the motor has more vibration. The parameter values for the example are: Motion Parameter values P_Gain=131072 VFF_GAIN=1573500 Fn001=8...
  • Page 290 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.
  • Page 291 Measured position In this mode the position and speed loop are closed in the Servo Driver. The CJ1W-MCH72 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"...
  • Page 292 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).
  • Page 293 How-to’s Section 5-1 Example 2 The Following Error reduces as the rigidity increases. The parameter values for the example are: Motion Parameter values Fn001=6 Pn109=0...
  • Page 294 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: Motion Parameter values Fn001=8 Pn109=0...
  • Page 295 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: Motion Parameter values Fn001=6 Pn109=95...
  • Page 296 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.
  • Page 297 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.
  • Page 298 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...
  • Page 299 The absolute encoder gives the position within one turn (that is, a fraction from 0 to and excluding 1), and it has a multiturn counter. You can set the multiturn behaviour of the absolute encoder with the parameter Pn205 of the Sigma-II Servo Driver.
  • Page 300 . It can be achieved with the following equation: the smallest value of m such that: n machine_cycles = m motor_revolution Because n and m are integers: Pn205 = m – 1. This setting is explained in the following example. 5-1-3-4 Example 2...
  • Page 301 For more detail on initialising absolute encoder, please see the Sigma-II Servo Driver manual. It is possible to reset the multiturn counter, but it is not possible to reset the position !Caution within one turn (the fraction from 0 to and excluding 1). To adjust zero offset, use the parameter Pn808.
  • Page 302 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.
  • Page 303 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.
  • Page 304 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.
  • Page 305 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.
  • Page 306 • Digital outputs 16 - 255. These outputs can be mapped to the PLC memory. If they are not mapped, they are software outputs only. They do not physically exist on the CJ1W- MCH72, but you can write them and read their correct status. You use these outputs mostly in BASIC programs to accomplish some control sequences that require outputs which do not need to be physical.
  • Page 307 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...
  • Page 308 How-to’s Section 5-1 Input signal - Parameter name Parameter CN1 pin number setting Sigma-II Sigma-V P_OT (active high) - Pn50A.3 40 (SI0) 13 (SI0) N_OT (active high) - Pn50B.0 41 (SI1) 7 (SI1) DEC (active high) - Pn511.0 42 (SI2)
  • Page 309 0 and 3. For the Sigma-II driver, we want to use input signal EXT1 (mapped to CN1-44 if Pn511.2 is set to 4) to serve as reverse limit input for axis 0. For the Junma driver, we want to use input signal EXT1 (CN1-2) as reverse limit for axis 3.
  • Page 310 22, which in this example are the EXT1 inputs of the connected Servo Drivers. 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)
  • Page 311 Origin search The origin search or homing functionality is often seen as a particular sequence of movements of an axis at the start-up phase of the machine. This sequence is done automatically in most cases, without the input from the operator of the machine.
  • Page 312 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.
  • Page 313 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.
  • Page 314 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. 'Origin and left limit switch: IN0...
  • Page 315 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.
  • Page 316 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.
  • Page 317 Servo Driver is connected to the Trajexia system via the MECHATROLINK-II bus. There are three registration inputs on these Servo Drivers, but only one hardware latch, so only one input can be used at a time. For Sigma-II Servo Drivers the physical inputs are in pins CN1-44, CN1-45 and CN1-46 on the 50-pins CN1 connector.
  • Page 318 How-to’s Section 5-1 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...
  • Page 319 REGIST captures the axis position when a registration signal is detected. The available settings depend on the axis type. Refer to section 4-2-200. • MARK is a flag that signals whether the position has been captured or not. For the second registration input of the , the parameter Encoder Interface MARKB is also available.
  • Page 320 5-1-6-7 Registration and windowing function The windowing function enables for registration to occur only within a specified range of axis positions. This function is selected by giving the right value as an argument for the REGIST command. The windowing function is controlled by two axis parameters, OPEN_WIN and CLOSE_WIN.
  • Page 321 • The latch is triggered. Because of these delays, there is an uncertainty in the edges of the window when marks may be detected near the edges. This is more notable for axes connected to the system via the MECHATROLINK-II bus due to bus delays. To compensate for these delays, a user must set the window margins large enough.
  • Page 322 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...
  • Page 323 Section 5-1 correction, an error of 0.1 mm per bag is accumulated. With a small number of bags the difference is not visible, but after 500 bags the error is 50 mm, which is a 25% of the bag length.
  • Page 324 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.
  • Page 325 Memory Manager of the device configuration (see the Trajexia Studio manual). With manual triggering, the user can see the changes of axis and system parameters in real time, as the system runs. A change in parameter values is graphically represented as soon as the change happens.
  • Page 326 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 x...
  • Page 327 'DPOS AXIS(1) is stored in TABLE(2000) to TABLE(2999) 'Torque reference for AXIS(1) is stored in 'TABLE(3000) to TABLE(3999) 'MSPEED AXIS(1) is stored in TABLE(4000) to TABLE(4999) 'The capture covers 1000 samples * 2ms / sample = 2seconds SCOPE(ON,2,1000,4999,MPOS AXIS(0),DPOS,DRIVE_MONITOR,MSPEED) FORWARD AXIS(0) 'Move the master axis forward...
  • Page 328 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.
  • Page 329 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...
  • Page 330 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.
  • Page 331: Practical Examples

    The purpose of the SHELL program is to ensure the proper initialization of your system and the integrity of your machine. The example in the next section can be used as a template and can be modified if required.
  • Page 332 (see 5-1-1). 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.
  • Page 333 'Omron Auto Generated - Symbols 'Warning: Automated code section - any manual code changes will be lost. First action is to declare the GLOBAL variables and CONSTANTS and make other initialization 'Omron Auto Generated - Globals GLOBAL "length",0 GLOBAL "lot_n",1...
  • Page 334 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 At least the right system needs to be properly detected...
  • Page 335 'Define here your signals to STOP/START/RESET 'This example uses the following signals: 'Rising edge of bit 0 of VR(signal_state) as RUN signal 'Rising edge of bit 1 of VR(signal_state) as STOP signal 'Rising edge of bit 2 of VR(signal_state) as RESET signal...
  • Page 336 RETURN '-------------------------------------------------------- stop_all: 'In this example, if the application program is stopped 'suddenly all the movements are cancelled and all the axes 'are set to BaseBlock. Modify this section if you require 'a different STOP procedure STOP "APPLICATION" WDOG=0...
  • Page 337 WA(1) CANCEL(1) 'Cancel possible program buffer NEXT i RAPIDSTOP 'Cancel MTYPE RETURN '-------------------------------------------------------- start_app: 'Add all the application programs that should be started 'with the START signal RUN "APPLICATION" RETURN '-------------------------------------------------------- reset_all: 'Uncorrect system setting IF READ_BIT(15,diag01)=0 THEN GOSUB system_detection...
  • Page 338 Practical examples Section 5-2 IF (SYSTEM_ERROR AND $40000)<>0 THEN 'Omron Auto Generated - ML IO 'Warning: Automated code section - any manual code changes 'will be lost. 'Omron Auto Generated - ML IO End 'Same with the other IO devices ELSEIF SYSTEM_ERROR<>0 THEN...
  • Page 339 VR(diag03)=0 VR(system01)=0 '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"...
  • Page 340 Practical examples Section 5-2 ENDIF 'Stop Mechatrolink Section 'Detection OK IF VR(diag01)=0 AND VR(diag02)=0 AND VR(diag03)=0 THEN SET_BIT(15,diag01) 'Invert input channels INVERT_IN(16,OFF) 'POT INVERT_IN(17,OFF) 'NOT 'Omron Auto Generated - Units End 'Start Standard Section IF READ_BIT(15,diag01)=1 THEN 'Drive Parameters BASE(2)
  • Page 341 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...
  • Page 342 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 BASE(1) 'Axis Name: Flex01 ATYPE=44 'Axis Type: Flexible_Servo UNITS=1024.0000 REP_DIST=5000000.0000 REP_OPTION=0 ERRORMASK=268 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...
  • Page 343 Practical examples Section 5-2 FASTDEC=0.0000 FHSPEED=1000.0000 OUTLIMIT=1.0000 FE_RANGE=0.0000 DAC=0.0000 BASE(2) 'Axis Name: Down ATYPE=40 'Axis Type: Mechatro_Position UNITS=32.0000 REP_DIST=360000.0000 REP_OPTION=0 ERRORMASK=268 AXIS_ENABLE=0 DRIVE_CONTROL=0 SPEED=3600.0000 ACCEL=36000.0000 DECEL=36000.0000 CREEP=100.0000 JOGSPEED=100.0000 FE_LIMIT=90.0000 SERVO=0 FWD_IN=16.0000 REV_IN=17.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...
  • Page 344 The Initialization program sets the parameters for the axes. These parameters are dependant upon the Motor Encoder resolution and the motor maximum speed. 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...
  • Page 345 'Pn202=1 (gear ratio numerator in the drive. Default 'is 4) 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...
  • Page 346 • 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).
  • Page 347 A ballscrew moves forward at a creep speed until it reaches a product, a microswitch (IN(2)) turns on. The ballscrew is stopped immediately, the position at which the product is sensed is indicated and the ballscrew returns at a rapid speed back to the start position. IN(1)
  • Page 348 5-2-6 Position on a grid 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...
  • Page 349 Square_rel Square_rel 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...
  • Page 350 Section 5-2 5-2-7 Bag feeder program 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. Bag feeder machines have two modes.
  • Page 351 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.
  • Page 352 GOTO loop 5-2-8 CAM table inside a program It shows how to create a CAM table inside a program, and use the CAMBOX motion command. The profile used is the COS square one. This is a quite typical profile for feeder-type applications as: •...
  • Page 353 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"...
  • Page 354 / 2 + synch_dist + l_dec / 2 Cut_length 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) Cut_length-l_acc / 2 '=================================================...
  • Page 355 'Third axis (shear_axis) is the shear advancement 'The distance in synchronization must be long enough 'to allow the cut at maximum speed. 'The return of the flying shear is done at such a 'speed that the wait time is zero (optimization of 'the movement).
  • Page 356 SPEED 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.
  • Page 357 5-2-10 Correction program This application is for a rotary labeller. The constants are: • The product arrives on a conveyor (master axis) that runs at a constant speed. • A rotary labeller that is synchronized 1:1 to the conveyor, attaches the labels.
  • Page 358: Troubleshooting

    Section 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, probable cause, items check, suggested countermeasures.
  • Page 359: Items To Check First

    Wiring Are signal lines and power lines placed in separate ducts? Is the proper grounding provided? Is there too much electric noise and if so does the power supply have a noise filter? Recent changes Has there been changes to the system?
  • Page 360: Error Indicators

    Error Indicators Section 6-2 Error Indicators The unit's status LED indicators indicate the following errors: 6-2-1 Errors During Initialisation Status LED: OFF: FLASH: --: Not Not lit Flashing changed WDOG Initial hardware test Flashing error Error log access error PLC watchdog...
  • Page 361: Troubleshooting Errors

    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-185 for more details on PLC_STATUS BASIC command).
  • Page 362 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...
  • Page 363 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-185 for...
  • Page 364 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-185 for more details on PLC_STATUS BASIC command).
  • Page 365 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-234 for more details ERROR_LINE find a line in the BASIC on this parameter).
  • Page 366 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-96 for more...
  • Page 367: Miscellaneous

    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.
  • Page 368 Absolute encoder CPU task Wiring Cycle time Architecture Motion sequence Axis sequence Process Program Axis type Servo period Description Motion buffers Bag feeder program example BASIC commands Encoder connector BASIC program Wiring Battery Encoder output Replace EnDat Buffer types Example Buffers...
  • Page 369 Wiring Peripherals Incremental encoder Position control Hardware PSWITCH Position loop algorithm Input Output Position mode example Registration Position on a grid example Wiring Position reference Inertia ratio Position with product detection example Initialization example Priority Installation Program control Process Process 0...
  • Page 370 Index Servo axis Wiring Servo Driver characteristics example Word allocations Servo period Examples Rules Servo system CJ1W-MCH72 operation Motion control algorithm Semi-closed loop Shell example Single axis example Specifications Dimensions Encoder connector Encoder interface I/O connector MECHATROLINK-II System Unit Speed control Speed mode example –...
  • Page 371 Index...
  • Page 372: Revision History

    Revision History Revision history A manual revision code appears as a suffix to the catalog number on the front cover of the manual. Cat. No. I55E-EN-01 Revision code The following table outlines the changes made to the manual during each revision.
  • Page 374 Authorized Distributor: Cat. No. I55E-EN-03 Note: Specifi cations subject to change without notice. Printed in Europe...

Table of Contents