Fundamentals of analog inputs: How to choose the right device

Nov. 2, 2015
How to turn measured conditions into useful numbers for controllers.
About the author
Thomas Stevic is a controls engineer at Star Manufacturing, an engineering and production company in Cincinnati. Contact him at [email protected].

When a control scheme requires the measurement of the quantity of some property, a sensor or transducer with an analog output often is chosen to provide the measurement capability. Picking the correct device to use requires consideration of a number of factors. Two specifications that are easy to overlook are the rated operating temperature and the shock resistance of the device. Exceeding these limits can have adverse effects, including incorrect measurement values and destruction of the device.

Resolution and span

If your system requires the measurement of a property such as air pressure, flow or distance, one of the first considerations might be the required resolution necessary to meet the measurement requirements. Try to match the input range of the sensor or transducer to closely match the true working values the sensor is expecting to be exposed to.

For example, to measure a weight that will not normally exceed 500 lb, a more accurate reading will be provided using a load cell with a range of 0-750 lb, rather than a load cell with a range of 0-5,000 lb. Some additional capacity beyond the expected operating conditions is often a desirable option, and allowances must be made for hydraulic hammering or loads that may be dropped from some distance, but the closer you can get to the normal operating range of the process, the more accurate the results will be.

Some sensors have the ability to be programmed for a specific output range, so while the device may have a wide operating range, the output may be programmed to provide an accurate measurement within a much narrower range for the application. If you’re choosing a programmable device, one thing to consider is the amount of time it will take to replace the device, if it should become defective. A simpler non-programmable device may take much less time to replace than one that requires several programming steps before it can be put back into service. However, programmable devices often have additional features that may be desirable such as various alarms or averaging of the measured property or diagnostic capabilities.

All analog sensing devices should have a resolution specification listed in the technical documentation. Pick a device that provides a greater resolution than what is required for the application.

Analog linearity

Another specification to check is the amount of linearity. The perfect analog sensor or transducer will output a signal that is linear compared to the input property being measured. Due electronic improvements, modern sensors typically have very good linearity.

A good linear signal is relatively easy to scale into the units being measured. Using a 0-250 psi pressure sensor as an example, an output of 0% corresponds to an input of 0 psi. And output of 100 will correspond to 250 psi. An output of 50% full scale is 50% of 250 psi, or 125 psi. An output of 75% full scale is equal to 75% of 250, or 187.5 psi. An example found in the technical specifications might be <-+ 0.1 BFSL (best fit straight line), which means the output from the device will deviate less than 0.1% from a straight line graphed from the low-range output to the high-range output.

An analog measurement device typically uses the change in some physical property of a connected electrical interface to provide a change in the device’s electrical output. For example, the measurement of pressure or force is accomplished by a change in resistance to one element of a Wheatstone bridge. When the element that is used for the measurement leg of the bridge is subjected to different mechanical stresses, the electrical resistance changes. The electronics of the device senses the change in resistance and changes the value of the output signal accordingly.

Because the actual element that detects this change is a mechanical device before it is changed to an electrical signal, the operating environment of the mechanical portion of the sensor can change due to temperatures, humidity, vibration and even mounting orientation. The electrical properties of the sensing element are not always a linear due to these mechanical changes.

To see an example of a typical raw electrical output from a sensing element, do an Internet search for “thermocouple mV output chart.” The raw output of a thermocouple could be measured with a standard analog input, but the nonlinear signal will need to be converted to a useful value of temperature using a lookup table or mathematical formula in the program of the control device.

Also read: Back to Basics - The Power of the Loop

An easier solution to this situation would be to use an input device or module that is specifically designed for thermocouples such as a thermocouple input module in a PLC rack. A signal conditioner or temperature transducer that converts the raw mV signal to a standard voltage or current. These products not only amplify the measured signal value, allowing longer cable length, they will also linearize the signal, simplifying programming of the control device.

Analog output signal levels

When all other characteristics have been satisfied, the next decision is to select the output signal type. Typical industrial analog output voltage and current ranges are 0-5 Vdc; 1-5 Vdc; -10-+10 Vdc; 0-20 mA; and 4-20 mA. The controlling platform that will be used may restrict some choices, although most medium-to-high-end controllers accept a wide range of analog input levels base on selection of analog input module or by programming the analog input module to operate at the same voltage or current level supplied by the sensing device.

There is no best analog signal voltage or current. Different people will offer different arguments as to why one type of signal is better than another. Voltage output devices are typically simpler than current devices because of the electronics used. Current devices should provide more resistance to stray electrical noise that is often experienced in an industrial setting. Devices that have a nonzero lower output allow for easier detection of a broken wire or defective sensor condition.

[pullquote]If using a signal of 4-20 mA, should the input read 0 mA, it may be assumed that a wire has broken. If the 4-20 mA input detects a 2-mA or 22-mA signal, it could be assumed that the sensing device is either defective or is being exposed to a property that is outside the sensing device’s range.

Connecting analog devices

Connecting a voltage output device is typically straightforward. One wire will connect to +24 V, or whatever control voltage is being used, one wire will be connected to 0 V, or control voltage common, and a third wire is connected to the control device input. Some voltage output devices may have a secondary common wire to allow the control voltage and the sensing signal to be isolated.

A current output device has a few more connection options. There are two-wire connections where the controlling device supplies a voltage to the sensor; this type of sensing device may be referred to as “loop powered.” The sensor uses part of that voltage to run the internal electronics and then operates somewhat like a variable resistor to return a specific mA value to the control device input. Not all analog inputs will work with a two-wire sensor, so check the documentation to be sure the sensing device can be used.

A second current output wiring scenario is a three-wire connection. This connection has one wire for +24 V, or control voltage positive, one wire for 0 V, or control voltage common, and the third wire for the signal input. A third type is a four-wire connection that isolates the control power from the sensing current loop.

