Boost Your PLC System: Advanced Analysis and Control Print

his article is part of the 7 Ways to Boost Your PLC System white paper series.


In a typical PLC-based system, an input value is often compared to a set point for a binary result that turns on a light, opens a hatch, starts the conveyor, and so on. This level of functionality works well in most straightforward applications. However, more advanced control systems require additional analysis through signal processing and advanced decision making to calculate meaningful data before adjusting the output values.

Different Approaches for Signal Processing and Advanced Control

Thousands of engineers and scientists rely on National Instruments hardware and software for their test, measurement, and control applications. The NI LabVIEW graphical programming platform provides powerful programming tools and hundreds of analysis function that you can use to filter and process data and extract the required information for your analysis tasks or as feedback for advanced control algorithms. Depending on your task requirements, you can incorporate analysis into your application in different ways.

Inline versus Offline Analysis

Inline analysis implies that you are analyzing the data within the same application you used to acquire it. This is generally the case when dealing with applications where you have to make decisions during run time, and the results have direct consequences on the process -- typically through changing parameters or executing actions. By measuring and analyzing certain aspects of the signals, you can make the application adapt to the circumstances and enable the appropriate execution parameters. Although this is only one example, there are thousands of applications where a certain degree of intelligence -- the ability to make decisions based on various conditions -- and adaptability are required, which you can achieve only by adding analysis algorithms to the application. While standard programmable logic controllers (PLCs) are well-suited for discrete (on/off) control, they lack the processing power and functionality needed to perform high-speed analog measurements and analysis. By adding programmable automation controllers (PACs) based on LabVIEW and using industrial protocols to connect them to a PLC, you can easily add those capabilities to your existing systems. While PACs offer the processing power and the fast and precise hardware I/O modules, LabVIEW delivers analysis and mathematical routines that natively work together with data acquisition functions and display capabilities, so you can easily build them into any application.

In addition, LabVIEW offers analysis routines for point-by-point execution; these routines are designed specifically to meet inline analysis needs in real-time applications. Point-by-point analysis is essential when dealing with control processes featuring high-speed, deterministic, point-by-point data acquisition. Anytime resources are dedicated to real-time data acquisition, point-by-point analysis becomes a necessity because acquisition rates and control loops are increased by orders of magnitude. Point-by-point analysis is streamlined and stable because it ties directly into the acquisition and analysis process. With streamlined, stable, point-by-point analysis, the acquisition and analysis process can move closer to the point of control in field-programmable gate array (FPGA) chips, embedded controllers, or dedicated CPUs executing a real-time OS.

To better understand the advantages of point-by-point analysis routines, you should read the white paper "Getting Started with LabVIEW Point-By-Point VIs."

For offline applications, you do not typically need to obtain the results in a real-time fashion in order to make decisions on the process. Offline analysis applications require only that sufficient computational resources are available. The main intent of such applications is to identify the cause and effect variables have on a process by correlating multiple data sets. These applications generally require importing data from custom binary or ASCII files and commercial databases such as Oracle, Access, and other QL/ODBC-enabled databases. Once the data is imported into LabVIEW, you can perform hundreds of analysis routines, manipulate the data, and arrange it in a specific format for reporting purposes. LabVIEW provides functions to access any type of file format and database, seamlessly connect to powerful reporting tools such as NI DIAdem software and the LabVIEW Report Generation Toolkit for Microsoft Office, and execute the latest data-sharing technologies such as XML, Web-enabled data presentation, and ActiveX.

Common Analysis and Advanced Control Algorithms in LabVIEW

Fast Fourier transform - The fast Fourier transform (FFT) and the power spectrum are powerful tools for analyzing and measuring signals. FFTs are useful for measuring the frequency content of stationary or transient signals. They produce the average frequency content of a signal over the entire time that the signal is acquired.

Time-frequency analysis - This technique can reveal information that is not immediately obvious with standard frequency analysis tools such as a FFT-based spectrum. Engineers usually implement time-frequency analysis algorithms to analyze time-varying signals whose frequency components evolve over time. Some common time-varying signals include biosignal, sound and vibration, and seismic signals.

Wavelet analysis - Wavelets are oscillatory and compact signals that have zero-mean and limit width in both the time and frequency domains. Wavelet analysis algorithms represent a signal by wavelets and are ideal for the following:
• Detecting discontinuities, spikes, sharp peaks/valleys, edges, and other transients in signals or images
• Compressing signals/images
• Reducing noise or removing trends

Sound and vibration - Sound and vibration analysis works in a variety of applications including acoustic measurements, environmental noise monitoring, machine condition monitoring, and rotating machinery evaluation

Image analysis - You can use image processing and analysis to enhance images, check for presence, locate features, identify objects, and measure parts.

Curve fitting - Curve fitting is the process of finding a function or model that matches a series of data points and possibly other constraints. The process of curve fitting can be very important for modeling, predicting, and calibrating test and measurement equipment.

System identification - System identification algorithms enable accurate plant modeling. You can take advantage of LabVIEW intuitive data acquisition tools to stimulate and acquire data from the plant and then automatically identify a dynamic system model. You can convert system identification models to state-space, transfer function, or pole-zero-gain form for control system analysis and design.

Control design and simulation – With LabVIEW control design and simulation tools, you can analyze open-loop model behavior, design closed-loop controllers, simulate online and offline systems, and conduct physical implementations. You can create models from first principles using transfer function, state-space, or zero-pole-gain representation. With time and frequency analysis tools, such as time step response or Bode plot, you can interactively analyze open- and closed-loop behavior and deploy your algorithms to real-time hardware using built-in functions and the LabVIEW Real-Time Module.

Case Study: Controlling the Movement of 20 tons of Concrete with Precise Accuracy

VAPO Hydraulics faced the challenge of lifting 20-metric-ton unbalanced trays containing uncured concrete more than 6 meters, using 4 hydraulic cylinders while maintaining a strict accuracy of two millimeters.  To control more complex machines, they decided to use NI CompactRIO. These systems are useful for applications that need additional custom requirements, such as precise position control over the whole stroke, or high velocity and synchronized motion of multiple cylinders. While adding these requirements to off-the-shelf PID controllers is usually not possible, CompactRIO provided a rugged and reliable industrial solution for custom control.  Their final system setup consisted of CompactRIO, LabVIEW, and a FPGA module.

Figure 1. Stability is maintained during the movement of 20 ton con create slabs to drying racks using NI hardware and software.

Overall, VAPO Hydraulics was able to implement a custom control algorithm in CompactRIO to control the four hydraulic cylinders to move the unbalanced load. They developed this application in just two months, and can reuse most of the content and adapt the software for new systems within weeks since they developed the software modularly.

Read the full case study

How to Boost Your PLC System

When adding high-speed measurements and other upgrades to your system, the need for advanced analysis to churn through all the data often goes hand in hand with the application. NI PACs are built with the high-performance processing capabilities of a PC and therefore can pass millions of samples per second directly into the processor for immediate analysis and decision making. For more information, please visit the following resources: