PLCs, DCSs & Controllers


PLC and FPGA to solve machine automation problems

October 2006 PLCs, DCSs & Controllers

Machine automation systems have become very complex to achieve better throughput, faster changeover times, reduced waste, and lower downtime. Today's automation systems require various functionality, such as predictive maintenance, intelligent fault handling, fast response times, or custom control algorithms, in addition to logic or process control. This functionality is difficult to implement in traditional PLC-based architectures. Today's machines need a combination of embedded and PLC technologies to deliver the expected functionality and performance. This article examines how a PLC works and explores FPGA technology with its parallel processing architecture, as well as applications for high-performance machine control.

PLC scanning architecture

A PLC typically operates in accordance with the IEC-61131-3 specification. This specification, developed by the International Electrotechnical Commission, details the guidelines for the operating system execution, data definitions, programming languages, and the instruction set a PLC uses. Unlike in the PC world, where one C program works well on any computer, in the PLC world, every vendor has its own flavour of an IEC 61131-3 compliant specification. However, the basic architecture of the system remains the same.

To illustrate, let us take a quick look at how a PLC operates. If you want to toggle an LED every second, your PLC program has three components to help you do this: program logic, memory map, and I/O scan. For program logic, you write out a value TRUE to a variable you call 'LEDValue'. This variable resides in the memory map. The I/O scan then transmits a binary equivalent of the value in memory to the physical I/O line, your LED turning on or off. Thus, the memory map acts as the link between your program logic and the I/O scan. Because your program logic and I/O scan are decoupled, you can do a variety of things, such as force I/O on to the memory map when debugging in the field or updating a program on the fly when the I/O scan is still running. However, you need to keep certain things in mind when programming PLCs, such as not having any blocking function that may cause the program logic to indefinitely halt.

Sequential and reactive programming architectures

The scanning architecture in Figure 1 is excellent for controlling sequential processes - turn the conveyor on, if the proximity sensor goes high, then turn the conveyor off and turn it on again after the proximity sensor goes low. However, modern machines are more complex and more reactive in nature. A typical packaging machine today devotes 20% of the program to the logic for normal operation and 80% for fault handling. It needs a combination of sequential and reactive programming architectures to accomplish control for such complex machines.

Figure 1. Scanning architecture of a PLC
Figure 1. Scanning architecture of a PLC

Programmable automation controllers, such as NI CompactRIO, incorporate embedded technologies, such as field-programmable gate arrays (FPGAs), for implementing reactive architectures (see Figure 2). In addition to the FPGA, there exists a floating point processor running a realtime operating system you can use to program sequential tasks, such as those in a PLC. PACs combine the best of embedded and PLC technologies to offer an ideal architecture for programming complex machines.

Figure 2. Programmable automation controllers, such as NI CompactRIO, combine the best of both PLC and embedded technologies to solve complex machine automation problems
Figure 2. Programmable automation controllers, such as NI CompactRIO, combine the best of both PLC and embedded technologies to solve complex machine automation problems

The case for FPGA technology

While engineers often use FPGAs in industrial control products as an internal component, they have not had access to FPGA functionality. Defining FPGAs has historically required expertise using HDL programming or complex design tools used more by hardware design engineers than by control engineers. With PACs, such as CompactRIO, you can use National Instruments' LabVIEW, a high-level graphical development environment designed specifically for measurement and control applications, to create control systems that incorporate reactive behaviour with fast response rates. Because LabVIEW configures custom circuitry in the FPGA, your system can process and rapidly and deterministically generate synchronised analog and digital signals, which you cannot achieve using the PLC execution architecture. With the FPGA, you can execute digital logic at 20 MHz, analog closed-loop control at 1 MHz, and achieve servo update rates of 200 kHz per axis for motion control.

Programming an FPGA-based PAC with LabVIEW

When you target an FPGA-based device, such as NI CompactRIO, NI Compact Vision System, or NI R Series PCI/PXI data acquisition devices, LabVIEW displays only the functions you can implement in the FPGA. The LabVIEW FPGA Module functions palette includes typical LabVIEW structures and functions, such as While Loops, For Loops, Case Structures, and Sequence Structures as well as a dedicated set of LabVIEW FPGA-specific functions for maths, signal generation and analysis; linear and nonlinear control; comparison logic, array, and cluster manipulation; occurrences; analog and digital I/O; and timing. You can use a combination of these functions to define logic and embed intelligence onto your FPGA-based device.

