Using MQTT Protocol for Smarter Automation

In my previous blog post, “Edge Gateways to Support Real-Time Condition Monitoring Data,” I talked about the importance of using an edge gateway to gather the IoT data from sensors in parallel with a PLC. This was because of the large data load and the need to avoid interfering with the existing machine communications. In this post, I want to delve deeper into the topic and explain the process of implementing an edge gateway.

Using the existing Ethernet infrastructure

One way to collect IoT data with an edge gateway is by using the existing Ethernet infrastructure. With most devices already communicating on an industrial Ethernet protocol, an edge gateway can gather the data on the same physical Ethernet port but at a separate software-defined number associated to a network protocol communication.

Message Queue Telemetry Transport (MQTT)

One of the most commonly used IoT protocols is Message Queue Telemetry Transport (MQTT). It is an ISO standard and has a dedicated software Ethernet port of 1883 and 8883 for secure encrypted communications. One reason for its popularity is that it is designed to be lightweight and efficient. Lightweight means that the protocol requires a minimum coding and it uses low-bandwidth connections.

Brokers and clients

The MQTT protocol defines two entities: a broker and client. The edge gateway typically serves as a message broker that receives client messages and routes them to the appropriate destination clients. A client is any device that runs an MQTT library and connects to an MQTT broker.

MQTT works on a publisher and subscriber model. Smart IoT devices are set up to be publishers, where they publish different condition data as topics to an edge gateway. Other clients, such as PC and data centers, can be set up as subscribers. The edge gateway, serving as a broker receives all the published data and forwards it only to the subscribers interested in that topic.

One client can publish many different topics as well as be a subscriber to other topics. There can also be many clients subscribing to the same topic, making the architecture flexible and scalable.

The edge gateway serving as the broker makes it possible for devices to communicate with each other if the device supports the MQTT protocol. MQTT can connect a wide range of devices, from sensors to actuators on machines to mobile devices and cloud servers. While MQTT isn’t the only way to gather data, it offers a simple and reliable way for customers to start gathering that data with their existing Ethernet infrastructures.

Edge Gateways To Support Real-Time Condition Monitoring Data

In my previous blog post from early summer, I talked about IO-Link sensors with condition monitoring features that work with PLCs. I covered how condition monitoring variables can be set up as alarms and how simple logic can be set up inside the sensor so it only sets off those alarms to the PLC in real time to alert operators when something is wrong. Many companies, however, take advantage of the IoT sensor data with the long-term goal of analyzing the environmental data conditions to predict maintenance needs in real-time versus relying on a schedule. Some even want to connect directly to their MES systems to inform maintenance personnel of daily maintenance orders, which requires a separate device, such as an IoT edge gateway.

Edge gateway benefits

The biggest benefit of an IoT edge gateway is the ability to process and store large amounts of data quickly, enabling real-time applications to use that data efficiently.

An IoT edge gateway typically sits at the end or edge of your network and gathers all the sensor data either directly from the sensors or from the PLC. Since there will be a large amount of data from all the sensors on the network, part of the edge gateway setup is to filter the relevant and important information and process this vast amount of data. The edge gateway must also handle the amount of data required reliably, and it must have low latency. These important factors are often associated with the gateway’s CPU and memory specifications.

After looking at the performance of the edge gateway, comes the ‘gateway’ aspect which provides a translation to different communications networks, whether local or cloud-based. There are the hardware specs of the gateway, whether it’s using serial, USB or Ethernet for that connection, as well as the environmental ratings on the gateway. Then, more importantly, is the software side of the edge gateway. There are cloud-based communications standards designed for different applications and for either private or public cloud networks.

Edge gateways support different communications protocols, such as HTTPS, MQTT, RESTful API, C/Python API. The gateway portion also helps in the conversion of those protocols and the ease of interoperability to different platforms, such as AWS, Azure, Ignition, and Wonderware. This provides data transparency so that all the data gathered can be used across the many different software platforms.

To get to the IoT end goal, an edge gateway is necessary and it’s important to choose the correct one.

How IO-Link Sensors With Condition Monitoring Features Work With PLCs

As manufacturers continually look for ways to maximize productivity and eliminate waste, automation sensors are taking on a new role in the plant. Once, sensors were used only to provide detection or measurement data so the PLC could process it and run the machine. Today, sensors with IO-Link measure environmental conditions like temperature, humidity, ambient pressure, vibration, inclination, operating hours, and signal strength. By setting alarm thresholds, it’s possible to program the PLC to use the resulting condition monitoring data to keep machines running smoothly.

Real-time data for real-time response

