Mitsubishi Electric MELSEC-L02SCPU User Manual

Cpu module, built-in i/o function
Table of Contents

Advertisement

MELSEC-L CPU Module User's Manual
(Built-In I/O Function)
-L02SCPU
-L02SCPU-P
-L02CPU
-L02CPU-P
-L06CPU
-L06CPU-P
-L26CPU
-L26CPU-P
-L26CPU-BT
-L26CPU-PBT

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC-L02SCPU

  • Page 1 MELSEC-L CPU Module User's Manual (Built-In I/O Function) -L02SCPU -L02SCPU-P -L02CPU -L02CPU-P -L06CPU -L06CPU-P -L26CPU -L26CPU-P -L26CPU-BT -L26CPU-PBT...
  • Page 3: Safety Precautions

    SAFETY PRECAUTIONS (Read these precautions before using this product.) Before using this product, please read this manual and the relevant manuals carefully and pay full attention to safety to handle the product correctly. In this manual, the safety precautions are classified into two levels: " WARNING"...
  • Page 4 [Design Precautions] WARNING ● Configure safety circuits external to the programmable controller to ensure that the entire system operates safely even when a fault occurs in the external power supply or the programmable controller. Failure to do so may result in an accident due to an incorrect output or malfunction. (1) Emergency stop circuits, protection circuits, and protective interlock circuits for conflicting operations (such as forward/reverse rotations or upper/lower limit positioning) must be configured external to the programmable controller.
  • Page 5 [Design Precautions] WARNING ● When changing data from a peripheral device connected to the CPU module during operation, configure an interlock circuit in the program to ensure that the entire system will always operate safely. For other forms of control (such as program modification or operating status change) of a running programmable controller, read the relevant manuals carefully and ensure that the operation is safe before proceeding.
  • Page 6 [Installation Precautions] WARNING ● Shut off the external power supply (all phases) used in the system before mounting or removing a module. Failure to do so may result in electric shock or cause the module to fail or malfunction. [Installation Precautions] CAUTION ●...
  • Page 7 [Wiring Precautions] CAUTION ● Individually ground the FG terminal of the programmable controller with a ground resistance of 100 or less. Failure to do so may result in electric shock or malfunction. ● Use applicable solderless terminals and tighten them within the specified torque range. If any spade solderless terminal is used, it may be disconnected when a terminal block screw comes loose, resulting in failure.
  • Page 8 [Startup and Maintenance Precautions] WARNING ● Do not touch any terminal while power is on. Doing so will cause electric shock or malfunction. ● Correctly connect the battery connector. Do not charge, disassemble, heat, short-circuit, solder, or throw the battery into the fire. Also, do not expose it to liquid or strong shock. Doing so will cause the battery to produce heat, explode, ignite, or leak, resulting in injury and fire.
  • Page 9 [Disposal Precautions] CAUTION ● When disposing of this product, treat it as industrial waste. When disposing of batteries, separate them from other wastes according to the local regulations. (For details on battery regulations in EU member states, refer to the MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection).) [Transportation Precautions] CAUTION...
  • Page 10: Conditions Of Use For The Product

    CONDITIONS OF USE FOR THE PRODUCT (1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions; i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or serious accident; ii) where the backup and fail-safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
  • Page 11: Introduction

    INTRODUCTION Thank you for purchasing the Mitsubishi MELSEC-L series programmable controllers. This manual describes the functions of the external I/O interface of the LCPU and programming. Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance of the MELSEC-L series programmable controller to handle the product correctly.
  • Page 12: Relevant Manuals

    RELEVANT MANUALS (1) CPU module user's manual Manual name Description <manual number (model code)> Specifications of the CPU modules, power supply modules, display unit, MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and branch module, extension module, SD memory cards, and batteries, Inspection) information on how to establish a system, maintenance and inspection, <SH-080890ENG, 13JZ36>...
  • Page 13 Memo...
  • Page 14: Table Of Contents

    CONTENTS CONTENTS SAFETY PRECAUTIONS ............. 1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 15 7.10.3 Speed change function ........... . . 115 7.10.4 Software stroke limit function .
  • Page 16 Appendix 2.2 Connection examples with stepping motors manufactured by ORIENTAL MOTOR CO.,LTD............273 Appendix 2.3 Connection examples with servo amplifiers manufactured by Panasonic Corporation .
  • Page 17: Manual Page Organization

    MANUAL PAGE ORGANIZATION In this manual, pages are organized and the symbols are used as shown below. The following illustration is for explanation purpose only, and should not be referred to as an actual documentation. "" is used for screen names and items. The chapter of the current page is shown.
  • Page 18 Pages describing instructions are organized as shown below. The following illustration is for explanation purpose only, and should not be referred to as an actual documentation. Instruction name Execution condition of the instruction Structure of the instruction in the ladder mode shows the devices applicable to the instruction Setting side...
  • Page 19 • Instructions can be executed under the following conditions. Execution condition Any time During on On the rising edge During off On the falling edge Symbol No symbol • The following devices can be used. Internal device Link direct device Intelligent Index Constant...
  • Page 20: Terms

    TERMS Unless otherwise specified, this manual uses the following terms. Term Description CPU module The abbreviation for the MELSEC-L series CPU module Power supply module The abbreviation for the MELSEC-L series power supply module Branch module The abbreviation for the MELSEC-L series branch module Extension module The abbreviation for the MELSEC-L series extension module END cover...
  • Page 21 Memo...
  • Page 22: Chapter 1 Overview

    CHAPTER 1 OVERVIEW The LCPU supports the following built-in I/O functions. The built-in I/O functions allow constructing a small-scale system using the LCPU alone because dedicated modules for these functions are not required. Therefore, the system cost can be reduced. •...
  • Page 23 CHAPTER 1 OVERVIEW (1) Number of points used for each function X0 to XF and Y0 to Y7 are sorted for each function. Number of points Function Available range Input Output General-purpose input 0 to 16 points (input signal) 0 to 16 points ...
  • Page 24: Chapter 2 External I/O Specifications

    CHAPTER 2 EXTERNAL I/O SPECIFICATIONS This chapter describes internal circuits, pin numbers and corresponding signal names, and specifications of external I/O interface. For connectors used for external wiring, refer to  MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection). (1) Input specifications Item Specifications...
  • Page 25 CHAPTER 2 EXTERNAL I/O SPECIFICATIONS (2) Output specifications Item Specifications Signal name Output (OUT0 to OUT7) Rated load voltage 5 to 24VDC Maximum load current 0.1A/point Maximum voltage drop at ON 0.2V (TYP.) Leakage current at OFF 0.1mA or lower 1s or less (rated load, resistive load) Response time 1s or less (rated load, resistive load)
  • Page 26 (4) Internal circuits (a) L02SCPU, L02CPU, L06CPU, L26CPU, L26CPU-BT Signal name External wiring Pin number Internal circuit Classification B line A line 24VDC High-speed 24V High-speed 24V input (IN0-24V) input (IN2-24V) 3.6k 1/2W High-speed High-speed differential differential input (IN0-DIFF) input (IN2-DIFF) High-speed High-speed 1/10W...
  • Page 27 CHAPTER 2 EXTERNAL I/O SPECIFICATIONS (b) L02SCPU-P, L02CPU-P, L06CPU-P, L26CPU-P, L26CPU-PBT Signal name External wiring Pin number Internal circuit Classification B line A line 24VDC High-speed High-speed 24V input 24V input (IN0-24V) (IN2-24V) 3.6k 1/2W High-speed High-speed differential input differential input (IN0-DIFF) (IN2-DIFF) 1/10W...
  • Page 28 (5) I/O connector pin numbers and corresponding I/O signals Cate- Correspondence Corresponding Cate- Correspondence Corresponding Type Type number gory for line driver I/O signal number gory for line driver I/O signal High- High-   speed speed High- High-  ...
  • Page 29 CHAPTER 2 EXTERNAL I/O SPECIFICATIONS (6) Input signal assignment : Selectable, : No combination Function External General- input Interrupt purpose Pulse catch High-speed counter Positioning signal input input X0 (High-     Counter CH1 A Phase speed) X1 (High- ...
  • Page 30 (7) Output signal assignment : Selectable, : No combination Function External General- output signal purpose High-speed counter Positioning output   CH1 Coincidence Output No.1  CH2 Coincidence Output No.1   CH1 Coincidence Output No.2 Axis #1 Deviation Counter Clear ...
  • Page 31 CHAPTER 2 EXTERNAL I/O SPECIFICATIONS (8) Simplified chart of I/O signals The following shows a simplified chart of I/O signals for the high-speed counter function and positioning function. High-speed counter Positioning Axis #1 Axis #2 (9) External input signals (X0 to XF) when using the functions The on/off status of the external input signals (X0 to XF) are reflected to the input device (X0 to XF) in the program when any built-in I/O functions (except the pulse catch function) is used.
  • Page 32 (11)Monitoring by the programming tool To check the I/O settings, open the "I/O Monitor" window by using the programming tool. [Tool]  [Built-in I/O Module Tool] For details, refer to the followings. GX Works2 Version 1 Operating Manual (Common)
  • Page 33: Chapter 3 General-Purpose Input Function

    CHAPTER 3 GENERAL-PURPOSE INPUT FUNCTION CHAPTER 3 GENERAL-PURPOSE INPUT FUNCTION This function uses the built-in external input signals (16 points) as general-purpose inputs to read the on/off status of external devices such as switches and sensors. The on/off status of the external input signals are refreshed to the input device (X0 to XF) and used in programs.
  • Page 34 (5) Partial refresh The LCPU can read the current external input status by executing partial refresh using the RFS instruction to the input device (X0 to XF). For the RFS instruction, refer to the following.  MELSEC-Q/L Programming Manual (Common Instruction) (6) Performance specifications The following is the performance specifications of the general-purpose output function.
  • Page 35: Chapter 4 General-Purpose Output Function

    CHAPTER 4 GENERAL-PURPOSE OUTPUT FUNCTION CHAPTER 4 GENERAL-PURPOSE OUTPUT FUNCTION This function uses the built-in external output signals (8 points) as general-purpose outputs for external devices such as lamps. By turning on/off the output device (Y0 to Y7) in programs, the LCPU can output the signals externally. (1) Parameter setting Set the output signals and error time output mode.
  • Page 36 (5) Error time output mode Select the output mode (Hold or Clear) for the output status of the output device (Y0 to Y7) when an error to stop the program occurs. (This is not the setting for outputs to the output modules and the intelligent function modules. For details on the error time output mode setting for modules, refer to the following....
  • Page 37: Chapter 5 Interrupt Input Function

    CHAPTER 5 INTERRUPT INPUT FUNCTION CHAPTER 5 INTERRUPT INPUT FUNCTION This function executes an interrupt program when triggered by the input signal (X0 to XF). (1) Parameter setting Set the input signals, input response time values, and interrupt processing condition. Project window ...
  • Page 38 (2) Interrupt pointer assignment and interrupt priority The following shows interrupt pointers corresponding to input signals (X0 to XF). I/O signal Interrupt pointer Priority The priority 1 to 4 are used for interrupt pointers I28 to I31 (interrupt by build-in timers). Interrupt pointer numbers can be changed.
  • Page 39 CHAPTER 5 INTERRUPT INPUT FUNCTION (a) Changing the interrupt pointer numbers Click the button in the "PLC System" tab. Project window  [Parameter]  [PLC Parameter]  "PLC System" tab Set the interrupt pointer start No., interrupt pointer count, start I/O No., and start SI No. Click the button to exit.
  • Page 40 (3) Interrupt processing condition The following table lists three types of conditions to execute the interrupt programs by the interrupt inputs. Interrupt processing Description condition Rising edge The interrupt program is executed at the rising edge of the interrupt input signal. Falling edge The interrupt program is executed at the falling edge of the interrupt input signal.
  • Page 41: Chapter 6 Pulse Catch Function

    CHAPTER 6 PULSE CATCH FUNCTION CHAPTER 6 PULSE CATCH FUNCTION This function can catch pulse signals that the general-purpose input function cannot catch because the on time is shorter than the scan time. (1) Parameter setting Set the input signals and input response time values. Project window ...
  • Page 42 (b) Operation when detecting more than one pulse in one scan Second pulse and later are ignored. Input pulse signals at intervals of one scan or more. 0 step 0 step 0 step Program 1) Input signal ON These pulses are ignored. External input signal Input device 2) ON for 1 scan...
  • Page 43 CHAPTER 6 PULSE CATCH FUNCTION (d) Operation when detecting a pulse that has on width of two scans or more The input device turns on for one scan. 0 step 0 step 0 step Program 1) Input signal ON External input signal Input device 2) ON for 1 scan (3) Detectable pulse width...
  • Page 44: Chapter 7 Positioning Function

    CHAPTER 7 POSITIONING FUNCTION Overview (1) Definition This function is used to move a table, machining target, tool, or other moving body (workpiece) at a specified speed with the purpose of stopping it accurately at a target position. (2) Features The positioning function is controlled by dedicated instructions.
  • Page 45 CHAPTER 7 POSITIONING FUNCTION (d) Limitation of the moving range of the workpiece Desired positions can be set as the logical upper limit and lower limit of the moving range of the workpiece, without using switches. (Software stroke limit function) Also, upper and lower limit switches can be used to limit the moving range.
  • Page 46 (3) Function list The following table lists and describes functions available for the positioning function. Item Description Reference A function to mechanically establish the reference point (OP) for Page 71, Section Machine OPR positioning control using a near-point dog or stopper 7.6.1 OPR control A function to execute positioning control to the OP address stored by...
  • Page 47 CHAPTER 7 POSITIONING FUNCTION (4) Mechanism of a positioning control system Positioning control is implemented based on pulses output from the LCPU. In a positioning system, software and external devices are used to perform the roles shown below. Parameter setting Signals such as a limit signal and Start instruction for the positioning control a positioning control switching signal are output.
  • Page 48 (5) Operation inside the drive unit After receiving a pulse input from the LCPU, the following operations occur in the drive unit. LCPU Drive unit Servomotor Forward run pulse train Program Servo Deviation converter amplifier Reverse run pulse train counter Operation such as data read and write...
  • Page 49 CHAPTER 7 POSITIONING FUNCTION (6) Principles of position control and speed control (a) Position control The total No. of pulses needed to move a specified distance can be obtained by the formula below. Designated distance Total number of pulses Number of pulses required for required to move designated distance motor to rotate once * Movement amount of...
  • Page 50 (7) Pulses output from the LCPU • Pulse trains are sparse when the servomotor is accelerating, and become denser as the servomotor approaches the stable speed that has been set. • At the stable speed, constant pulse trains are output. •...
  • Page 51 CHAPTER 7 POSITIONING FUNCTION (8) Movement amount and speed of a worm gear system This section describes methods of calculations required for positioning control by using worm gear system. The worm gear consists of a balls lined up in an engagement part, just like a ball bearing. The ball screw has no backlash and can rotate with a small force.
  • Page 52: Procedure For Performing The Positioning Function

    7.1.1 Procedure for performing the positioning function The following shows the procedure. Start Connection to an external device  (Page 51, Section 7.2) Connect an external device.  (Page 57, Section 7.3.1) Positioning parameters  (Page 64, Section 7.6) OPR parameters Set parameters by a programming ...
  • Page 53: Connection To External Devices

    CHAPTER 7 POSITIONING FUNCTION Connection to External Devices 7.2.1 I/O signals The following shows the simplified diagrams of the internal circuits of LCPU external device connection interface. "" in the signal name indicates either 1 (Axis 1) or 2 (Axis 2). For I/O signal settings, refer to  Page 56, Section 7.3. (1) Input Pin number External wiring...
  • Page 54 (2) Output (a) L02SCPU, L02CPU, L06CPU, L26CPU, L26CPU-BT Pin number Internal circuit Signal name Axis 1 Axis 2 Insulating (Not used for the positioning function) element Deviation counter clear signal (CLEAR ) Insulating element CW/PULSE/A phase output (PULSE F ) Insulating element CCW/SIGN/B phase output (PULSE R )
  • Page 55 CHAPTER 7 POSITIONING FUNCTION (3) Details of I/O signals The following table lists and describes the I/O signals of the connector for LCPU external devices. Category Signal name Description • The zero signal from the pulse generator is used to input the OP signal for performing the machine OPR.
  • Page 56 (4) On/off status of input signals (a) On/off status of input signals On/off status of input signals is determined according to external wiring. Signal name External wiring Signal on/off status as viewed from LCPU (Photocoupler OFF) 24VDC INn - 24V INn - COM (n = 0 to 5) High-speed input...
  • Page 57: Wiring

    CHAPTER 7 POSITIONING FUNCTION 7.2.2 Wiring For connectors used for external wiring, refer to  MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection). For examples of connection with servo amplifiers, refer to  Page 271, Appendix 2.
  • Page 58: Parameter Setting

    Parameter Setting Set parameters for each axis. Click the button in the "Built-in I/O Function Setting" tab. Project window[Parameter][PLC Parameter]"Built-in I/O Function Setting" tab Select the "Use positioning function (Axis #1)" checkbox on the top left on the "Positioning Axis #1 Detailed Setting"...
  • Page 59: Positioning Parameters

    CHAPTER 7 POSITIONING FUNCTION 7.3.1 Positioning parameters Positioning parameters are common to all controls. Set these parameters for each axis. Setting item Setting range Default CW/CCW Mode PULSE/SIGN Mode Pulse Output Mode CW/CCW Mode A Phase/B Phase Mode (Multiple of 1) A Phase/B Phase Mode (Multiple of 4) Current Value Increment with Forward Run Pulse Output...
  • Page 60 (b) PULSE/SIGN mode Forward/reverse control is based on on/off of the direction sign (SIGN). • The direction sign turns on when the motor is rotating forward. • The direction sign turns off when the motor is rotating in reverse. PULSE SIGN Forward run Reverse run...
  • Page 61 CHAPTER 7 POSITIONING FUNCTION (2) Rotation direction setting Set how the current position would increase/decrease in each rotation direction of the motor. Check the settings by JOG operation. ( Page 104, Section 7.9) Set "Current Value Increment with Forward Run Pulse Output" for the rotation direction setting and perform forward JOG operation.
  • Page 62 (4) Speed limit value Set the maximum speed for OPR control, positioning control and JOG operation. If any of the following settings exceeds the speed limit, the speed is limited to the specified limit. • OPR speed • Command speed •...
  • Page 63: Specifications

    CHAPTER 7 POSITIONING FUNCTION Specifications (1) Performance specifications The following is the performance specifications of the positioning function. Description Item L02SCPU, L02CPU, L06CPU, L02SCPU-P, L02CPU-P, L06CPU-P, L26CPU, L26CPU-BT L26CPU-P, L26CPU-PBT Number of controlled axes Control unit pulse Available control Operation pattern Path control Not usable Number of positioning data...
  • Page 64 (2) Special relay and special register The following table lists the special relay (SM) and special register (SD) related to the positioning function.  in the name indicates either 1 (Axis 1) or 2 (Axis 2). For details of the special relay and special register other than the Axis 1 axis operation status (SD1844) (...
  • Page 65: Checking Current Position And Operation Status

    CHAPTER 7 POSITIONING FUNCTION Checking Current Position and Operation Status The current position and operation status of the moving workpiece can be monitored in the special register. (1) Checking a current position Values indicating the current position are stored in the Axis 1 current feed value (SD1840, SD1841). The address established by machine OPR is used as the reference.
  • Page 66: Opr Control

    OPR Control Two controls (machine OPR and fast OPR) are defined as OPR controls in line with the flow of OPR operation of the LCPU. OPR control Description Reference This is control to establish the reference position (= OP) to be used when positioning control is started.
  • Page 67 CHAPTER 7 POSITIONING FUNCTION (1) OPR method Set the method of machine OPR. (This setting does not affect the fast OPR.) Operations under each method are explained below. For details of each method and applicable precautions, refer to ( Page 71, Section 7.6.1). Near-point dog method 1) Start of machine OPR.
  • Page 68 Stopper 3 1) Start of machine OPR.  2) The axis contacts the stopper at the creep speed and stops. Stopped by Creep speed stopper  3) When the zero signal is detected, pulse output from the LCPU Bias speed at start stops and machine OPR is complete.
  • Page 69 CHAPTER 7 POSITIONING FUNCTION (a) OPR methods and OPR parameters Different OPR parameters are required depending on each OPR method. The relationships are shown below. For the settings required for the fast OPR, refer to  Page 89, Section 7.6.2. : Must be set, : Need not be set OPR method OPR parameter...
  • Page 70 (4) OPR speed Set the speed of OPR control. The following condition must be met: Bias speed at start  Creep speed  OPR speed  Speed limit (5) Creep Speed Set the low speed at which the axis moves immediately before stopping after decelerating from the OPR speed following the turning on of the near-point dog.
  • Page 71 CHAPTER 7 POSITIONING FUNCTION (7) OPR deceleration stop time Set the time required for the following conditions. • For "Count 2", this time is from when the axis decelerates the speed from the creep speed to when it stops at the bias speed at start.
  • Page 72 (9) OPR dwell time Set this parameter in the conditions below. (This setting does not affect the fast OPR.) (a) When the OPR Method is set to "Stopper 1": Set the time required for machine OPR to complete after the near-point dog turns on. For the OPR dwell time, set a value equal to or greater than the moving time after the near-point dog turns on until the axis stops at the stopper.
  • Page 73: Machine Opr

    CHAPTER 7 POSITIONING FUNCTION 7.6.1 Machine OPR The machine OPR establishes the machine OP using the OPR start instruction (IPOPR1(P)). ( Page 146, Section 7.12.1 (4)) Once the machine OPR is complete, the mechanically established position becomes the "OP" which defines the starting point of positioning control.
  • Page 74 Important ■OPR direction The direction of the OP must always be the same when viewed from any arbitrary position in the moving area of the workpiece (= the OP must be positioned near the upper limit or lower limit of the machine). Set the OPR direction correctly so that the workpiece moves toward the OP.
  • Page 75 CHAPTER 7 POSITIONING FUNCTION (3) Operations of near-point dog method and precautions Under the near-point dog method, machine OPR completes when a zero signal is input after the near-point dog has turned off. The following operations take place. Operation step Description of operation Machine OPR starts upon execution of the OPR start instruction (IPOPR1(P)).
  • Page 76 (a) Required pulse generator Use a pulse generator with zero signal. If a pulse generator without zero signal is used, generate a zero signal using an external signal. (b) Near-point dog length The near-point dog length should be equal to or longer than the distance moved by the axis as it decelerates from the OPR speed to creep speed.
  • Page 77 CHAPTER 7 POSITIONING FUNCTION (c) Advantages of using limit switches The following functions can be used when the upper and lower limit signals are selected: • OPR retry function When machine OPR is started in a position indicated as interval A (where the near-point dog is turned off and no near-point dog is found in the OPR direction) in the figure below, the axis continues to operate at the OPR speed until reaching the limit switch of the machine system because it cannot detect the near- point dog.
  • Page 78 (d) Machine OPR from a position where the near-point dog is turned on When machine OPR is started at a position indicated as interval B (where the near-point dog is turned on) in the figure below, the OPR retry function does not operate. The axis moves at the creep speed to complete machine OPR.
  • Page 79 CHAPTER 7 POSITIONING FUNCTION (4) Operations of stopper 1 and precautions Under this method, machine OPR completes upon elapse of the OPR dwell time after the detection of near-point dog ON. The following operations take place. Operation step Description of operation Machine OPR starts upon execution of the OPR start instruction (IPOPR1(P)).
  • Page 80 (b) Setting of OPR dwell time For "OPR dwell time," set a value equal to or greater than the moving time from the near-point dog ON position until the stopper is contacted. If the OPR dwell time is short, machine OPR completes before the stopper is contacted and the OP position deviates.
  • Page 81 CHAPTER 7 POSITIONING FUNCTION (5) Operations of stopper 2 and precautions Under this method, machine OPR completes upon input of a zero signal via an external switch, following stopper contact. The following operations take place. Operation step Description of operation Machine OPR starts upon execution of the OPR start instruction (IPOPR1(P)).
  • Page 82 (a) Motor torque limit Be sure to limit the motor torque after the creep speed is reached. If the torque is not limited, the motor may be damaged when the stopper is contacted. For limitation of torque, refer to the manual for the drive unit. (b) Near-point dog and starting position •...
  • Page 83 CHAPTER 7 POSITIONING FUNCTION (d) Zero signal input • Input a zero signal after the stopper has been contacted. If a zero signal is input before the stopper is contacted, machine OPR completes at that point. As a result, the OP position deviates and if a zero signal is input while the axis is decelerating to the creep speed, the motor load also increases because the axis stops suddenly at the creep speed or higher.
  • Page 84 (6) Operations of stopper 3 and precautions Under this method, machine OPR completes upon input of a zero signal via an external switch, following stopper contact. This method is effective when no near-point dog is installed. Note, however, that it takes a longer time to complete machine OPR because the axis operates at the creep speed, not at the OPR speed.
  • Page 85 CHAPTER 7 POSITIONING FUNCTION (7) Operations of count 1 and precautions Under this method, machine OPR completes when the first zero signal is input after the axis has moved the distance set by "Movement amount after near-point dog ON" from the near-point dog ON point. The following operations take place.
  • Page 86 (a) Required pulse generator A pulse generator with a zero signal is required. If a pulse generator without zero signal is used, generate a zero signal using an external signal. (b) Movement amount after near-point dog ON The "Movement amount after near-point dog ON" should be equal to or longer than the distance moved by the axis as it decelerates from the OPR speed to creep speed.
  • Page 87 CHAPTER 7 POSITIONING FUNCTION (c) Advantages of using limit switches The following functions can be used when the upper and lower limit signals are selected: • OPR retry function When machine OPR is started in a position indicated as interval A (where the near-point dog is turned off and no near-point dog is found in the OPR direction) in the figure below, the axis continues to operate at the OPR speed until reaching the limit switch of the machine system because it cannot detect the near- point dog.
  • Page 88 (8) Operations of count 2 and precautions Under this method, the position achieved by moving the distance set by "Movement amount after near-point dog ON" from the near-point dog ON point is set as the OP. This method is effective when a stepping motor is used so that a zero signal cannot be issued.
  • Page 89 CHAPTER 7 POSITIONING FUNCTION (b) Movement amount after near-point dog ON The "Movement amount after near-point dog ON" should be equal to or longer than the distance moved by the axis as it decelerates from the OPR speed to creep speed. ( Page 69, Section 7.6 (8)) If the axis has moved the distance set by "Movement amount after near-point dog ON"...
  • Page 90 (c) Advantages of using limit switches The following functions can be used when the upper and lower limit signals are selected: • OPR retry function When machine OPR is started in a position indicated as interval A (where the near-point dog is turned off and no near-point dog is found in the OPR direction) in the figure below, the axis continues to operate at the OPR speed until reaching the limit switch of the machine system because it cannot detect the near- point dog.
  • Page 91: Fast Opr

    CHAPTER 7 POSITIONING FUNCTION 7.6.2 Fast OPR The fast OPR is a function to perform positioning to the "OP address" established by machine OPR or other position (standby address). Address Description OP address This address is used to perform positioning using the OP established by machine OPR as the starting point. This address is used to perform positioning using a position other than the OP established by machine OPR as the starting point.
  • Page 92: Forced Off Of Axis 1 Opr Request (Sm1842)

    7.6.3 Forced off of Axis 1 OPR request (SM1842) When the LCPU requests machine OPR upon power on, the Axis 1 OPR request (SM1842) turns on. If the system does not require machine OPR, the Axis 1 OPR request (SM1842) can be forcibly turned off by turning on the Axis 1 OPR request off (SM1851).
  • Page 93: Positioning Control

    CHAPTER 7 POSITIONING FUNCTION Positioning Control The positioning control method is set by the positioning data "Control System". 10 positioning data can be set for each axis with the programming tool. To start positioning control using positioning data set with the programming tool, use the Table start instruction (IPPSTRT1(P)) (...
  • Page 94 (1) Control system Set the positioning control system. Control system Description Reference  Not selected (blank) Set this option if positioning control is not performed. Position Control (ABS) Positioning control is implemented from the position at which the axis is currently Page 97, Section stopped, to the specified position.
  • Page 95 CHAPTER 7 POSITIONING FUNCTION (2) Acceleration/deceleration time, deceleration stop time, dwell time, and command speed • Acceleration/deceleration time: Set the time required for the axis to reach the command speed from the bias speed at start. • Deceleration stop time: Set the time required for the axis to reach the bias speed at start from the command speed and then stop upon completion of position control or occurrence of a stop cause.
  • Page 96 (3) Positioning address/movement amount Set the address or movement amount to be used as the target value for positioning control. The setting range of values varies depending on the control system. (a) Position control (ABS), current value change Set the address from the OP. Stop position (positioning start address) -1000...
  • Page 97: Start Of Positioning Control

    CHAPTER 7 POSITIONING FUNCTION 7.7.1 Start of positioning control Positioning control can be started by using positioning data set with the programming tool or by setting positioning data in a program. The I/O signals used under each control system are shown below. : Wiring required, : Wire as necessary, : Wiring not required Control system I/O signal...
  • Page 98 (3) Sub function • The command speed can be changed using the Speed change instruction (IPSPCHG1(P)) ( Page 115, Section 7.10.3). • The software stroke limit function can be used when the software stroke upper/lower limits are set ( Page 120, Section 7.10.4). •...
  • Page 99: Position Control

    CHAPTER 7 POSITIONING FUNCTION 7.7.2 Position control Positioning control is implemented for the specified axis from the current position to specified position. (1) Positioning control by ABS (absolute) method Positioning is performed by specifying a position with reference to the OP. The moving direction is determined by the current position.
  • Page 100: Speed/Position Switching Control

    7.7.3 Speed/position switching control After the start instruction has been executed, positioning control is started via speed control first. When the external command signal turns on, speed control switches to position control and positioning control is implemented by the movement amount set by "Positioning address/movement amount." Speed/position switching control is implemented in forward and reverse directions.
  • Page 101 CHAPTER 7 POSITIONING FUNCTION (2) Precautions (a) Selection of external command signal An attempt to start speed/position switching control without selecting an external command signal generates a "Speed/position switching control start not possible" error (Axis 1 error code: 1505). (b) External command signal on timing and operation •...
  • Page 102: Current Value Change

    7.7.4 Current value change The Axis 1 current feed value (SD1840, SD1841) of a stationary axis is changed to a specified address. (1) Timing of current value change When the execution command for start instruction turns on, the specified address is stored in the Axis 1 current feed value (SD1840, SD1841).
  • Page 103: Speed Control

    CHAPTER 7 POSITIONING FUNCTION 7.7.5 Speed control After accelerating to the command speed, the axis continues to operate at the command speed until the Axis stop instruction (IPSTOP1) is executed. Speed control is implemented in forward and reverse directions. Operation timings are shown in the figure below.
  • Page 104: Multiple Axes Simultaneous Start Control

    Multiple Axes Simultaneous Start Control Two axes can be started simultaneously using the Two axes simultaneous start instruction (IPSIMUL(P)) ( Page 143, Section 7.12.1 (3)). (1) Operation details Two axes can be started simultaneously. The stop timing varies depending on the data of each axis. Axis 1 Axis 2 Simultaneous 2-axes...
  • Page 105 CHAPTER 7 POSITIONING FUNCTION If you want the two axes to generate a linear composite locus, simulated interpolation control can be performed. In this case, take note of the following points: • Calculate the speed according to the ratio of movement amounts of two axes. •...
  • Page 106: Jog Operation

    JOG Operation JOG operation is used for moving the axis only by a desired movement amount without using positioning data. Use this operation when checking the connection of the positioning control system, or to move the workpiece to inside the range of software stroke limits after operation has stopped by the software stroke limit function.
  • Page 107 CHAPTER 7 POSITIONING FUNCTION (2) Precautions (a) JOG speed adjustment It is dangerous to set a high JOG speed from the beginning. To ensure safety, set a small value first and gradually increase it while checking the operation to adjust to an optimal speed for control. (b) Axis stop instruction command during JOG operation When the execution command for Axis stop instruction (IPSTOP1) turns on during JOG operation, the axis decelerates to a stop.
  • Page 108 If the execution command for Axis stop instruction (IPSTOP1) is turned on while the execution command for the JOG start instruction (IPJOG1) is on and then the execution command for Axis stop instruction (IPSTOP1) is turned off, JOG operation cannot be performed. To start JOG operation, turn on the execution command for JOG start instruction (IPJOG1) again.
  • Page 109 CHAPTER 7 POSITIONING FUNCTION (c) Multiple instruction executions If the execution command for JOG start instruction (IPJOG1) is turned on again while the axis is decelerating due to the turning off of the JOG start instruction (IPJOG1), JOG operation cannot be performed. JOG start instruction is ignored.
  • Page 110 (3) Sub function • The software stroke limit function can be used when the software stroke upper/lower limits are set ( Page 120, Section 7.10.4). • The hardware stroke limit function can be used when upper/lower limit signals are input ( Page 123, Section 7.10.5).
  • Page 111: Sub Function

    CHAPTER 7 POSITIONING FUNCTION 7.10 Sub Function "Sub functions" govern control limitation, addition of function when OPR control, positioning control, and JOG operation are performed. These sub functions are implemented by setting parameters or in programs. Sub function Description Reference A function to perform machine OPR automatically by detecting an off edge of the OPR retry function limit signal and moving to a position where machine OPR is possible, even when...
  • Page 112: Opr Retry Function

    7.10.1 OPR retry function The workpiece may not move toward the OP depending on the position (for example, when it has already exceeded the OP during position control). In this case, normally machine OPR is started again after moving the workpiece to just before the near-point dog using JOG operation.
  • Page 113 CHAPTER 7 POSITIONING FUNCTION (2) Flow of operation The following shows OPR retry function when the workpiece is within the range of upper or lower limit switches. Operation step Description of operation Machine OPR starts upon execution of the OPR start instruction (IPOPR1(P)). The axis starts moving in the OPR direction.
  • Page 114 (3) When the workpiece is outside the range of upper or lower limit switches (a) When the OP direction is the same as the OPR direction Machine OPR is not performed. A "Hardware stroke limit +" error (Axis 1 error code: 1100) or "Hardware stroke limit -"...
  • Page 115 CHAPTER 7 POSITIONING FUNCTION (4) Near-point dog and starting position of machine OPR If machine OPR is performed at a position where the near-point dog is turned on, the following operations take place under each OPR method: • Near-point dog method: Machine OPR starts at the creep speed. •...
  • Page 116: Speed Limit Function

    7.10.2 Speed limit function If the operating speed exceeds the speed limit, this function limits the speed to within the setting range of speed limits. To use this function, set the positioning parameter "Speed limit." (1) Relationship of speed limit function and control Control Operation when the speed limit is exceeded Machine OPR...
  • Page 117: Speed Change Function

    CHAPTER 7 POSITIONING FUNCTION 7.10.3 Speed change function The speed change function changes the operating speed to a newly specified speed at a desired timing. This function is implemented with the Speed change instruction (IPSPCHG1(P)) by setting the new speed value, ACC/DEC time at speed change and DEC/STOP time at speed change (...
  • Page 118 (3) Precautions (a) Limitation of new speed value If the new speed value exceeds the speed limit, the axis operates at the speed limit and an "Out of speed range" warning (Axis 1 warning code: 1020) occurs. If the new speed value is less than the bias speed at start, the same warning occurs and the bias speed at start is applied.
  • Page 119 CHAPTER 7 POSITIONING FUNCTION (c) Speed change during position control If the target position is reached during the processing for speed change in the case of a speed change during position control or position control of speed/position switching control, a "Speed change not possible" warning (Axis 1 warning code: 1022) occurs and the speed is not changed.
  • Page 120 (f) Speed change to 0 • When bias speed at start is 0 If the bias speed at start is set to 0 and new speed value is changed to 0, the axis stops. However, the Axis 1 busy (SM1840) does not turn off. Even when the axis is stopped, the Axis 1 axis operation status (SD1844) does not change.
  • Page 121 CHAPTER 7 POSITIONING FUNCTION (g) Speed change and "out of setting range" error If an "Outside the acceleration/deceleration time setting" error (Axis 1 error code: 1502) or "Deceleration stop time out of range" error (Axis 1 error code: 1503) occurs at the start of speed change, the Axis 1 axis operation status (SD1844) changes to Error occurring (-1).
  • Page 122: Software Stroke Limit Function

    7.10.4 Software stroke limit function This function prevents execution of a moving command to a position outside the upper/lower limit of the moving range of the workpiece. The range is set using the address established by machine OPR. Limit switch for emergency stop Movable range of work Software stroke limit (lower limit)
  • Page 123 CHAPTER 7 POSITIONING FUNCTION (1) Range check A software stroke limit range check is executed at the start of operation and also during operation. (a) Range check at start of operation The following are checked at start of operation • Whether operation starts from outside the range of software stroke limits •...
  • Page 124 (b) Range check during operation The software stroke limit range check is processed as follows depending on the applicable control. In the table, "error" indicates "Software stroke limit +" (Axis 1 error code: 1103) or "Software stroke limit -" (Axis 1 error code: 1104).
  • Page 125: Hardware Stroke Limit Function

    CHAPTER 7 POSITIONING FUNCTION 7.10.5 Hardware stroke limit function The hardware stroke limit function stops the control (after deceleration) by detecting an input from the upper and lower limit switches that are installed at the upper and lower limit of the physical moving range. Equipment damage can be prevented by this function.
  • Page 126: Target Position Change Function

    7.10.6 Target position change function The target position change function changes the target position set by "Positioning address/movement amount" during position control (including it of speed/position switching control), to a new target position at a desired timing. This function is implemented with the Target position change instruction (IPTPCHG1(P)) ( Page 159, Section 7.12.1 (9)).
  • Page 127 CHAPTER 7 POSITIONING FUNCTION (1) Control details • If the position of the workpiece upon establishment of the execution command for Target position change instruction (IPTPCHG1(P)) is located before the position at which to start decelerating to the new target value over the deceleration stop time, positioning is performed to the new target position.
  • Page 128 (2) Precautions (a) Instruction execution during acceleration/deceleration If the axis was accelerating/decelerating to the command speed when the execution command for Target position change instruction (IPTPCHG1(P)) was established, the workpiece is allowed to reach the command speed, after which positioning to the new target position is performed. If the axis starts decelerating to a stop before reaching the command speed, positioning to the new target position is performed after the axis has decelerated to a stop.
  • Page 129 CHAPTER 7 POSITIONING FUNCTION (g) Axis 1 axis operation status (SD1844) and target position change If the Axis 1 axis operation status (SD1844) is indicating a stopped status (1) or indicating a standby status (0), the target position is not changed. (h) Instruction calculation and positioning completion If positioning based on positioning data completes while the calculation relating to the Target position change instruction (IPTPCHG1(P)) is still in progress, the target position is not changed.
  • Page 130: Acceleration/Deceleration Processing Function

    7.10.7 Acceleration/deceleration processing function The acceleration/deceleration processing function is used to adjust the acceleration/deceleration when OPR control, positioning control or JOG operation is performed. By adjusting the acceleration/deceleration processing according to each control, the control can be implemented in a more detailed manner. (1) Decision of acceleration/deceleration processing method The acceleration/deceleration method is determined by the setting items specified below.
  • Page 131 CHAPTER 7 POSITIONING FUNCTION (2) Trapezoidal acceleration/deceleration, S-curve acceleration/deceleration Set an appropriate method by the positioning parameter "Acceleration/deceleration method selection" ( Page 60, Section 7.3.1 (6)). When S-curve acceleration/deceleration is selected, the motor load can be reduced upon start and during standstill.
  • Page 132: Stop Processing Function

    7.10.8 Stop processing function The following explains the stop processing that takes place when a stop cause occurs during operation. The deceleration time after the occurrence of a stop cause varies depending on the specific control. Control details Deceleration time •...
  • Page 133 CHAPTER 7 POSITIONING FUNCTION (3) Stop processing during speed change If the axis starts decelerating to a stop before the new speed value is reached, the actual deceleration stop time may not become the same as the set value of "Deceleration stop time." When a stop cause occurs in the middle of speed change during speed control Interruption factor Movement when no interruption occurred during speed change (dotted line)
  • Page 134 (6) Pulse output processing upon stop If the axis stops due to occurrence of a stop cause, pulse output currently in progress after elapse of the set deceleration stop time after the start of deceleration stop will continue until one pulse is output. The actual deceleration time may become longer by a maximum of 1s than the deceleration stop time.
  • Page 135: Absolute Position Restoration Function

    CHAPTER 7 POSITIONING FUNCTION 7.11 Absolute Position Restoration Function The absolute position restoration function restores the absolute position of the specified axis using the absolute position detection system. The Absolute position restoration function (IPABRST1) ( Page 152, Section 7.12.1 (6)) is used to adjust the Axis 1 current feed value (SD1840, SD1841) to the actual motor position.
  • Page 136 (2) Communication overview of absolute position detection data As shown below, the detector consists of phase A/B/Z signals for position control during normal operation, an encoder for detecting positions within one rotation, and an accumulative revolution counter for detecting the rotation amount.
  • Page 137 CHAPTER 7 POSITIONING FUNCTION (3) Connection example with a servo amplifier (MR-J3-A) manufactured by Mitsubishi For details, refer to the manual for the MR-J3-A specification. <Servo amplifier> <Programmable controller system> MR-J3-A LCPU ABS transmission data bit 0 0(X0) 22(ABSB0) General-purpose output or ABS transmission data bit 1 16-point output module 1(X1)
  • Page 138 (4) Condition for starting positioning using the absolute position detection system Use the system within the range where conditions 1 and 2 specified below are satisfied. If this range is exceeded, the current value cannot be successfully restored by absolute position restoration. (a) Condition 1: Number of output pulses This is the number of pulses that can be output to the servo amplifier when positioning is performed from the OP using the absolute position detection system.
  • Page 139: Dedicated Instructions

    CHAPTER 7 POSITIONING FUNCTION 7.12 Dedicated Instructions The following table lists and describes dedicated instructions for the positioning function. The table start instruction for Axis 1 is IPPSTRT1(P), and for Axis 2 is IPPSTRT2(P). Instruction Description Reference Axis 1 Axis 2 Start operation based on the desired data number specified among "Positioning Page 138, Section IPPSTRT1(P)
  • Page 140: Details Of Dedicated Instructions

    7.12.1 Details of dedicated instructions (1) Table start instructions: IPPSTRT1(P), IPPSTRT2(P) Command IPPSTRT1 IPPSTRT1 Command IPPSTRT1P IPPSTRT1P Command IPPSTRT2 IPPSTRT2 Command IPPSTRT2P IPPSTRT2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word  ...
  • Page 141 CHAPTER 7 POSITIONING FUNCTION (b) Function • These instructions start operation based on the desired data number specified by "n" among "Positioning data" No.1 to 10 set beforehand using the programming tool. Timing chart when "Positioning data" No.1 is executed Axis 1 Positioning data Starts positioning data No.1.
  • Page 142 (2) Positioning start instructions: IPDSTRT1(P), IPDSTRT2(P) Command IPDSTRT1 IPDSTRT1 Command IPDSTRT1P IPDSTRT1P Command IPDSTRT2 IPDSTRT2 Command IPDSTRT2P IPDSTRT2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word       ...
  • Page 143 CHAPTER 7 POSITIONING FUNCTION (c) Function • These instructions start positioning with data stored in the device specified by and subsequent devices, without using "Positioning data" No.1 to 10 set beforehand using the programming tool. Timing chart when position control is performed by setting the start device number in D0 Using values set for the specified device, Device positioning is started.
  • Page 144 (d) Error In the following cases, an operation error occurs. Error flag (SM0) turns on and an error code is stored into SD0. • Inapplicable device is specified in (Error code: 4101) • The positioning function for the target axis is not set to "Use": (Error code: 4116) (e) Program example Program that starts Axis 1 based on the set positioning data below when M0 turns on...
  • Page 145 CHAPTER 7 POSITIONING FUNCTION (3) Two-axes simultaneous start instruction: IPSIMUL(P) Command IPSIMUL IPSIMUL Command IPSIMULP IPSIMULP Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word         ...
  • Page 146 (b) Function • This instruction start positioning using the "Positioning data" number for Axis 1 specified by "n1", and positioning using the "Positioning data" number for Axis 2 specified by "n2", simultaneously. Timing chart when positioning data No.1 for Axis 1 and positioning data No.10 for Axis 2 are started simultaneously Positioning execution for axis 1...
  • Page 147 CHAPTER 7 POSITIONING FUNCTION (c) Error In the following cases, an operation error occurs. Error flag (SM0) turns on and an error code is stored into SD0. • A value other than 1 to 10 is specified in "n1" or "n2": (Error code: 4100) •...
  • Page 148 (4) Original position return start instructions: IPOPR1(P), IPOPR2(P) Command IPOPR1 IPOPR1 Command IPOPR1P IPOPR1P Command IPOPR2 IPOPR2 Command IPOPR2P IPOPR2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word     ...
  • Page 149 CHAPTER 7 POSITIONING FUNCTION (c) Function • These instructions start OPR of the type specified by Near-point dog method Machine OPR execution IPOPR1(P) execution command Near-point watchdog signal Zero signal Deviation counter clear signal 10ms Axis 1 start instruction in execution (SM1848) Axis 1 BUSY (SM1840) Axis 1 positioning...
  • Page 150 The following operations take place in the case of fast OPR OP or standby address Fast OPR IPOPR1(P) execution command Axis 1 start instruction in execution (SM1848) Axis 1 BUSY (SM1840) Axis 1 positioning complete (SM1841) • When fast OPR starts successfully, the Axis 1 busy (SM1840) turns on. (1)) •...
  • Page 151 CHAPTER 7 POSITIONING FUNCTION (5) JOG start instructions: IPJOG1, IPJOG2 Command IPJOG1 IPJOG1 Command IPJOG2 IPJOG2 Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word         ...
  • Page 152 (c) Function • These instructions perform JOG operation in the direction specified by using the JOG speed, JOG ACC time and JOG DEC time stored in onwards. Decelerating by JOG DEC time Accelerating by JOG ACC time JOG speed JOG operation IPJOG1 execution command Axis 1 start instruction in execution (SM1848)
  • Page 153 CHAPTER 7 POSITIONING FUNCTION (e) Program example Program that starts forward JOG when M0 turns on, and reverse JOG when M1 turns on. Device used Item Setting item D0, D1 JOG speed 10000 (pulse/s) JOG ACC time 1000 (ms) JOG DEC time...
  • Page 154 (6) Absolute position restoration instructions: IPABRST1, IPABRST2 Command IPABRST1 IPABRST1 Command IPABRST2 IPABRST2 Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word            ...
  • Page 155 CHAPTER 7 POSITIONING FUNCTION (c) Function • These instructions perform absolute position restoration of the specified axis via communication with the servo amplifier using the input device and output device specified by , respectively. IPABRST1(P) execution command Axis 1 start instruction in execution (SM1848) Axis 1 BUSY (SM1840) Axis 1 positioning complete...
  • Page 156 (7) Axis stop instructions: IPSTOP1, IPSTOP2 Command IPSTOP1 IPSTOP1 Command IPSTOP2 IPSTOP2 Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word            ...
  • Page 157 CHAPTER 7 POSITIONING FUNCTION (a) Function • These instructions stop the operation of the specified axis. Timing chart when the positioning started by the Table start instruction (IPPSTRT1(P)) is stopped Positioning execution IPPSTRT1(P) execution command IPSTOP1 execution command Turn it on more than 2ms. This command may not be Axis 1 start instruction in detected in the case of 2ms...
  • Page 158 (8) Speed change instructions: IPSPCHG1(P), IPSPCHG2(P) Command IPSPCHG1 IPSPCHG1 Command IPSPCHG1P IPSPCHG1P Command IPSPCHG2 IPSPCHG2 Command IPSPCHG2P IPSPCHG2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word       ...
  • Page 159 CHAPTER 7 POSITIONING FUNCTION (c) Function • These instructions change the speed using the ACC/DEC at speed change, DEC/STOP time at speed change, and new speed value stored in onward. Timing chart when the speed is changed during positioning which was started by the Table start instruction (IPPSTRT1(P)) Accelerating by ACC/DEC time at speed change Decelerating by DEC/STOP time...
  • Page 160 (e) Program example Program that changes the Axis 1 speed when M0 turns on Device used Item Setting item ACC/DEC time at speed change 2000 (ms) DEC/STOP time at speed change 1000 (ms) D2, D3 New speed value 20000 (pulse/s)
  • Page 161 CHAPTER 7 POSITIONING FUNCTION (9) Target position change instructions: IPTPCHG1(P), IPTPCHG2(P) Command IPTPCHG1 IPTPCHG1 Command IPTPCHG1P IPTPCHG1P Command IPTPCHG2 IPTPCHG2 Command IPTPCHG2P IPTPCHG2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word  ...
  • Page 162 (c) Function • These instructions change the target position to the new value specified by Timing chart when the address is changed during positioning which was started by the Table start instruction (IPPSTRT1(P)) Positioning execution New target position First target position IPPSTRT1(P) execution command IPTPCHG1(P) execution command Axis 1 start instruction in...
  • Page 163: Precautions On Dedicated Instructions

    CHAPTER 7 POSITIONING FUNCTION 7.12.2 Precautions on dedicated instructions (1) Multiple instruction executions (a) Axis 1 start instruction (SM1848) and execution of instructions When the Axis 1 start instruction (SM1848) is on, any attempt to perform positioning of the same axis by each of the following instructions is ignored.
  • Page 164 (5) Pulse instructions The pulse instructions such as IPPSTRT1P and IPSIMULP are executed at the leading edge of their execution command. If these instructions are used in an interrupt program or subroutine, they are not executed until the second or later leading edge of their execution command is detected. Executing the IPPSTRT1P in an interrupt program IPPSTRT1P IPPSTRT1P...
  • Page 165: Programming

    CHAPTER 7 POSITIONING FUNCTION 7.13 Programming This section describes the programs for the positioning function. When applying the program examples provided in this section to an actual system, properly verify the applicability and reliability of the control on the system.
  • Page 166 (1) Programming procedure For program examples, refer to  Page 169, Section 7.13 (3). Start Use positioning data set with the programming tool? Data setting programs Position control (ABS) Position control (INC) Speed/position switching control (forward) Speed/position switching control (reverse) Current value change Speed control (forward) Speed control (reverse)
  • Page 167 CHAPTER 7 POSITIONING FUNCTION (2) System configuration and programing condition The following system configuration is used to introduce program examples. (a) System configuration LCPU Servo amplifier LY42NT1P (Y60 to Y9F) X50 to X52 (for absolute LX42C4 (X20 to X5F) position restoration) Y60 to X62 (for absolute position restoration) Servomotor...
  • Page 168 (b) Programming conditions Device Function Stop command Axis 1 machine original position return start selection Axis 1 fast OPR (OP address) start selection Axis 1 fast OPR (standby address) start selection Axis 1 original position return start command Axis 1 positioning start command (table start) Current start command Axis 1 position control (ABS) start selection Axis 1 position control (INC) start selection...
  • Page 169 CHAPTER 7 POSITIONING FUNCTION Device Function New speed value Target position change value D100 Control system D101 Acceleration/deceleration time D102 Deceleration stop time D103 Dwell time Position control (ABS) start data D104 Command speed D105 D106 Positioning address/movement amount D107 D110 Control system D111...
  • Page 170 Device Function D150 Control system D151 Acceleration/deceleration time D152 Deceleration stop time D153 Dwell time Speed control (forward run) start data D154 Command speed D155 D156 Positioning address/movement amount D157 D160 Control system D161 Acceleration/deceleration time D162 Deceleration stop time D163 Dwell time Speed control (reverse run) start data...
  • Page 171 CHAPTER 7 POSITIONING FUNCTION (3) Program example Positioning programs for Axis 1 are shown below. (a) Data setting program • Position control Control method: Position control (ABS) ACC/DEC time: 1000ms DEC/STOP time: 1000ms Dwell time: 100ms Command speed: 30000 pulses/s Positioning address/movement amount: 250000 pulses Control method: Position control (INC)
  • Page 172 • Current value change Control method: Current value change ACC/DEC time: 0ms DEC/STOP time: 0ms Dwell time: 0ms Command speed: 0 pulses/s Positioning address/movement amount: 250000 pulses • Speed control Control method: Speed control (forward run) ACC/DEC time: 1000ms DEC/STOP time: 1000ms Dwell time: 0ms Command speed: 30000 pulses/s Positioning address/movement...
  • Page 173 CHAPTER 7 POSITIONING FUNCTION (d) OPR start program Selection of OPR type: Machine OPR Axis 1 OPR enable/disable setting: On Selection of OPR type: Fast OPR (OP address) Axis 1 OPR enable/disable setting: On Axis 1 OPR enable/disable setting: Off Selection of OPR type: Fast OPR (standby address) Axis 1 OPR enable/disable setting: On...
  • Page 174 (h) JOG operation program Direction of JOG operation: Forward run Forward JOG command Direction of JOG operation: Reverse run Reverse JOG command JOG speed (forward run): 10000 pulses/s JOG ACC time: 10000s JOG DEC time: 10000s Dedicated instruction (IPJOG1) (i) Speed change program ACC/DEC time at speed change: 1000ms DEC/STOP time at speed change:...
  • Page 175: Errors And Warnings

    CHAPTER 7 POSITIONING FUNCTION 7.14 Errors and Warnings This section describes errors and warnings of the positioning function. (1) Error When an error occurs, the following operations are performed. • The I/O ERR. LED turns on. • The Axis 1 error (SM1845) turns on. •...
  • Page 176 The following table lists the Axis  error codes. Axis  error code Operation at error Error name Description Corrective action (decimal) occurrence Axis 1 Axis 2 The hardware stroke limit At start: Operation starts from a position Hardware 1100 2100 (upper limit signal) turned where the limit signal is on.
  • Page 177 CHAPTER 7 POSITIONING FUNCTION Axis  error code Operation at error Error name Description Corrective action (decimal) occurrence Axis 1 Axis 2 The OPR method is Stopper 2 or 3 and a zero Machine OPR control is Turn off the zero signal and then perform 1200 2200 Zero signal ON...
  • Page 178 Axis  error code Operation at error Error name Description Corrective action (decimal) occurrence Axis 1 Axis 2 At start: Operation is not started. During operation: • During speed control (including speed control The set value of JOG DEC of speed/position Deceleration time, deceleration stop Set the JOG DEC time, deceleration stop...
  • Page 179 CHAPTER 7 POSITIONING FUNCTION (2) Warning When a warning occurs, the following operations are performed. • The Axis 1 warning (SM1846) turns on. • A warning code corresponding to the warning is stored to the Axis 1 warning code (SD1846) in decimal. Different from errors, occurrence of a warning does not stop the operation of the axis.
  • Page 180: Monitoring With A Programming Tool

    7.15 Monitoring with a Programming Tool When the positioning function is executed, the operating status can be checked on the "Positioning Monitor" window of the programming tool. [Tool]  [Built-in I/O Module Tool] For details, refer to the following. GX Works2 Version 1 Operating Manual (Common)
  • Page 181: Chapter 8 High-Speed Counter Function

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION CHAPTER 8 HIGH-SPEED COUNTER FUNCTION Overview (1) Definition This function counts the number of high-speed input pulses that cannot be measured by general counter. (2) Features The high-speed counter function is controlled by parameters and dedicated instructions. LCPU PWM output mode PWM output ON time...
  • Page 182 (3) Function list The following table lists and describes available functions of the high-speed counter function. Operation mode Item Description where the function Reference can be used Counts pulses within the range of -2147483648 Page 199, Section Linear counter function to 2147483647, and detects an overflow or an 8.4 (1) underflow if the count range is exceeded.
  • Page 183: Procedure For Performing The High-Speed Counter Function

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.1.1 Procedure for performing the high-speed counter function The following flowchart shows the procedure. Start Connecting to external devices ( Page 182, Section 8.2) Connect an external device. Setting parameters ( Page 191, Section 8.3) Configure common settings such as operation mode in a programming tool.
  • Page 184: Connecting To External Devices

    Connecting to External Devices 8.2.1 I/O signals The following shows the internal circuits on interfaces for connecting LCPU external devices using schematic drawings.  in a signal name indicates either 1 (CH1) or 2 (CH2). For I/O signal settings, refer to  Page 191, Section 8.3.
  • Page 185 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) Output (a) L02SCPU, L02CPU, L06CPU, L26CPU, L26CPU-BT Pin number Internal circuit Signal name Coincidence output No.1 signal (EQU 1) Insulating element Coincidence output No.2 signal (EQU 2) Insulating element Insulating element (Not used for the high-speed counter function) Insulating element Output common...
  • Page 186 (3) Details of I/O signals The following table lists and describes the I/O signals of the connector for LCPU external devices. Category Signal name Description Phase A (PULSE A) Pulse input signal. Pulses input to these signals are counted according to the operation mode set for the phases A and B.
  • Page 187: Wiring

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.2.2 Wiring This section describes wiring to an encoder and a controller. For connectors used for external wiring, refer to the  MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection). (1) Wiring precautions •...
  • Page 188 (3) Example of wiring to an encoder Characters in the parentheses of the terminal part indicate the pin number of CH2. (a) Example of wiring to an open collector output type encoder (24VDC) Encoder LCPU Shielded twisted pair cable +24V Phase A B20(A20) DIFF...
  • Page 189 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (b) Example of wiring to a line driver (equivalent to AM26LS31) encoder LCPU Encoder Phase A Shielded twisted B20(A20) pair cable DIFF B19(A19) B18(A18) Shield Phase B Shielded twisted B17(A17) pair cable DIFF B16(A16) B15(A15) Shield (4) Example of wiring between a controller and external input signals Characters in the parentheses of the terminal part indicate the pin number of CH2.
  • Page 190 (b) Example of wiring when the controller is a line driver LCPU Controller Phase Z Shielded twisted B14(A14) pair cable DIFF B13(A13) Shield B12(A12)
  • Page 191 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (5) Example of wiring to an external output device (a) L02SCPU, L02CPU, L06CPU, L26CPU, L26CPU-BT LCPU Load B5(A5) Load B4(A4) 5 to 24VDC B1(A1) When connecting an inductive load, connect a diode to the load in parallel to prevent the back EMF from being generated for output element protection.
  • Page 192 (b) L02SCPU-P, L02CPU-P, L06CPU-P, L26CPU-P, L26CPU-PBT LCPU Load B5(A5) Load B4(A4) 5 to 24VDC B1(A1) When connecting an inductive load, connect a diode to the load in parallel to prevent the back EMF from being generated for output element protection. Back EMF Load...
  • Page 193: Parameter Settings

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION Parameter Settings Set parameters for each channel. Click the button in the "Built-in I/O Function Setting" tab. Project window  [Parameter]  [PLC Parameter]  "Built-in I/O Function Setting" tab Select the "Use high-speed counter function (CH1)" checkbox on the top left on the "High-speed Counter CH1 Detailed Setting"...
  • Page 194 Operation mode Item Description Default where the setting Reference can be used Select whether to perform the preset Coincidence Output Time Preset function on the rising edge of CH1 Page 207, Not preset Setting Counter value coincidence (No.1) Section 8.4.2 (1) (SM1881).
  • Page 195: Common Settings

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.3.1 Common settings This section describes settings common to some operation modes. (1) Operation mode setting According to the application, select an operation mode from the following five modes. The setting items depend on the selected operation mode. For required settings and available functions for each operation mode, refer to the following table.
  • Page 196 (a) Internal clock By setting the internal clock, clock frequencies generated at the inside of the LCPU can be counted as input pulses. For example, when the internal clock is used together with the coincidence output function, an on delay timer can be configured.
  • Page 197 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (3) Pulse input mode Select the mode of pulses input to the pulse input signals of phases A and B. The mode can be set when "A Phase/B Phase" has been selected for Count Source Selection. The following eight pulse input modes are available.
  • Page 198 Pulse input Count timing method Counts on the rising edge () of A. For counting up B is off. CW/CCW A is off. For counting down Counts on the rising edge () of B. Counts on the rising edge () of A while B is off. For counting up 2-phase multiple of 1 Counts on the falling edge () of A while B is off.
  • Page 199 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION The overview of external connections regarding pulse input is as follows. 1-phase pulse input 1-phase pulse input (phase A only) LCPU LCPU Pulse input Pulse input Encoder Encoder B or CH1 subtraction count command (SM1894) CW/CCW pulse input 2-phase pulse input LCPU...
  • Page 200: Normal Mode

    Normal Mode This section describes settings that become valid and functions that can be used when "Normal Mode" is selected for "Operation Mode Setting". The following table shows I/O signals used in this mode. : Wiring required, : Wiring required when necessary, : Wiring not required Input signal Output signal Count source...
  • Page 201 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (1) Counter type Select the high-speed counter type. • Linear counter: Counts pulses within the range of -2147483648 to 2147483647. • Ring counter: Counts pulses within the range between the ring counter upper limit value and the lower limit value.
  • Page 202 (b) Operations of the ring counter This counter type counts pulses repeatedly within the range within the range between the ring counter upper limit value and the lower limit value. These limit values are set by the ring counter upper/lower limit value write instruction (ICRNGWR1(P)) (...
  • Page 203 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION • Count range of the ring counter The count range differs depending on the CH1 Current value (SD1880, SD1881) when preset is performed or CH1 Count enable command (SM1895) is turned on, upper limit value and lower limit value. When setting the ring counter lower limit value to -50000 and the ring counter upper limit value to 100000 (except for Range 3) Count range...
  • Page 204: Preset

    8.4.1 Preset This function overwrites CH1 Current value (SD1880, SD1881) with a value set to Preset value write instruction (ICPREWR1(P)) (preset value) and counts pulses starting from the set value ( Page 245, Section 8.10.1 (3)). The following methods are available. •...
  • Page 205 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) Details of the preset (a) Preset by phase Z input With phase Z input, the current value is replaced with the preset value when the set trigger condition is met. Operation when "Z Phase (Preset) Trigger Setting" is set to "Rising" and "External Preset (Z Phase) Request Detection Setting"...
  • Page 206 (b) Preset by a program When not using a phase Z and the counter function selection, perform the preset function by turning on CH1 Preset command (SM1893) by a program. CH1 count enable command (SM1895) Counter input pulse Preset value setting CH1 preset command (SM1893) 65 66 100 101 102103 104...
  • Page 207: Coincidence Output

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.4.2 Coincidence output Coincidence output is a function by which a signal can be output when a value set by the coincidence output point write instruction (ICCOVWR1(P)) matches the CH1 Current value (SD1880, SD1881) ( Page 250, Section 8.10.1 (6)).
  • Page 208 Description of operation By executing the Coincidence output point write instruction (ICCOVWR1(P)), any value can be written to the coincidence output No.1 point setting area. When the following condition is met, CH1 Counter value smaller (No.1) (SM1882) turns on. • CH1 Current value (SD1880 or SD1881) < Coincidence output No.1 point setting When CH1 Coincidence signal No.1 reset command (SM1890) is turned on, CH1 Counter value coincidence (No.1) (SM1881) and the Coincidence output No.1 signal turn off.
  • Page 209 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (1) Coincidence output time preset setting Select whether to set a preset value on the rising edge of CH1 Counter value coincidence (No.1) (SM1881). • Not preset • Preset This setting is used for an operation such as sizing. Note, however, that this setting is not available for CH1 Counter value coincidence (No.2) (SM1884).
  • Page 210: Coincidence Detection

    8.4.3 Coincidence detection When a match is detected, an interrupt request can be issued to start an interrupt program. There are four points of interrupt factors (interrupt pointers, I0 to I3). I Number Interrupt factor Coincidence detection of CH1 Coincidence output No.1 point setting Coincidence detection of CH1 Coincidence output No.2 point setting Coincidence detection of CH2 Coincidence output No.1 point setting Coincidence detection of CH2 Coincidence output No.2 point setting...
  • Page 211 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) Changing the interrupt pointer numbers Configure the settings in the "Interrupt Function Module Interrupt Pointer Setting" window. Click the button in the "PLC System" tab. Project window  [Parameter]  [PLC Parameter]  "PLC System" tab Set the interrupt pointer start No., interrupt pointer count, start I/O No., and start SI No.
  • Page 212 (a) Precautions When there is no high-speed counter with the coincidence detection output setting and no input interrupt within the range specified in the "Intelligent Function Module Interrupt Pointer Setting" of PLC Parameter, "PARAMETER ERROR" occurs (error code: 3000). The following are a correct example and an incorrect example of assigning the interrupt pointers of the high- speed counter to I50 and higher as shown above.
  • Page 213: Counter Function Selection

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.4.4 Counter function selection The following counter functions are selectable. • Latch counter function: Latches the current value of the counter. • Count disabling function: Stops the counting while it is enabled. • Sampling counter function: Counts the pulses input during the specified sampling time. •...
  • Page 214 A time lag occurs before start of the selected function due to any of the following factors: • Input response time of the Function input signal • Program scan time (for CH1 Selected counter function start command (SM1896)) • Internal control cycle (1ms) of the high-speed function (for CH1 Selected counter function start command (SM1896)) The count error is as follows: •...
  • Page 215 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) Details on each function (a) Latch counter function CH1 Current value (SD1880 and SD1881) can be latched by setting in "Counter Function Selection" or by using the Latch counter input signal. • Using "Counter Function Selection": Select "Latch Counter Function" or "Latch Counter/Preset/replace Function"...
  • Page 216 (b) Count disabling function Counting can be stopped while CH1 Count enable command (SM1895) is on. To use this function, select "Count Disabling Function" for "Counter Function Selection." CH1 count enable command (SM1895) CH1 selected counter function start command (SM1896) Function input signal Pulse actually input CH1 current value...
  • Page 217 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (c) Sampling counter function The pulses input during the specified sampling time (Sampling time setting ( Page 211, Section 8.4.4 (1) (b))) can be counted. The sampling count value can be read out into the specified device by the Sampling count value read instruction (ICSMPRD1(P)) (...
  • Page 218 • Precautions • While either of CH1 Selected counter function start command (SM1896) or the Function input signal is on, turning on the other does not perform the sampling counter function. If CH1 Selected counter function start command (SM1896) or the Function input signal is turned on during execution of the sampling counter function, the sampling time measurement will continue.
  • Page 219 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (d) Count disable/preset function The count disable function and the preset function can be performed depending on changes of the Function input signal without switching the function. CH1 count enable command (SM1895) Preset value setting Function input signal Pulse actually input CH1 current value...
  • Page 220 The explanation in this section is based on the case where the Function Input Logic Setting is set to Positive Logic (default). The execution timing of the count disable function and the preset function in the case of Negative Logic setting is as shown below.
  • Page 221 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (e) Latch counter/preset/replace function The latch counter function and the preset function can be performed depending on changes of the Function input signal without switching the function. CH1 count enable command (SM1895) Preset value setting Function input signal Pulse actually input CH1 current value...
  • Page 222: Frequency Measurement Mode

    Frequency Measurement Mode This section describes settings and functions that become valid when "Frequency Measurement Mode" is selected for "Operation Mode Setting". In this mode, the pulses input from phase A and phase B pulse input signals are counted, and the frequency is automatically calculated from the pulses. The measured frequency value is written to the specified device using the Frequency measurement instruction (ICFCNT1) (...
  • Page 223 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (1) Required settings (a) Frequency movement averaging processing count The frequency measurement function performs moving average processing to reduce the unevenness among the measured frequencies. The setting range is 1 to 100 (times). When "1" is set, the processing is not performed.
  • Page 224 (4) Measurement example In this example, frequency is measured under the following conditions. • Actual frequency: 1234Hz • Frequency measurement unit time: 0.01s • Frequency movement averaging processing count: 1 (The moving average processing is not performed.) (a) Count value per time unit Count value per time unit for the actual frequency is calculated as follows using the formula in (...
  • Page 225 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (c) Reducing unevenness When the frequency movement averaging processing count setting is changed to "4", frequency error (maximum) will be as follows. 60(ppm) Error (maximum) (Hz) = 1234(Hz) 1000000 0.01(s) = 0.07404(Hz) + 25(Hz) = 25.07404(Hz) The measured frequency value in this example is 1225Hz or 1250Hz.
  • Page 226 (5) Function details The following example describes the frequency measurement operation. Operation when the frequency measurement unit time is set to "0.1s" and the frequency movement averaging processing count is set to "4" 0.1s 0.1s Frequency 1st storage (a) 2nd storage (b) 3rd storage (c) t (s) Frequency measurement...
  • Page 227 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (a) Precautions To restart frequency measurement after an interruption, execute Frequency measurement instruction (ICFCNT1) after "stopped (0)" is stored in CH1 Frequency measurement flag (SD1882. b4). If another execution command of CH1 Frequency measurement instruction (ICFCNT1) is turned on, failing to check Frequency measurement flag (SD1882.
  • Page 228: Rotation Speed Measurement Mode

    Rotation Speed Measurement Mode This section describes settings and functions that become valid when "Rotation Speed Measurement Mode" is selected for "Operation Mode Setting". In this mode, the pulses input phase A and phase B pulse input signals are counted, and the rotation speed is automatically calculated from the pulses. The measured rotation speed value is written to the specified device using the Rotation speed measurement instruction (ICRCNT1) (...
  • Page 229 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (1) Required settings (a) Rotation speed movement averaging processing count The rotation speed measurement function performs moving average processing to reduce the unevenness among the measured rotation speed. The setting range is 1 to 100. When "1" is set, the processing is not performed.
  • Page 230 (4) Measurement example In this example, rotation speed is measured under the following conditions. • Actual rotation speed: 1234r/min • Rotation speed measurement unit time: 0.01s • Rotation speed movement averaging processing count: 1 (The moving average processing is not performed.) •...
  • Page 231 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (c) Reducing unevenness When the rotation speed movement averaging processing count setting is changed to "4", rotation speed error (maximum) will be as follows. 60(ppm) Error (maximum) (r/min) = 1234(r/min) 1000000 0.01(s) 60(pulse) = 0.07404(r/min) + 25(r/min) = 25.07404(r/min) The measured rotation speed value in this example is 1225r/min or 1250r/min.
  • Page 232 (5) Function details The operation of rotation speed measurement is shown below. Operation when the rotation speed measurement unit time is set to "0.1s" and the rotation speed movement averaging processing count is set to "4" 0.1s 0.1s Rotation speed 1st storage (a) 2nd storage (b) 3st storage (c)
  • Page 233 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (a) Precautions To restart frequency measurement after an interruption, execute Rotation speed measurement instruction (ICRCNT1) after "stopped (0)" is stored in CH1 Rotation speed in-measurement flag (SD1882.b5). If another execution command of Rotation speed measurement instruction (ICRCNT1) is turned on, failing to check CH2 Rotation speed in-measurement flag (SD1882.b5), while the measurement is being executed, the command may be ignored because the current measurement does not stop.
  • Page 234: Pulse Measurement Mode

    Pulse Measurement Mode This section describes settings and functions that become valid when "Pulse Measurement Mode" is selected for "Operation Mode Setting". In this mode, the on or off width of pulses that are input to Function input signal is measured.
  • Page 235 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (1) Required settings (a) Pulse measurement target setting Select a target of pulse measurement from "Pulse ON Width" and "Pulse OFF Width". ON width OFF width • The range of pulses that can be measured Pulses can be measured within the range from 2000 to 2147483647 (0.2ms to approx.
  • Page 236 (2) Function details The following example describes the pulse measurement operation. Pulse ON Width" is selected for "Pulse Measurement Target Setting" Pulse measurement start command (SM1898) Function input signal Pulse measurement value Pulse in-measurement flag (SD1882.b6) Description of operation When CH1 Pulse measurement start command turns on, 0 is set as a measured pulse value and then "operating (1)" is stored in CH1 Pulse measurement flag (SD1882.b6).
  • Page 237: Pwm Output Mode

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION PWM Output Mode This section describes settings and functions that become valid when "PWM Output Mode" is selected for "Operation Mode Setting". With this mode, PWM waveforms at a maximum of 200kHz can be output from Coincidence output No.1 signal.
  • Page 238 (1) Required settings (a) Output waveform setting Store the values of on width and a cycle in the setting data of PWM output instruction (ICPWM1). Setting item Setting range Description PWM output on width setting value 0 or 10 to 10000000 (0.1s) Set the on width of output pulses.
  • Page 239 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) Function details The operation of PWM output is shown below. PWM output instruction execution command 1000 PWM output on width setting value PWM output cycle setting value 2000 Coincidence output No.1 signal CH1 PWM output flag (SD1882.
  • Page 240: Specifications

    Specifications (1) Performance specifications The following is the performance specifications of the high-speed counter function. Description L02SCPU-P, L02CPU-P, Item L02SCPU, L02CPU, L06CPU, L06CPU-P, L26CPU-P, L26CPU, L26CPU-BT L26CPU-PBT Number of channels 1-phase input (1 multiple/2 multiples), Phase CW/CCW, 2-phase input (1 multiple/2 multiples/4 multiples) Count input DC input 24VDC, 6.0mA (TYP.)
  • Page 241 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION Description L02SCPU-P, L02CPU-P, Item L02SCPU, L02CPU, L06CPU, L06CPU-P, L26CPU-P, L26CPU, L26CPU-BT L26CPU-PBT Pulse width (ON width: 200s or more, OFF width: 200s or Measurement item more) Pulse width measurement Measurement resolution 5s Number of measurement points 1 point/channel Pulse width (ON width: 200s or more, OFF width: 200s or Measurement item...
  • Page 242 (2) Special relay and special register The following table lists the special relay (SM) and special register (SD) relevant to the high-speed counter function.  in the name indicates either of 1 (CH1) or 2 (CH2). For details, refer to the  MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection).
  • Page 243: Dedicated Instructions

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.10 Dedicated Instructions The following table lists and describes dedicated instructions for the high-speed counter function. The current value read instruction for CH1 is ICCNTRD1(P) and for CH2 is ICCNTRD2(P). Instruction Description Reference ICCNTRD1(P) ICCNTRD2(P) Stores the current counter value in the special register.
  • Page 244: Details Of Dedicated Instructions

    8.10.1 Details of dedicated instructions (1) Current value read instructions: ICCNTRD1(P), ICCNTRD2(P) Command ICCNTRD1 ICCNTRD1 Command ICCNTRD1P ICCNTRD1P Command ICCNTRD2 ICCNTRD2 Command ICCNTRD2P ICCNTRD2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word ...
  • Page 245 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) Ring counter upper/lower limit value write instructions: ICRNGWR1(P), ICRNGWR2(P) Command ICRNGWR1 ICRNGRWR1 Command ICRNGWR1P ICRNGRWR1P Command ICRNGWR2 ICRNGRWR2 Command ICRNGWR2P ICRNGRWR2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word ...
  • Page 246 (c) Error In the following cases, an operation error occurs. Error flag (SM0) turns on and an error code is stored into SD0. • Ring counter lower limit value is greater than ring counter upper limit value (Error code: 4100) •...
  • Page 247 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (3) Preset value write instructions: ICPREWR1(P), ICPREWR2(P) Command ICPREWR1 ICPREWR1 Command ICPREWR1P ICPREWR1P Command ICPREWR2 ICPREWR2 Command ICPREWR2P ICPREWR2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word ...
  • Page 248 (4) Latch counter value read instructions: ICLTHRD1(P), ICLTHRD2(P) Command ICLTHRD1 ICLTHRD1 Command ICLTHRD1P ICLTHRD1P Command ICLTHRD2 ICLTHRD2 Command ICLTHRD2P ICLTHRD2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word     ...
  • Page 249 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (c) Error In the following cases, an operation error occurs. Error flag (SM0) turns on and an error code is stored into SD0. • Other than 1 or 2 is specified to n. (Error code: 4100) •...
  • Page 250 (5) Sampling count value read instructions: ICSMPRD1(P), ICSMPRD2(P) Command ICSMPRD1 ICSMPRD1 Command ICSMPRD1P ICSMPRD1P Command ICSMPRD2 ICSMPRD2 Command ICSMPRD2P ICSMPRD2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word     ...
  • Page 251 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (c) Error In the following cases, an operation error occurs. Error flag (SM0) turns on and an error code is stored into SD0. • Inapplicable device is specified in (Error code: 4101) • The device specified in is exceeding its range.
  • Page 252 (6) Coincidence output point write instructions: ICCOVWR1(P), ICCOVWR2(P) Command ICCOVWR1 ICCOVWR1 Command ICCOVWR1P ICCOVWR1P Command ICCOVWR2 ICCOVWR2 Command ICCOVWR2P ICCOVWR2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word     ...
  • Page 253 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (c) Error In the following cases, an operation error occurs. Error flag (SM0) turns on and an error code is stored into SD0. • Other than 1 or 2 is specified to n. (Error code: 4100) •...
  • Page 254 (7) Frequency measurement instructions: ICFCNT1, ICFCNT2 Command ICFCNT1 ICFCNT1 Command ICFCNT2 ICFCNT2 Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word            (a) Setting data Setting data Setting item Setting range...
  • Page 255 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (8) Rotation speed measurement instructions: ICRCNT1, ICRCNT2 Command ICRCNT1 ICRCNT1 Command ICRCNT2 ICRCNT2 Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word       ...
  • Page 256 (9) Measured pulse value read instructions: ICPLSRD1(P), ICPLSRD2(P) Command ICPLSRD1 ICPLSRD1 Command ICPLSRD1P ICPLSRD1P Command ICPLSRD2 ICPLSRD2 Command ICPLSRD2P ICPLSRD2P Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word     ...
  • Page 257 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (10)PWM output instructions: ICPWM1, ICPWM2 Command ICPWM1 ICPWM1 Command ICPWM2 ICPWM2 Internal device J\ Constant R, ZR Setting data U\G Z Others Word Word K, H Word         ...
  • Page 258 (b) Function This instruction outputs PWM waveforms. The PWM waveform of the on width ( +1) and cycle ( +1) is output from the coincidence output No.1 signal while ICPWM1 is being executed. Outputting of the PWM waveform starts from the off status of the instruction. The number of steps is basically three.
  • Page 259: Precautions On Dedicated Instructions

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.10.2 Precautions on dedicated instructions This section describes the precautions for the following instructions. • ICFCNT1 • ICRCNT1 • ICPWM1 (1) Multiple instruction executions in one scan The instruction may not be successfully processed if it is executed to the same channel more than one time in one scan.
  • Page 260: Programming

    8.11 Programming This section describes the programs for the high-speed counter function. When applying the program examples provided in this section to an actual system, properly verify the applicability and reliability of the control on the system. (1) Programming procedure Start Use it in Normal mode? Common programs in Normal mode...
  • Page 261 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (2) System configuration and programing condition The following system configuration is used to introduce program examples. (a) System configuration LCPU CH1 encoder LY42NT1P (Y70 to YAF) CH2 encoder LX42C4 (X30 to X6F) (b) Programming conditions Device Function CH1 Count start signal...
  • Page 262 Device Function D2008 CH1 Measured frequency value storage D2009 D2010 CH1 Measured rotation value storage D2011 D2012 CH1 Measured pulse value storage D2013 D2014 CH1 Error code storage D2015 CH1 Warning code storage D2020 CH1 Error code acquisition D2021 CH1 Warning code acquisition SM1881 CH1 Counter value coincidence (No.1) SM1887...
  • Page 263 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (3) Program example The following are program examples of CH1. Note that the coincidence output signal No.2 is on by default (not indicated in the examples below). Also note that when CH1 Coincidence output enable command (SM1892) turns on, Coincidence output No.2 signal also turns on.
  • Page 264 (h) Latch counter and preset function program A latch count value is stored in D2002. (i) Overflow detection processing program Overflow occurrence confirmation LED signal (j) Frequency measurement mode program A measured frequency value is stored in D2008. (k) Rotation speed measurement mode program A measured rotation speed value is stored in D2010.
  • Page 265 CHAPTER 8 HIGH-SPEED COUNTER FUNCTION (4) Program example with the coincidence detection interrupt function This section introduces an example of interrupt program where CH1 Counter value coincidence (No.1) (SM1881) is used. Before using an interrupt pointer, enable an interruption with the IMASK instruction. For details on the IMASK instruction, refer to the ...
  • Page 266 (c) Program example Program for the high-speed counter function Interrupt program...
  • Page 267: Errors And Warnings

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.12 Errors and Warnings This section describes errors and warnings of the high-speed counter function. (1) Error When an error occurs, the following operations are performed. • The I/O ERR. LED turns on. • CH1 Error (SM1887) turns on. •...
  • Page 268 (2) Warning When a warning occurs, the following operations are performed. • CH1 Warning (SM1888) turns on. • A warning code corresponding to the warning is stored to the CH1 Warning code (SD1888) in decimal. Different from errors, occurrence of a warning does not stop the operation of CH1. The SD value is always updated with the latest warning code.
  • Page 269: When The Lcpu Stops Operation

    CHAPTER 8 HIGH-SPEED COUNTER FUNCTION 8.13 When the LCPU Stops Operation The following shows the function status when the LCPU stopped its operation. Function Operation Linear counter function Ring counter function Preset function Coincidence Preset at coincidence output function output Coincidence detection interrupt function function Latch counter function...
  • Page 270: Monitoring With A Programming Tool

    8.14 Monitoring with a Programming Tool When the high-speed function is executed, the operating status can be checked on the "High-Speed Counter Monitor" window of the programming tool. [Tool]  [Built-in I/O Module Tool] For details, refer to the  GX Works2 Version1 Operating Manual (Common).
  • Page 271: Appendices

    APPX APPENDICES Appendix 1 Processing Time of Each Instruction The following tables list operation processing time values of the instructions introduced in this manual. For the operation processing time of the LCPU, refer to the following.  MELSEC-Q/L Programming Manual (Common Instruction) (1) Dedicated instructions for the positioning function Processing time (s) L06CPU, L06CPU-P,...
  • Page 272 (2) Dedicated instructions for the high-speed counter function Processing time (s) L06CPU, L06CPU-P, Category Instruction Condition L02SCPU, L02SCPU-P L02CPU, L02CPU-P L26CPU, L26CPU-P, L26CPU-BT, L26CPU-PBT Minimum Maximum Minimum Maximum Minimum Maximum ICCNTRD1  3.70 8.70 2.10 4.60 1.60 3.80 ICCNTRD2 ICRNGWR1 ...
  • Page 273: Appendix 2 Connection Examples With Servo Amplifiers

    APPX Appendix 2 Connection Examples with Servo Amplifiers Appendix 2.1 Connection examples with servo amplifiers manufactured by Mitsubishi (1) Connection example with MR-JN series Configure a sequence program in which MC is turned off using Alarm signal and an emergency stop switch. Servo motor CNP1 CNP1...
  • Page 274 (2) Connection example with MR-J3- A series Configure a sequence program in which MC is turned off using Alarm signal and an emergency stop switch. Servo motor CNP1 MR-J3- A CNP3 Power 3-phase (200VAC) CNP2 24VDC Electromagnetic brake This relay is turned off when Within 2m* Servo on signal turns off and LCPU...
  • Page 275: Co.,Ltd

    APPX Appendix 2.2 Connection examples with stepping motors manufactured by ORIENTAL MOTOR CO.,LTD. (1) Connection example with RK series (a) L02SCPU, L02CPU, L06CPU, L26CPU, L26CPU-BT Within 2m* LCPU RK series* IN0-24V IN0-DIFF IN0-COM IN1-24V IN1-DIFF 5 +A.W.OFF IN1-COM 6 -A.W.OFF IN4-24V IN4-DIFF IN4-COM...
  • Page 276 (b) L02SCPU-P, L02CPU-P, L06CPU-P, L26CPU-P, L26CPU-PBT Within 2m* LCPU RK series* IN0-24V IN0-DIFF IN0-COM IN1-24V IN1-DIFF 5 +A.W.OFF IN1-COM 6 -A.W.OFF IN4-24V 17 +TIM. IN4-DIFF 18 -TIM. IN4-COM OUT2 OUT-COM OUT4 1 CW+ 2 CW- OUT-COM 3 CCW+ OUT6 4 CCW- OUT-COM 19 +O.H.
  • Page 277 APPX (2) Connection example with AR series (a) L02SCPU, L02CPU, L06CPU, L26CPU, L26CPU-BT Within 2m* LCPU AR series* IN0-24V IN0-DIFF 3 ASG+ IN0-COM 4 ASG- IN1-24V IN1-DIFF 5 BSG+ IN1-COM 6 BSG- IN4-24V IN4-DIFF 7 TIM1+ IN4-COM 8 TIM1- OUT2 24 CLR/ALM-RST OUT-COM 31 CW+/PLS+...
  • Page 278 (b) L02SCPU-P, L02CPU-P, L06CPU-P, L26CPU-P, L26CPU-PBT Within 2m* LCPU AR series* IN0-24V IN0-DIFF 3 ASG+ IN0-COM 4 ASG- IN1-24V IN1-DIFF 5 BSG+ IN1-COM 6 BSG- IN4-24V IN4-DIFF 7 TIM1+ IN4-COM 8 TIM1- OUT2 24 CLR/ALM-RST OUT-COM OUT4 31 CW+/PLS+ OUT-COM 32 CW-/PLS- OUT6 35 CCW+/DIR+...
  • Page 279: Appendix 2.3 Connection Examples With Servo Amplifiers Manufactured By Panasonic Corporation

    APPX Appendix 2.3 Connection examples with servo amplifiers manufactured by Panasonic Corporation (1) Connection example with MINAS-A4 series Within 2m* LCPU MINAS-A4 series* IN0-24V IN0-DIFF 21 OA+ IN0-COM 22 OA- IN1-24V IN1-DIFF 48 OB+ IN1-COM 49 OB- IN4-24V IN4-DIFF 23 OZ+ IN4-COM 24 OZ- OUT2...
  • Page 280 (2) Connection example with MINAS-E series Within 2m* LCPU MINAS-E series* IN0-24V IN0-DIFF 15 OA+ IN0-COM 16 OA- IN1-24V IN1-DIFF 17 OB+ IN1-COM 18 OB- IN4-24V IN4-DIFF 19 OZ+ IN4-COM 20 OZ- OUT2 4 CL OUT-COM 22 PULS1 1/2W OUT4 23 PULS2 OUT-COM 24 SIGN1...
  • Page 281: Appendix 2.4

    APPX Appendix 2.4 Connection examples with servo amplifiers manufactured by SANYODENKI CO.,LTD. (1) Connection example with R series Within 2m* LCPU R series* IN0-24V IN0-DIFF IN0-COM IN1-24V IN1-DIFF IN1-COM IN4-24V IN4-DIFF IN4-COM OUT2 34 CLR (CONT4) OUT-COM OUT4 26 F-PC OUT-COM 47 SG OUT6...
  • Page 282: Corporation

    Appendix 2.5 Connection examples with servo amplifiers manufactured by YASKAWA Electric Corporation (1) Connection example with -V series Within 2m* LCPU -V series* IN0-24V IN0-DIFF 33 PAO IN0-COM 34 /PAO IN1-24V IN1-DIFF 35 PBO IN1-COM 36 /PBO IN4-24V IN4-DIFF 19 PCO IN4-COM 20 /PCO 18 PL3...
  • Page 283: Index

    INDEX 0 to 9 ..... . 195 ... . 156 1-phase multiple of 1 DEC/STOP time at speed change .
  • Page 284 Program example with the coincidence detection ......263 interrupt function ......246 Latch count value .
  • Page 285 ....... . 18 Warning ....22,23 Wiring method for common .
  • Page 286: Instruction Index

    INSTRUCTION INDEX ....242 ICCNTRD1(P), ICCNTRD2(P) ....250 ICCOVWR1(P), ICCOVWR2(P) ..... . 252 ICFCNT1, ICFCNT2 .
  • Page 287 Memo...
  • Page 288: Revisions

    This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
  • Page 289: Warranty

    WARRANTY Please confirm the following product warranty details before using this product. 1. Gratis Warranty Term and Gratis Warranty Range If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company.
  • Page 290: Trademarks

    TRADEMARKS Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The company names, system names and product names mentioned in this manual are either registered trademarks or trademarks of their respective companies. ...
  • Page 292 SH(NA)-080892ENG-I(1907)MEE MODEL: LCPU-U-IO-E MODEL CODE: 13JZ38 HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission.

Table of Contents