Design a wireless IIoT gateway with open-source tools

Wireless: Software-defined radio (SDR) hardware and open-source programming software provides an alternative to proprietary wireless communications systems, helping improve Industrial Internet of Things (IIoT) networks.

By Paul Dillien, High Tech Marketing September 4, 2018

Despite many discussions about how the Industrial Internet of Things (IIoT) will change factory automation, no unifying technology exists to connect various "things" together, which results in incompatibility among systems. Connections among disparate industrial wireless standards can be made with open-source software-defined radio (SDR) technologies.

Compatibility issues can be best illustrated by looking at IIoT, an application subset where pervasive connectivity offers significant benefits. A leading communications equipment vendor estimated over 90% of industrial machinery is not currently connected to any network. Sensors can provide real-time information of production line efficiency and throughput, equipment loading, asset tracking, energy consumption, and monitoring device wear. Having this data will allow factories to increase efficiency, lower costs, predict maintenance requirements, and reduce machine downtime.

The controlling computers can run machine-learning (ML) algorithms to detect patterns in data and tune program actions to get the most from the assets. The "Big Data" collected can be extracted for human analysis and comprehension. The vision of a fully interconnected and automated smart factory is sometimes called Industrie 4.0.

The advantages of connected machinery are diminished unless data communications from the whole facility can be collected, analyzed, and shared between multiple data sources. This might be easier for a greenfield site where the installation of new machinery supporting open standards can be planned with this objective, Most industrial complexes, however, have an array of legacy equipment that needs retrofitting to become connected. 

Incompatible wireless standards

The primary barrier to greater interconnectivity is the likelihood that multiple vendors supply machinery on most sites. Each vendor is likely to have a different approach to adopting IIoT, which includes wireless for maximum flexibility, but without interoperability among standards among wireless links and protocols. These include Wi-Fi, NB-IoT (also called Cat-NB1), LTE MTC Cat M1, Long Range (LoRa), Sigfox, Ingenu, WirelessHART, Weightless, 2G in the form of Extended coverage GSM IoT (EC-GSM-IoT), 3G, Bluetooth Low Energy (BLE), and ZigBee.

Each technology has advantages and limits and the use case may dictate the selection. Low Power Wide Area Networking (LPWAN) schemes, such as LoRa, NB-IoT, and Sigfox, are better suited to longer range links with low data rates, while radio access via Wi-Fi and Bluetooth are very popular, but the range is limited. A new Wi-Fi variant called HaLow is being added to the mix. It uses IP packets and lower frequencies that give greater range and penetration.

Multiple players to compete for IIoT business with incompatible systems, a drawback for any factory information technology (IT) department seeking to move to Industrie 4.0, as it might require multiple hubs and gateways to collect and collate data for analysis. 

Radio access technologies

An SDR can support a vast range of wireless technologies, is compact, programmable, open source, full duplex, and "app-enabled," meaning it can be configured after downloading code from an app store. Such a radio requires a means to communicate and a controller, such as a dual transceiver field programmable radio frequency (FPRF) device and a field-programmable gate array (FPGA) chip. The board plugs into a suitable processor, which would typically be a PC unit, via a USB 3.0 connector or PCIe interface. A processor running Linux can be enabled with open source apps from the SoapySDR project, which can be used "as is" or modified to provide the exact requirements.

Open-source Ubuntu-based apps are available for GSM and LoRa, with an active eco-system working on a raft of new applications. Hardware designers can use the Intel FPGA on the board to encode and decode the data for the various wireless standards; open-source software is becoming available. The FPGA also could be used to encrypt the data to avoid transmitting "in the clear."

Application example

Let’s consider an application in a factory that uses WirelessHART for some machines and Sigfox and LoRa for others. The WirelessHART will typically use the 2.4 GHz ISM band, while Sigfox uses ultra-narrow band (UNB) based around a 902 MHz carrier in North America; 920 MHz in South America, Australia, and New Zealand; and 868 MHz in EMEA. LoRa systems run IEEE 802.15.4 using chirp spread spectrum (CSS) radios that can operate at very low power over a typical range of 15 km and can be decoded even when the received signal levels fall below the noise floor.

While 2.4 GHz can be used, it is advisable to use lower frequencies to achieve greater range and better building penetration in an industrial site. In North America, 902 to 928 MHz should be used; 868.0 to 868.6 MHz for European systems; and 433 MHz in Asia.

As an example, let’s look at the design of a LoRa gateway in an SDR. LoRa is well-suited to remote sensors with slow-moving readings that do not need to be read or polled frequently. The design of the gateway involves detecting and generating the LoRa chirps which are linear frequency modulated sweeps using all of the allocated channel bandwidth. Data is transmitted in the pattern of instantaneous changes in the frequency of the chirp.

