Académique Documents
Professionnel Documents
Culture Documents
where Bn(t) is a pulse that exists from 0 < t < T and has a value of 1 or -1, according to
whether the nth bit is a 0 or 1. T is one bit time. If phase is plotted versus time it is a
steadily increasing value that increases with two possible slopes.
Generating HART Signal With MATLAB
The following "M" file listing is a program for generating HART modulation with
MATLAB [3.1]. This is useful for testing or simulation. The program uses random
input bits and generates square, trapezoidal, and sinusoidal outputs. The output ranges
from -1 to +1. Figure 3.1 is an example of the output. The curves have been separated
for clarity. The bottom curve is the modulating signal.
%
%
hartgen.m
Generates HART signals.
%
%
%
%
%
%
%
%
%
%
%
%
%
%
OSI Model
Although HART can be adequately understood without resort to the OSI Model, some
of the OSI terminology exists in HART Standards. Therefore, a brief description of the
relationship is given here. A mapping of HART hardware to the Model is also
attempted.
The Open Systems Interconnection (OSI) Model [3.7] is a standard model for
communication systems. The intent of the OSI Model is to provide requirements for
being "open." The model consists of 7 layers, which are either physical or abstract
entities within the communicating system (device). The layers, listed in order from
highest to lowest are:
7.
6.
5.
4.
3.
2.
1.
Application
Presentation
Session
Transport
Network
Data Link
Physical
A given layer of one system (device) communicates with its counterpart in the other
system (device). A given layer generally knows (or can find out) the capabilities of the
next lower layer; and may request services of this lower layer. The Physical Layer,
which is the lowest layer, connects to a medium, which serves all of the communicating
systems. Sending a message consists of a series of requests by each layer to the next
lower layer, with appropriate protocol and addressing information being added at each
level. A request to a lower level or receipt of information from a lower level is called a
PDU (Protocol Data Unit). The next lower level that received the request or provided
the information calls it an SDU (Service Data Unit). Sometimes the terms PDU and
SDU are preceded by an indicator of the layer. For example, a DLPDU would be a
PDU sent or received by the Data Link Layer.
As defined by the OSI Model, conventional HART uses "connectionless"
communication. That is, connections are not established and removed (as with public
telephone network) in order for communication to occur.
In virtually all implementations of HART, the functions of layers 3 through 6 either
don't exist or are performed as a single activity by one computer or embedded
microcontroller. Consequently, conventional HART is usually said to implement only
layers 1 (Physical), 2 (Data Link), and 7 (Application).
In addition to interfacing (voltages, impedances, etc.) to the network cable, the HART
Physical Layer performs 4 basic functions:
1. Modulating an outgoing message.
2. Demodulating an incoming message.
3. Turning on carrier for an outgoing message.
4. Detecting carrier for an incoming message.
In the jargon of OSI a message transmission occurs like this: the Application Layer
gives a PDU (request) to the Data Link Layer. This request contains the destination
address and the data (including command number) to be sent. To the Data Link Layer,
this information is an SDU. The Data Link Layer then creates its own PDU by adding a
preamble, delimiter, source address, and error check bits and arranging them all in the
proper order. The Data Link Layer then performs three functions to send its message:
1.
2.
3.
A similar series of events takes place in a receiving device. One of the first steps is the
Data Link Layer making a PDU to the Physical Layer to listen for carrier.
HART hardware can be roughly related to the OSI layers 1, 2, and 7 as in figure 3.2.
9.90 nF
1.97 nF
27.04 nF
The simple model is seen to be just a single-pole lowpass filter. The output voltage is
easily determined. A comparison between the simple model voltage and the SPICE
model voltage is given in table 3.2. There is relatively good agreement, which suggests
that the simple model is probably sufficient for most analyses of HART signaling.
Rm (ohm)
Frequency
(Hz)
SPICE
magnitude
Simple
SPICE phase Simple phase
magnitude
100
900
0.0588 volt
0.0594
-13 degree
-8
100
3193
0.0493
0.0539
-40
-26
200
900
0.1137
0.116
-20
-15
200
3193
0.0779
0.0859
-55
-44
500
900
0.2400
0.247
-38
-35
500
3193
0.1076
0.114
-75
-68
1000
900
0.3429
0.353
-56
-54
1000
3193
0.1179
0.121
-85
-78
Frequency
(Hz)
Calc.
magnitude
Meas.
magnitude
Calc. phase
Meas. phase
250
500
12.3 mV
12.3
-2 degree
-2
250
1000
12.3
12.3
-4
-4
250
2000
12.2
12.3
-9
-8
250
5000
11.5
11.7
-21
-18
500
1000
24.0
23.9
-9
-7
500
2000
23.3
23.3
-17
-15
500
5000
19.3
20.1
-37
-32
1000
1000
45.4
44.9
-17
-14
1000
2000
40.5
41.1
-31
-27
1000
5000
26.0
28.7
-57
-50
The power spectral density (psd) of a signal is often of interest, since it defines which
frequency components are most important. The psd tells us what we need in the way of
frequency response of the communication channel, and whether there are any discrete
spectral lines that might be used for synchronization. It is also used to compare
different modulation methods. An expression for the psd of continuous phase FSK
under conditions used in HART is [3.3]
,
,
,
,
and
The resulting power spectrum (in dB) is indicated in figure 3.7. The amplitude has
been deliberately adjusted so that the peaks of the main lobe are at about 0 dB. The
measured power spectrum is shown in figure 3.8, for comparison.
acceptable capacitance versus series resistance and parallel resistance is now specified
in HART documents. See section entitled HART Network Circuit Models .)
never been an option in HART because of a desire to continue existing wiring practice.
The mechanism of crosstalk is illustrated in figure 3.12. The figure shows two current
loops and a signal path from a Field Instrument (F1) back to the wrong Master (Master
2).
5. Various investigations of crosstalk have shown that the worst type is Masterto-Master.
It occurs when one Master is talking on its respective network and another
Master
is trying to listen on an adjacent network. The listening Master receives not
only the
desired transmission from a Field Instrument, but also some of the
transmission from
the talking Master. Therefore, whenever possible, Masters connected to
adjacent
pairs should stagger their transactions so that messages don't overlap. The
nature of
HART is such that this is usually the case anyway.
Studies of HART crosstalk have usually been done by dividing the cable into many
small sections and using SPICE simulation on the resulting lumped circuits.
Agreement with measurement is usually good.
Non-HART devices can also interfere with HART through the same crosstalk
mechanism described here. End-users and installers of HART should be careful about
how they allocate the pairs in a multi-pair cable. Especially troublesome are pairs that
are used for any kind of ON-OFF or binary signaling (switches or relays) or supplying
power to heavy loads in the field area. Communication methods such as Honeywell DE
that involve very large signal excursions are also a possible source of trouble. We
suspect that, in many cases where interference exists, the interference source remains
dormant (OFF or in some unchanging state) for a long enough time that a HART
transaction can be completed. Thus, acceptable operation is still possible.
HART Message Errors
All data communication systems, including HART, are subject to bit errors caused by
noise and signal distortion. The rules for constructing HART networks attempt to
minimize signal distortion. And most receive circuits include a bandpass filter to limit
noise power. Still, these measures only reduce the likelihood of bit errors and don't
eliminate them.
In HART, if one or more bits are wrong, then the whole message is considered bad.
The Master-Slave nature of the HART Protocol means that Masters and Slaves behave
differently in response to a bad message. Normally a Master sends a command to a
Slave and expects a reply from the Slave. If a Master receives a bad message or no
message, it must usually re-transmit its command to the Slave. If a Slave receives a bad
message, it must not act on this message. But, depending on circumstances, it may still
send back a reply. The criterion to reply to a bad message is usually that everything
appeared correct up to and including the command byte. The reply includes a status bit
indicating that the message was bad.
HART uses vertical and longitudinal parity to catch bad bits. Longitudinal parity is
the exclusive OR of the 8 bits in each transmitted byte. Vertical parity is a checksum
byte that becomes the last byte of the message. This form of error detection was
chosen for HART because it is easily implemented in a smart process transmitter
without special hardware. The longitudinal parity is just the odd parity that is available
in most UART implementations, including UARTs built into popular microcontrollers.
In most device implementations, the longitudinal parity is generated and checked
automatically as part of the UART operation. The checksum byte is generated and
checked in software by exclusive ORing full bytes as they are transmitted or received.
An error detection scheme can be fooled into thinking that a message is good when it
isn't or bad when it isn't. A bad message that appears good is an undetected message
error or UME. A UME is the cardinal sin of data communication. Most
communication schemes try to make it a very rare occurrence. Numbers like once in 20
years are not uncommon. A UME usually results from a few combinations of bit errors
that are transparent to the detection scheme. For example, suppose we look at just the
longitudinal parity alone. This is a relatively unsophisticated error detection scheme.
Any even number of bit errors in a given byte will fool the parity checker.
For purposes of examining error detection, the full HART message may be thought of
as a matrix of bits. The matrix consists of 9 columns and N rows, where N is dependent
on the size of the message. Each row corresponds to one byte or character, including
the longitudinal (UART) parity bit. The Nth row is the checksum byte and its
longitudinal parity bit. This is illustrated in figure 3.13
Row
DDDDDDDDP
1
Row
DDDDDDDDP
2
.
.
Row
DDDDDDDDP
N-1
Row
CCCCCCCCP
N
D = message bit, P = long. parity bit, C = checksum bit.
Figure 3.13 -- HART Message as Bit Matrix
Each bit P in figure 3.13 is the exclusive OR of the 8 bits in its row. And each bit C is
the exclusive OR of all of the bits D in the column above it. We see that, for this
scheme to be fooled, we must have at least 4 bit errors and they must be located at the
vertices of a rectangle. An example is that of figure 3.14.
Row
DDDDDDDDP
1
Row
DEDDDDEDP
2
.
.
Row
DEDDDDEDP
N-1
Row
CCCCCCCCP
N
E = bit that is in error.
Figure 3.14 -- Bit Matrix That Will Cause UME
It is apparent that this is a much more sophisticated detection scheme than either
longitudinal parity or vertical parity alone, because there must be more bad bits and they
must be strategically located.
A measure of how well the error detection scheme works is the frequency of UMEs or
the probability of a UME. The probability of UME depends on the probability of 4 bit
errors and the probability that they are arranged to form a rectangle. Clearly, there
could also be 2 rectangles formed from 8 bad bits, or 3 rectangles, etc. But, given that
the probability of a bad bit is small, these multiple rectangle situations are improbable
compared to a single rectangle and need not be included. Then the probability of UME
is approximately given by
where P1 is the probability that any two bits in any row will be in error, P2 is the
probability that one of the corresponding column bits will be in error, P3 is the
probability that the remaining row/column bit will be in error. Let Pb be the probability
of a bit error and N the number of rows (= number of message bytes). Then
Another dimension to this problem is that there is actually more error detection
occurring than is implied by just the parity and checksum. Most HART software checks
delimiters, addresses, status, commands, sizes of data fields, units, limits on process
variable numbers, etc. This adds another layer of relatively exhaustive error checking.
If we are even moderately satisfied with a UME rate based on parity and checksum
alone, we should be entirely satisfied by the additional error checking.
The bit error rate is a function of (energy per bit)/(noise density) = (Eb/No). The
relationship given in Proakis [3.4], is
This applies to orthogonal FSK, in which one shift frequency is an integer multiple of
the other. The FSK used in HART is not quite orthogonal (ratio of frequencies is
2200/1200 = 1.833), but is close enough that a more complex relationship is probably
not warranted.
The above equation for Pb is based on a "bandwidth" that is the reciprocal of the bit
rate. It is generally found, however, that a bandwidth of at least twice the bit rate is
desired for FSK. Shanmuggam [3.5] uses this wider bandwidth and comes up with
what is probably a better expression for Pb. It is
where A = peak signal, T = bit time. To get Pb = 0.001 requires (Eb/No) = 24.9. Let S
be the signal power. Then Eb = ST = S/1200/second. Then
Simple HART receivers often do not limit received noise to a bandwidth of 2x bit
rate. The receive filter is often a single-pole lowpass with corner frequency in the range
of 5 to 10 kHz. A more general expression for Pb, that includes noise bandwidth, is
For a 10 kHz single-pole lowpass, B = 1.57(10 kHz) = 15.7 kHz. And BT = 13.1. To
get Pb = 0.001 now requires (Eb/No) = 163 and
Again, let the message length be N and assume that messages occur continuously.
The probability that a message is in error is given by the well known expression
where Y = 1/Nb.
The frequency criterion may be stated that there must be, on average, only one failure
per time T; or that the probability of a failure is 1 if there are fT messages, where f is the
frequency of messages. The time of one message is Nb*(1 second)/1200. Then f =
1200/(Nb second). The probability that there are exactly X consecutive messages in
error out of a total of fT depends on the number of ways that the X erroneous message
can occur. If fT is far larger than X, then the approximate number of ways is just fT.
That is, any message could be the start of the string of message errors. There could also
be X+1 consecutive errors and X+2, and so on. But if the probability of a message
being in error is small, then only the case of exactly X messages need be included. The
probability of X consecutive errors becomes
Setting Px = 1 gives
As an example, suppose that a Slave Device is in burst mode and repeatedly sending
a single process variable. Suppose that the Master receiving the information has been
programmed to flag an operator if there are 4 consecutive message errors. Assume that
20 bytes per message are sent; and that the operator is to be flagged no more than once a
week. Then we have X = 4 and Nb = 11*20 = 220. Continuous transmission implies
that there are about 5 messages per second. However, the protocol requires a delay
curve. This means that some combinations of noise and crosstalk are worse (cause
more errors) then either noise or crosstalk alone, even though the amount of interfering
(noise + crosstalk) power remains constant.
How Fast?
One interesting question is how fast could the HART Physical Layer be, given the
existing constraints of signal size, bandwidth, and noise? The Shannon-Hartley
Theorem [3.4, 3.5] gives the channel capacity as
1.5. HART Communication Foundation, 9390 Research Blvd., Suite II-250, Austin,
TX, 78759
1.6. HART Field Communications Protocol: A Technical Overview, HCF LIT 20, rev.
2, 1994, HART Communication Foundation.
1.7. Fieldbus Standard for Use in Industrial Control Systems, ISA SP-50, Instrument
Society of America.
3.1
3.4
3.5 Shanmugam, K.S., "Digital and Analog Communication Systems," 1979, John
Wiley & Sons.
3.6
3.7