HIGH-SPEED INPUT AND PULSE OUTPUT FEATURES A PPENDIX E In This Appendix... Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .E–2 Choosing the HSIO Operating Mode . . . . . . . . . . . . . . . . . . . . . . .E–4 Mode 10: High-Speed Counter . . . . . . . . . . . . . . . . . . . . . . . . . . .E–7 Mode 20: Up/Down Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . .E–24 Presets and Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Introduction Built-in Motion Control Solution 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 DL06 Micro PLC solves this traditionally expensive problem with built-in CPU enhancements.
Appendix E: High-speed Input and Pulse Output Features Dedicated High- Speed I/O Circuit 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 DL06 includes a special circuit which is dedicated to a portion of the I/O points. Refer to the DL06 block diagram in the figure below.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Choosing the HSIO Operating Mode E–4 Understanding the Six Modes 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 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.
Appendix E: High-speed Input and Pulse Output Features Physical I/O Point Usage Mode 10 20 30 40 X0 High-Speed Counter Counter #1 DC Input Points X1 X2 Counter #2, Interrupt, Pulse Input or Filtered Input Reset #1, Interrupt, Pulse Input or Filtered Input X3 DC Output Points Y0 Y1 Reset #2, Interrupt, Regular Pulse Input or Output Filtered Input Regular Output Reset, Input or Regular Pulse Input or Pulse Filtered Input Output Filtered Input Phase B Input Regular Output Up/Down counter Down (S
Appendix E: High-speed Input and Pulse Output Features Configuring the HSIO Mode 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–6 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.
Appendix E: High-speed Input and Pulse Output Features Mode 10: High-Speed Counter Purpose The HSIO circuit contains two high-speed counters. 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.
Appendix E: High-speed Input and Pulse Output Features G LG 0V Y0 Y2 C1 Y5 Y7 Y10 Y12 C3 Y15 Y17 AC(L) AC(N) 24V C0 Y1 Y3 Y4 Y6 C2 Y11 Y13 Y14 Y16 N.C. Wiring Diagram OUTPUT: 6-240V 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D 50 - 60Hz 2.0A, 6 - 27V 2.0A PWR: 100-240V PWR RUN CPU TX1 RX1 TX2 RX2 50-60Hz 40VA A general wiring diagram for counters/encoders in HSIO Mode 10 is shown X below.
Appendix E: High-speed Input and Pulse Output Features Setup for Mode 10 V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 10 in the lower byte of V7633 to select the High-Speed Counter Mode. Memory Location V7633 Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 For the function of bits 8 - 15, refer to page E-6.
Appendix E: High-speed Input and Pulse Output Features Absolute and Incremental Presets 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–10 Two preset modes are available, absolute and incremental. Presets are entered into a contiguous block of V-memory registers. In the absolute mode, each preset is treated as the total count. In the incremental mode, the presets are cumulative. Incremental presets represent the number of counts between events.
Appendix E: High-speed Input and Pulse Output Features Preset Data Starting Location V7630 is the pointer to the V-memory location which contains the beginning of the Preset Data Tables. The default starting location for the Preset Data Tables is V3630 (default after initializing scratchpad). However, you may change this by programming a different value in V7630. Use the LDA and OUT instructions as shown: LDA O2000 Load the octal address, convert to hex, leave result in accumulator.
Appendix E: High-speed Input and Pulse Output Features Equal Relay Numbers 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–12 The following table lists all 24 preset register default locations for each high-speed counter. Each occupies two 16-bit V-memory registers. The corresponding special relay contact number is in the next column. We might also call these equal relay contacts, because they are true (closed) when the present high-speed counter value is equal to the preset value.
Appendix E: 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 -8388608 to 8388607, just like the high-speed counter value. All 24 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.
Appendix E: High-speed Input and Pulse Output Features X Input Configuration 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–14 The configurable discrete input options for High-Speed Counter Mode are listed in the table below. Input X0 is dedicated for the first counter clock input. Input X1 can be the clock for the second counter or a filtered input. The section on Mode 60 operation at the end of this appendix describes programming the filter time constants.
Appendix E: High-speed Input and Pulse Output Features Writing Your Control Program The mnemonic for the counter instruction is UDC (up-down counter).The DL06 can have up to 128 counters, labeled CT0 through CT177. The high speed counter in the HSIO circuit is accessed in ladder logic by using UDC CT174 and CT176. It uses counter registers CT174 through CT177 exclusively when the HSIO mode 10 is active (otherwise, CT174 through CT177 are available for standard counter use).
Appendix E: High-speed Input and Pulse Output Features Program Example 1: Counter Without Presets 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–16 The following example is the simplest way to use the high-speed counters, which does not use the presets and special relays in the interrupt routine. The program configures the HSIO circuit for Mode 10 operation, so X0 is automatically the counter clock input for the first counter, and X1 is the counter clock input for the second counter.
Appendix E: High-speed Input and Pulse Output Features Program Example: (cont’d) The compare double instructions below use the current count of the HSIO counter to turn on Y0 and Y1. This technique can make more than 24 comparisons, but it is scan-time dependent. However, use the 24 built-in presets with the interrupt routine if your application needs a very fast response time, as shown in the next example.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Program Example 2: Counter With Presets 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 appendix. This example program shows how to control the lathe cutter head to make three grooves in the work-piece at precise positions.
Appendix E: High-speed Input and Pulse Output Features continued from previous page SP0 Load the preset A value into the accumulator . LDD K1500 Load Presets Output the accumulator contents to the memory location for preset 1. OUTD V3630 Load the preset B value into the accumulator . LDD K3780 Output the accumulator contents to the memory location for preset 2. OUTD V3632 Load the preset C value into the accumulator .
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–20 Some applications will require a different type of action at each preset. It is possible for the interrupt routine to distinguish one preset event from another, by turning on a unique output for each equal relay contact SPxxx. We can determine the source of the interrupt by examining the equal relay contacts individually, as well as X2.
Appendix E: High-speed Input and Pulse Output Features Program Example 3: Counter With Preload 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 (V1076V1077). We preload the current count of the counter with K3000.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–22 continued from last page X4 C0 RST Load the BCD value K3000 into the accumulator. LDD K3000 Output the constant to V1174/V1175, the location of the accumulated count for CT76. OUTD V1174 C0 C1 When the preload request is made, the user turns on X4. First we disable counting by resetting C0, the counter ’s enable input.
Appendix E: 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 sensor actually turns on and illuminates the status LED for X0 (counter 1) and X1 (counter 2).
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Mode 20: Up/Down Counter Purpose The counter in the HSIO circuit can count up/down signals from two separate sources (i.e., two single channel encoders) or two quadrature signal pulses. Quadrature signals are commonly generated from incremental encoders, which may be rotary or linear. The up/down counter has a range from -8388608 to 8388607.
Appendix E: High-speed Input and Pulse Output Features Quadrature Encoder Signals Quadrature encoder signals contain position and direction information, while their frequency represents speed of motion. Phase A and B signals shown below are phase-shifted 90 degrees, thus the quadrature name. When the rising edge of Phase A precedes Phase B’s leading edge (indicates clockwise motion by convention), the HSIO counter counts UP.
Appendix E: High-speed Input and Pulse Output Features Interfacing to Encoder Outputs 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–26 The DL06’s DC inputs are flexible in that they detect current flow in either direction, so they can be wired to an encoder with either sourcing or sinking outputs. In the following circuit, an encoder has open-collector NPN transistor outputs. It sinks current from the PLC input point, which sources current.
Appendix E: High-speed Input and Pulse Output Features Setup for Mode 20 Remember that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 20 in the lower byte of V7633 to select the High-Speed Counter Mode.
Appendix E: High-speed Input and Pulse Output Features X Input Configuration 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D The configurable discrete input options for High-Speed Counter Mode are listed in the table below. The section on Mode 60 operation at the end of this appendix describes programming the filter time constants.
Appendix E: High-speed Input and Pulse Output Features Writing Your Control Program The mnemonic for the counter is UDC (up-down counter). The DL06 can have up to 128 counters, labeled CT0 through CT177. The quadrature counter in the HSIO circuit is accessed in ladder logic by using UDC CT174. It uses counter registers CT174 and CT175 exclusively when the HSIO mode 20 is active (otherwise, CT174 and CT175 are available for standard counter use).
Appendix E: High-speed Input and Pulse Output Features Program Example 1: Quadrature Counting with an Interrupt 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Below is a simple example of how quadrature counting with an interrupt can be programmed. DirctSOFT DirectSOFT ENI SP0 Load constant K20 into the accumulator. This selects Mode 20 as the HSIO mode. LD K20 OUT V7633 Output this value to V7633, the location of the HSIO Mode select register.
Appendix E: High-speed Input and Pulse Output Features continued from last page INT O0 SP540 Y0 OUT Set Y0 to ON when the counter reaches or exceeds our comparison value while COUNTING UP. SP541 Y1 OUT Set Y1 to ON when the counter reaches or goes below our comparison value while COUNTING DOWN. IRT The Load Accumulator instructions have set up the V-memory as required, i.e., 20 in V7633 for the mode and 0202 in V7634 to designate the standard up/down with the absolute preset mode.
Appendix E: High-speed Input and Pulse Output Features Program Example 2: Up/Down Counting with Standard Inputs 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D In this example, there is a conveyor belt “A” that transports bottles to be inspected. During the course of the process, one sensor is keeping track of the bottles that are going onto belt “A” for inspection, and another sensor is keeping track of how many bottles are being removed to the finished product line.
Appendix E: High-speed Input and Pulse Output Features continued from previous page Counter output Over 500 light When the pulse count reaches or exceeds the preset value of 500, the output of the OUT counter (CT174) goes high and turns on Over 500 latch the "over 500" light (Y21) and latches C5. CT174 Y21 C5 SET Over 500 latch C5 Y22 OUT Counter output CT174 When the count is 500 or greater, the rerouting gate (Y22) turns on and will stay on for 30 seconds after the count falls below 500.
Appendix E: High-speed Input and Pulse Output Features Program Example 3: Quadrature Counting 1 2 3 In this example, a wooden workpiece is being drilled with 3 holes and then the holes are injected with glue for dowels to be inserted at another workstation. A quadrature encoder is connected to a positioning table which is moving a drill press horizontally over the workpiece. The positioning table will stop and the drill press will lower to drill a hole in an exact location.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page. Forwarding positioning table. Manual start of drilling process momentary PB. Y30 X20 SET C1 C1 RST Drilling sequence completed (one hole only). Drilling sequence completed (one hole only). 1st preset actual counts. Reversing Position Table. V3630 V1174 V1174 K5100 Y31 Glue injection. Y32 OUT 2nd preset actual counts. V3632 V1174 V1174 K6100 3rd preset actual counts.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page. 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–36 One-shot bit. First scan bit. C7 SP1 Drill press down. Y22 RST Drill turning. Y21 RST Drilling sequence completed (one hole only). C1 SET Drilling sequence initiation. C5 RST END INT O0 SP540 Forwarding Positioning Table. Y30 OUT Drilling sequence initiation. C5 SET SP541 Forwarding Positioning Table. Y30 OUT Drilling sequence initiation.
Appendix E: High-speed Input and Pulse Output Features Troubleshooting Guide for Mode 20 If you’re having trouble with Mode 20 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 or other field device inputs actually turn on and illuminate the status LEDs for X0 and X1.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Mode 30: Pulse Output Purpose E–38 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.
Appendix E: 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.
Appendix E: High-speed Input and Pulse Output Features Wiring Diagram 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D The generalized wiring diagram below shows pulse outputs Y0 and Y1 connected to the drive amplifier inputs of a motion control system. Motor Amplifier +24 VDC Signal Common Power Input - Pulse Direction + G 0V LG Y0 Y2 C1 Y5 Y7 Y10 Y12 C3 Y15 Y17 AC(L) AC(N) 24V C0 Y1 Y3 Y4 Y6 C2 Y11 Y13 Y14 Y16 +V OUTPUT: Sinking Output 6 - 27V 1.
Appendix E: High-speed Input and Pulse Output Features Motion Profile Specifications The motion control profiles generated in Pulse Output Mode have the following specifications: Motion Control Profile Specifications Parameter Specification Automatic Trapezoidal – Accel Slope / Target Velocity / Decel Slope Step Trapezoidal - Step Acceleration / Deceleration Velocity Control – Speed and Direction only –8388608 to 8388607 Absolute / relative command 40 Hz to 10 kHz V3630 to V3652 (Profile Parameter Table)
Appendix E: High-speed Input and Pulse Output Features Setup for Mode 30 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–42 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 30 in the lower byte of V7633 to select the High-Speed Counter Mode.
Appendix E: High-speed Input and Pulse Output Features Profile / Velocity Select Register The first location in the Profile Parameter Table stores two key pieces of information. The upper four bits (12–15) select the type of profile required. The lower 12 bits (0-11) select the Target Velocity. The ladder program must program this location before initiating any of the three profiles.
Appendix E: High-speed Input and Pulse Output Features Step Trapezoidal Profile 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–44 V-Memory V3630, bits 12–15 V3630, bits 0–11 V3631 / V3632 V3633 V3634 V3635 V3636 V3637 V3640 V3641 V3642 V3643 V3644 V3645 V3646 V3647 V3650 V3651 V3652 Function Range 0=absolute w/o interrupt with interrupt* Step Trapezoidal Profile 7=absolute 8=relative w/o interrupt 9=relative with interrupt* 4 to 999 Target Velocity or 0 for 1000 Target Position** –8388608 to 8388607 Step
Appendix E: High-speed Input and Pulse Output Features 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.
Appendix E: High-speed Input and Pulse Output Features Step Trapezoidal Profiles Defined The step trapezoidal profile is a combination of velocity and position control modes. The move begins by accelerating to a programmed velocity. The velocity is sustained and the move is of indefinite duration. When an external interrupt signal occurs (due to registration sensing), the profile switches from velocity to position control.
Appendix E: High-speed Input and Pulse Output Features Automatic Trapezoidal Profile Operation Starting velocities must be within the range of 40 pps to 1k pps. The remainder of the profile parameters are in the profile parameter table.
Appendix E: High-speed Input and Pulse Output Features Program Example 1: Automatic Trapezoidal Profile without External Interrupt 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D The Automatic Trapezoidal Profile we want to perform is drawn and labeled in the following 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 = 40Hz In this example the ending velocity is not selected.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page.
Appendix E: High-speed Input and Pulse Output Features Program Example 2: Automatic Trapezoidal Profile with External Interrupt 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–50 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 Finished part area Scrap Area area of the work-piece allow a machine tool to register its position relative to the rectangle, to drill properly.
Appendix E: High-speed Input and Pulse Output Features The Automatic Trapezoidal profile we want to perform is drawn and labeled in the following figure. It consists of a non-zero starting velocity, and moderate target velocity. Automatic Trapezoidal Profile Velocity Target V elocity = 1 kHz Decel = 4 sec Accel = 2 sec Ending Velocity = 80 Hz Starting Velocity = 40 Hz Time Start position Target position = 5000 The following program will realize the profile drawn above, when executed.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–52 SP0 Profile / Target Velocity Target Position LD KF100 OUT V3630 LDD K5000 OUTD V3631 Starting Velocity Start Profile X3 OUT V3637 Y0 SET Y2 OUT C0 PD C0 Output this constant to V3633, the location of the starting velocity parameter register. Output this constant to V3634, the location of the acceleration parameter register.
Appendix E: High-speed Input and Pulse Output Features Program Example 3: Automatic Trapezoidal Profile with Home Search 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.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D DirectSOFT This rung cofigures the CPU. SP0 LD K30 Mode 30 OUT V7633 Locate Parameter Table LDA O3630 This selects Mode 30 as the HSIO mode. Configure the address of the parameter table. OUT V7630 Select Pulse / Direction LD K103 Configure the Y0 and Y1 pulse outputs for pulse and direction, respectively.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page “Start Homing” is assigned as X7. This will set Y0, which starts the Pulse Output. Pulses will continue until the CCW Limit is reached. Homing Started Start Homing C0 X7 LDD K200 This constant K200 selects the target position 200 pulses (CW direction). OUTD V3631 Target Position Pulse Out Y0 SET Homing Started C0 SET Turn on Pulse Out, searching for the CW Limit. Set C0 to indicate the CW Limit search has begun.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D This rung waits until the Home Switch, X1, is triggered, then it prepares the next step by loading a new, slo wer, speed into V3631. Notice that the value loaded is not in the form of 8xxxxxxx. Rev. to Home Sw C2 Found Home C3 Target Position Home Switch X1 Found Home C3 SET LDD K40 CCW past home. The constant K40 selects a target position count (CW direction). OUTD V3631 Rev.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page Once the Home Switch is sensed again (at the lower speed), the Pulse Output is stopped. Return to Home C5 Home Switch X1 Pulse Out Y0 RST Home Move Cmplt C6 SET A 0.3 second delay. Home Move Cmplt C6 T2 Return to Home C5 RST TMR T2 K3 Turn off Pulse Out. Set C6 to indicate the Home move has completed. Reset C5 because the Home Limit was found. Timer added for a 0.3 sec. delay before reseting the internal counter.
Appendix E: High-speed Input and Pulse Output Features Step Trapezoidal Profile Operation 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–58 With this step trapezoidal profile, you can control the acceleration and deceleration slopes as you want.
Appendix E: High-speed Input and Pulse Output Features Program Example 4: Step Trapezoidal Profile Program Example SP0 LD K30 Mode 30 OUT V7633 Locate Parameter Table* LDA O3630 OUT V7630 Select CW/CCW LD K3 OUT V7632 Filtered Inputs LD K2006 OUT V7634 LD K1006 OUT V7635 Load the octal address O3630 of the beginning of the Profile Parameter Table. Output this constant to V7630, the location of the pointer to the Profile Parameter Table.
Appendix E: High-speed Input and Pulse Output Features Continued from previous page 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–60 Program Example SP0 Step 1 Acceleration Step 1 Distance LD K20 OUT V3633 LD K100 OUT V3634 Step 2 Acceleration LD K40 OUT V3635 Step 2 Distance LD K200 OUT V3636 Step 3 Acceleration LD K60 OUT V3637 Step 3 Distance LD K300 OUT V3640 Step 4 Acceleration LD K80 OUT V3641 Step 4 Distance LD K400 OUT V3642 Step 5 Deceleration LD K80 OUT V3643 Load the constant K2
Appendix E: High-speed Input and Pulse Output Features Continued from previous page Program Example SP0 Load the constant K400 which selects the step 5 distance of 400 pulses. LD K400 Step 5 Distance Output this constant to V3644, the location of the step 5 distance. OUT V3644 Step 6 Deceleration Load the constant K60 which is required to select the step 6 deceleration velocity of 600 Hz. LD K60 Output this constant to V3645, which is required to select the step 6 deceleration velocity of 600 Hz.
Appendix E: High-speed Input and Pulse Output Features Velocity Profile Operation 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–62 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 Time Start Y0 Profile Complete SP104 The time line of signal traces below the profile indicates the order of events.
Appendix E: High-speed Input and Pulse Output Features Program Example 5: Velocity Profile 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.
Appendix E: High-speed Input and Pulse Output Features Program Example Cont’d 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–64 SP0 Profile / Target Velocity Select Direction LD K2000 OUT V3630 LDD K80000000 OUTD V3631 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 V3630, the location of the Profile Select setup register.
Appendix E: High-speed Input and Pulse Output Features Automatic Trapezoidal Profile Error Codes The Profile Parameter Table starting at V3630 (default location) defines the profile. Certain numbers will result in an error when the HSIO attempts to use the parameters to execute a move profile. When an error occurs, the HSIO writes an error code in V3636. Most errors can be corrected by rechecking the Profile Parameter Table values.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D 4. Wiring – Verify the wiring to the stepper motor is correct. Remember the signal ground connection from the PLC to the motion system is required. 5. 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.
Appendix E: High-speed Input and Pulse Output Features Mode 40: High-Speed Interrupts Purpose 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: • External events need to trigger an interrupt subroutine in the CPU. Using immediate I/O instructions in the subroutine is typical. • An interrupt routine needs to occur on a timed basis which is different from the CPU scan time (either faster or slower).
Appendix E: High-speed Input and Pulse Output Features Setup for Mode 40 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 40 in the lower byte of V7633 to select high-speed interrupts.
Appendix E: High-speed Input and Pulse Output Features External Interrupt Timing Parameters External interrupt signals must meet certain timing criteria to guarantee an interrupt will result. Refer to the timing diagram below. 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.
Appendix E: High-speed Input and Pulse Output Features Program Example 1: External Interrupt 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–70 The following program selects Mode 40, then selects the external interrupt option for inputs X0 and X1. Inputs X2 and X3 are configured as filtered inputs with a 10 ms time constant. The program is otherwise generic, and may be adapted to your application. Direct SOFT SP0 Mode 40 External Interrupt Filtered Inputs Load constant K40 into the accumulator.
Appendix E: High-speed Input and Pulse Output Features Program Example 2: Timed Interrupt 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 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. Direct SOFT SP0 Load constant K40 into the accumulator.
Appendix E: High-speed Input and Pulse Output Features 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Mode 50: Pulse Catch Input Purpose The HSIO circuit has a pulse-catch mode of operation. It monitors the signal on inputs X0 X3, 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. The HSIO circuit latches the input event on input X0 - X3 for one scan.
Appendix E: High-speed Input and Pulse Output Features When to use Pulse Catch Mode Use the pulse catch mode for applications where the input (e.g. X0) can not be used in the user program because the pulse width is very narrow. Use SP100 instead of X0. The SP100 contact stays on through the next scan, as shown above. Even if X0 is on for more than one scan, SP100 is still on for only one scan.
Appendix E: High-speed Input and Pulse Output Features X Input Configuration 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–74 The configurable discrete input options for Pulse Catch Mode are listed in the table below. Each input has its own configuration register and filter time constant.
Appendix E: High-speed Input and Pulse Output Features Program Example 1: Pulse Catch The following program selects Mode 50, then programs the pulse catch code for X0 and X1. Inputs X2, and X3 are configured as filtered inputs with 10 and 30 mS time constants respectively. The program is otherwise generic, and may be adapted to your application. Direct SOFT SP0 Load constant K50 into the accumulator. This selects Mode 50 as the HSIO mode.
Appendix E: High-speed Input and Pulse Output Features Mode 60: Discrete Inputs with Filter 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D Purpose 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.
Appendix E: 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 of V7633 to select the High-Speed Counter Mode.
Appendix E: High-speed Input and Pulse Output Features Program Example: Filtered Inputs 1 2 3 4 E 6 7 8 9 10 11 12 13 14 A B C D E–78 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. Direct SOFT SP0 Load constant K60 into the accumulator. This selects Mode 60 as the HSIO mode.