A SURVEY OF COMMUNICATION PROTOCOLS IN MODERN EMBEDDED CONDITION MONITORING SYSTEMS

The aim of the paper is to present a recent development in the field of communication from the point of view of embedded machine condition monitoring system (CMS). Although the general purpose of CMS remains the same over years, various electronic innovations open new possibilities of enhancement, including lower price, smaller size, larger bandwidth, smaller energy consumption or larger distance for wireless transmission. The paper considers a general notion of an embedded monitoring system, which consists of a sensor, data acquisition and processing unit, storage peripherals


INTRODUCTION
Measuring and monitoring the condition of any machine has become increasingly important due to the introduction of agile production, increased accuracy requirements for products, and customers' requirements for quality assurance.Condition Based Maintenance (CBM) and Condition Monitoring Systems (CMS) practices, such as vibration monitoring, are becoming more attractive, but still challenging.CBM and CMS are usually used to plan the maintenance action based on the condition of the machines, and to prevent failures by solving the problems in advance (before they occur), as well as to control the accuracy of the machining operations.By increasing the knowledge in this area, it becomes possible to save money through fewer breakdowns, reduction of inventory cost, reduction of downtime needed for repairs, and an increase in the robustness of the manufacturing processes.The process of monitoring the technical state of machinery needs some contribution from an early fault and malfunctions detection, in order to succeed in prevention of machine failure.Keeping the machine working point at the conditions that are the optimal leads to downtime reduction of a machine, which results in economic loss reduction [4].The following specification and comparison of popular communication protocols is supposed to indicate the development direction of modern embedded condition monitoring system.

CONDITION MONITORING SYSTEM
Condition monitoring (CM) can be shortly described as a process of monitoring a parameter of condition in machinery, like vibration, in order to identify a significant change in the range of this Staszewski W, Jabłoński A, Dziedziech K.: A survey of communication protocols in modern embedded … parameter which usually may indicate a progression of ongoing fault [5].Condition Monitoring has a benefit in compare to other techniques (breakdown and preventive maintenance)deterioration of the crucial parameters that would shorten a typical lifespan of a component can be addressed before they could develop into a major failure [10], causing an unplanned downtime.Condition monitoring techniques are usually used on rotating machinery and other equipment like pumps, electric motors, internal combustion engines, presses, while periodic inspection using non-destructive testing techniques are used for stationary plant equipment such as steam boilers, piping and heat exchangers.The advantages that have been offered by the application of predictive maintenance techniques have in a past few years led to the increase in the development of a number of methods for condition monitoring/faultdiagnostic systems [17].After detection of possible failure (significant change of monitored parameter), mostly the diagnostic staff is responsible for taking the necessary actions in order to verify the condition of the machinery and later on act accordingly to prevent from machine failure.These activities may require further data measurement in order to collect more data that might be necessary in order to make appropriate decision regarding machines condition, but at the point where the failure starts to develop it is necessary to notify the engineers that the condition of machinery is changing.The scheme of major Condition Monitoring System functionalities is presented in the Figure 1.

Fig. 1. Scheme of modern Condition Monitoring System
Nowadays, that technology related to electronics systems is developing rapidlythis trend could be observed by looking into the direction of mobile devices development, where every few months there is improvement in data processing (clock speed and number of processing cores [14]), data transfer (speed and power efficiency of wireless communication [1][2][6]) and energy consumption [8].
The Internet of Things (IoT) is the rapidly growing trend of non-traditional devices being connected to the Internet.Industry analysts from International Data Corporation (IDC) suggest that the IoT devices and their ecosystem is expected to create $8.9 (a five-year annual growth rate of 16,8%) trillion market in 2021 with an estimated 20 billion devices [19].
A point where all modern technologies are being culminated is already underway in the industry (called Industry 4.0).It leverages existing and emerging technologies to improve the efficiency, effectiveness and service that must be provided in order to be competitive in the future.Fig. 2. A scheme of embedded device which is a part of CMS Figure 2 represents embedded device that is a part of Monitoring System presented on the Figure 1, taking into consideration what the possible communication protocols are between each of the components.Unfortunately, a development trend which is visible in today's world cannot be distinguished in practices related to Condition Monitoring Systems, because the complexity of installation and cost of such systems is holding its manufacturers from introducing significant changes in the architecture of CMS.On the other hand, it is difficult to argue reasonably why it is necessary to invest in new diagnostic infrastructure if the condition monitoring system is already installed on the machinery and since such modification would probably mean that it is crucial to interrupt machine operation.

