High-Speed Input and Pulse Output Features In This Chapter. . . .
3--2 High-speed Input and Pulse Output Features Introduction High-Speed Input and Pulse Output Features Built-in Motion Control Solution Availability of HSIO Features Many machine control applications require various types of simple high-speed monitoring and control. These applications usually involve some type of motion control, or high-speed interrupts for time-critical events. The DL105 Micro PLC solves this traditionally expensive problem with built-in CPU enhancements.
High-Speed Input and Pulse Output Features Dedicated HighSpeed I/O Circuit 3--3 The internal CPU’s main task is to execute the ladder program and read/write all I/O points during each scan. In order to service high-speed I/O events, the DL105 includes a special circuit which is dedicated to a portion of the I/O points. Refer to the DL105 block diagram in the figure below.
3--4 High-speed Input and Pulse Output Features Choosing the HSIO Operating Mode High-Speed Input and Pulse Output Features Understanding the The High-Speed I/O circuit operates in one of 6 basic modes as listed in the table below. The number in the left column is the mode number (later, we’ll use these Six Modes numbers to configure the PLC). Choose one of the following modes according to the primary function you want from the dedicated High-Speed I/O circuit.
High-Speed Input and Pulse Output Features Configuring the HSIO Mode 3--5 If you have chosen a mode suited to the high-speed I/O needs of your application, we’re ready to proceed to configure the PLC to operate accordingly. In the block diagram below, notice the V-memory detail in the expanded CPU block. V-memory location V7633 determines the functional mode of the high-speed I/O circuit.
3--6 High-speed Input and Pulse Output Features Mode 10: High-Speed Counter Purpose Functional Block Diagram The HSIO circuit contains one high-speed counter. A single pulse train from an external source (X0) clocks the counter on each signal leading edge. The counter counts only upwards, from 0 to 99999999. The counter compares the current count with up to 24 preset values, which you define.
High-Speed Input and Pulse Output Features Wiring Diagram 3--7 A general wiring diagram for counters/encoders to the DL105 in HSIO Mode 10 is shown below. Many types of pulse-generating devices may be used, such as proximity switches, single-channel encoders, magnetic or optical sensors, etc. Devices with sinking outputs (NPN open collector) are probably the best choice for interfacing. If the counter sources to the inputs, it must output 12 to 24 VDC.
3--8 High-speed Input and Pulse Output Features Setup for Mode 10 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 10 in the lower byte to select High-Speed Counter Mode. Use BCD 00 or 20 in the upper byte as required. Combine the two bytes into a data word “xx10”, for writing to V7633.
3--9 High-Speed Input and Pulse Output Features Preset Data Starting Location Using Fewer than 24 Presets V7630 is a pointer location which points to the beginning of the Preset Data Table. The default starting location for the Preset Data Table is V2320 (default after initializing scratchpad V-memory). However, you may change this by programming a different value in V7630.
3--10 High-speed Input and Pulse Output Features Calculating Your Preset Values The preset values occupy two data words each. They can range in value from 0000 0000 to 9999 9999, just like the high-speed counter value. All twenty-four values are absolute values, meaning that each one is an offset from the counter zero value. The preset values must be individually derived for each application. In the industrial lathe diagram below, the PLC monitors the position of the lead screw by counting pulses.
High-Speed Input and Pulse Output Features Writing Your Control Program 3--11 You may recall that the counter instruction is a standard instruction in the DL105 instruction set. Refer to the figure below. The mnemonic for the counter is UDC (up-down counter).The DL105 can have up to 64 counters, labeled CT0 through CT77. The high speed counter in the HSIO circuit is accessed in ladder logic by using UDC CT76.
3--12 High-speed Input and Pulse Output Features Program Example Cont’d DirectSOFT First Scan Only SP0 Load constant K10 into the accumulator. This selects Mode 10 as the HSIO mode. LD K10 Mode 10 OUT V7633 Load the constant required to configure X0 as the counter clock.
High-Speed Input and Pulse Output Features Counter With Presets Program Example Preset Data 3--13 The following example shows how to program the HSIO circuit to trigger on three preset values. You may recall the industrial lathe example from the beginning of this chapter. This example program shows how to control the lathe cutter head to make three grooves in the work-piece at precise positions. When the lead screw turns, the counter device generates pulses which the DL105 can count.
3--14 High-speed Input and Pulse Output Features Load the preset C value into the accumulator. LDD K4850 Output the accumulator contents to the memory location for preset 3. OUTD V2324 Load the constant Kffff into the accumulator. This value represents the end of the preset list. LDD Kffff Output the accumulator contents to the memory location for preset 4 (end of preset marker). OUTD V2326 SP1 UDC SP1 CT76 Kxxxxxxxx CT76 is the HSIO counter. The first rung’s SP1 always enables the counter.
High-Speed Input and Pulse Output Features Counter With Preload Program Example 3--15 The following example shows how you can preload the current count with another value. When the preload command input (X4 in this example) is energized, we disable the counter from counting with C0. Then we write the value K3000 to the count register (V1076-V1077). By pulsing C1 on, we preload the current count of the counter with K3000.
3--16 High-speed Input and Pulse Output Features High-Speed Input and Pulse Output Features Troubleshooting Guide for Mode 10 If you’re having trouble with Mode 10 operation, please study the following symptoms and possible causes. The most common problems are listed below. Symptom: The counter does not count. Possible causes: 1. Field sensor and wiring -- Verify that the encoder, proximity switch,or counter actually turns on and illuminates the status LED for X0.
High-Speed Input and Pulse Output Features 3--17 Mode 20: Quadrature Counter Purpose Functional Block Diagram The counter in the HSIO circuit can count two quadrature signal pulses instead of a single pulse train (mode 10 operation). Quadrature signals are commonly generated from incremental encoders, which may be rotary or linear. The quadrature counter has a range from 0 to 99999999, and can count at up to a 5 kHz rate, using CT76 and CT77.
3--18 High-speed Input and Pulse Output Features Wiring Diagram A general wiring diagram for encoders to the DL105 in HSIO Mode 20 is shown below. Encoders with sinking outputs (NPN open collector) are probably the best choice for interfacing. If the encoder sources to the inputs, it must output 12 to 24 VDC. Note that encoders with 5V sourcing outputs will not work with DL105 inputs.
High-Speed Input and Pulse Output Features Setup for Mode 20 3--19 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 20 in the lower byte to select High-Speed Counter Mode. Use BCD 00 or 20 in the upper byte as required. Combine the two bytes into a data word “xx20”, for writing to V7633.
3--20 High-speed Input and Pulse Output Features Writing Your Control Program You may recall that the Up-Down counter instruction is standard in the DL105 instruction set. Refer to the figure below. The mnemonic for the counter is UDC (up-down counter).The DL105 can have up to 64 counters, labeled CT0 through CT77. The quadrature counter in the HSIO circuit is accessed in ladder logic by using UDC CT76.
High-Speed Input and Pulse Output Features Program Example Cont’d DirectSOFT SP0 Load constant K20 into the accumulator. This selects Mode 20 as the HSIO mode. LD K20 Select Mode 20 OUT V7633 OUT V7634 OUT V7635 Output the constant to V7635, the location of the setup register for X1. Load the constant required to configure X2 as an external reset. LD K7 LD K1006 OUT V7637 C0 SET CT76 Kxxxxxxxx Output the constant to V7636, the location of the setup register for X2.
3--22 High-speed Input and Pulse Output Features Counter Preload Program Example X4 C0 RST Preload counter Load the BCD value K3000 into the accumulator. LDD K3000 Output the constant to V1076/V1077, the location of the accumulated pulse count. OUTD V1076 C1 PD C0 High-Speed Input and Pulse Output Features Troubleshooting Guide for Mode 20 C1 When the preload request is made, the user turns on X4. First we disable counting by resetting C0, the counter’s enable input.
3--23 High-Speed Input and Pulse Output Features Mode 30: Pulse Output Purpose The HSIO circuit in Mode 30 generates output pulse trains suitable for open-loop control of a single-axis motion positioning system. It generates pulse (stepper increment) and direction signals which you can connect to motor drive systems and perform various types of motion control.
3--24 High-speed Input and Pulse Output Features Functional Block Diagram The diagram below shows HSIO functionality in Mode 30. When the lower byte of HSIO Mode register V7633 contains a BCD “30”, the pulse output capability in the HSIO circuit is enabled. The pulse outputs use Y0 and Y1 terminals on the output connector. Remember that the outputs can only be DC type to operate.
High-Speed Input and Pulse Output Features Wiring Diagram 3--25 The generalized wiring diagram below shows pulse outputs Y0 and Y1 connected to the drive amplifier inputs of a motion control system. Pulse Output Wiring Power Input + Motor Amplifier Pulse Signal Common -- Direction The pulse signals from Y0 and Y1 outputs will typically go to drive input circuits as shown above. Remember that the DL105’s DC outputs are sinking-only.
3--26 High-speed Input and Pulse Output Features Motion Profile Specifications The motion control profiles generated in Pulse Output Mode have the following specifications: Parameter Specification Profiles Trapezoidal -- Accel Slope / Target Velocity / Decel Slope Registration -- Velocity to Position Control on Interrupt Velocity Control -- Speed and Direction only High-Speed Input and Pulse Output Features Physical I/O Configuration Logical I/O Functions Position Range --88388608 to 88388607 Po
3--27 High-Speed Input and Pulse Output Features Setup for Mode 30 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 30 in the lower byte to select Pulse Output Mode. Use BCD 00 or 20 in the upper byte as required. Combine the two bytes into a data word “xx30”, for writing to V7633.
3--28 High-speed Input and Pulse Output Features Profile Parameter Table Trapezoidal Profile V7630 is a pointer location which points to the beginning of the Profile Parameter Table. The default starting location for the profile parameter table is V2320. However, you may change this by programming a different value in V7630. Remember to use the LDA (load address) instruction, converting octal into hex.
High-Speed Input and Pulse Output Features 3--29 Choosing the Profile Type Pulse Output Mode generates three types of motion profiles. Most applications use one type for most moves. However, each move can be different if required.
3--30 High-speed Input and Pulse Output Features Trapezoidal Profile Operation Trapezoidal Profile The trapezoidal profile is best suited for simple point-to-point moves, when the target position is known in advance. Starting velocities must be within the rage of 40 pps to Applications 1 kpps. The remainder of the profile parameters are in the profile parameter table.
3--31 High-Speed Input and Pulse Output Features Trapezoidal Profile The trapezoidal profile we want to perform is drawn and labeled in the following Program Example figure. It consists of a non-zero starting velocity, and moderate target velocity. Trapezoidal Profile Velocity Target Velocity = 1 kHz Accel = 2 sec Decel = 4 sec Starting Velocity = 40 Time Start position Target position = 5000 The following program will realize the profile drawn above, when executed.
3--32 High-speed Input and Pulse Output Features Program Example Cont’d SP0 Profile / Target Velocity Target Position Load the constant K100 which is required to select Trapzoidal Profile, absolute positioning, and a target velocity of 1 kHz. LD K100 Output this constant to V2320, the location of the Profile Select / Starting Velocity setup register. OUT V2320 Load the constant K5000 which selects a target position of 5000 pulses. Don’t forget to use double word size (8-digit BCD position value).
3--33 High-Speed Input and Pulse Output Features Registration Profile Operation Registration Applications 1. In a typical application shown to the right, product material in work moves past a work tool such as a drill. Registration marks on the scrap area of the work-piece allow a machine tool to register its position relative to the rectangle, to drill properly. 2. In other examples of registration, the work piece is stationary and the tool moves.
3--34 High-speed Input and Pulse Output Features Registration Profile The registration profile we want to perform is drawn and labeled in the following Program Example figure. It consists of a non-zero starting velocity, and moderate target velocity. Registration Profile Velocity Target Velocity = 1 kHz Accel = 2 sec Decel = 4 sec Starting Velocity = 40 Time Start position Target position = 5000 The following program will realize the profile drawn above, when executed.
High-Speed Input and Pulse Output Features 3--35 Program Example Cont’d SP0 Profile / Target Velocity Target Position LD K9100 OUT V2320 LDD K5000 OUTD V2321 Starting Velocity Load the constant K5000 which selects a target position of 5000 pulses. Don’t forget to use double word size (8-digit BCD position value). Output this constant to V2321 and V2322, the location of the Target Position double-word register. Output this constant to V2323, the location of the starting velocity parameter register.
3--36 High-speed Input and Pulse Output Features Home Search Program Example One of the more challenging aspects of motion control is the establishment of actual position at powerup. This is especially true for open-loop systems which do not have a position feedback device. However, a simple limit switch located at an exact location on the positioning mechanism can provide “position feedback” at one point. For most stepper control systems, this method is a good and economical solution.
High-Speed Input and Pulse Output Features Profile / Target Velocity SP0 LD K9100 Select Registration Profile, relative positioning, and a target velocity of 1000 pps (9xxx times 10 pps). OUT V2320 Starting Velocity OUT V2323 Acceleration TMR T0 K5 T0 The constant K4 selects a starting velocity of 40 Hz (4 x 10 pps). LD K4 C1 CCW past home C2 C3 X2 The constant K20 selects an acceleration time of 2 seconds (20 x 100 mS).
3--38 High-speed Input and Pulse Output Features Velocity Profile Operation Velocity Profile Applications The velocity profile is best suited for applications which involve motion but do not require moves to specific points. Conveyor speed control is a typical example. Velocity Profile Velocity High-Speed Input and Pulse Output Features Time Start Y0 Profile Complete X0 The time line of signal traces below the profile indicates the order of events.
High-Speed Input and Pulse Output Features Velocity Profile Program Example 3--39 The velocity profile we want to perform is drawn and labeled in the following figure. Each velocity segment is of indefinite length. The velocity only changes when ladder logic (or other device writing to V-memory) updates the velocity parameter. Velocity Profile Velocity Time The following program uses dedicated discrete inputs to load in new velocity values.
3--40 High-speed Input and Pulse Output Features Program Example Cont’d SP0 Profile / Target Velocity Select Direction LD K2000 OUT V2320 LDD K80000000 OUTD V2321 Set Velocity Load the constant K2000 which is required to select Velocity Profile. This data word contains no velocity information in the case of velocity mode. Output this constant to V2320, the location of the Profile Select setup register. Load the constant K80000000 which selects CCW direction for Velocity Profiles.
High-Speed Input and Pulse Output Features 3--41 Pulse Output Error The Profile Parameter Table starting at V2320 (default location) defines the profile. Certain numbers will result in a error when the HSIO attempts to use the parameters Codes to execute a move profile. When an error occurs, the HSIO writes an error code in V2326.
3--42 High-speed Input and Pulse Output Features 3. Wiring -- Verify the wiring to the stepper motor is correct. Remember the signal ground connection from the PLC to the motion system is required. 4. Motion system -- Verify that the drive is powered and enabled. To verify the motion system is working, you can use Mode 60 operation (normal PLC inputs/outputs) as shown in the test program below. With it, you can manually control Y0 and Y1 with X0 and X1, respectively.
High-Speed Input and Pulse Output Features 3--43 Mode 40: High-Speed Interrupts Purpose Functional Block Diagram The HSIO Mode 40 provides a high-speed interrupt to the ladder program. This capability is provided for your choice of the following application scenarios: S An external event needs to trigger an interrupt subroutine in the CPU. Using immediate I/O instructions in the subroutine is typical.
3--44 High-speed Input and Pulse Output Features Setup for Mode 40 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 40 in the lower byte to select High-Speed Interrupt Mode. Use BCD 00 or 20 in the upper byte as required. Combine the two bytes into a data word “xx40”, for writing to V7633.
3--45 High-Speed Input and Pulse Output Features External Interrupt Signal pulses at X0 must meet certain timing criteria to guarantee an interrupt will Timing Parameters result. Refer to the timing diagram below. The input characteristics of X0 are fixed (it is not a programmable filtered input). The minimum pulse width is 0.1 mS. There must be some delay before the next interrupt pulse arrives, such that the interrupt period cannot be smaller than 0.5 mS. 0.5 mS minimum 0.
3--46 High-speed Input and Pulse Output Features External Interrupt Program Example The following program selects Mode 40, then selects the external interrupt option. Inputs X1, X2, and X3 are all configured as filtered inputs with a 10 mS time constant. The program is otherwise generic, and may be adapted to your application. DirectSOFT SP0 Load constant K40 into the accumulator. This selects Mode 40 as the HSIO mode.
3--47 High-Speed Input and Pulse Output Features Timed Interrupt Program Example The following program selects Mode 40, then selects the timed interrupt option, with an interrupt period of 100 mS. 100 mS Timed Interrupt Time Inputs X0, X1, X2, and X3 are all configured as filtered inputs with a 10 mS time constant. Note that X0 uses the time constant from X1. The program is otherwise generic, and may be adapted to your application. DirectSOFT SP0 Load constant K40 into the accumulator.
3--48 High-speed Input and Pulse Output Features Mode 50: Pulse Catch Input Purpose Functional Block Diagram The HSIO circuit has a pulse-catch mode of operation. It monitors the signal on input X0, preserving the occurrence of a narrow pulse. The purpose of the pulse catch mode is to enable the ladder program to “see” an input pulse which is shorter in duration than the current scan time.
High-Speed Input and Pulse Output Features Setup for Mode 50 3--49 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 50 in the lower byte to select High-Speed Counter Mode. Use BCD 00 or 20 in the upper byte as required. Combine the two bytes into a data word “xx50”, for writing to V7633.
3--50 High-speed Input and Pulse Output Features Pulse Catch Program Example The following program selects Mode 50, then programs the pulse catch code for X0. Inputs X1, X2, and X3 are all configured as filtered inputs with 10, 30, and 50 mS time constants respectively. The program is otherwise generic, and may be adapted to your application. DirectSOFT SP0 Load constant K50 into the accumulator. This selects Mode 50 as the HSIO mode.
High-Speed Input and Pulse Output Features 3--51 Mode 60: Discrete Inputs with Filter Purpose Functional Block Diagram The last mode we will discuss for the HSIO circuit is Mode 60, Discrete Inputs with Filter. The purpose of this mode is to allow the input circuit to reject narrow pulses and accept wide ones, as viewed from the ladder program. This is useful in especially noisy environments or other applications where pulse width is important.
3--52 High-speed Input and Pulse Output Features Setup for Mode 60 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 60 in the lower byte to select High-Speed Counter Mode. Use BCD 00 or 20 in the upper byte as required. Combine the two bytes into a data word “xx60”, for writing to V7633.
High-Speed Input and Pulse Output Features Filtered Inputs Program Example 3--53 The following program selects Mode 60, then programs the filter delay time constants for inputs X0, X1, X2, and X3. Each filter time constant is different, for illustration purposes. The program is otherwise generic, and may be adapted to your application. DirectSOFT SP0 Load constant K60 into the accumulator. This selects Mode 60 as the HSIO mode.