omron — Basic Programming Concepts

Basic Programming Concepts The encoder variables contained in this final equation are described in later sections. The Belt Encoder Six belt encoders are supported by the conveyor tracking feature. Each belt encoder generates pulses that indicate both the distance that the belt has moved and the direction of travel. The pulses are counted by the belt interface, and the count is stored as a signed 24-bit number. Therefore, the value of an encoder counter can range from 2 23 -1 (8,388,607) to -2 23 (-8,388,608).

For example, if a single count of the encoder corresponds to 0.02 millimeters (0.00008 inch) of belt motion, then the full range of the counter would represent motion of the belt from approximately -167 meters (-550 feet) to +167 meters (+550 feet). After a counter reaches its maximum positive or negative value, its value will roll over to the maximum negative or positive value, respectively. This means that if the encoder value is increasing and a rollover occurs, the sequence of encoder counter values will be ... ; 8,388,606; 8,388,607; -8,388,608; -8,388,607; ...

As long as the distance between the workspace of the robot and the nominal transformation of the belt is within the distance that can be represented by the maximum encoder value, eV+ application programs normally do not have to take into account the fact that the counter will periodically roll over. The belt_ distance equation described above is based upon a relative encoder value: encoder_count - encoder_offset and eV+ automatically adjusts this calculation for any belt rollover that may occur. Care must be exercised, however, if an application processes encoder values in any way.

For example, a program may save encoder values associated with individual parts on the conveyor, and then later use the values to determine which parts should be processed by the robot. In such situations the application program may need to consider the possibility of rollover of the encoder value. The Encoder Scaling Factor For any given conveyor/encoder installation, the encoder scaling factor is a constant number that represents the amount the encoder counter changes during a change in belt position. The units of the scaling factor are millimeters/count.

This factor can be determined either directly from the details of the mechanical coupling of the encoder to the belt or experimentally by reading the encoder as the belt is moved. The belt calibration program supports either method of determining the encoder scaling factor. If the encoder counter decreases as the belt moves in its normal direction of travel, the scaling factor will have a negative value. eV+Language User's Guide, v2.x, 18318-000 Rev A Page 194