Figure 3 shows the block diagram for a 32-bit counter, pulse generator, and a PID control loop implemented in LabVIEW FPGA. Following the data flow makes it easy to understand the behaviour of this program. For example, to create the counter, you continuously read from a digital line and compare the line status from one iteration to the next. The counter increments by one when the digital line state changes.

Figure 3. Programming an FPGA is easy with the LabVIEW graphical development environment
Figure 3. Programming an FPGA is easy with the LabVIEW graphical development environment

Customising the counter or creating additional functionality is merely a matter of changing the LabVIEW code. Unlike traditional PC or PLC processors, FPGAs are parallel processors and adding additional loops to your application does not affect the performance of other independent loops. In this example, the counter and the PID loop execute in parallel on the FPGA - no multitasking as in PLCs or PCs.

The PID function block is just one example of intellectual property (IP) available for programming your FPGA in LabVIEW. For complex, high-speed monitoring and control applications, you can use signal processing IP from a variety of sources. The NI SoftMotion Development Module includes enhanced algorithms for motion control and built-in inputs for a variety of feedback devices including quadrature encoders. The NI Digital Filter Design Toolkit provides functions and interactive tools for design, analysis, and implementation of digital filters within LabVIEW FPGA. Additionally, you can link custom VHDL or Verilog IP into a LabVIEW FPGA block diagram using the HDL interface node.

Adding floating point capabilities to FPGA-based PACs

PACs, such as NI CompactRIO, have a combination of a floating point processor running a realtime operating system and an FPGA running logic in hardware. You can use LabVIEW Real-Time to create programs that execute on the floating point processor and communicate with the FPGA. You also can use the program running on the floating point processor to perform complex floating-point calculations, datalogging, networking, e-mail, File Transfer Protocol (FTP), remote Web control, and any operations that do not fit within the FPGA fabric. LabVIEW Real-Time systems deliver deterministic processing engines for functions performed synchronously or asynchronously to the FPGA. For example, floating-point arithmetic, including spectral analysis or custom control algorithms are often performed in the LabVIEW Real-Time environment. You can store relevant data on a LabVIEW Real-Time system or transfer it to a Windows host computer for off-line analysis, datalogging, or user interface displays. The architecture for this configuration is shown in Figure 4.

Figure 4. Architecture of an FPGA-based PAC – NI CompactRIO.
Figure 4. Architecture of an FPGA-based PAC – NI CompactRIO.

Each FPGA-based device has flash memory available to store a compiled LabVIEW FPGA program and run the application immediately after power up of the device. In this configuration, as long as the FPGA has power, it runs the FPGA program, even if the host computer crashes or is powered down. This is ideal for programming safety power down and power up sequences when unexpected events occur.

Applications using FPGA-based PACs

When it comes to very high speed sorting, implementing custom control algorithms, such as Model-Free Adaptive control, performing high-speed realtime analysis and control, or fast event response, FPGA-based PACs are an ideal choice for implementing machine control systems. For example, Mink Hollow Systems in Highland, MD, used LabVIEW FPGA technology to tightly synchronise the high-speed valve operation of a solid-state hydraulic actuator. The Servo Systems Technology Group at BAE Systems, UK, used LabVIEW FPGA technology to develop field-oriented control of a three-phase brushless permanent magnet motor. Process Automation in Belle Mead, NJ, used FPGA-based NI CompactRIO to acquire high-speed analog data on multiple channels, run custom processing algorithms, and provide deterministic control to operate its new verifiable fastener installation tool.

Incorporating embedded technologies, such as FPGAs, with parallel, reactive architectures effectively complement the sequential processing offered by PCs and PLCs for next generation automation systems.

What is an FPGA?