EMBEDDED DEVICE
An embedded device is a type of device that is highly specialized for one or very few specific purposes, and is embedded or included within another object or as element of a larger system that serves a greater purpose than the embedded device itself.Data Acquisition Unit (DAQ) is a hardware that acts as the interface between a computer (end-user or host) and signals from the considered machine.Its primary function as a device is to digitize incoming signals so that a computer can interpret them.Many DAQ devices include other functions for automating measurement systems and data processing.

. Protocol constraints
The choice of a transducer (in considered case it is an accelerometer)analog or digital -is determined by the hardware (System on Chip -SoC) that is interfacing with the accelerometer.Analog accelerometer outputs a continuous voltage that is proportional to acceleration, and therefore there is a need to introduce an element (called Analog-Digital Converter -ADC), which will convert the analog signal into digital form that can be used later on in Monitoring System.Digital accelerometers use Pulse Width Modulation (PWM) for their output which means that on their output there is a square wave of a certain frequency, and the amount of time the voltage is high will be proportional to the amount of acceleration.
The core element of a typical MEMS accelerometer is a moving beam structure composed of two sets of fingers: one set is fixed to a solid ground plane on a substrate; the other set is attached to a known mass mounted on springs that can move in response to an applied acceleration.This applied acceleration (Figure 4) changes the capacitance between the fixed and moving beam fingers.

Fig. 4. Diagram of MEMS accelerometer
The communication protocol between a transducer and the SoC is determined directly by chosen type of accelerometer or ADC.The following subsections describe in details the possible protocols.

Inter-Integrated Circuit (I²C) communication protocol
This bus is typically used for attaching lowerspeed peripheral ICs (integrated circuits) to processors and microcontrollers over a short-distance.Usually used for an intra-board communication.I²C uses only two bidirectional lines, Serial Data Line (SDA) and Serial Clock Line (SCL), pulled up with resistors.As the name indicates, the SDA line contains the data and the SCL with the clock signal for synchronization.Typical voltages used are +5 V or +3.3 V, although systems with other voltages are permitted [16].
The I²C reference design has address space of a 7bit or a 10-bit -depending on the used device.Common bus speeds are: the 100 kbit/s in a standard mode and the 10 kbit/s low-speed mode.Recent revisions of I²C can host more nodes and run at faster speeds (400 kbit/s Fast mode, 1 Mbit/s Fast mode plus, and 3.4 Mbit/s High Speed mode) [13].These higher speeds are more widely used on modern embedded systems, where it might be necessary to transmit the large amount of data.It is worth noting that the bit rates are quoted for the transactions between master and slave, without clock stretching or other hardware overhead.Protocol overheads include a slave address and perhaps a register address within the slave device, as well as acknowledged/not acknowledged bits.Thus, the actual transfer rate of user data is lower than those peak bit rates alone would imply.Figure 5 presents exemplary connection for I²C protocol.

Fig. 5. Example of I²C communication protocol
The basic design of I²C has a 7-bit address space with 16 reserved addresses, which makes the maximum number of nodes that can communicate on the same bus as 112 [16].That means each I²C device is recognized by a unique 7-bit address.It is important to note that the maximum number of nodes is limited by the address space, and also by the total bus capacitance which is 400 nodes.