A sensor with condition monitoring features allows a PLC to use real-time data with the same speed it uses a sensor’s primary process data. This typically requires setting an alarm threshold at the sensor and a response to those alarms at the PLC.

When a vibration threshold is set up on the sensor and vibration occurs, for example, the PLC can alert the machine operator to quickly check the area, or even stop the machine, to look for a product jam, incorrect part, or whatever may be causing the vibration. By reacting to the alarm immediately, workers can reduce product waste and scrap.

Inclination feedback can provide diagnostics in troubleshooting. Suppose a sensor gets bumped and no longer detects its target, for example. The inclination alarm set in the sensor will indicate after a certain degree of movement that the sensor will no longer detect the part. The inclination readout can also help realign the sensor to the correct position.

Detection of other environmental factors, including humidity and higher-than-normal internal temperatures, can also be set, providing feedback on issues such as the unwanted presence of water or the machine running hotter than normal. Knowing these things in real-time can stop the PLC from running, preventing the breakdown of other critical machine components, such as motors and gearboxes.

These alarm bits can come from the sensors individually or combined together inside the sensor. Simple logic, like OR and AND statements, can be set on the sensor in the case of vibration OR inclination OR temperature alarm OR humidity, output a discrete signal to pin 2 of the sensors. Then pin 2 can be fed back through the same sensor cable as a discrete alarm signal to the PLC. A single bit showing when an alarm occurs can alert the operator to look into the alarm condition before running the machine. Otherwise, a simple ladder rung can be added in the PLC to look at a single discrete alarm bit and put the machine into a safe mode if conditions require it.

In a way, the sensor monitors itself for environmental conditions and alerts the PLC when necessary. The PLC does not need to create extra logic to monitor the different variables.

Other critical data points, such as operating hours, boot cycle counters, and current and voltage consumption, can help establish a preventative and predictive maintenance schedule. These data sets are available internally on the sensors and can be read out to help develop maintenance schedules and cut down on surprise downtimes.

Beyond the immediate benefits of the data, it can be analyzed and trended over time to see the best use cases of each. Just as a PLC shouldn’t be monitoring each alarm condition individually, this data must not be gathered in the PLC, as there is typically only a limited amount of memory, and the job of the PLC is to control the machines.

This is where the IT world of high-level supervision of machines and processes comes into play. Part two of my blog will explore how to integrate this sensor data into the IT level for use alongside the PLC.

IO-Link: End to Analog Sensors

With most sensors now coming out with an IO-Link output, could this mean the end of using traditional analog sensors? IO-Link is the first IO technology standard (IEC 61131-9) for communications between sensors and actuators on the lower component level.

Analog sensors

A typical analog sensor detects an external parameter, such as pressure, sound or temperature, and provides an analog voltage or current output that is proportional to its measurement. The output values are then sent out of the measuring sensor to an analog card, which reads in the samples of the measurements and converts them to a digital binary representation which a PLC/controller can use. At both ends of the conversion, on the sensor side and the analog card side, however, the quality of the transmitted value can be affected. Unfortunately, noise and electrical interferences can affect the analog signals coming out of the sensor, degrading it over the long cable run. The longer the cable, the more prone to interference on the signal. Therefore, it’s always recommended to use shielded cables between the output of the analog sensor to the analog card for the conversion. The cable must be properly shielded and grounded, so no ground loops get induced.

Also, keep in mind the resolution on the analog card. The resolution is the number of bits the card uses to digitalize the analog samples it’s getting from the sensor. There are different analog cards that provide 10-, 12-, 14-, and 16-bit value representations of the analog signal. The more digital bits represented, the more precise the measurement value.

IO-Link sensor—less interference, less expensive and more diagnostic data

With IO-Link as the sensor output, the digital conversion happens at the sensor level, before transmission. The measured signal gets fed into the onboard IO-Link chipset on the sensor where it is converted to a digital output. The digital output signal is then sent via IO-Link directly to a gateway, with an IO-Link master chipset ready to receive the data. This is done using a standard, unshielded sensor cable, which is less expensive than equivalent shielded cables. And, now the resolution of the sensor is no longer dependent on the analog card. Since the conversion to digital happens on the sensor itself, the actual engineering units of the measured value is sent directly to the IO-Link master chipset of the gateway where it can be read directly from the PLC/controller.

Plus, any parameters and diagnostics information from the sensor can also be sent along that same IO-Link signal.

So, while analog sensors will never completely disappear on older networks, IO-Link provides good reasons for their use in newer networks and machines.

To learn about the variety of IO-Link measurement sensors available, read the Automation Insights post about ways measurement sensors solve common application challenges. For more information about IO-Link and measurement sensors, visit www.balluff.com.