Initially, the gateway must achieve what is called channel activity detection (CAD). The CAD forms a preamble or training sequence and is identified by sending 8 symbols or chirps followed by 1 reverse chirp. This synchronizes or aligns the receiver, and subsequent data is represented by frequency discontinuities in the chirps.

The FPRF registers are loaded with the center frequency, gain setting, and bandwidth required, and the device outputs a digital data stream representing the received signal. This needs to be processed by the FPGA, which uses a fast Fourier transform (FFT) to resolve the data into frequency bins. The magnitude of the results in each bin is used to decode the transmissions.

Further processing is required in the FPGA because the transmitter encodes the data to enhance the system robustness and increase the probability of correct reception. The FPGA is configured to perform the deinterleaving and forward error correction (FEC) functions.

The design of the complex gateway is simplified by the use of open-source material where many engineers are cooperating to solve the same problems. For example, users can download a proven open source LoRa modem from an app store that saves enormously on time, money, and risk. If the only requirement is to detect and transmit LoRa signals, then the answer is to simply download the open source software into the SDR.

LoRa technology is only suitable for data that is not time critical as is carries infrequent, small messages with a maximum packet length of 256 bytes. An industrial environment is likely to contain other means of communications. In the example, support also is needed for WirelessHART and Sigfox. It is imperative that the gateway must cope with many frequencies, bandwidths, and different modulation types.

The gateway system might be arranged to poll the different remote nodes in a round-robin fashion, or perhaps access each using prearranged time slots. Consequently, the optimum solution would be a system that is compatible with multiple wireless systems, and the additional functionality to support these standards can be added to the SDR. 

Open-source flexibility

Open-source material’s major advantage is functionality can be modified to match application needs. The documentation allows the software designer to understand the operation of the code. In addition, forums and blogs can answer many frequently asked questions, and the open-source community can help sort out issues and answer questions. A software engineer might start by downloading the LoRa files and then enhance the system on the SDR to support other technologies.

Options are available for modifying the system. SoapySDR supports a vendor neutral support library where a designer can access C++ APIs, C wrappers, and Python bindings. This data includes detailed explanations of the operation of the code, which can form the starting point for the new design. 

Open-source software

Free open-source software is used to program SDR. The graphical-user-interface (GUI)-driven design environment allows control over aspects of the RF chip, such as the bandwidth or frequency. This is achieved using the FPGA to load data via the serial peripheral interface (SPI) connections to set the required wireless standard. Downloads onto the board can be performed in real time and the system performance can be checked with hardware-in-the-loop (HIL). Once the RF design is final, the FPRF settings can be saved for use in the final system.

The control logic for the SDR is handled in the FPGA, and commands can be downloaded into the module via the USB port. FPGA functions can be modified, a task previously allocated to the hardware design team with specialized skills needed for device design. This is recognized as one of the biggest barriers to wider adoption of FPGAs in electronics by the vendors. As a result, they have made significant efforts to offer simpler design flows to the software or non-specialist community.

Altera was a pioneer in this effort, boosted when Intel acquired Altera. OpenCL is the initiative that abstracts away the complexities of FPGA architectures to facilitate high-level hardware design. The Intel FPGA SDK for OpenCL uses a low-level programming language derived from C, allowing software engineers to work in a familiar development environment where they can emulate kernels and validate the functionality. The software highlights any bottlenecks and produces a detailed optimization report.

A profiler also is available and can be used to examine the system performance. Once completed, the design is passed to the Intel Quartus FPGA design software, which performs the mapping onto FPGA resources. 

Easier wireless connectivity

The IIoT is integral to the drive to higher levels of industrial automation, and wireless connectivity must hold a place in the overall IIoT strategy. Some options exploit unlicensed spectrum LPWANs while others might deploy emerging cellular standards.

It is unlikely one wireless communication technology will cover all requirements, which creates the need for a configurable gateway designed to cover a wide range of options. The availability of open-source SDR hardware and software communications provides an alternative to proprietary wireless communications systems.

Paul Dillien is a consultant with High Tech Marketing. https://www.high-tech-marketing.co.uk/ Edited by Mark T. Hoske, content manager, Control Engineering, CFE Media, mhoske@cfemedia.com.

KEYWORDS: Industrial wireless, wireless gateway

  • Software-defined radio (SDR) can communicate among wireless standards that are not interoperable.
  • Open-source tools and apps ease communications programming.

CONSIDER THIS

Among applications, how are industrial wireless protocols exchanging data?