Serial Peripheral Interface (SPI) communication protocol
It is a synchronous serial communication interface used for short distance communication, primarily in embedded systems.SPI devices communicate in full duplex mode (both parties can communicate with each other simultaneously, which is visualized in the Figure  As already known, in SPI-bus communication there is one master allowed with multiple slaves devices connected to master.In single-master protocol, usually one SPI device acts as the SPI Master, and controls the data flow by generating the clock signal (SCLK), and activating the appropriate slave to communicate with slave-select signal (SS), then receives and or transmits data via the two data lines.A master, usually the host micro controller, always provides clock signal to all devices on a bus whether it is selected or not.

Data Acquisition Unit
Cache memory, also called CPU memory, is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM.This memory is typically integrated directly with the CPU chip or placed on a separate chip that has a separate bus interconnect with the CPU.The basic purpose of cache memory is to store program instructions that are frequently rereferenced by software during operation.Fast access to these instructions increases the overall speed of the software program.As the microprocessor processes data, it looks first in the cache memory; if it finds the instructions there (from a previous reading of data), it does not have to do a more time-consuming reading of data from larger memory or other data storage devices.
Although, for CMS application cache memory might be not enough, that is why the following connection protocols can be used in order to extend the storage in embedded device.

Serial Peripheral Interface (SPI)
communication protocol SPI communication protocol described in 3.1.3.

Serial communication -Universal Asynchronous Receiver-Transmitter (UART)
It is hardware device for asynchronous serial communication, in which the data format and transmission speeds are configurable.Exemplary connection is presented in the Figure 7.The electric signaling levels and methods are handled by a driver circuit external to the UART [9].The universal asynchronous receiver/transmitter (UART) takes bytes of data and transmits the individual bits in a sequential fashion.At the destination, a second UART reassembles the bits into complete bytes [11].Each UART contains a shift register, which is the fundamental method of conversion between serial and parallel forms.Serial transmission of digital information (bits) through a single wire or other medium is less costly than parallel transmission through multiple wires.8) is a computer or other device connected to a computer network.It may offer information resources, services, and applications to users or other nodes on the network.A network gateway is a network node that is assigned a network layer host address.[3][20] Computers participating in networks that use the Internet Protocol Suite may also be called IP hosts.Specifically, computers participating in the Internet are called Internet hosts, sometimes Internet nodes.Internet hosts and other IP hosts have one or more IP addresses assigned to their network interfaces.The addresses are configured either manually by an administrator, automatically at start-up or by stateless address auto-configuration methods [18].Every network host is a physical network node (i.e. a network device), but not every physical network node is a host.Network devices such as modems, hubs and network switches are not assigned host addresses (except sometimes for administrative purposes), and are consequently not considered to be network hosts.Devices such as network printers and hardware routers have IP addresses, but since they are not general-purpose computers, they are sometimes not considered to be hosts.[12][15].
Network hosts that participate in applications that use the client-server model of computing are classified as server or client systems.Network hosts may also function as nodes in peer-to-peer applications, in which all nodes share and consume resources in an equipotent manner.
The netwrk host serves as the control center of the DAQ system.It can be used to: • control the DAQ, • provide a graphical user interface (GUI) for the user to operate the system (with use of web GUI based on http protocol) • store the acquired information on mass storage devices • provide the tools to display and/or analyze the acquired data in real or non-real time

Wireless communication protocols 3.3.1.1 Bluetooth
It is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices and building personal area networks (PANs).Invented by telecom vendor Ericsson in 1994, it was originally conceived as a wireless alternative to RS-232 data cables.It can connect up to seven devices, overcoming problems that older technologies had when attempting to connect to each other.[8] Bluetooth operates at frequencies between 2402 and 2480 MHz, or 2400 and 2483.5 MHz including guard bands 2 MHz wide at the bottom end and 3.5 MHz wide at the top.This is in the globally unlicensed (but not unregulated) Industrial, Scientific and Medical (ISM) 2.4 GHz short-range radio frequency band.Bluetooth uses a radio technology called frequency-hopping spread spectrum.Bluetooth divides transmitted data into packets, and transmits each packet on one of 79 designated Bluetooth channels.Each channel has a bandwidth of 1 MHz.It usually performs 800 hops per second, with Adaptive Frequency-Hopping (AFH) enabled.Bluetooth low energy uses 2 MHz spacing, which accommodates 40 channels.