Which RFID Technology is Best for Your Traceability Application?

There are a lot of articles on using RFID for traceability, but it’s hard to know where to begin. Examples of traceability include locating an important asset like a specific mold that is required to run a machine or verifying a specific bin of material required to run production. Spending time looking for these important assets leads to lost time and production delays. RFID can help but understanding the different RFID capabilities will narrow down the type of RFID that is required.

Not all RFID technology is the same. Each RFID technology operates differently and is categorized by the frequency band of the radio spectrum, such as low frequency, high frequency and ultra-high frequency. In low and high frequency RFID, the read range between RFID tag and reader antenna is measured in millimeters and inches. The read range on ultra-high frequency (UHF) RFID technology can range from one meter to 100 meters. Typically, inventory traceability is done using ultra-high frequency band of the radio frequency spectrum, due to the need to read the asset at a further distance so it does not interfere with the production flow. Also, there are cases where there needs to be a reading of multiple tags in an area at the same time to determine where an asset is located. UHF RFID technology allows for simultaneous reading of multiple RFID tags from a single antenna reader.

There are two types of UHF RFID, passive and active.  Passive UHF RFID means that the RFID tags themselves have no additional power source. The UHF reader antenna sends out an electromagnetic wave field, and the RFID tags within the electromagnetic field have an internal antenna that receives the energy which activates the integrated circuit inside the tag to reflect the signals back to start communicating. The read distance between the passive RFID tag and antenna reader is determined by several factors, such as the size of the electromagnetic wave field generated out of the reader antenna and the size of the receiver antenna on the RFID tag. Typical read ranges on passive UHF systems can be anywhere from one to 12 meters, where the larger the power and RFID tag, the longer the range.

Active UHF RFID systems do not require the tag to reflect signals back to communicate because the active RFID tag has its own transmitter and internal battery source. Because of this, with active UFH RFID you can get read ranges of up to 100 meters. There are active tags which wake up and communicate when they receive a radio signal from a reader antenna, while others are beacons which emit a signal at a pre-set interval. Beacon active tags can locate in real time the location of the asset that the RFID tag is attached to. However, a downfall to active RFID tags is the battery life on the tag. If the battery is dead, then the asset will no longer be visible.

Figure 1

Once the strengths and weaknesses of each type of UHF RFID system is known, it’s easier to work with the constraints of the system. For example, the application in Figure 1 shows a reader antenna for reading bins of material placed a few feet away so that its’ not in the way of production. A passive UHF RFID system will work in this case, due to the distance between the antenna and the RFID tag on the bin a few feet away. There is no need to worry about battery life on the passive RFID tag.

Figure 2

If the exact location of a production mold is required in a large facility, then using an active UHF RFID system is likely a better fit. Incorporating an active RFID tag that sends out a beacon at a fixed interval to a data center ensures the location of all assets are always known. With this setup, the exact location of the mold can be found at any time in the facility.

Examining the different types of RFID technology can help determine the correct one to use in a traceability application. This includes analyzing the pros and cons of each technology and seeing which one is the best fit for the application.

Adding Smart Condition Monitoring Sensors to Your PLC Control Systems Delivers Data in Real Time

Condition monitoring of critical components on machines delivers enormous benefits to productivity in a plant.  Rather than have a motor, pump, or compressor unexpectedly fail and the machine be inoperable until a replacement part is installed, condition monitoring of those critical pieces on the machine can provide warning signs that something is about to go terribly wrong. Vibration measurements on rotating equipment can detect when there is imbalance or degrade on rolling bearing elements. Temperature measurements can detect when a component is getting overheated and should be cooled down. Other environmental detections such as humidity and ambient pressure can alert someone to investigate why humidity or pressure is building up on a component or in an area. These measurement points are normally taken by specific accelerometers, temperature probes, humidity and pressure sensors and then analyzed through high end instruments with special analysis software. Typically, these instruments and software are separate from the PLC controls system. This means that even when the data indicates a future potential issue, steps need to be taken separately to stop the machine from running.

Using smart condition monitoring sensors with IO-Link allows these measured variables and alarms to be available directly onto the PLC system in real time. Some condition monitoring sensors now even have microprocessors onboard that immediately analyze the measured variables. The sensor can be configured for the measurement limit thresholds of the device it’s monitoring so that the sensor can issue a warning or alarm through the IO-Link communications channel to the PLC once those thresholds have been hit. That way, when a warning condition presents itself, the PLC can react immediately to it, whether that means sending an alert on a HMI, or stopping the machine from running altogether until the alarmed component is fixed or replaced.