One must also be aware of the input impedance of the device the sensor will be attached to. If the impedance is too low for a voltage output device or too high for a current one, incorrect operation and even damage to the device may occur.

The manufacturer’s documentation usually has connection diagrams for all the types of sensing devices that may be connected. Unfortunately, not all manufacturers use the same nomenclature when documenting their products. Pay careful attention to the recommended grounding and wire shielding specifications.

The analog signal voltage levels of industrial devices are quite small compared to other devices that may be mounted in the same cabinet or connected using the same wireway. Good construction and installation practices can save considerable time in troubleshooting a measurement value that is wrong, or one that is not stable.

Analog input considerations

With the input device selected, the control analog input must be specified to match the input device. Along with being able to accept the type of signal the sensing device supplies, input resolution and conversion speed need to be considered.

Resolution is stated in the number of bits that the analog-to-digital (A/D) convertor breaks the input signal into. An 8-bit analog input will take the full range of voltage/current and convert it into 28 or one of 256 numbers. A 4-20 mA signal will supply 4 mA at 0 and 20 mA at 255. Similarly, a 0-10 Vdc signal will supply 0 Vdc at 0 and 10 Vdc at 255. Eight-bit input resolution is typically offered with lower-price and lower-capability control devices. For a 0-1,000 lb pressure sensing device, the smallest amount of change that can be detected is 3.90625 lb (1,000/256). If the application does not require a higher resolution, using 8-bit inputs can be less costly.

A 12-bit input resolution is a common analog input resolution for industrial equipment. A 12-bit A/D converter will divide the full range of the input signal into 4,096 parts(212). The 4-mA signal stays at 0, but the 20 mA signal now becomes 4,095. For the 1,000-lb pressure sensor used above, the smallest change in pressure is now 0.24414 lb (1,000/4,096).

There are some modules available that offer 16-bit resolution. The A/D converter for these will divide the full range of the input signal into 65,536 parts (216). This will make the smallest detectable change in input pressure (1,000/65,536 = 0.015258790625 psi).

Depending on the control platform used, some specialty modules may also be available that have 13-bit, 15-bit or other resolutions. The smallest change they can detect is calculated in the same manner.

Analog-to-digital convertors all have an operational speed referred to as the “conversion time.” Modern control devices are typically fast enough to work with most industrial processes, but it should be kept in mind that an analog measurement is not instantaneous and could be a factor on a very high-speed production line. A worst-case reaction time can be calculated as the reaction time of the sensing device + conversion time of the control’s A/D convertor + (2 x processor scan time).

When using a control system that has a base memory size of 16-bit registers and using a 12-bit analog input module, there will be 4 bits that are not part of the analog measurement. These bits are usually the upper 4 bits of the input word. Some manufacturers do not use the extra bits to signify anything and will be set to equal 0. Other manufacturers use these bits to signal a fault or status condition such as broken-wire detection or out-of-range condition (voltage/current too high or too low).

Assuming a 12-bit A/D module with diagnostic bits, the measurement information can be parsed from the input word in several ways. One technique is to logically “AND” the input register with FFF (hex) or 4,095 (dec) and put the result in a work register. Any further mathematical or comparison instructions will be performed on the work register. The diagnostic bits can directly control other logic conditions if they are accessible or they can be parsed in the same manner as above.

Scaling to engineering units

The analog input value or number that ends up inside the control device will normally need to be scaled, so it represents a meaningful quality of the property being measured (engineering units). The majority of devices will provide an analog signal that is from zero to some higher value, 0-1,000 psi, 0-10 gpm or 0-500°C. When the sensing device has 0 as one of the output points, scaling is quite simple. Divide the full scale value by the resolution and multiply by the measured input value.

Engineering units = (full scale value/resolution) * measure input value

                              = (1,000 psi/4,096 resolution) * measured input value

Some devices do not incorporate a 0 output that equals a 0 input. Laser displacement sensors typically have a non-zero input that is equal to the zero output. A laser displacement sensor may list the full scale output as 40 mm to 100 mm. In cases such as this, calculate the upper value minus the lower value (100 mm – 40 mm) to determine the full scale range, 60 mm in this case. Divide the full scale range by the input resolution, for example, 60/4,096, to calculate the scaling factor, and then add the zero point minimum value to determine the correct value of the property being measured.

Engineering units: = (((max–min) / resolution) * measured input value) + min

                               = (((100–40) / 4,096) * measured input value) + 40 mm

When the input signal is one of a positive and negative value, -10 Vdc to +10 Vdc, the sensor will have some value of the measured property that is equal to 0, again, using a laser displacement sensor, if 0 Vdc is equal to a distance midpoint of 0 mm, and 10 Vdc is equal to +100 mm from the midpoint, and -10 Vdc is equal to -100 mm from the midpoint, the full scale range of measurement will be 200 mm (+100 mm - (-100 mm)). The scaling factor will be 4,096/200. The measurement value will be (200/4,096) * measured input value. The polarity of the result will need to be determined by testing the measured input value against 0. The result will be 0 if the measured input value is 0; the result will be positive if the measured input value is greater than zero; and the result will be negative if the measured input value is less than zero.

In most cases, the analog measurement device and the control’s input device will need to be calibrated per company quality standards. Often, the sensing device may have zero and span adjustments built-in. If they do, standard calibration techniques can be used to bring the instrument into compliance. If the sensing device does not allow separate calibration, the control device will allow the same effect by mathematically moving the zero point as described above with the 40 mm to 100 mm laser displacement scaling discussion. To adjust the span, modify the scaling factor.

Homepage image courtesy of sumetho at FreeDigitalPhotos.net