beautypg.com

Sensor specifics, User-defined resistive sensors, Application example – Sensoray 518 User Manual

Page 45

background image

44

Sensor Specifics

User-defined Resistive Sensors

User-defined resistive sensors may be interfaced to the coprocessor subject to these constraints:

1. Sensor resistance does not exceed 300K ohms.

2. A quadratic linearization polynomial is sufficiently accurate.

This is the procedure for interfacing a user-defined resistive sensor:

1. Fit the sensor data to a polynomial of the form f(R) = aR

²

+ bR + c, where: R is the

resistance of the sensor in ohms, f(R) is the corresponding sensor data value in the
desired 518 integer output units, and a, b, and c are constant coefficients derived from
the curve fit.

2. Install commands in the host processor’s 518 initialization string to declare the

channel as a ‘user-defined resistive sensor’ and to define the channel sensor
linearization coefficients. See the Define Channel Sensor and Set Coefficients
commands for information.

Application Example

A non-linear resistive position transducer is to be interfaced to the 518 on channel 5. Position
data is to be acquired from the sensor and displayed in centimeters with resolution of one
millimeter. The following data have been determined empirically:

RESISTANCE

(ohms)

0

50

100

150

POSITION (mm)

-7.2

1673

4303

7883

A curve is fit to the transducer, resulting in the linearization function:

P = 0.19R

²

+ 24.1R – 7.2

This code fragment will declare the channel 5 sensor type to be a User-defined Resistive Sensor
and specify the linearization coefficients. Note that the “Send518Real” procedure is described in
the Set Coefficients command section.

CALL Send518Byte (16 + 5) ‘ declare channel 5 as User-defined
CALL Send518Byte (&HC) ‘ resistive sensor