Having the condition monitoring sensor on IO-Link has many advantages. As an IEC61131-9 standard, IO-Link is an open standard and not proprietary to any manufacturer. The protocol itself is on the sensor/actuator level and fieldbus independent. IO-Link allows the condition monitoring sensor to connect to Ethernet/IP, Profinet & Profibus, CC-Link & CC-Link IE Field, EtherCAT and TCP/IP networks regardless of PLC. Using an IO-Link master gateway, multiple smart condition monitoring sensors and other IO-Link devices can be connected to the controls network as a single node.

The picture above shows two condition monitoring sensors connected to a single address on the fieldbus network. In this example, a single gateway allows up to eight IO-Link condition monitoring sensors to be connected.

Through IO-Link, the PLC’s standard acyclic channel can be used to setup the parameters of the measured alarm conditions to match the specific device the sensor is monitoring. The PLC’s standard cyclic communications can then be used to monitor the alarm status bits from the condition monitoring sensor.  When an alarm threshold gets hit, the alarm status bit goes high and the PLC can then react in real time to control the machine. This relieves the burden of analyzing the sensor’s condition monitoring data from the PLC as the sensor is doing the work.

 

Reduce the Number of Ethernet Nodes on Your Network Using IO-Link

Manufacturers have been using industrial Ethernet protocols as their controls network since the early 1990s. Industrial Ethernet protocols such as Ethernet/IP, ProfiNet, and Modbus TCP were preferred over fieldbus protocols because they offered the benefits of higher bandwidth, open connectivity and standardization, all while using the same Ethernet hardware as the office IT network. Being standard Ethernet also allows you to remotely monitor individual Ethernet devices over the network for diagnostics and alarms, delivering greater visibility of the manufacturing data.

With Ethernet as the key technology for Industry 4.0 and digitalization, more and more devices will have Ethernet capabilities. Typical industrial Ethernet nodes on a plant floor could include PLC controllers, robots, I/O devices for sensors, actuators, flowmeters, transducers and manifolds. While, it’s great getting all the data and diagnostics of the entire manufacturing process, having every device connected via Ethernet has some downfalls. It can lead to larger Ethernet networks, which can mean more costs in hardware such as routers, switches and Ethernet cables, and some Ethernet software license costs are based on the number of Ethernet nodes being used in the network.

Also, as more Ethernet devices are added to a network, the Ethernet network itself can get more complex. Each individual Ethernet device requires an IP address. If an Ethernet node stopped working and needed to be replaced, an operator would need to know the previous IP address of the device and have quick access to the manual with instructions on how to assign the previous IP address to the new device. Someone must also manage the IP addresses on the network. There will need to be a list of the IP addresses on the network as well as the available ones, so when a new Ethernet device is added to the network, a duplicate address is not use

One way to reduce the number of Ethernet nodes while still getting device data and diagnostics is by using IO-Link for field device communications. IO-Link is an open point-to-point communication standard for sensors and actuators published by IEC (International Electrotechnical Commission) as IEC 61131-9. Since it’s fieldbus and manufacturer independent, there is a long list of manufacturer devices that come with IO-Link. Each IO-Link device can then be brought back to a single Ethernet node, through an IO-Link to Ethernet gateway. Since it’s open technology, there are also multiple manufacturers that make different IO-Link to industrial Ethernet gateways.

On the IO-Link to Ethernet gateway, each channel has an IO-Link master chipset. It is designed to automatically communicate and provide data as soon as an IO-Link device is connected to a port. So, there is no addressing or additional setup required. IO-Link is point to point, so it’s always a single IO-Link device connected to a single port on the gateway using a standard sensor cable. Depending on the number of IO-Link devices to be connected to a single Ethernet node, IO-Link gateways can come in 4, 8 or 16 device channels. This graphic (image 1) shows six IO-Link devices connected to a single 8-channel Ethernet gateway. This gateway then communicates back to the Ethernet PLC controller as a single IP address with a standard Ethernet cable. Without using IO-Link, this might require all six devices to be industrial Ethernet devices. Each device would have its own IP address to set up, along with six Ethernet cables going back to a 6-port managed switch before going to the PLC controller.

 

1
Image 1: Six IO-Link devices connected to a single 8-channel Ethernet gateway.

IO-Link Devices Connected:

  1. Device I/O Hub used to connect to 16 standard discrete sensors/photoeyes.
  2. Valve Manifold used to control up to 24 coils.
  3. Visual Indicator Light
  4. RFID Processor System
  5. Pressure Sensor
  6. IO-Link to Standard Analog (0-10V or 4-20ma) Converter