WiFi
It is a technology for wireless local area networking with devices based on the IEEE 802.11 standards.802.11 is the "radio frequency" needed to transmit Wi-Fi, it was defined by Vic Hayes who created the IEEE 802.11 committee.Devices that can use Wi-Fi technology include personal computers, video-game consoles, smartphones, digital cameras, tablet computers, digital audio players and modern printers.Wi-Fi compatible devices can connect to the Internet via a WLAN network and a wireless access point.Such an access point (or hotspot) has a range of about 20 meters indoors and a greater range outdoors.Hotspot coverage can be as small as a single room with walls that block radio waves, or as large as many square kilometers achieved by using multiple overlapping access points.[8] Depiction of a device sending information wirelessly to another device, both connected to the local network, in order to print a document Wi-Fi most commonly uses the 2.4 gigahertz (12 cm) UHF and 5 gigahertz (6 cm) SHF ISM radio bands.Having no physical connections, it is more vulnerable to attack than wired connections, such as Ethernet.

Zigbee
It is an IEEE 802.15.4-based specification for a suite of high-level communication protocols used to create personal area networks with small, low-power digital radios, such as for home automation, medical device data collection, and other low-power low-Staszewski W, Jabłoński A, Dziedziech K.: A survey of communication protocols in modern embedded … bandwidth needs, designed for small scale projects which need wireless connection.
The technology defined by the ZigBee specification is intended to be simpler and less expensive than other wireless personal area networks (WPANs), such as Bluetooth or Wi-Fi.Applications include wireless light switches, electrical meters with in-home-displays, traffic management systems, and other consumer and industrial equipment that require short-range lowrate wireless data transfer.
Its low power consumption limits transmission distances to 10-100 meters line-of-sight, depending on power output and environmental characteristics.ZigBee devices can transmit data over long distances by passing data through a mesh network of intermediate devices to reach more distant ones.ZigBee is typically used in low data rate applications that require long battery life and secure networking (ZigBee networks are secured by 128 bit symmetric encryption keys.)ZigBee has a defined rate of 250 kbit/s, best suited for intermittent data transmissions from a sensor or input device.

Wired communication protocols 3.3.2.1. Modbus
The Modbus communication interface is built around messages.The format of these Modbus messages is independent of the type of physical interface used.On plain old RS232 are the same messages used as on Modbus/TCP over Ethernet.This gives the Modbus interface definition a very long lifetime.The same protocol can be used regardless of the connection type.Because of this, Modbus gives the possibility to easily upgrade the hardware structure of an industrial network, without the need for large changes in the software.A device can also communicate with several Modbus nodes at once, even if they are connected with different interface types, without the need to use a different protocol for every connection.Serial Modbus connections can use two basic transmission modes, ASCII or RTU, remote terminal unit.The transmission mode in serial communications defines the way the Modbus messages are coded.With Modbus/ASCII, the messages are in a readable ASCII format.The Modbus/RTU format uses binary coding which makes the message unreadable when monitoring, but reduces the size of each message which allows for more data exchange in the same time span.All nodes on one Modbus network segment must use the same serial transmission mode.A device configured to use Modbus/ASCII cannot understand messages in Modbus/RTU and vice versa.

A Controller Area Network -CAN bus
CAN bus is a robust bus standard designed to allow microcontrollers and devices to communicate with each other in applications without a host device.This protocol is a message-based protocol, designed originally for multiplex electrical wiring within automobiles to save on copper, but is also used in many other contexts.CAN is a multi-master serial bus standard for connecting Electronic Control Units [ECUs] also known as nodes.Two or more nodes are required on the CAN network to communicate.The complexity of the node can range from a simple I/O device up to an embedded computer with a CAN interface and sophisticated software.The node may also be a gateway allowing a standard computer to communicate over a USB or Ethernet port to the devices on a CAN network.
Each node requires a: • Central processing unit, microprocessor, or host processor o The host processor decides what the received messages mean and what messages it wants to transmit.o Sensors, actuators and control devices can be connected to the host processor.• CAN controller; often an integral part of the microcontroller o Receiving: the CAN controller stores the received serial bits from the bus until an entire message is available, which can then be fetched by the host processor (usually by the CAN controller triggering an interrupt).o Sending: the host processor sends the transmit message(s) to a CAN controller, which transmits the bits serially onto the bus when the bus is free.

