1 - Overview of the Incremental Encoder Module. Allen-Bradley FLEX I/O 1794-ID2
Advertisement
Advertisement
What This Chapter
Contains
How You Use the
Incremental Encoder
Module
Chapter
1
Read this chapter to familiarize yourself with the 1794–ID2 module.
For information on See page
How You Use the incremental encoder Module . . . . . . . . . . . 1–1
What the incremental encoder Module Does . . . . . . . . . . . . . 1–2
Input Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–3
How the incremental encoder Operates . . . . . . . . . . . . . . . . . 1–4
The 1794–ID2 module is an intelligent I/O module designed to perform high speed pulse counting. The module provides:
•
2 pulse transmitter interfaces, each with 4 optocoupled inputs
Each input has + and – inputs for connection to transmitters with complementary and noncomplementary signals.
The pulse inputs can accept frequencies up to 100KHz. The module accepts and returns binary data.
The module’s primary use is accurate, high-speed counting of pulse from pulse transmitters or incremental encoders with 1 or 2 pulse trains. This includes quantity counting, positioning and speed calculations.
The module has 2 up/down counters, each individually programmable. The number of edges to be counted can be multiplied by 1, 2 or 4 (x1, x2, x4). Pulse transmitters can be complementary or noncomplementary.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–2
Overview of the Incremental Encoder Module
Optocouplers
Preset Register
Counter Register
Latch Register
Control Word
+
Preset Register
Counter Register
Latch Register
Control Word
+
Internal +5V dc
Gavanically Isolated dc/dc Converter
What the Incremental
Encoder Module Does
Z+
Z–
G+
G–
A+
A–
B+
B–
Z+
Z–
G+
G–
A+
A–
B+
B–
12–24V dc
0V
The incremental encoder module performs high-speed scaling calculation operations for various industrial applications. The module interfaces with a FLEX family adapter which then communicates with a programmable controller processor that has block-transfer capability and external I/O devices.
The adapter/power supply transfers data to the module (block transfer write) and from the module (block transfer read) using BTW and BTR instructions in your ladder diagram program. These instructions let the adapter read input values and status from the module, and let you write output values and configure the module’s mode of operation. The following illustration describes the communication process.
Publication 1794-6.5.15 – December 1998
Overview of the Incremental Encoder Module
1
The adapter transfers your configuration data to the module using a BTW.
2
1–3
External devices transmit frequency signals to the module.
Flexbus
Allen-Bradley
ADAPTER
ACTIVE FAULT
LOCAL
FAULT
24VDC
POWER SUPPLY
RIO ADAPTER
1794-ASB
4
Your ladder program instructs the adapter to perform a BTR of the values and stores them in a data table.
Allen-Bradley
2 CH INCREMENTAL ENCODER
1794–ID2
OK
1
5
The adapter and module determine that the transfer was made without error and input values are within specified range.
6
Your ladder program can use and/or move the data (if valid) before it is written over by the transfer of new data in a subsequent transfer.
7
Your ladder program performs BTWs to the module when you power it up, and any time you wish to reconfigure the module.
3
The module converts frequency signals into integer format and stores these values until the adapter requests their transfer.
Typical Applications
You can use the 1794–ID2 module in the power management, automotive, food and beverage, and oil and gas industries for various flow and/or turbine metering applications. Some sample applications include:
• turbine shaft speed monitoring
• automotive paint booths
• brewery flow monitoring
• petrochemical flow and custody transfer
Input Capabilities
The incremental encoder module has 2 identical input channels.
Each of the input channels may accept these input signals:
•
A+ and A–
•
B+ and B–
•
Z+ and Z–
•
G+ and G–
The pulse inputs can accept frequencies up to 100KHz. The module
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–4
Overview of the Incremental Encoder Module
How the Incremental
Encoder Operates
The counter module handles up/down counting and detection of selectable number of edges (X1, X2, X4) for incremental encoders with 2 pulse trains, nominal 90 o
out of phase. The minimum stable input condition is 2
µ s.The following paragraphs detail operation of the incremental encoder module.
Each of the 2 counters has a 16–bit counter register, a preset register and a latch register.
Variables
Communication between the counter module and the control system uses variables accessible in the control system program. These variables include:
•
a counter register (Counter)
• a preset register (PresetValue)
• a latch register (LatchValue).
Signal registers and control words are used to set parameters for the counter configuration. The control word sent to the incremental encoder module can be read back to the control system, allowing verification that one I/O scan been performed since the cycle has been initiated.
Start Counting
The control bit CounterEnable enables counting. It must be set to 1 to enable counting and all other functions.
Selecting the Incremental Encoder and up/down counting
Depending on the incremental encoder, the module can be set in different counter modes. The parameter is set using a 3 digit code in write word 1 or 2 (depending on the channel) control word.
Mode Selection
Bit 02 01 00 Mode Selection bits
0 0
0
0
0
1
1
1
1
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
Quadrature encoder X1
Quadrature encoder X2
Quadrature encoder X4
Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
No count function.
No count function.
No count function.
Publication 1794-6.5.15 – December 1998
Overview of the Incremental Encoder Module
1–5
Up/Down Counting Controlled by B Input
Pulse Counting (Mode 000)
Up/Down counting controlled by input B
The positive edge of the pulses are counted at input A. If input B = 0, the counter counts up; if B = 1, the counter counts down.
Counter Mode = 0
A
B = 0/1
Logic
Counter Register
Up/Down
Input A
Input B
Counter Value
0
1 2
Counting Up
3 2
Counting Down
1
Up/Down Counting using Pulses at Inputs A and B
Pulse Counting Mode (100)
Up/Down Counting using pulses at the inputs of A and B
The counter counts up on the positive edge of the pulses at input A, and counts down on the positive edge of input B.
Counter Mode = 4
A
B
Logic
Counter Register
Up/Down
Input A
Input B
Counter Value
0
1 0 1 2 1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–6
Overview of the Incremental Encoder Module
Count Pulses from Incremental Encoders
Pulse Counting Mode (001, 010. 011) Up/Down Counting using pulses at the inputs of A and B
If countermode = 1, 2 or 3, then 1, 2 or 4 edges of the pulse train will be counted. The count direction (up/down) is determined by the phase difference of the input signals A and B.
Counter Mode = 1, 2 or 3
Logic
A
B
Counter Register
Up/Down
Example 1 – Counter Mode = 1 (x1)
Input A
Input B
Counter Value
1
Example 2 – Counter Mode = 2 (x2)
2
Counting Up
3 2 1
Counting Down
0
Input A
Input B
Counter Value
1 2 3 4
Counting Up
5 4 3 2
Counting Down
1 0
Example 3 – Counter Mode = 3 (x4)
Input A
Input B
Counter Value
1 2 3 4 5 6 7
Counting Up
8 9 8 7 6 5 4
Counting Down
3 2 1 0
Publication 1794-6.5.15 – December 1998
Overview of the Incremental Encoder Module
1–7
Preset Function
Use the preset function to copy a value from the preset register to the counter register.
Method 1
Preset Register
Preset
PresetReached = 1
Counter Register
Method 2
PresetEnable = 1
Preset Register
Logic
PresetReached = 1
Z =
Counter Register
The flag PresetReached is set when the counter register and the preset register are equal (if the counter preset is reached, or if the counter has been loaded with the preset value). This flag is reset on a positive edge of PresetReset after the operation and can only be set after at least one additional counting pulse.
Gate Function
Use the gate function to determine when counting starts and stops.You can use this function to measure distance.
The parameter GateControl determines the gate function. The gate signal is connected to input G. It is a 2–bit binary code in write word
1 or 2, bits 09 and 10
Word
Bits
Gate Control Function
Binary 10 09 Gate Control bits
0
1
0
0
0
1
No gate function on input G (Count is independent)
Counting only if G = 1 (active)
2
3
1 0 Counting only if G = 0 (inactive)
1 1 Calibration if G = 1 and all other conditions are fulfilled (refer to Calibrating the Module, chapter ?).
Example
Gate Control = 1
G = 1
Logic
Counter Register
A
The counter is counting if G = 1.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–8
Overview of the Incremental Encoder Module
Store Function
Use the store function to copy the value in the counter register
(Counter) to the latch register (StoreValue).
The StoreControl parameter determines the store function. Execution occurs on either the positive or negative edge of input signals G and
Z respectively (see table). The parameter is a 2–bit binary code in write word 1 (bits 11 and 12)
Word Bits
1 or 2 11–12
Binary 12 11 Store Control bits
0
1
2
3
0
0
1
1
0 Save the counter value on the positive edge of Z
(if Stored X = 0)
1 Save the counter value on the positive edge of G
(if Stored X = 0)
0 Save the counter value on the negative edge of G
(if Stored X = 0)
1 Save the counter value on both the positive edge and negative edge of G (if Stored X = 0)
The parameter Stored must be reset (0). Stored is set (1) when the operation is completed. Reset after the operation with StoreReset.
Example
Store Control = 1
Stored = 0
Counter Register
Logic
Latched = 1
G
Store Register
The counter value is copied to the store register on the positive edge of input signal G.
Limitation Function
If the control bit RangeLimited = 1, the counter counts up to the preset value and restarts at 0. Counting down, the counter reaches the preset value on the next pulse if the current counter value = 0.
RangeLimited = 0 corresponds to RangeLimited = 1 if the preset value = FFFF in hex = 65535 in decimal.
The flag PresetReached is set when the counter is equal to the preset value. Use PresetReset to reset the flag.
Publication 1794-6.5.15 – December 1998
Chapter Summary
Overview of the Incremental Encoder Module
Count Up pulse (+)
RangeLimited = 1
Counter = PresetValue
Logic
Value 0
Counter Register
Count Down pulse (–)
RangeLimited = 1
Preset Register
Logic
Counter = 0
Counter Register
Note: If the preset register value = 0, the counter retains the value 0.
1–9
In this chapter, you learned about the incremental encoder module, block transfer communication, and details of how the module functions. Now you can install the module.
Install the
ID2 Module
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–10
Overview of the Incremental Encoder Module
Publication 1794-6.5.15 – December 1998

Public link updated
The public link to your chat has been updated.
Advertisement