Omron TJ2-MC64 - PROGRAMMING Programming Manual
Omron TJ2-MC64 - PROGRAMMING Programming Manual

Omron TJ2-MC64 - PROGRAMMING Programming Manual

Hide thumbs Also See for TJ2-MC64 - PROGRAMMING:

Advertisement

Cat. No.
I58E-EN-01
Trajexia machine control system
TJ2-MC64
PROGRAMMING MANUAL

Advertisement

Table of Contents
loading

Summary of Contents for Omron TJ2-MC64 - PROGRAMMING

  • Page 1 Cat. No. I58E-EN-01 Trajexia machine control system TJ2-MC64 PROGRAMMING MANUAL...
  • Page 2 CANopen is a registered trademark of CAN in Automation (CiA). ModbusTCP is a registered trademark of Modbus IDA. All rights reserved. No part of this publication may be reproduced, stored in a retrieval sys- Trajexia is a registered trademark of OMRON.
  • Page 3 G7 Inverter TOE S616-60 Describes the installation and operation Please read this manual and the related manuals listed in the following table of G7 Inverters carefully and be sure you understand the information provided before attempting to install or operate the Trajexia Machine Control units. Be sure...
  • Page 4 WARNING Failure to read and understand the information provided in this manual may result in personal injury or death, damage to the pro- duct, or product failure. Please read each section in its entirety and be sure you understand the information provided in the section and related sections before attempting any of the procedures or opera- tions given.
  • Page 5: Table Of Contents

    Contents Safety warnings and precautions................................1 Intended audience ............................................1 General precautions ............................................1 Safety precautions ............................................1 Operating environment precautions........................................2 Application precautions.............................................3 Unit assembly precautions..........................................5 Trajexia system ......................................6 Introduction ...............................................6 Multitasking BASIC programming........................................8 BASIC programming............................................9 Motion execution.............................................14 Command line interface ..........................................15 BASIC programs.............................................15...
  • Page 6 Contents Troubleshooting......................................341 Voltage and analysis tools ..........................................341 TJ2-MC64 ..............................................341 TJ1-PRT ...............................................344 TJ1-DRT ...............................................345 TJ1-CORT ..............................................345 TJ1-ML__..............................................346 GRT1-ML2 ..............................................346 TJ1-FL02 ..............................................349 GRT1-ML2 timing ...................................... 350 Timing concepts............................................350 Examples ..............................................352 Revision history ......................................355 PROGRAMMING MANUAL...
  • Page 7: Safety Warnings And Precautions

    Not doing so may result in serious accidents. WARNING WARNING Do not attempt to take the Unit apart and do not touch any of the When the 24-VDC output (I/O power supply to the TJ2) is over- internal parts while power is being supplied.
  • Page 8: Operating Environment Precautions

    Machine Controller (referred to as "TJ2"), in order to ensure Locations subject to condensation as the result of severe safety in the system if an abnormality occurs due to malfunction of changes in temperature. the TJ2 or another external factor affecting the TJ2 operation.
  • Page 9: Application Precautions

    The numbers of the Flexible axes will change if MECHATROLINK- II network errors occur during start-up or if the MECHATROLINK-II Caution network configuration changes. Do not apply voltage to the Input Units in excess of the rated input voltage. WARNING Excess voltage may result in burning.
  • Page 10 Double-check all the wiring before turning on the power supply. any of the following. Incorrect wiring may result in burning. Not turning off the power supply may result in malfunction or elec- tric shock. Caution Mounting or dismounting expansion Units, CPU Units, or any Wire correctly.
  • Page 11: Unit Assembly Precautions

    Safety warnings and precautions Caution Caution When replacing parts, be sure to confirm that the rating of a new Outputs may remain on due to a malfunction in the built-in transis- part is correct. tor outputs or other internal circuits.As a countermeasure for such Not doing so may result in malfunction or burning.
  • Page 12: Trajexia System

    At the heart of Trajexia lies the TJ2 multi-tasking machine Master Master Master controller. Powered by a 64-bit processor, it can do motion tasks such as e- Ethernet cam, e-gearbox, registration control and interpolation, all using simple motion commands.
  • Page 13 Trajexia system messaging over Ethernet and through MECHATROLINK-II to provide full transparency down to the actuator level, and making remote access possible. PROGRAMMING MANUAL...
  • Page 14: Multitasking Basic Programming

    PROFIBUS-DP The TJ2-MC64 can hold up to 32 programs if memory size permits. Up to 22 The PROFIBUS-DP slave allows connectivity to the PROFIBUS network in programs can be run simultaneously. The execution of the programs is user your machine.
  • Page 15: Basic Programming

    For example, ABS will take assumed. The BASE command (see above) is task specific and can be the value of its parameter and return the absolute value of it to be used by used with the PROC modifier.
  • Page 16 Some variables have predefined functions, such as the axis parameters and same time. The size of this memory is 64,000 slots with indexes 0 to 63,999. system parameters; other variables are available for the programmer to A memory slot is addressed using the VR(x) macro where x is index of the define as required in programming.
  • Page 17 GOTO and GOSUB. To define a label it must appear as the first statement PRINT(VR(length)) on a line and it must be ended by a colon (:). Labels can be character strings of any length, but only the first 32 characters are significant.
  • Page 18 Trajexia system 'The declaration in start-up program GLOBAL length, 3 'In other programs executed after the start-up program start: start: length = x MOVE(length) PRINT(length) PROGRAMMING MANUAL...
  • Page 19 The double precision floating point format is internally a 64 bit value. It has Floating point comparison an 11 bit exponent field, a sign bit and a 52 bit fraction field. Floating point The comparison function considers a small difference between values as −308...
  • Page 20: Motion Execution

    2.4.1 Motion generator The motion generator has a set of up to 64 motion buffers for each axis. One buffer called MTYPE, holds the Actual Move, which is the move currently executing on the axis. The next buffer called NTYPE, holds the Next Move, which is executed after the Actual Move has finished.
  • Page 21: Command Line Interface

    NTYPE buffers to see if any of them are available. If there are and from a computer for archiving, printing and editing. It also has several any available then it checks the task buffers to see if there is a move waiting controller monitor and debugging facilities.
  • Page 22 Priority property in the Properties window. If you click the ellipsis button in the edit field of this property, the StartUp Priority window shows. To set the program to run at power up, select the Run at Power Up check box and select a priority in the list.
  • Page 23: Basic Commands

    Changes the ACCEL and DECEL at the same time. MECHATROLINK Initializes MECHATROLINK-II bus and performs various operations ADD_DAC Sum to the DAC value of one axis to the analogue output of the on MECHATROLINK-II stations connected to the bus. base axis. MHELICAL Interpolates 3 orthogonal axes in a helical move.
  • Page 24 Contains the axis acceleration rate. MOVECIRC Interpolates 2 orthogonal axes in a circular arc. ADDAX_AXIS Contains the number of the axis to which the base axis is cur- MOVECIRCSP Forced speed version of the MOVECIRC command. rently linked to by ADDAX.
  • Page 25: Mechatrolink

    ENDMOVE_BUFFER Holds the absolute position at the end of the buffered sequence. MERGE Is a software switch that can be used to enable or disable the ENDMOVE_SPEED Contains the ramp to exit speed when forced speed moves are merging of consecutive moves.
  • Page 26 Contains the speed profile speed. REP_OPTION Controls the application of the REP_DIST axis parameter. REV_IN Contains the input number to be used as a reverse limit input. REV_JOG Contains the input number to be used as a jog reverse input. RS_LIMIT Contains the absolute position of the reverse software limit.
  • Page 27 Writes data to the Host Link Slave from either VR or TABLE var- Returns the value of digital inputs. iable array. Sets one or more outputs or returns the state of the first 24 out- HLS_NODE Defines the Slave unit number for the Host Link Slave protocol.
  • Page 28 Performs a NOT operation on corresponding bits of the integer part of the expression. > (IS GREATER THAN) Checks two expressions to see if the expression on the left is Performs an OR operation between corresponding bits of the greater than the expression on the right.
  • Page 29 Slot parameters and modifiers Name Description Executes a program. RUNTYPE Determines if a program is run at start-up, and which task it is to Name Description run on. Is a modifier that specifies that all items in the controller are con- SELECT Specifies the current program.
  • Page 30 Writes and reads data to and from the global (VR) variables. FREE Returns the amount of available memory. VRSTRING Combines VR memory values so they can be printed as a string. GLOBAL Declares a reference to one of VR variables. Holds program execution for the number of milliseconds speci- HALT Stops execution of all programs currently running.
  • Page 31: Mechatrolink

    BASIC commands 3.1.12 Task commands and parameters Name Description DATE Sets or returns the current date held by the real time clock. Sets or returns the current day. Name Description DISPLAY Determines I/O channels to be displayed on the front panel...
  • Page 32: All Basic Commands

    Any valid BASIC expression. Example result = 3 * 7 • expression2 Assigns the value 21 to the variable result. Any valid BASIC expression. See also Example result = 4 + 3 Assigns the value 7 to the variable result.
  • Page 33 Example IF a <> 10 THEN GOTO label1 Any valid BASIC expression. If variable a contains a value not equal to 10, program execution continues at Example IF a = 10 THEN GOTO label1 label label1. Otherwise, program execution continues with the next state- If variable a contains a value equal to 10, program execution continues at ment.
  • Page 34 IF a <= 10 THEN GOTO label1 If variable a contains a value greater than or equal to 10, program execution If variable a contains a value less than or equal to 10, program execution con- continues at label label1. Otherwise, program execution continues with the tinues at label label1.
  • Page 35 Note: Communications Channels greater than 3 will only be used when run- Description ' marks all that follows it on a line as comment and not program code. Com- ning the Trajexia Studio software. ment is not executed when the program is run. You can use ' at the beginning Arguments of a line or after a valid statement.
  • Page 36 ACCEL and DECEL axis parameters. 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. Arguments • rate Input values outside the range will return 0.
  • Page 37: Mechatrolink

    DAC_OUT AXIS(m) + DAC_OU T AXIS(n) Note: SERVO = ON Demanded Following Speed Be aware that the control loop gains for both axes need to be determined error command position with care. As different encoders with different resolutions are used, the Measured position gains are not identical.
  • Page 38 The axis specified by the parameter can be any axis and does not have to physically exist in the system.
  • Page 39 BASIC commands fig. 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 PROGRAMMING MANUAL...
  • Page 40 Pieces are placed randomly onto a belt that moves continuously. Further along the line they are transferred to a second flighted belt. A detection sys- tem indicates if a piece is in front of or behind its nominal position, and how far.
  • Page 41 4 Example An X-Y marking machine must mark boxes as they move along a conveyor. Using CONNECT enables the X marking axis to follow the conveyor. A virtual axis is used to program the marking absolute positions; this is then superim- posed onto the X axis using ADDAX.
  • Page 42: Mechatrolink

    The output of the ultra-sonic sensor is in >> PRINT ADDAX_AXIS the range 0V to 4V where the output is at 4V when the loop is at its longest. -1.0000 Note: The analogue input value is checked to ensure it is above zero even...
  • Page 43: Mechatrolink

    MECHATROLINK-II bus. The range of the value set is [- 32000, 32000] for full output range. The output range depends on the ana- logue unit used and can be one of the following: [-10V, 10V], [0V, 10V] or [0V, Type Mathematical operation 5V] for voltage and [0mA, 20mA] or [4mA, 20mA] for current output.
  • Page 44: Mechatrolink

    The ATAN function returns the arc-tangent of the argument. expression can Description The ATYPE axis parameter indicates the axis type for the axis. The valid val- have any value. The result is in radians and is between -PI/2 and PI/2.
  • Page 45 LEDs showing axis status. The default value Description The AUTORUN command starts all the programs that have been set to run at of this parameter on start-up for all axes is 0. The valid values are shown in start-up. the table below.
  • Page 46: Mechatrolink

    BASIC commands 3.2.36 AXIS_ENABLE Arguments • unit_number Unit numbers are 0 to 6, with 0 being the unit immediately to the right of the TJ2-MC64. • offset_value Type Axis parameter Offset applied during axis number assignment for axes connected to the...
  • Page 47 BASE(1) B_SPLINE(1, 0, 9, 200, 10) Arguments This command expands a 10 point profile in TABLE locations 0 to 9 to a larger 100 points profile starting at TABLE location 200. Example IF (AXISSTATUS AND 16)>0 THEN PRINT "In forward limit"...
  • Page 48 The backlash compensation is achieved as follows: the axis when BACKLASH = ON. • An offset move is applied when the motor demand is in one direction. Arguments • The offset move is reversed when the motor demand is in the opposite Example IF BACKLASH_DIST>100 THEN...
  • Page 49 BASIC commands Description The BASE command is used to set the default base axis or to set a specified Example BASE(0) axis sequence group. All subsequent motion commands and axis parameters MOVE(100,-23.1,1250) will apply to the base axis or the specified axis group unless the AXIS com- In this example, axes 0, 1 and 2 will move to the specified positions at the mand is used to specify a temporary base axis.
  • Page 50 PRINT " occurred in line "; ERROR_LINE[0] ENDIF 3.2.46 CAM STOP If an error occurs in a BASIC program in this example, the error routine will be executed. Type Axis command The IF statement is present to prevent the program going into error routine...
  • Page 51 Arguments • start_point The address of the first element in the TABLE array to be used. Being able to specify the start point allows the TABLE array to hold more than one profile and/or other information. • end_point The address of the end element in the TABLE array.
  • Page 52 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 pro- vides a simple oscillation superimposed with a constant speed. To load the table and cycle it continuously the program would be:...
  • Page 53 BASIC commands TABLE position Degree Value 12500 10340 9103 9000 PROGRAMMING MANUAL...
  • Page 54: Programming Manual

    6 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 trans- mitted through port 1 serial port to the controller as ASCII text.
  • Page 55: Programming Manual

    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 param- eter must range from 10000 to 80000.
  • Page 56: Programming Manual

    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 avail- able (500000). Being able to specify the start point allows the TABLE array to be used to hold more than one profile and/or other information.
  • Page 57: Programming Manual

    The Table multiplier value used to scale the values stored in the TABLE. As the TABLE values are specified in encoder edges, use this argument to set the values for instance to the unit conversion factor (set by UNITS parameter).
  • Page 58: Programming Manual

    RETURN This graph plots TABLE contents against table array position. This corre- sponds to motor POSITION against link POSITION when called using CAMBOX. The SPEED of the motor will correspond to the derivative of the position curve above. fig. 8...
  • Page 59: Programming Manual

    9 Example A pair of rollers feeds plastic film into a machine. The feed is synchronised 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...
  • Page 60 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 61: Programming Manual

    CONTROL BLOCK: This is pointed to by the third CAMBOX parameter in this options mode only. It is of fixed length (7 table values). It is impor- tant to note that the control block is modified during the CAMBOX opera- tion.
  • Page 62: Programming Manual

    CB(6)=-1. The value can be set to 0 to terminate the CAMBOX at the end of the current pattern. The axis the CAMBOX is linked to can run in a positive or neg- ative direction. In the case of a negative direction link the pat- tern will execute in reverse.
  • Page 63: Programming Manual

    TABLE(305,0) ' Set zero repeats: This will stop at end of pattern Note: The axis to which the CAMBOX is linked can run in a positive or nega- tive direction. In the case of a negative direction link, the pattern executes in reverse.
  • Page 64: Programming Manual

    • area_type Configure a TPDO. The memory area in Trajexia: 1 = VR, 2 = TABLE, 3 = Digital I/O, 4 = CAN_CORT(unit,9,node_ID,index,subindex,byte1,byte2,…) Analog I/O. Make the TJ1-CORT configure an object in a slave during the CANopen net- •...
  • Page 65: Programming Manual

    (MTYPE). The command CANCEL(1) cancels the contents of the next move buffer (NTYPE) without affecting the current move in the MTYPE buffer. CANCEL works on the default basis axis (set with BASE) unless AXIS is used to specify a temporary base axis.
  • Page 66 13 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 67 BASIC commands 3.2.50 CHANGE_DIR_LAST Type Axis parameter Syntax CHANGE_DIR_LAST Description Allows the program to examine the change in direction in radians of the last programmed MOVESP/MOVEABSSP/MOVECIRCSP move of 2 or more axes. CHANGE_DIR_LAST is always positive. Arguments fig. 14 Example MOVESP(100,100) PRINT "START_DIR_LAST: ";START_DIR_LAST/(2*PI)*360[0];"...
  • Page 68 The CLEAR command resets all global VR variables to 0 and sets local varia- bles 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 69 The CLUTCH_RATE axis parameter defines the change in connection ratio when using the 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 compati- Type System command bility with previous TJ2-MC64 units.
  • Page 70 Return value Description Unused unit TJ1-ML16 TJ1-FL02 TJ1-PRT TJ1-DRT TJ1-ML04 TJ1-CORT Arguments • unit_number Unit numbers are 0 to 6, with 0 being the unit immediately to the right of the TJ2-MC64. Example No example. See also PROGRAMMING MANUAL...
  • Page 71 ON. 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 con- veyor. The roller is wired to the master axis 0. The reference encoder is con- nected to axis 1.
  • Page 72 16 Example A machine has an automatic feed on axis 1 that must move at a set ratio to axis 0. This ratio is selected using inputs 0-2 to select a particular “gear”. This ratio can be updated every 100 ms. Combinations of inputs select the inter- mediate gear ratios.
  • Page 73 TJ2-MC64 will return 1266. Note: The program containing the CONSTANT definition must be run before the name is used in other programs. In addition, only that program should be Arguments running at the time the CONSTANT is executed, otherwise the program error Example No example.
  • Page 74 It is possible to use combinations of these. Arguments fig. 18 Example CORNER_MODE=2 Speed [%] In the following example the system will reduce the speed to 27.5% during an change in angle of PI/4. DECEL_ANGLE=0.2 STOP_ANGLE=1 Example Bit 2 - allows RAISE_ANGLE and CORNER_STATE interaction See CORNER_STATE 27.5...
  • Page 75 Description of the bits in CORNER_STATE: Bit 1 - This bit is set when the change in direction is above RAISE_ANGLE Bit 2 - Set this bit to continue at FHSPEED Bit 3 - This bit is set when the axis is continuing at FHSPEED Clear all bits to continue normal operation.
  • Page 76 The COS function returns the cosine of the expression. Input values are in CRC16(0, poly) 'Initialise internal CRC table memory radians and may have any value. The result value will be in the range from -1 TABLE(0,1,2,3,4,5,6,7,8) ‘Load data into table memory location 0-7 to 1.
  • Page 77 With these 2 parameters set as above, the DAC output will be clamped at DATUM(4) AXIS(1) 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 See also AXIS, DATUM, UNITS.
  • Page 78 See also between the servo control loop output and the Digital to Analog Converter which output is supplied to the Servo Drive. Its value is set to 16 on axes with 3.2.77 DATE$ a 16 bit Digital to Analog Converter, which are Flex axis types. This scales the values applied to the higher resolution DAC so that the gains required on the axis are similar to those required on the other controllers.
  • Page 79 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, other- wise there will be unpredictable errors on the motion.
  • Page 80 20 Example A production line must stop if something blocks the product belt, which causes a motion error. The obstacle must be removed, and a reset button must be pressed to restart the line. FORWARD 'start production line WHILE IN(2)=ON IF MOTION_ERROR=0 THEN OP(8,ON) 'green light on;...
  • Page 81 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 decelerate at this point, and therefore it stops after the mark. A move is used to bring it back to the Z position.
  • Page 82 23 Example A machine similar to the machine in the example above must locate a home switch, which is at the forward end of the move. The machine then moves backwards to the next Z marker, and set this Z marker as the datum.
  • Page 83 Servo Drive which Servo Drive inputs are mapped into inputs 16 to 31. 3.2.82 DECEL 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 84 The measured position (MPOS) will be changed accordingly in order to keep the Following Error. DEFPOS is typically used after an origin search sequence (see DATUM command), as this sets the cur- rent position to 0. DEFPOS can be used at any time.
  • Page 85 BASIC commands fig. 24 Example After 2 axes returned to their homing positions, it is required to change the DPOS values so that the home positions are not zero, but some defined posi- tions instead. DATUM(5) AXIS(1) ' home both axes. At the end of the DATUM DATUM(4) AXIS(3) ' procedure, the positions are 0,0.
  • Page 86 BASIC commands fig. 25 Example Set the axis position to 10, then start an absolute move, but make sure the axis has updated the position before loading the MOVEABS. DEFPOS(10.0) WAIT UNTIL OFFPOS=0 ' Makes sure that DEFPOS is complete before next line MOVEABS(25.03)
  • Page 87 DEVICENET function 4 returns the data exchange sta- DEL can also be used to delete the Table: DEL "TABLE". The name tus of the TJ1-DRT. Refer to the table below for the description of the bits in "TABLE" must be in quotes.
  • Page 88 The DISABLE_GROUP is used to create a group of axes which will be disa- The number of output words from the DeviceNet master in VR memory. bled if there is a motion error in any or more axes in the group. After the group •...
  • Page 89 27 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 90 Syntax DISPLAY=value Example One group of axes in a machine must be reset if a motion error occurs, with- Description Determines the I/O channels to be displayed on the front panel LEDs. The out affecting the remaining axes. This must be done manually by clearing the...
  • Page 91 Trajexia system via MECHATROLINK-II. Upon successful then turning it on again. Also, an alarm will not be cleared if the cause of the execution, the command returns -1 and stores the value in the VR memory alarm is still present.
  • Page 92 EXT2 Second external latch signal 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 EXT3...
  • Page 93 SERVO_PERIOD. The command is executed on the Drive for the base axis and Sigma-V), Torque limit set by BASE. The base axis can be changed with the AXIS modifier, as with input in negative direction (G/ all the other axis commands and parameters.
  • Page 94 The DRIVE_RESET command resets the Servo Drive connected via the MECHATROLINK-II bus. The command is executed on the Drive for the base Machine Lock axis set by BASE. The base axis can be changed with the AXIS modifier, as Home Position with all the other axis commands and parameters.
  • Page 95 -1. If the command cannot be executed, the value 0 is returned. is given in the second table below. (Note: Only bits relevant to Flexible axis The command is executed on the Drive for the base axis set with BASE. It are listed.) can be changed using the AXIS modifier, as with all other axis commands and parameters.
  • Page 96 Servo Drive is removed. When applied to Flexible axis EnDat absolute encoder axis, bits 0 - 7 of the parameter should be set to the total number of encoder bits. Bits 8 - 14 should 3.2.101 ELSE be set to the number of multi-turn bits to be used.
  • Page 97 ATYPE = 47 This parameter is applicable only to Flexible axis absolute Tamagawa axis In this example a 25 bit EnDat encoder is used, that has 12 bits for multi-turn with ATYPE value 46. value and 13 bits per one revolution.
  • Page 98 ATYPE value 46. It returns both the status field SF and the ALMC ENCODER_RATIO(8192,7200) encoder error field. The SF field is in bits 0 - 7, while the ALMC filed is in bits 8 UNITS=20 ' axis calibrated in degrees, resolution is 0.05 deg.
  • Page 99 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. Writing to address 0 performs an encoder reset function.For more information see EnDat absolute encoder...
  • Page 100 MOVECIRCSP, MHELICALSP) are loaded. The ENDMOVE_SPEED param- (DPOS). eter should be set to the required value at the time of loading the move into Note: As the measured position is not changed initially, the Following Error the buffer.
  • Page 101 BASIC commands 3.2.118 ERROR_LINE Caution It is up to the user to define in which cases a motion error is gener- Type Task parameter (read-only) ated. For safe operation it is strongly recommended to generate a motion error when the Following Error has exceeded its limit in all...
  • Page 102 Description Resets the controller as if it were being powered up again. There are two types of reset performed by the EX command. EX without the 3.2.124 FAST_JOG argument, or EX(0) does the software reset of the controller. EX(1) does the hardware reset of the controller, also resetting the communication interface.
  • Page 103 Description The FAST_JOG axis parameter contains the input number to be used as the Arguments fast jog input. The number can be from 0 to 31. As default the parameter is set Example No example. to -1, no input is used for the fast jog.
  • Page 104 The FHOLD_IN axis parameter contains the input number to be used as the If FE_LIMIT_MODE is set to 1, the axis will only generate a feedhold input. The valid input range is 0 to 31. Values 0 to 15 represent phys- MOTION_ERROR when the FE exceeds FE_LIMIT during 2 consecutive ically present inputs of TJ2-MC64 I/O connector and are common for all axes.
  • Page 105 [, ip1, ip2, ip3, ip4]) Description The FHSPEED axis parameter contains the feedhold speed. This parameter can be set to a value in user units/s and defines at which speed the axis will Description FINS (Factory Interface Network Service) is a Proprietary OMRON communi- move when the feedhold input turns on.
  • Page 106 FINS frame length and the capabilities of the client and remote servers. PLC (remote_area=$80), starting from CIO50 (remote_offset=50). So, val- The range for a Trajexia system is from 1 to 700 integer values, or 1 to ues in Trajexia memory range VR(300) to VR(309) are placed in memory 350 floating point values.
  • Page 107 NEXT. See also REPEAT..UNTIL, WHILE..WEND. Note: FOR ... NEXT statements can be nested up to 8 levels deep in a BASIC program. 3.2.135 FORCE_SPEED Arguments •...
  • Page 108 CANCEL or RAPIDSTOP command, the axis decelerates to a stop at the programmed DECEL rate. Arguments fig. 28 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...
  • Page 109 A machine that applies lids to cartons uses a simulated line shaft. This exam- ple sets up a virtual axis running forward to simulate the line shaft. Axis 0 is then connected, with the CONNECT command, to this virtual axis to run the conveyor.
  • Page 110 Note: Each line takes a minimum of 4 characters (bytes) in memory. This is for 0.2340 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. Additional commands See also need one byte per token;...
  • Page 111 When the limit is reached, the TJ2-MC64 will ramp down the speed of an axis to 0, and then cancel the move. Bit 9 of the AXISSTATUS axis parameter will be turned on while the axis position is greater than FS_LIMIT.
  • Page 112 Example In the following program, when the first two MOVECIRCSP is reached the speed remains at 1000 because the radius (60) is greater than that set in FULL_SP_RADIUS. The speeds of the following circular moves are reduced to 60% (40/60), 30% (20/60) and 15% (20/60) because the radius is propor- tionally lower than that stored in FULL_SP_RADIUS.
  • Page 113 The GET command assigns the ASCII code of a received character to a varia- ward limit input. The valid input range is 0 to 31. Values 0 to 15 represent ble. If the serial port buffer is empty, program execution will be paused until a physically present inputs of TJ2-MC64 I/O connector and are common for all character has been received.
  • Page 114 For fast startup the program A valid label that occurs in the program. An invalid label will give a compi- should also be the only process running at power-up. lation error before execution.
  • Page 115 • label Example PRINT#5,HEX(IN(8,16)) A valid label that occurs in the program. An invalid label will give a compi- See also lation error before execution. Labels can be character strings of any length, but only the first 15 char- 3.2.151 HLM_COMMAND acters are significant.
  • Page 116 HLM_COMMAND(HLM_STWR,2,0,2) The memory selection of the TJ2-MC64 to read the send data from. See When data has to be written to a PC using Host Link, the CPU Unit can not be the table below. in RUN mode. The HLM_COMMAND command can be used to set it to MONITOR mode.
  • Page 117 Host link command string containing the specified node of the Slave to the PLC_EM EM area serial port. The received response data will be written to either VR or TABLE (or value 6) variables. Each word of data will be transferred to one variable. The maximum data length is 30 words (single frame transfer).
  • Page 118 BASIC commands 3.2.153 HLM_STATUS Example >> HLM_WRITE(1,28,PLC_EM,50,25,MC_VR,200) >> PRINT HEX(HLM_STATUS PORT(1)) Apparently the CPU Unit is in RUN mode and does not accept the write oper- Type Communication parameter ation. Syntax HLM_STATUS PORT(n) Example >> HLM_COMMAND(HLM_TEST,2,0) Description The HLM_STATUS parameter contains the status of the last Host Link Master >>...
  • Page 119 Description The HLM_TIMEOUT parameter specifies the fixed timeout time for the Host Link Master protocol for both serial ports. A timeout error will occur when the time needed to both send the command and receive the response from the Slave is longer than the time speci- fied with this parameter.
  • Page 120 Slave by sending a Host link command string containing the specified node of PLC_EM EM area the Slave to the serial port. The received response data will be written from (or value 6) either VR or TABLE variables. Each variable will define the word or data that will be transferred.
  • Page 121 This command is applicable only to Flexible axis axes with ATYPE values 43, HLS_NODE, SETCOM. 44 and 45. The command can be used with either 1 or 5 parameters. Only 1 parameter is 3.2.156 HLS_NODE needed to disable the switch or clear FIFO queue. All five parameters are needed to enable switch.
  • Page 122 Note: Servo gains have no affect on stepper output axis (ATYPE=46) and function will typically be called 4 times to extract each byte in turn. MECHATROLINK position axis (ATYPE=40). Note: Byte 0 is the high byte of the 32 bit IEEE floating point format. Arguments Arguments •...
  • Page 123 If all conditions are FALSE the commands following ELSE ELSEIF key_char=$33 THEN will be executed or the program will resume at the line after ENDIF in case no GOSUB char_3 ELSE is included. The ENDIF is used to mark the end of the conditional block.
  • Page 124 BASIC commands Example The following lines can be used to move to the position set on a thumb wheel Value Description multiplied by a factor. The thumb wheel is connected to inputs 4, 5, 6 and 7, Trajexia Studio port 0 user channel 7 and gives output in BCD.
  • Page 125 1.0000 If the string is invalid, the user will be prompted with an error message and the See also task will be repeated. The maximum amount of inputs on one line has no limit other than the line length.
  • Page 126 Servo Drive parameters. • 7: Controls operation signals. • 8: Set an Inverter to Servo Drive mode, so it acts as a servo axis. This is See also possible only for Inverters with an encoder feedback option card con- nected.
  • Page 127 Step 1: Speed reference is set to 45.00 Hz. If with function 8 the mode parameter is set to 1, the Inverter is set into servo Step 2: The Inverter is set to run in reverse direction for 10 seconds with axis mode.
  • Page 128 • param_size 3.2.173 INVERTER_WRITE 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 TJ-MC__ where the read informa-...
  • Page 129 The command returns -1 if successfully executed and 0 if failed. The result (if input is low. A forward jog input and a reverse jog input are available for each any) is returned in the selected VR.
  • Page 130 Most systems do not use all the available axes. It would therefore be a waste Command Line Terminal interface. Please be aware that this channel may of time to task the idle moves on all axes that are not in use. To avoid this to give problems for this command.
  • Page 131 BASIC commands 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. Value Input device The LIST command prints the current selected program or the program spec- Programming port 0 ified by program_name.
  • Page 132 The lock code number is GOTO loop stored in the Flash-PROM. The UNLOCK command allows the locked state to be unlocked. The code number can be any integer and is held in encoded See also AXIS, REGIST, REG_POS.
  • Page 133 Station functions that work on a specific station_address of a given 3.2.185 MECHATROLINK unit. All functions that retrieve a value store it in the VR variable indicated in the last parameter. If this parameter has the value -1 then the value is printed to Type System command the command line port.
  • Page 134 3.2.186 MERGE Description 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 linear move on a third axis. The first 5 parameters are similar to those of a MOVECIRC com- mand.
  • Page 135 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 prod- uct. The UNITS for axis 3 are set such that the axis is calibrated in degrees.
  • Page 136 33 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 137 The parameter is set to 0 or 1. See MOVECIRC. • distance3 Type System parameter (read-only) The distance to move on the third axis in the BASE array axis in user Syntax MOTION_ERROR units. • mode 0 = Interpolate the third axis with the main two axis when calculating path speed (true helical path).
  • Page 138 The MOVE command moves with one or more axes at the demand speed which have a motion error. For example. if axis 2 and 6 have the motion error and acceleration and deceleration to a position specified as increment from the MOTION_ERROR value would be 68 (4+64).
  • Page 139 BASIC commands Example Axes 3, 4 and 5 must move independently, that is, without interpolation. Each axis moves at its own programmed SPEED, ACCEL and DECEL etc. 'setup axis speed and enable BASE(3) SPEED=5000 ACCEL=100000 DECEL=150000 SERVO=ON BASE(4) SPEED=5000 ACCEL=150000...
  • Page 140 34 Example An X-Y plotter can write text at any position within its working envelope. Indi- vidual 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 141 DECEL parameters from the base axis and the total multi-axes distance L = SQR(x ), where x = ax - ay The individual speed for axis at any time of the movement is calculated as v = (x ) / L. Arguments The command can take up to 64 arguments.
  • Page 142 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 position 2 (if the first switch is off and the second switch is on). Position 2 has priority over position...
  • Page 143 36 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 144 If they do not, it is possible to adjust the encoder scales in many cases by adjusting with ENCODER_RATIO axis parameters for a Flexible axis or with the gear ratio in the Servo Drive of a MECHATROLINK axis.
  • Page 145 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 imagi- nary) orthogonal axis.
  • Page 146 38 Note: The MOVECIRC computes the radius and the total angle of rotation from the centre, and end-point. If the end point is not on the calculated path, SPECIFIED END POINT the move simply ends at the computed end and not the specified end point. It is the responsibility of the programmer to ensure that the two points corre- spond to correct points on a circle.
  • Page 147 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 148 The MOVELINK command creates a linear move on the base axis linked via version MOVECIRC. a software gearbox to the measured position of a link axis. The link axis can move in either direction to drive the output motion. Arguments •...
  • Page 149 41 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 150 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 151 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 152 The MOVEMODIFY command changes the absolute end position of the cur- rent single-axis linear move (MOVE, MOVEABS). If there is no current move or the current move is not a linear move, then MOVEMODIFY is treated as a MOVEABS command. The ENDMOVE parameter will contain the position of the end of the current move in user units.
  • Page 153 250mm fig. 45 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 con- nected to the registration input:...
  • Page 154 47 Example A satellite receiver sits on top of a van. It must align correctly to the satellite 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 information is used to control the two axes.
  • Page 155 ENDMOVE_SPEED defines the ramp to exit speed. If two forced speed move types are merged, the speed at the merge point is controlled by the ENDMOVE_SPEED of the outgoing move. If a forced speed move follows one or more non-forced speed moves the deceleration will occur to the FORCE_SPEED of the incoming move.
  • Page 156 BASIC commands fig. 48 SPEED =1000 Example In the following example the first move is finished with the speed of the first move by setting ENDMOVE_SPEED to the FORCE_SPEED of the first move. 1000 FORCE_SPEED=500 ENDMOVE_SPEED=500 MOVESP(400) SPEED =500 FORCE_SPEED=1000...
  • Page 157 An X-Y positioning system has a stylus which must be turned so that it is fac- ing in the same direction as it is travelling at all times. The XY axis pair are axes 4 and 5. The tangential stylus axis is 2:...
  • Page 158 MPOS is reset to 0 at start-up or after the controller has been reset, the start, or returning to the start point to complete a circle. The path of the except when using absolute encoders. In that case MPOS is initialised with movement in 3D space can be defined either by specifying a point somewhere the absolute position read from the encoder.
  • Page 159 BASIC commands fig. 50 Example A move is needed that follows a spherical path which ends 30mm up in the Z direction: BASE(3,4,5) MSPHERICAL(30,0,30,8.7868,0,21.2132,0) fig. 51 Example A similar move that follows a spherical path but at 45 degrees to the Y axis...
  • Page 160 This parameter returns the number of analogue input channels connected on the MECHATROLINK-II expansion bus. For example a TJ2-MC64 will return MOVEABSSP 8 if there are 2 x AN2900 Units connected as each has 4 analogue input MOVECIRCSP channels. MHELICALSP...
  • Page 161 An offset of 327 will represent an offset of 0.1 volts. It is suggested Syntax that as offset of 65% to 70% of the value required to make the stage move in an open loop situation is used. Description Returns the number of inputs/outputs fitted to the system, or connected on the MECHATROLINK-II expansion bus.
  • Page 162 The measured position will be changed accordingly in order to keep the 3.2.212 NTYPE 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. Type Axis parameter (read-only) Note: The offset is applied on the next servo period.
  • Page 163 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 dis- tance from the start of the box.
  • Page 164 See also integer expression is used to select a label from the list. If the expression has value 1 the first label is used, for value 2 the second label is used, and so on. 3.2.218 OP Once the label is selected, subroutine GOSUB jump to that label is per- formed.
  • Page 165 This line sets the bit pattern 10010 on the first 5 physical outputs, outputs 13 to 17 would be cleared. The bit pattern is shifted 8 bits by multiplying by 256 to set the first available outputs as outputs 0 to 7 do not exist.
  • Page 166 3.2.221 OUTDEVICE Description The output limit restricts the demand output from a servo axis to a lower value than the maximum. The value required varies depending on the maximum demand output possible. If the voltage output is generated by a 16 bit DAC values an OUTLIMIT of 32767 will produce the full +/-10v range.
  • Page 167 PRINT "Radius = "; circum/(2*PI) axis with servo output generated by a 16 bit DAC. It is suggested that as off- set of 65% to 70% of the value required to make the stage move in an open See also loop situation is used.
  • Page 168 The width of the field in which a number is printed can be set with the use of are placed. [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 169 PROFIBUS-DP master unit and defines areas in the VR memory where I/O exchange takes place. PROFIBUS function 4 returns the data exchange sta- 3.2.231 PROCESS tus of the TJ1-PRT. Refer to the table below for the description of the bits in the data exchange status word. Type...
  • Page 170 Note: An output may remain ON if it was ON when the PSWITCH was disa- • no_outputs bled. In such cases the OP command can be used to turn off an output as fol- The number of output words from the PROFIBUS-DP master in VR lows: memory.
  • Page 171 There is also a proximity switch on the shaft to indicate the TDC of the machine. With a mechanical cam, the change from job to job is time consuming. This can be eased by using PSWITCH as a software cam switch.
  • Page 172 Used to define the angle change in radians above which an X-Y system will Speed interact with a BASIC program to allow for a large change in direction on a tangential axis. RAISE_ANGLE does not control speed directly so should be greater than or equal to STOP_ANGLE.
  • Page 173 (MTYPE). Moves for speed profiled move commands (MOVE, MOVEABS, MOVEMODIFY, FORWARD, REVERSE, MOVECIRC and MHELICAL) will decelerate to a stop with the deceleration rate as set by the DECEL parameter. Moves for other commands will be immediately stopped.
  • Page 174 BASIC commands fig. 55 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 175 The READ_BIT command returns the value of the specified bit in the speci- fied VR variable, either 0 or 1. Example If output 11 has value 1, output 12 has value 1, output 13 has value 0, and output 14 has value 1, READ_OP(11,14) returns 13 (1101 bin). Arguments •...
  • Page 176 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 the length of the...
  • Page 177 When a primary registration event has events are ignored if the axis measured position is not less than the occurred, the MARK axis parameter is set to ON and the position is stored in OPEN_WIN axis parameter, and greater than the CLOSE_WIN parameter.
  • Page 178 • 11: Exclusive windowing • 10: EXT2 input Set this bit to use filtering function • 11: EXT3 input Set this bit to use secondary registration event Not used 9, 8 Windowing function choice: • 00: No windowing • 01: Inclusive windowing •...
  • Page 179 57 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. Z MARK...
  • Page 180 Components are placed on a flighted belt. The flights are 120 mm apart. The components are on the belt 30 mm from the flights. When a component is found, an actuator pushes it off the belt. To prevent that the sensor finds a flight instead of a component, registration with windowing is used.
  • Page 181 59 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 182 Within Trajexia Studio users can Description The REMAIN parameter contains the distance remaining to the end of the select the command from the Program menu. current move. It can be checked to see how much of the move has been com- Arguments • old_program_name pleted.
  • Page 183 The automatic repeat option of the CAMBOX and MOVELINK commands are con- position reaches REP_DIST, twice that distance is subtracted to ensure that trolled by bit 1 of the REP_OPTION parameter. The bit is set on to request the sys- the axis always stays in the range [-REP_DIST, REP_DIST], assuming that tem software to end the automatic repeat option.
  • Page 184 BASIC commands 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: SPEED = 1000 REPEAT MOVE(100)
  • Page 185 Description The REV_JOG parameter contains the input number to be used as a jog reverse input. The input can be from 0 to 31. As default the parameter is set to -1, no input is selected. Note: This input is active low.
  • Page 186 RAPIDSTOP command, or by reaching the reverse limit, inhibit, or origin return limit. Arguments 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...
  • Page 187 61 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 188 0, and then cancel the move. Bit 10 of the AXISSTATUS Example RUN "sausage",3 axis parameter will be turned on while the axis position is smaller than / below This example executes the program named sausage on task 3. RS_LIMIT.
  • Page 189 Invalid transfer type LABEL expected RETURN without GOSUB Value is incorrect Error programming Flash Program not found LABEL must be at start of line Invalid I/O channel Operand expected Duplicate label Cannot nest one line IF Value cannot be set. Use...
  • Page 190 Command expected Parameter expected run on. The task number is optional, if omitted the program will run at the highest available task. Invalid command Firmware error: Device in use...
  • Page 191 The sample period can be any multiple of the servo period. The parameters WA(250) are stored in the TABLE array and can then be read back to a computer and S_REF AXIS(0) = -2000 displayed on the Trajexia Studio Oscilloscope or written to a file for further WA(250) analysis using the Create Table file option on the File menu.
  • Page 192 This example programs the SCOPE function to store the MPOS parameter Studio automatically selects programs when you click on their entry in the list for axis 1 and the DPOS parameter for axis 1 every 10 servo cycles. The in the control panel.
  • Page 193 The command will enable the Host Link and ModbusRTU protocols or define 2000 2.0ms the general-purpose communication. The serial ports have 9,600 baud rate, 7 data bits, 2 stop bits, even parity and XON/XOFF enabled for general-purpose communication by default. These Arguments default settings are recovered at start-up.
  • Page 194 The SIN function returns the sine of the expression. Input values are in radi- ModbusRTU Slave Protocol (transfer as 32-bit IEEE floating pointer) ans and may have any value. The result value will be in the range from -1 to Arguments •...
  • Page 195 During forward movements, the controller sets OUT1 to OFF. During reverse movements, the controller sets OUT1 to ON. See also This setting is to be used for Servo Drives that require both speed and direc- tion signals as a speed reference. 3.2.270 SPEED...
  • Page 196 The SQR function returns the square root of the expression. The expression Description Allows the program to examine the start direction in radians of the last pro- must have positive (including 0) value. grammed MOVESP/MOVEABSSP/MOVECIRCSP move of 2 or more axes.
  • Page 197 Example >> STEPLINE "maths",2 Example Two axes are set up as X and Y but the axes ' steps per mm are not the See also RUN, SELECT, STOP, TROFF, TRON. 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 198 Description The SYSTEM_ERROR parameter contains system errors that occurred in the The name of the program to be stopped. TJ2 system since the last time it was initialized. The bits in the • task_number SYSTEM_ERROR parameter are given in the table below.
  • Page 199 [-2147483648, 2147483648], which corresponds to a voltage range [-Peak torque, Peak torque]. These ranges can be limited by A value in the TABLE can be read-only if a value of that number or higher has using the OUTLIMIT parameter.
  • Page 200 In this example a CAM profile is loaded into TABLE location 1000 and is setup TABLE(1000,(TABLE(100)*scale)) on axis 0 and is linked to a master axis 1. A copy of the CAM table is added at TABLE(1009,(TABLE(109)*scale)) location 100. The Analogue input is then read and the CAM TABLE value is 'Update previous value updated when the table pointer is on the next value.
  • Page 201 Description Returns a list of TABLE points starting at the number specified. There is only interpolated axes. The value returned is between –PI and +PI and one format supported at the moment, and that is comma delimited text.
  • Page 202 Type System command Arguments Syntax TIME$ Example delay: Description Prints the current time as defined by the real time clock as a string in 24-hour TICKS = 3000 format. OP(9,ON) Arguments test: Example When the time is 13:20:00 IF TICKS <= 0 THEN >>...
  • Page 203 The TRON command creates a breakpoint in a program that will suspend pro- gram execution at the line following the TRON command. The program can 3.2.294 TRIGGER then for example be executed one line at a time using the STEPLINE com- mand. Notes:...
  • Page 204 Description The UNITS parameter contains the unit conversion factor. The unit conversion factor enables the user to define a more convenient user unit like m, mm or Arguments motor revolutions by specifying the amount of encoder edges to include in a...
  • Page 205 Axis parameter 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 Syntax VFF_GAIN an array of elements. The TJ2-MC64 has in total 64000 VR variables.
  • Page 206 VR(101) to VR(110) are used to hold an array of ten number of first VR() in the character array. 1 ' s and 0 ' s to signal that the positions are full (1) or empty (0). The gantry Example PRINT #5,VRSTRING(100) puts the load down in the first free position.
  • Page 207 (set with BASE) unless AXIS is used to specify a temporary base axis. This is useful for activating events at the beginning of a move, or at the end Note: The execution of WAIT IDLE does not necessarily mean that the axis when multiple moves are buffered together.
  • Page 208 The expressions evaluated can be as complex as you like provided they fol- low BASIC syntax, for example: WAIT UNTIL DPOS AXIS(2) <= 0 OR IN(1) = ON The above line would wait until the demand position of axis 2 is less than or Type Program control command equal to 0 or input 1 is on.
  • Page 209 • 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 follows: 01010 XOR 10010 = 11000. The result is therefore 24. See also PROGRAMMING MANUAL...
  • Page 210: Communication Protocols

    LAN. EtherNet/IP To respond to any EtherNet/IP request. Make sure that the IP address of the PC is in the same range as the TJ2- Serial Host Link Master To communicate with any Host MC64: if the IP address of the TJ2-MC64 is aaa.bbb.ccc.ddd, the IP address Link slave, for example an of the PC must be aaa.bbb.ccc.xxx, where xxx is 000 to 255 other than ddd.
  • Page 211 Communication protocols The subnet mask of the TJ2-MC64 is generic. It does not need to match with The FINS server protocol requires no configuration settings. the subnet mask of the PC. Use the Ethernet command to read or write the Ethernet settings. It is necessary to power off and on again the units for the changes to take effect.
  • Page 212 Address range designation error Number of elements invalid 1104 Address out of range • If var_type is 30: If var_type is 82 or B0, and the response code is 0000, the TJ2-MC64 responds with: command_ var_ start_ address bit_ total_bits...
  • Page 213 General Purpose Read command (2001) TABLE memory The FINS General Purpose read command has this format: Example: Read VR in 64 bit IEEE Floating point format: var_type = 0xE2 When reading axis parameters (for the offsets see the table below): command_code parameter...
  • Page 214 Maximum length exceeded 110B Reply (response) exceeds the maxi- DRIVE_INPUTS mum response length DRIVE_MONITOR Parameter error 110C Invalid var_type DRIVE_STATUS If the response code is 0000, the TJ2-MC64 responds with: ENCODER ENCODER_BITS ENCODER_CONTROL command_code response_code byte_1 byte_2 ERRORMASK FASTDEC Note The returned words and dwords are in big-endian format.
  • Page 215 TABLE memory Example: The FINS General Purpose write command has this format: Write VR in 64 bit IEEE Floating point format: var_type = 0xE2 When writing axis parameters (for the offsets see the table at the General command_ parameter var_...
  • Page 216 Invalid source memory area. • zz = memory address (Least Significant byte) Request was sent, but no response from the remote server was received within the The TJ2-MC64 responds with these codes: timeout period. An error response code was received from the remote server.
  • Page 217 VR or TABLE memory on the Controller. This mapping is 32 bit floating point (4 byte element) defined at run-time using the ETHERNET command. Examples Set endpoint 1 to VR data type, and data format to 32 bit floating point: PROGRAMMING MANUAL...
  • Page 218: Serial Protocol

    If the TJ2-MC64 is the Host Link master, you can send BASIC commands to a Host Link slave, for example a PC. When you send a BASIC command to a Host Link slave, the execution of the next BASIC command waits until the Host Link slave sends a response.
  • Page 219 Communication protocols Commands Type Header code Name Function These Host Link commands are supported for the Host Link Master protocol: I/O memory CIO AREA Writes the specified data in word writing WRITE units beginning with the designated CIO/IR word. Type...
  • Page 220 (response only) The Host Link Master protocol supports the commands only in single frame. The following table shows how you can use the Host Link protocol with the Caution BASIC commands, and for which CPU unit operating mode (RUN, MON or You must execute the Host Link master commands from one pro- PROG) the command is valid.
  • Page 221 Set up Command not This status indicates that the slave did not recognise the com- You need the SETCOM command to set up the serial port of the TJ2-MC64 recognised mand and has returned an IC response. for the Host Link Master protocol. Set the command as follows: The HLM_STATUS has value 0 when no problems occurred.
  • Page 222 A Trajexia system with a TJ2-MC64. • A slave PC, with node address 13. • A connection from the serial port of the TJ2-MC64 to the PC. The serial Example Send TS (test) command to PC using HLM_COMMAND. port uses RS422 communication.
  • Page 223 4.3.2 Host Link slave Type Header code Name Function If the TJ2-MC64 is the Host Link slave, a Host Link master (for example, a I/O memory CIO AREA Writes the specified data in word writing WRITE units to VR memory beginning programmable terminal) can read data from the TJ2-MC64 and write data to with the designated word.
  • Page 224 Set up Format error • The command format is Check the format and You need the SETCOM command to set up the serial port of the TJ2-MC64 wrong. transfer the command • A command that cannot be again.
  • Page 225 Registers between the TJ2-MC64 and a ModbusRTU master. Implementation of the protocol is provided on serial port 1 for RS232 and port 2 for RS485. Baud rate and slave address can be set in the BASIC program during serial port initialisation.
  • Page 226 A Trajexia system with a TJ2-MC64. • An OMRON Vision system F500. GOTO loop • A connection from the serial port of the TJ2-MC64 to the F500. The read buffer: serial port uses RS232 (port 1) communication. count=0 resp_status=0 This program sends a Vision command through the serial port, reads the...
  • Page 227: Profibus

    The TJ1-PRT has two node number selectors. You can use the node IF TABLE(i)<>13 THEN number selectors to assign a PROFIBUS network address to the TJ1-PRT. PRINT CHR(TABLE(i)) You must assign an address to the TJ1-PRT before you set the power of the ELSE Trajexia system on. PRINT "'cr'"...
  • Page 228 PROFIBUS(2,2,1,10,7,150,3). In this example the system initializes a TJ1-PRT unit with unit number 2. The system sends seven output words from the master to the VR’s 10 to 16 and three input words from the VR’s 150 to 152 to the master.
  • Page 229 6. Open the Device Catalogue from the View menu. fig. 4 7. Click Install GSD Files..The GSD file is on the Trajexia Tools CD. It fig. 5 can also be found in the Download Center on the OMRON website.
  • Page 230 11. Set the node number in the Station Address field. 12. Add (Insert) input and output modules to the configuration list below. 13. Make sure that the quantity of input words and output words in the selected modules are equal to the quantity selected with the PROFIBUS command.
  • Page 231 1. Double-click the master module in the MyNetwork tree. fig. 7 2. Set the Station Address and Unit Number. 3. Select the Slave area tab. fig. 8 4. Set the Start Address field of Output Area 1 and Input Area 1. 5. Save the project. PROGRAMMING MANUAL...
  • Page 232: Devicenet

    Communication protocols 6. Click the Device Online/Offline (Toggle) toolbar button to go on-line. fig. 9 7. Click the Device Download toolbar button to download the parameters. 4.4.3 Communication Status TJ1-PRT can provide status information to the TJ2-MC64. You can retrieve the status information in BASIC with the command PROFIBUS (unit_number,4,0).
  • Page 233 The TJ1-DRT has two node number selectors. You can use the node number selectors to assign a node number to the TJ1-DRT. The DeviceNet node numbers range from 0 to 63. If you select a node number with the node number selectors that exceeds this range, you will select the node number that is set by software.
  • Page 234 Communication protocols A VR variable can hold a 53-bit number, and it can also hold fragments. The exchange with the DeviceNet master does not support values outside the range -32768 to 32767 or fragments. Configure the DeviceNet network To configure the OMRON CJ1W/CS1W-DRM21 DeviceNet master to exchange VR variables with the Trajexia system, do these steps: 1.
  • Page 235 Communication protocols 5. Drag and drop the CJ1W-DRM21 to the Network window. fig. 12 6. Install the EDS file from the CX-Integrator. fig. 13 7. Select No from the dialog window. The icon is not needed. PROGRAMMING MANUAL...
  • Page 236 Communication protocols 8. Register the slave to the master, right click on the #01TJ1-DRT icon. fig. 14 9. Double click on the Master Icon. 10. Select the TJ1-DRT device. 11. Click Advanced Setup. fig. 15 12. Click Connection tab. 13. Click User Setup.
  • Page 237 Communication protocols 4.5.3 Communication Status the level set in the TJ1-DRT DeviceNet parameters. You can set the TJ1- DRT DeviceNet parameters using a DeviceNet configurator. The default TJ1-DRT can provide status information to both the TJ2-MC64 and the level is 11V.
  • Page 238: Canopen

    CANopen systems. The TJ1-CORT is identified in the CANopen network by its node number. The node number can range from 1 to 99. The node number of the TJ1- CORT is set with the two node number selectors.
  • Page 239 • It is possible that certain non-default settings are required for the TJ1-CORT or the CANopen slaves in the network. An example is to initialize the heartbeat consumption and production object entries. • It is highly recommended that the TJ1-CORT acts as the heartbeat consumer for all connected CANopen devices.
  • Page 240 Communication protocols 5. Start the CANopen network and the mapping of the Trajexia memory to RPDOs and TPDOs: execute the command CAN_CORT(unit,10). fig. 16 An example is the configuration given in the figure. TJ1-CORT TJ1-MC__ (node 9) Connection COB-ID Size...
  • Page 241 PRINT "Add Nodes Fail" STOP ENDIF '---------------------------------------- ' Add TPDO / RPDO '---------------------------------------- ' Map TPDO 0 to VR(100) result = CAN_CORT(0,8,0,1,100,$202,0,0,5) tot_result = tot_result AND result ' Map RPDO 0 to VR(0) result = CAN_CORT(0,7,0,1,0,$1e3,5) tot_result = tot_result AND result IF tot_result = FALSE THEN PRINT "Add TPDO / RPDO Fail"...
  • Page 242 Communication status ' Additional settings result = CAN_CORT(0,9,$2,$2001,1,$f) The TJ1-CORT can give status information to the TJ2-MC64. To retrieve this tot_result = tot_result AND result status information, use the BASIC command CAN_CORT(unit,4,0). The result value of this command is given in the table below.
  • Page 243: Mechatrolink-Ii

    The number of MECHATROLINK-II devices determines the data exchange cycle time: • For 1 to 4 devices the cycle time can be 0.5 ms, 1 ms or 2 ms. • For 5 to 8 devices the cycle time can be 1 ms or 2 ms.
  • Page 244 The I/O data from GRT1-ML2 units is mapped in the TJ2-MC64 in order of the GRT1-ML2 addresses. For example, the I/O data of a GRT1-ML2 unit with address 67 hex is mapped before the I/O data of a GRT1-ML2 unit with address 68 hex.
  • Page 245 Communication protocols I/O mapping example 1 With a MECHATROLINK-II network as shown in the figure, the response of fig. 17 the system when the network is initialized GRT1-ML2: 67(32/8/6/0/2/0/2) 67 hex GRT1-ML2 ROS2 where: • 67 is the GRT1-ML2 address (hexadecimal) •...
  • Page 246 Communication protocols I/O mapping example 2 The configuration of the GRT1-ML2 units in the example above is: fig. 18 GRT1-ML2: 63(32/8/0/0/0/0/6) 63 hex where: GRT1-ML2 • 63 is the GRT1-ML2 address (hexadecimal) • 32 is the start address of the digital I/O •...
  • Page 247 [32–63], [80–95] and [104–127]. These digital inputs and outputs are virtual. Virtual digital inputs always have value 0 (OFF). Virtual outputs can be set ON or OFF and they can be used in programming, but they do not have a physical representation and cannot activate a device.
  • Page 248 Flag Description • vr is the VR memory address where the read status word is put. Use -1 SmartSlice I/O Bus Communication Monitors the status of SmartSlice I/O commu- to print the status word to the Command Line Terminal interface.
  • Page 249 Communication protocols WDOG when an error occurs in the GRT1-ML2. 4000 hex equals 0100 0000 0000 0000 binary. Bit 14 is the overall error bit, which is set to 1 when an error occurs. 4.8.4 Table registration The table registration function registers the configuration of the SmartSlice I/ O Units that are connected to the GRT1-ML2 in a table in the GRT1-ML2.
  • Page 250 Communication protocols Comparison of the actual configuration and the registered table When unit dipswitch 1 is set to ON, an I/O configuration table is registered in the GRT1-ML2, and the GRT1-ML2 is turned on, the GRT1-ML2 automatically compares the actual I/O configuration and the registered table.
  • Page 251: Examples And Tips

    StartUp Priority window shows. 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 0 (lowest priority) to 21 (highest priority).
  • Page 252 The application program starts when the startup program is exe- cuted successfully and without errors. If you set an application program to “Run at startup” there is a risk that the machine starts if there is an error on the MECHATRO- LINK-II bus.
  • Page 253 Examples and tips IF NOT MECHATROLINK(0,4,0,0) THEN PRINT "Error getting address for unit 0, station 0" STOP ELSE IF VR(0) <> 65 THEN PRINT "Incorrect address for unit 0, station 0" STOP ENDIF ENDIF IF NOT MECHATROLINK(0,4,1,0) THEN PRINT "Error getting address for unit 0, station 1"...
  • Page 254 '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 255 Examples and tips The example values for the program and motion parameters in the Trajexia system are given below. Note that they are appropriate for 13-bit encoders. Drive Parameter value Description Pn103 = 716 Inertia ratio Pn110 = 0012 No autotuning...
  • Page 256 Examples and tips In this mode the position loop is closed in Trajexia and the Speed loop is fig. 3 closed in the Servo Driver. The Speed axis parameter is sent to the Servo Driver, and reads the position feedback.
  • Page 257 Examples and tips Example 1 Only proportional gain has a set value, the Following Error is proportional to fig. 4 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 258 VFF_GAIN=0 Fn001=6 Example 4 The value of the parameter P_GAIN two times the value in example 1. The fig. 7 Following Error is half, but there is vibration due to the excessive gains. The parameter values for the example are:...
  • Page 259 Examples and tips Example 5 The value of the parameter P_GAIN is set to the value in example 1. The fig. 8 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 260 VFF_GAIN=1573500 Fn001=8 Example 8 Opposite to the P_GAIN, where the higher, the better (the limit is when the fig. 11 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 261 Examples and tips Position mode examples In this mode the position and speed loop are closed in the Servo Driver. The fig. 12 TJ1-ML__ sends the position command through the MECHATROLINK-II TJ1-MC__ TJ1-ML__ SERVO network to the Servo Driver, and reads the position feedback.
  • Page 262 Examples and tips Example 1 The Following Error is proportional to the speed. There is a "soft profile" due fig. 13 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 263 Examples and tips Example 3 With high gain the motor starts to vibrate but the profile is more stable that in fig. 15 MECHATROLINK-II Speed mode. The parameter values for the example are: Motion Parameter values Fn001=8 Pn109=0 Example 4 The effect of the Feedforward gain is that the Following Error is reduced and fig.
  • Page 264 For example, for a moving part that makes a linear motion, you can prefer mm, or fraction of mm. For a moving part that makes a rotation motion, you can prefer a degree of angle or its fraction. For more information on the UNITS axis parameter, see section 3.2.299.
  • Page 265 Examples and tips However, the user must be aware that not only the UNITS axis parameter matters in the conversion between encoder counts and user defined units. Certain Servo Driver parameters and some characteristics of the mechanical system are also important. The following sections describe which Servo Driver parameters are important for this conversion.
  • Page 266 Servo Driver manual. The UNITS axis parameter effectively expresses the ratio between user encoder_counts, units that the user wants to use in the program and the position sent to the reference_units, the ultimate minimum distance the minimum unit you can set...
  • Page 267 Pn202 UNITS = Pn203 From this equation, we can derive the values for Pn202, Pn203 and UNITS, given the following restrictions and recommendations: 1. Pn202 and Pn203 are integers. 2. UNITS must not have an infinite number of decimal digits. This can create rounding errors that result in small position errors that add up to large accumulative position errors.
  • Page 268 The absolute encoder keeps the current motor position, even if there is no power supplied. 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 269 Examples and tips n machine_cycles = m motor_revolution Because n and m are integers: Pn205 = m – 1. This setting is explained in the following example. Example 2 The mechanical system consists of simple rotary table shown in the figure. A fig.
  • Page 270 Sigma-II Servo Driver manual. Caution It is possible to reset the multiturn counter, but it is not possible to reset the position within one turn (the fraction from 0 to and exclud- ing 1). To adjust zero offset, use the parameter Pn808. For more details see the NS115 MECHATROLINK-II Interface Unit manual.
  • Page 271 The mechanical gear ratio of the gearbox is 1:6.31. One rotation of the Total length (perimeter) of belt: 4160 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 272 Pn202 = 631 Pn203 = 125 Note that we have not used the pulley radius in the calculation. This is to avoid the use of π, which cannot be expressed as a fractional number). In toothed pulleys, the number of teeth and mm per tooth is commonly used.
  • Page 273 Therefore the total 3600 x tenth of degree repeat distance for the full turn of the moving part is 3600 tenths of an angle degree. With the same procedure as in example 1, we have:...
  • Page 274 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 275 With these settings, executing MOVE(50) moves the moving part 50 mm, or one station. Example 6 The mechanical system consists of a ball screw. It uses a servo motor with a fig. 24 17-bit absolute encoder. The mechanical gear ratio of the gearbox is 1:3.
  • Page 276 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 277 Examples and tips 5.1.4 Mapping Servo Driver inputs and outputs The Trajexia controller has got a digital I/O space that consists of 256 digital inputs and 256 digital outputs. The digital outputs range has four parts: • Digital outputs 0 - 7.
  • Page 278 Examples and tips inputs are active (ON) when a 24 VDC signal is applied to them. When you read them, they return their current status. Use the command IN to read these inputs. • Digital inputs 16 - 31. These outputs are software inputs only. They do not physically exist on the TJ2-MC64, but you can read them.
  • Page 279 MECHATROLINK-II Servo Drivers inputs in the Trajexia I/O space With the BASIC command IN, you can access the physically present inputs in a BASIC program. These inputs can be built in the controller or connected via the MECHATROLINK-II bus. Servo Drivers can have additional inputs that are located on their I/O connectors.
  • Page 280 Sigma-V), General input 1 (G-Series and Accurax The inputs in the table above are located on the CN1 I/O connector of the respective Servo Driver. The pin arrangement of this connector is different for the respective Servo Drivers. For the Sigma-II and Sigma-V Servo...
  • Page 281 Examples and tips 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 282 45 (SI5) 11 (SI5) 46 (SI6) 12 (SI6) For the Junma Servo Driver, all input signals are mapped to a fixed location on the CN1 I/O connector. The table below shows the input signals and pin numbers. Input signal CN1 pin number...
  • Page 283 PCL (active high) NCL (active high) For the Accurax G5 Servo Drivers, the CN1 input pins IN1 to IN8 can be allocated to a specific function. To do this, you must set the appropriate parameter of the Servo Driver. The table below shows the parameters to allocate a function to a CN1 input pin.
  • Page 284 Servo Driver inputs that are mapped into the Trajexia I/O space like this are accessed within the program per axis and cannot be accessed in the usual way with the IN command. The only way you can use these inputs in the program is to assign them to the axis parameters DATUM_IN, FHOLD_IN, FWD_IN and REV_IN.
  • Page 285 For axis 0 the input on CN1-44 of the Sigma-II driver (assigned to axis 0) is used, but for axis 3 the input on CN1-41 of the Junma driver (assigned to axis 3) is used. Therefore we say that those inputs are accessed per axis, they are not unique for the whole controller.
  • Page 286 This sequence is done automatically in most cases, without the input from the operator of the machine. In general, an origin search procedure couples a position to a specific axis. It depends on the encoders used (absolute or relative), on the system used (linear or circular), and on the mechanical construction of the machine.
  • Page 287 This is not really an origin search. This command sets DPOS=MPOS and cancels the axis errors. • DATUM(1) This does an origin search in forward direction using the Z mark of an encoder as homing switch. • DATUM(2) Does an origin search in reverse direction using the Z mark of an encoder as homing switch.
  • Page 288 ON, and the high signal level is indi- cated as OFF. It is important to note that, before any homing procedure is executed, it is...
  • Page 289 Examples and tips measurement units used in programming. Those parameters have influence to the origin search, especially if an absolute encoder is used. For more information on setting these parameters, see section 5.1.2. Absolute switch origin search plus limit switches The origin search function is performed by searching for an external limit fig.
  • Page 290 The possible scenarios for origin search against limit switches, depending fig. 29 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. min limit switch...
  • Page 291 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 292 This origin search procedure performs origin search by searching for the fig. 31 "Zero Mark" signal of the encoder. This signal is also known as "marker" or "reference pulse". It appears one time per full encoder revolution. The example for this homing procedure is shown in the figure.
  • Page 293 Registration Registration, also called ‘latch’ or ‘print registration’, is about real-time storing of the position of an axis when an external input is activated. The information that is registered, i.e. stored, is processed later, not in real time, by the application program.
  • Page 294 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 295 The input used for registration is determined by the argument of the REGIST command. The delay in the capture in the Sigma-II Servo Driver is about 3 µs. As the fig. 33 encoder information is refreshed every 62.5 µs, it is necessary to make Latch input interpolation to obtain the right captured position value (see the picture).
  • Page 296 Registration in the G-Series Servo Driver is the same as registration in the Sigma-II Servo Driver, with one difference: There are three physical inputs but only one can be activated at a time. The physical input is associated to logical latch EXT1, EXT2 and EXT3, but the corresponding locations on the CN1 connector are fixed, so no settings of Servo parameters are necessary.
  • Page 297 The registration can be executed on G-5Series Servo Drivers only when WDOG is set to ON. If registration is required when the G-Series Servo Driver is in base-block state, this workaround can be used: put the G-Series Servo Driver in torque mode with zero torque by executing: •...
  • Page 298 The available settings depend on the axis type. Refer to section 3.2.241. • MARK is a flag that signals whether the position has been captured or not. For the second registration input of the TJ1-FL02, the parameter MARKB is also available. For more information, refer to sections 3.2.183 and 3.2.184.
  • Page 299 Registration and windowing function REGIST(0) ignored The windowing function enables for registration to occur only within a REGIST(0) specified range of axis positions. This function is selected by giving the right MARK=-1 MARK=-1 MARK=0 MARK=-1 MARK=0 value as an argument for the REGIST command. The windowing function is controlled by two axis parameters, OPEN_WIN and CLOSE_WIN.
  • Page 300 • The latch is triggered. CLOSE_WIN 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 OPEN_WIN connected to the system via the MECHATROLINK-II bus due to bus delays.
  • Page 301 The picture shows the vertical fill and seal machine for packaging products fig. 37 into bags. The bag material comes from a plastic film coil that is unwinded, then it is shaped into the tube by a mechanical mandrel and at the same Mandrel for Printed mark time the tube is sealed vertically.
  • Page 302 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 correction, an error of 0.1 mm per bag is accumulated.
  • Page 303 The picture shows a flying shear cutting the "head" of wood tables. When fig. 41 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 304 Examples and tips The picture shows how the position of the slave axis is corrected using the fig. 42 registration event on the master axis to start the movement of the slave axis. The influence of SERVO_PERIOD and the fact that the registration event...
  • Page 305 (Table entries) as configured in the Oscilloscope Configuration window. Example This section gives you a practical example on the use of the SCOPE and TRIGGER commands, and how to use them in combination with the oscilloscope to monitor axis parameters and troubleshoot the system. For more information on the SCOPE and TRIGGER commands, refer to sections 3.2.260 and 3.2.294.
  • Page 306 AXIS(0), and x is the position of the slave AXIS(1). You can link the two axis with the CAMBOX command. For more details, refer to section 3.2.47. Suppose furthermore that the parameter end_pos is not constant, but it can change due to different conditions of the motion system.
  • Page 307 '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 TRIGGER 'Start tracing and storing of parameters...
  • Page 308 At high speeds, there are some ripples. The green graph is the torque of the motor for the slave axis set with DRIVE_COMMAND=11 as a percentage of the nominal torque. The torque is proportional to the acceleration.
  • Page 309 In the end this leads to a discontinuation of the profile, which causes an indefinite speed of the axis and ends up with this error: the WDOG goes off, and all axes stop.
  • Page 310 The measured position of the master axis, given in red, does not seem to be the cause, because there is no discontinuity on it. We discard a mechanical problem as well, because the torque, given in green, has low values.
  • Page 311 The result is given in the figure. The red graph clearly shows a discontinuity fig. 46 in the position values that the slave axis must follow. Because the speed is a derivative of the position, at the point of discontinuity of the position curve the speed gets a high value.
  • Page 312: Practical Examples

    (see 5.1.1). System initialization 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 Stop Application not have to type it manually.
  • Page 313 'VR(901) - VR(status_bits) reports next status Bit0 Alarm flag Bit15 ML communication error with one slave 'VR(902) - "action" send messages to the upper controller =0 during initialization =1 Push RESET to restart =2 Resetting =3 System healthy 'VR(903) - VR(diag01) gives feedback of the MECHATROLINK...
  • Page 314 'alarm code of the servo '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 315 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 316 Examples and tips The main loop of the program handles the fault handling: run application programs, stop application programs, reset the system and report the status. loop: IF alarm_bit THEN action=1 ' Alarm, push RESET to restart IF status_word<>2 THEN PRINT "Stop with Alarm"...
  • Page 317 '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 318 ENDIF 'MECHATROLINK axis alarm monitoring FOR i=0 TO max_axis BASE(i) VR(servo_status+i*2)=AXISSTATUS 'if stopped by alarm, notify the alarm code IF ATYPE>=40 AND ATYPE<=42 THEN IF status_word=2 THEN 'if no response, notify "communication alarm" IF (AXISSTATUS AND 4)<>0 THEN VR(servo_alarm+i*2)=$E6...
  • Page 319 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 320 Examples and tips '-------------------------------------------------------- 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 'MECHATROLINK axes reset sequence FOR i=0 TO max_axis BASE(i) IF ATYPE>=40 AND ATYPE<=42 THEN...
  • Page 321 'MECHATROLINK devices reset sequence 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 322 '-------------------------------------------------------- absencoder: 'To be implemented in the future RETURN '-------------------------------------------------------- system_detection: status_word=0 action=0 VR(status_bits)=0 'Omron Auto Generated - Units 'Warning: Automated code section - any manual code changes 'will be lost. 'Unit Variables reset VR(diag01)=0 VR(diag02)=0 VR(diag03)=0 VR(system01)=0 PROGRAMMING MANUAL...
  • Page 323 Examples and tips '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 324 Examples and tips ENDIF ' Check SJDE-02ANA-OY address IF NOT MECHATROLINK(0,4,1,system01) THEN PRINT "Error getting address for ML04 unit 0, station 1" SET_BIT(1,diag02) ELSEIF VR(system01) <> $44 THEN PRINT "Incorrect address for ML04 unit 0, station 1" SET_BIT(1,diag02) ENDIF ENDIF...
  • Page 325 IF TABLE(i+2)=$FFFFFF THEN IF VR(system01)<>TABLE(i+1) THEN IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),TABLE(i+1),1) THEN SET_BIT(1,diag02) ELSE res=1 ENDIF ENDIF ELSE 'Parameter set using Mask IF (VR(system01) AND NOT TABLE(i+2))<>TABLE(i+1) THEN VR(system01)=(VR(system01) AND TABLE(i+2)) OR TABLE(i+1) IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),VR(system01),1) THEN SET_BIT(1,diag02) ELSE res=1 ENDIF ENDIF ENDIF...
  • Page 326 IF TABLE(i+2)=$FFFFFF THEN IF VR(system01)<>TABLE(i+1) THEN IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),TABLE(i+1),1) THEN SET_BIT(1,diag02) ELSE res=1 ENDIF ENDIF ELSE 'Parameter set using Mask IF (VR(system01) AND NOT TABLE(i+2))<>TABLE(i+1) THEN VR(system01)=(VR(system01) AND TABLE(i+2)) OR TABLE(i+1) IF NOT DRIVE_WRITE(TABLE(i),TABLE(i+3),VR(system01),1) THEN SET_BIT(1,diag02) ELSE res=1 ENDIF ENDIF ENDIF...
  • Page 327 Examples and tips IF res=1 THEN IF NOT DRIVE_RESET THEN SET_BIT(0,diag02) ENDIF ' Axis Parameters BASE(0) 'Axis Name: Flex00 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 FE_LIMIT=10.0000 SERVO=0 FWD_IN=-1.0000...
  • Page 328 Examples and tips 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 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...
  • Page 329 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 BASE(3) 'Axis Name: Up ATYPE=40 'Axis Type: Mechatro_Position UNITS=32.0000 REP_DIST=360.0000 REP_OPTION=1 ERRORMASK=268 AXIS_ENABLE=0 DRIVE_CONTROL=0 SPEED=3600.0000 ACCEL=36000.0000 DECEL=36000.0000 CREEP=100.0000 PROGRAMMING MANUAL...
  • Page 330 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 infor- mation. '================================================ 'EXAMPLE OF INITIALIZATION PROGRAM...
  • Page 331 'WRITE PARAMETERS IN THE SERVO '---------------------------- DRIVE_WRITE($103,2,inertia_ratio) 'Write inertia ratio DRIVE_READ($110,2,10) IF VR(10)<>$0012 THEN DRIVE_WRITE($110,2,$0012,1) 'Pn110=0012h (autotuning disabled) restart=1 ENDIF DRIVE_READ($202,2,10) IF VR(10)<>1 THEN DRIVE_WRITE($202,2,1,1) 'Pn202=1 (gear ratio numerator in the drive. Default is 4) restart=1 ENDIF DRIVE_READ($511,2,10) PROGRAMMING MANUAL...
  • Page 332 'Change feedforward gain Pn109 if required '---------------------------- 'Initial parameter of the AXIS '---------------------------- 'If set to 1 (and Pn202=Pn203=1) the UNITS are 'encoder counts UNITS=1 'Theoretical FE we will have running the motor at "max_speed" 'without VFF_GAIN in MECHATROLINK SPEED...
  • Page 333 • 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 334 5.2.4 Position with product detection A ballscrew moves forward at a creep speed until it reaches a product, a fig. 49 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.
  • Page 335 5.2.5 Position on a grid A square palette has sides 1m long. It is divided into a 5 x 5 grid, and each of fig. 51 the positions on the grid contains a box which must be filled using the same square pattern of 100mm by 100mm.
  • Page 336 Examples and tips Example fig. 52 nozzle = 8 start: FOR x = 0 TO 4 FOR y = 0 TO 4 MOVEABS(x*200, y*200) WAIT IDLE OP(nozzle, ON) GOSUB square_rel OP(nozzle, OFF) NEXT y NEXT x GOTO start square_rel: MOVE(0, 100)
  • Page 337 Examples and tips 5.2.6 Bag feeder program A bag feeder machine feeds plastic film a fixed distance that is set by the fig. 53 operator. The figure shows a typical bag feeder that is part of the machine. Bag feeder machines have two modes.
  • Page 338 '================================================ 'BAG FEEDER program Position '================================================ Bag_distance-expected_pos+REG_POS 'Working with marks, if any mark is missing, feed the Bag_distance 'theoretical distance. But if the mark is missing for 'a number of consecutive bags, stop the operation. REG_POS 'A digital output is activated a certain time to cut 'the bag.
  • Page 339 WAIT UNTIL IN(start_signal)=0 WAIT UNTIL IN(start_signal)=1 'Move bag length MOVEABS(bag_distance) WAIT UNTIL MTYPE=2 'To verify that the MOVEABS is being executed 'If we work with Mark, activate the trigger 'MARK=FALSE when triggered and TRUE when not triggered IF work_with_mark AND MARK THEN...
  • Page 340 GOTO loop 5.2.7 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 341 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 342 FOR i= in_tbl TO end_tbl TABLE(i,(k*(COS(PI*i/npoints)-1))^2) NEXT i RETURN 5.2.8 Flying shear program An example of the Flying shear program. In this application there are three fig. 56 axes: • Axis 0, shear_axis, the advancement of the shear. • Axis 1, flying_axis, is the flying shear.
  • Page 343 Cut_length 'FIRST CYCLE 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) 'Make a first material cut MOVEABS(end_pos) AXIS(shear_axis) WAIT UNTIL MTYPE AXIS(shear_axis)=2...
  • Page 344 SPEED AXIS(line_axis)=line_speed 'Cutting movement at synchronized speed line_cut=synch_dist+l_acc+l_dec shear_cut=synch_dist+l_acc/2+l_dec/2 MOVELINK(shear_cut,line_cut,l_acc,l_dec,line_axis) AXIS(flying_axis) WAIT UNTIL MPOS AXIS(flying_axis)>l_acc/2 'Activate the shear when it is in synchronization with the line 'Slow speed to cut SPEED AXIS(shear_axis)=cut_speed MOVEABS(end_pos) AXIS(shear_axis) MOVEABS(0) AXIS(shear_axis) WAIT UNTIL NTYPE AXIS(shear_axis)=2...
  • Page 345 The speed-time graph shows the steps of the above example. The steps fig. 58 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,...
  • Page 346 Examples and tips The difference between the expected position and the actual position is measured with a photocell. This is the correction factor. Every time a correction is made, the origin position is updated accordingly. Example fig. 59 conveyor=0 labeller=1...
  • Page 347: Troubleshooting

    6.2.1 System errors Voltage and analysis tools System errors show on the LED display of the TJ2-MC64 as Enn, where nn Check the voltage to the power supply input terminals. Make sure the is the error code. voltage is within the specified range. If the voltage is outside the specified range, the system can operate incorrectly.
  • Page 348 You can also open the Axis Parameter window in Trajexia Studio and check The error code U0n shows on the display, where n ranges from 0 to 6 and is the AXISSTATUS field of the axis that caused the error. The bits that the number of the unit that causes the error.
  • Page 349 To replace the backup battery, do these steps: TJ1-ML__ version not supported 1. Make sure the Power Supply Unit is set to on for at least five minutes. If TJ2-MC64 requires TJ1-ML__ units with a minimum FPGA version 18. The...
  • Page 350: Tj1-Prt

    • Check that no station address is used twice. ERH LED is on Communication failure between Reset the TJ2-MC64. If this does The PROFIBUS wiring is not cor- • Check that the correct pins TJ2-MC64 and TJ1-PRT. not help, replace the TJ2-MC64.
  • Page 351: Tj1-Drt

    I/O data communication problems Indication Problem Solution COMM LED is off The PROFIBUS configuration is • Check that you use the cor- and BF LED is incorrect, there is no communica- rect GSD file in the master. Indication Problem Solution flashing tion with the master.
  • Page 352: Tj1-Ml

    GRT1-ML2 has bit 13 set, which means that there is an error or a warning in the SmartSlice system. The default value of the error mask is set to detect if this bit is on, and thus an error is detected and reported by the PROGRAMMING MANUAL...
  • Page 353 SmartSlice I/O Units is enough to drive the external outputs on the switches. individual units. • vr is the VR memory address where the read code is put. Use value -1 to print the status word to the Command Line Terminal interface. I/O PWR Probable cause Correction...
  • Page 354 Not Lit Not lit Initialization in progress second) There can be a break in the con- Check the connection between Flashing Fatal system error during initializa- Replace the unit nection between individual slices at the point where the first unit...
  • Page 355: Tj1-Fl02

    MECHATROLINK(unit, 0), the controller responds with the following message in the terminal interface window: INVALID MECHATROLINK MASTER CONFIG FOR SERVO PERIOD: INVALID SLICE CONFIGURATION No input or output of the SmartSlice I/O Units connected is mapped into the Trajexia I/O space. PROGRAMMING MANUAL...
  • Page 356: Agrt1-Ml2 Timing

    This appendix describes the I/O timing issues for the communication between the TJ2-MC64, the GRT1-ML2 and the SmartSlice I/O Units. The information in this section is useful for planning operations that require strict control of the I/O timing. In this section, the following is assumed: •...
  • Page 357 To display the number of pages used, execute the command MECHATROLINK(unit,38,station,vr). This command reads the paging data and stores it in the VR array: first the number of input pages, and then the number of output pages. If vr equals -1, the paging data is printed to the Command Line Terminal interface.
  • Page 358: Examples

    + number of output words of SmartSlice Output Units that use words × 0.008 + number of output bits of SmartSlice Output Units that use bits × 0.001 ms The data processing and synchronisation time of the SmartSlice I/O Units.
  • Page 359 GRT1-ML2 timing The following SmartSlice I/O Units, which are used in the examples, have fig. 2 the following ON/OFF delays: Input Output sync SmartSlice I/O Unit ON/OFF TJ1-MC__ 0 ms ≤ T ≤ 1.5 ms GRT1-ID4 ON/OFF 0 ms ≤ T ≤...
  • Page 360 ≤ 1.5 + 0.7 + 1.1 + 1 + 1 = 5.3 ms 28 / 27, rounded up = 2 Pages = 0.66 + 6 × 0.022 + 12 × 0.009 + 12 × 0.008 + 8 × 0.001 = 1.004 ms GRT1-OD4 output response time...
  • Page 361: Revision History

    Revision history Revision history A manual revision code shows as a suffix to the catalogue number on the front cover of the manual. Revision code Date Revised content February 2010 Original PROGRAMMING MANUAL...
  • Page 362 Omron Europe BV and/or its subsidiary and affiliated companies reserve the right to make any changes to the products, their specifications, data at its sole discretion at any time without prior notice. The material contained in this catalogue may be out of date and Omron Europe BV and/or its subsidiary and affiliated companies make no commitment to update such material.

This manual is also suitable for:

Tj1-prtTj1-drtTj1-cortTj1-mlGrt1-ml2Tj1-fl02

Table of Contents