• Transceiver
o Receiving: it converts the data stream from CAN bus levels to levels that the CAN controller uses.It usually has protective circuitry to protect the CAN controller.o Transmitting: it converts the data stream from the CAN controller to CAN bus levels.The CAN specifications use the terms "dominant" bits and "recessive" bits where dominant is a logical 0 (actively driven to a voltage by the transmitter) and recessive is a logical 1 (passively returned to a voltage by a resistor).The idle state is represented by the recessive level (Logical 1).If one node transmits a dominant bit and another node transmits a recessive bit then there is a collision and the dominant bit "wins".This means there is no delay to the higher-priority message, and the node transmitting the lower priority message automatically attempts to re-transmit six bit clocks after the end of the dominant message.This makes CAN very suitable as a real time prioritized communications system.

Universal Serial Bus (USB) via UART
A Universal Serial Bus (USB) is a common interface that enables communication between devices and a host controller such as a personal computer (PC).It connects peripheral devices from printers and Staszewski W, Jabłoński A, Dziedziech K.A survey of communication protocols in modern embedded … scanners to media devices such as external hard drives and flash drives.Because of its wide variety of uses, including support for electrical power, the USB has replaced a wide range of interfaces like the parallel and serial port.
A USB is intended to enhance plug-and-play and allow hot swapping.Plug-and-play enables the operating system (OS) to spontaneously configure and discover a new peripheral device without having to restart the computer.As well, hot swapping allows removal and replacement of a new peripheral without having to reboot.
There have been three major USB standards, 3.1 being the newest:

COMPARISON OF CONNECTION PROTOCOLS BETWEEN DIFFERENT PARTS OF CONDITION MONITORING SYSTEM
Table 1 presents comparison of properties of available connection protocols that can be used in order to connect peripherals to the DAQ.It provides comparison between these interfaces based on various factors which include possible distance, type of communication, clock, hardware and software complexity, advantages and disadvantages.
In order to choose proper protocol for communication between elements in modern data acquisition unit for use in Condition Monitoring System it is necessary to analyze the preceding table, since the choice of the protocol may affect the operation of the device, especially efficiency of data measurement and data transfer.UART protocol provides the smallest data transfer rate comparing to the rest of protocols, its range is very limited and only two devices can communicate with each otherbut the implementation of this protocol is the simplest and therefore many embedded devices provide interface for this type of communication.SPI protocol provides the highest data transfer rate and allows to communicate over the longest distance in compare to other considered protocols, but hardware complexity might be undesirable while development on embedded systems.I2C protocol allows distinguishing many masters and many slaves in the network, but supports only half-duplex communication.This might be a reason to choose another communication protocol when it is necessary to support full-duplex mode between devices in the network.3 presents a comparison of properties of available connection protocols that can be used in order to connect embedded monitoring system to the network gateway or enduser device responsible for data distribution across all over the Condition Monitoring System network.It provides comparison between these interfaces based on various factors which include possible range, used frequency, data rate, advantages and disadvantages.
Since introduce wireless communication protocol might be needed between embedded device and end-user device it is necessary to consider the parameters of data transmission rate, nominal range of the protocol and energy efficiency and therefore analyze the preceding table which sums up the comparison between described interfaces, including wireless and wired communication protocols.Bluetooth allows to communicate over the shortest distance with respect to considered protocols, it's network is limited to only 8 devices, but attracts by decent data transfer rate, simplicity of implementation, accessibility in many devices (e.g.smartphones, tablets, computers) and efficient power consumption whereas Zigbee protocol provides even better energy efficient than Bluetooth.WiFi is a protocol that provides the biggest data transmission rate for wireless protocols, decent network size and signal range, but uses a lot of energy and therefore is not always the best choice when considering battery power devices.Modbus TCP/IP wired protocol offers the highest data transfer rate considering both wired and wireless protocols and therefore is usually used when it is necessary to send a lot of data over the network or when it is necessary to design wired condition monitoring system.