An FPGA is a chip that consists of many unconfigured logic gates. Unlike the fixed, vendor-defined functionality of an ASIC (application-specific integrated circuit) chip, you can configure and reconfigure the logic on FPGAs for your specific application. Engineers use FPGAs in applications where either the cost of developing and fabricating an ASIC is prohibitive, or the hardware must be reconfigured after it is placed into service. The flexible, software-programmable architecture of FPGAs offer benefits such as high-performance execution of custom algorithms, precise timing and synchronisation, rapid decision making, and simultaneous execution of parallel tasks. Today, FPGAs appear in a variety of devices, including instruments, consumer electronics, automobiles, aircraft, copy machines, and application-specific computer hardware.

For more information contact National Instruments, 0800 203 199, ni.southafrica@natinst.co.za, ni.com/southafrica





Share this article:
Share via emailShare via LinkedInPrint this page

Further reading:

ABB updates distributed control system
ABB South Africa PLCs, DCSs & Controllers
Leveraging 30 years of continuous innovation and reliability, ABB’s updated Freelance 2024 distributed control system (DCS) offers greater plant adaptability, faster and more reliable device communication, improved system security, and seamless data exchange.

Read more...
Four ways modern operations control can boost sustainability and efficiency
PLCs, DCSs & Controllers
With the growing importance of digital transformation, HMIs and scada have evolved from control panels to vast operational hubs. Next-gen HMI/scada can bring together data, personalisation, and advanced insights to successfully achieve organisational goals, it is important to think about HMI/scada holistically within the operations ecosystem.

Read more...
The convergence of intelligence: DCS, SCADA and TLC
Schneider Electric South Africa PLCs, DCSs & Controllers
In the early days of industrialisation, control systems were primarily mechanical, and relied on manual intervention and simple feedback loops to manage processes. Now, in the 21st century, industrial process automation systems are mind-blowingly intelligent, and provide almost unparalleled control and monitoring capabilities, making them integral to modern industrial systems.

Read more...
PC-based control for advanced hydrogen storage technology
Beckhoff Automation Editor's Choice PLCs, DCSs & Controllers
The proportion of renewable energies from solar, wind and water is rising continuously. However, sufficient storage options are of the essence to use these energies as efficiently as possible. GKN Hydrogen offers a particularly compact and safe option, low-pressure metal hydride hydrogen storage systems with PC-based control from Beckhoff.

Read more...
ABB modernises key board mill
ABB South Africa PLCs, DCSs & Controllers
ABB has secured a landmark contract to modernise Smurfit Kappa’s Paper Machine 5 at its corrugated cardboard mill near Mexico City. ABB will provide Smurfit Kappa with DCS, accompanied by a comprehensive paper machine drives system, encompassing some of the market’s most advanced drives and motors meticulously designed to optimise PM5’s performance.

Read more...
The synapses of the distributed control system
Schneider Electric South Africa PLCs, DCSs & Controllers
Industrial operations require a distributed control system (DCS) to coordinate and control their process subsystems in real time. Like the brain, a DCS is a multitasking maestro, controlling and coordinating complex processes in a myriad of industrial setting such as large manufacturing plants, providing valuable top-down control.

Read more...
Modular assembly platform for clean manufacturing
Beckhoff Automation PLCs, DCSs & Controllers
JR Automation delivers custom automated solutions for numerous industries. It has done this through its scalable, modular automation platform, FlexChassis, which speeds up time to market while cutting costs. The company chose the XTS linear transport system from Beckhoff because of its speed, and modular design that allows for multiple configurations.

Read more...
Selecting the best remote access solution for your application
PLCs, DCSs & Controllers
In today’s Internet of Things (IoT) world, remote mobile access is a necessity for many industrial applications. There are several ways of implementing this connectivity with routers and virtual private networks.

Read more...
PLCs and PACs simplify data acquisition
PLCs, DCSs & Controllers
Data acquisition, data logging and data analysis are required functions for most modern industrial control systems. The simplest and lowest cost way to provide these functions is often by using the same platform providing real-time control, namely the PLC or the PAC.

Read more...
Small-scale custom development in the information age
H3iSquared PLCs, DCSs & Controllers
In the twenty-first century, the ability to put together custom electronic devices has become much more accessible to smaller companies, and even the private user. With the open nature of these platforms, potential developers can start learning systems easily, and do not need a massive capital output to do so.

Read more...