Skip to content
Automation Systems Design

Sensors and connections: the 4-20 mA loop and encoders

Why a current, live zero and NAMUR, the loop voltage budget proved with an example, HART, sensor parameters, encoder quadrature and Gray code proved.

An automated system sees the plant through sensors and acts through actuators; the link between the field and the controller must carry signals over hundreds of metres, in environments full of noise, and report its own faults. In this lesson we look at the 4-20 mA current loop with the voltage budget proved and an example, scaling and the “live zero”, sensor parameters, and incremental and absolute encoders with the proofs on quadrature decoding and Gray code.

The 4-20 mA current loop

The most widespread standard for analogue field signals transmits the measurement as a current between 4 and 20 mA, proportional to the value between the minimum and maximum of the range.

4-20 mA current loop
A 24 V supply, the transmitter TX (which regulates the current I and needs at least V TX,min across it), the wire resistances R w and the 250 ohm measuring resistor in the controller input, across which the current becomes a voltage from 1 to 5 volts.

Why a current and not a voltage? In a series circuit the current is the same at every point (Kirchhoff’s current law): the wire resistance, which changes with length and temperature, does not alter the measurement, whereas a voltage would arrive reduced by the drop across the wires. Moreover, the low impedance of the circuit makes it insensitive to capacitive disturbances (Electromagnetic Compatibility lesson on coupling). And two wires are enough, carrying both the transmitter’s supply and the signal.

The measured value is obtained with x = x_{min} + (x_{max} - x_{min})(I - 4)/16. The zero of the range corresponds to 4 mA, not 0: this is the live zero. A current below about 3.6 mA (broken wire, failed transmitter) or above 21 mA (short circuit) is outside the range and is recognised as a fault (NAMUR recommendation NE 43). With a zero at 0 mA a cut wire would look like a valid minimum reading: for example an empty tank, while it is overflowing.

Theorem. A loop supplied with voltage V_s, with a transmitter needing at least V_{TX,min} to operate, works over the whole range if the total loop resistance (wires plus measuring resistor) satisfies

    \[ R_{tot} \le \frac{V_s - V_{TX,min}}{I_{max}} \]

Proof. By Kirchhoff’s voltage law, the voltage available across the transmitter is V_s - IR_{tot}. It is minimum when the current is maximum, I_{max} = 20 mA (or a little more if the high fault must be signalled). It must remain at least V_{TX,min}: V_s - I_{max}R_{tot} \ge V_{TX,min}, hence the formula. ∎

Example. V_s = 24 V, V_{TX,min} = 12 V: R_{tot} \le 12/0.02 = 600 Ω. With 250 Ω of measuring resistance, 350 Ω remain for the wires: with 0.5 mm² cable (about 36 Ω/km per conductor, i.e. 72 Ω/km out and back) almost 5 km can be reached. If other instruments are inserted in the loop (a local indicator, an intrinsic safety barrier for explosive areas), each uses part of the budget.

On top of the analogue current the HART protocol superimposes a frequency-modulated digital signal with zero mean, which does not disturb the measurement and allows the transmitter to be configured and its diagnostics read. More and more often sensors are connected directly to a network (IO-Link, fieldbuses, lesson on industrial networks).

Sensor parameters

  • Measuring range and permissible overload.
  • Accuracy: how close the measurement is to the true value, including all errors (Electrical Measurements lesson on uncertainty).
  • Repeatability: how similar repeated measurements under the same conditions are. For many control loops it matters more than accuracy, because a constant error is compensated.
  • Resolution: the smallest detectable change.
  • Response time, often expressed as a time constant: a slow sensor adds a delay to the control loop (lesson on process models).
  • Ingress protection (IP), operating temperature, certifications for explosive atmospheres (ATEX).

Encoders

An incremental encoder measures a rotation with a disc with N lines read by two sensors offset by a quarter of a line: the signals A and B are two square waves in quadrature.

Theorem. Counting all edges of A and B gives 4N counts per revolution, and the direction of rotation follows from the order of the edges.

Proof. In one line period each wave has one rising and one falling edge; the edges of A and B, offset by a quarter period, never coincide, and in one period there are four, equally spaced. With N periods per revolution there are 4N edges. Rotating one way A leads B by a quarter period, the other way it lags: at the rising edge of A, B is 0 in one direction and 1 in the other, and the counter goes up or down accordingly. ∎

Example. A 1024-line encoder gives 4096 counts per revolution, i.e. a resolution of about 0.088°. A third signal Z (index) gives one pulse per revolution, to find zero.

An incremental encoder loses its position when switched off. An absolute encoder reads on several tracks a code identifying the position. Gray code is used, in which consecutive positions differ by a single bit: with natural binary, going from 0111 to 1000 four bits change, which the sensors never read at exactly the same instant, and for a moment any value could be read. Gray code is built by reflection: the (n + 1)-bit code is the n-bit one preceded by 0, followed by the same in reverse order preceded by 1. By induction, consecutive positions within each half differ by one bit (by the hypothesis on the n-bit code), and at the boundary between the halves the two words have the same tail and differ only in the added bit; the first and last also differ by a single bit, and the code is cyclic.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x