SUMMARY
Generally, industrial machine monitoring systems typically operate on well-established communication protocols, and are simply wired.However, latest development in sensor technologies (MEMS with exceptional low noise characteristics [21]) and wireless transmission enabled new possibilities, which in the near future could result in Staszewski W, Jabłoński A, Dziedziech K.A survey of communication protocols in modern embedded … cheap, widely spread monitoring systems.As it is easily deducted from the paper, recent development covers both, new technologies, as well as applications on existing protocols on different levels.Such idea is additionally enhanced by currently favored concept of Industry 4.0, which assumes practically ubiquitous measuring points on industrial machinery.In this scenario, development of cheap, wireless technology, which requires implementation of protocols described in the paper is inevitable.

Figure 3
Fig. 3.A scheme of an embedded DAQ as autonomous device in local monitoring system 3.1.Vibration transducer 3.1.1.Protocol constraintsThe choice of a transducer (in considered case it is an accelerometer)analog or digital -is determined by the hardware (System on Chip -SoC) that is interfacing with the accelerometer.Analog accelerometer outputs a continuous voltage that is proportional to acceleration, and therefore there is a need to introduce an element (called Analog-Digital Converter -ADC), which will convert the analog signal into digital form that can be used later on in Monitoring System.Digital accelerometers use Pulse Width Modulation (PWM) for their output which means that on their output there is a square wave of a certain frequency, and the amount of time the voltage is high will be proportional to the amount of acceleration.The core element of a typical MEMS accelerometer is a moving beam structure composed of two sets of fingers: one set is fixed to a solid ground plane on a substrate; the other set is attached to a known mass mounted on springs that can move in response to an applied acceleration.This applied acceleration (Figure4) changes the capacitance between the fixed and moving beam fingers.

DIAGNOSTYKA, Vol. 19 ,
No. 2 (2018)   Staszewski W, Jabłoński A, Dziedziech K.: A survey of communication protocols in modern embedded … 6) using a master-slave architecture with a single master [7][16].The master device originates the frame for reading and writing.An SPI protocol specifies 4 signal wires: 1. Master Out Slave In (MOSI) -MOSI signal is generated by Master, recipient is the Slave.2. Master In Slave Out (MISO) -Slaves generate MISO signals and recipient is the Master.3. Serial Clock (SCLK or SCK) -SCLK signal is generated by the Master to synchronize data transfers between the master and the slave.4. Slave Select (SS) from master to Chip Select (CS) of slave -SS signal is generated by Master to select individual slave/peripheral devices.The SS/CS is an active low signal.

Fig. 6 .
Fig. 6.Scheme of SPI communication protocolMultiple slave devices are supported through selection with individual slave select (SS) lines.The SPI bus can operate with a single master device and with one or more slave devices.If a single slave device is used, the SS pin may be fixed to logic low if the slave permits it.With multiple slave devices, an independent SS signal is required from the master for each slave device.Most of the slave devices have outputs with triple states, so their MISO (Master Input Slave Output) signal becomes high impedance (logically disconnected) when the device is not selected.Devices without outputs with triple state cannot share SPI bus segments with other devices; only one such slave can communicate to the master node.Among these four logic signals, two of them MOSI & MISO can be grouped as data lines and other two SS & SCLK as control lines.As already known, in SPI-bus communication there is one master allowed with multiple slaves devices connected to master.In single-master protocol, usually one SPI device acts as the SPI Master, and controls the data flow by generating the clock signal (SCLK), and activating the appropriate slave to communicate with slave-select signal (SS), then receives and or transmits data via the two data lines.A master, usually the host micro controller, always provides clock signal to all devices on a bus whether it is selected or not.

Fig. 7 .
Fig. 7. Scheme of UART communication protocolThe term universal means that transmission speed and data format is configurable.As it is asynchronous, so it does not need to send clock signal along with the data signals.UART uses two data lines for sending (Tx) and receiving (Rx) data.The ground of both devices should be made common.

Table 1 .
Comparison of CMS connection protocols used in the embedded system part

Table 2 .
Comparison of CMS wireless connection protocols used between embedded system and the network gateway (or end-user)

Table 3 .
Comparison of CMS wired connection protocols used between embedded system and the network gateway (or end-user)

Table 2 and
Table