1 measuring angle and position – Interlink Electronics Ring Sensor User Manual

Page 9

Advertising
background image

www.interlinkelectronics.com

7

Ring Sensor

Integration Guide

5.1 Measuring

Angle and Position

In the following discussion, the sensor is oriented with the tail at 12 o’clock. 0º is straight north (12
o’clock) and the angle increases clockwise. The drivelines are at 0°, 120° and 240°. It is useful to
think of the ring as divided into three zones, with zone 1 defined as the 120° segment centered on
D1, zone 2 as the 120° segment centered on D2, and zone 3 as the 120° segment centered on
zone 3.

Determining the Touched Zone

The first part of the algorithm is to determine which zone is being touched. The goal is to determine
which drive line is closest to the point of touch, so that the other two drive lines can be used in a
later step to determine the precise touch location.

Finding which drive line is closest to the point of touch can be done quickly with three
measurements. In each measurement, two of the drivelines are set high and one is set low. The
closest driveline will be the one with the lowest ADC reading. Here are the detailed steps required
for this measurement:

1. Set lines D2 and D3 high, and D1 low.

2. Measure the sense line using the ADC. Call this V1.

3. Set lines D1 and D3 high, and D2 low.

4. Measure the sense line using the ADC. Call this V2.

5. Set lines D1 and D2 high, and D3 low.

6. Measure the sense line using the ADC. Call this V3.


Then following code can be used to determine which zone is being touched:

if(v1<=v2)

{

if(v1<=v3)

zone=1;

else

zone=3;

}

else

{

if(v2<v3)

zone=2;

else

zone=3;

}

Advertising