.

Compares and Encoder Rollover

The XMP's compare engine is capable of handling encoder rollover. The compare engine is designed to produce correct comparisons when the encoder is within 230 counts (1073741824 counts). The way the compare engine works is by dividing the range of signed 32-bit integers into four "quadrants" as shown below.

   

The compare engine looks to see if the encoder position is in an adjacent quadrant to the compare position.

If so, then the engine responds appropriately thus avoiding encoder rollover problems. If the encoder position is in the opposite quadrant, the compare engine assumes a false comparison and no comparison is made. If the encoder position is in the same quadrant, a comparison is necessary and the compare engine will perform a comparison.

TRUE = Comarison
FALSE = No Comparison

For motion that is in the negative direction, you will typically use a Less Than or Equal to Comparison (blue).

For motion that is in the positive direction, you will typically use a Greater Than Comparison (green).

         

A scenario that may be confusing and prone to an encoder rollover problem occurs between ±231 and -230. However, the following diagram will show how this comparison is not plagued by any rollover problem. For example,

If,
   y =  2,000,000,000
   x = -1,600,000,000
   z = -1,000,000,000

Despite the actual values of the points, the compare engine sees the following relationships:

y < x
z > x

 

Here is an example demonstrating how the compare engine might work in a real-life scenario. The example below is using the Greater Than Comparison. Let's say that the XMP is controlling the camera so that it takes a snapshot once an object passes the compare position. The camera is set up to take a photo upon the transition of a digital I/O line that the XMP controls. Once the object has passed the compare position, the I/O state will change and a snapshot will be taken of the object. The host computer may then receive the data and based upon the results, tell the XMP to make the necessary adjustments.

The following table of diagrams can be used as a guide to explain every possible compare engine result.

For motion that is in the positive direction, you will typically use a Greater Than Comparison (yellow).
For motion that is in the negative direction, you will typically use a Less Than or Equal Comparison (blue).

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering