PLCs, DCSs & Controllers


Hard realtime control: moving PLC technology to the PC

January 2003 PLCs, DCSs & Controllers

Many manufacturers are turning to alternate solutions to replace their current proprietary PLC technology used on the factory floor. PC-based control is increasingly the method of choice.

The benefits of using a PC-based control solution that incorporates flowchart programming include:

* Faster design cycles

* Lower downtime on the factory floor

* Ease of use through Windows-based solutions

* Improved economies of scale

For many manufacturers, these benefits alone are all the reason they need to switch from their 20-year-old PLCs to PC-based control. For manufacturers with discrete applications, however, the need for deterministic scan times under one millisecond requires a solution that can achieve hard realtime in the Windows environment. This white paper summarises the need for hard realtime in discrete applications and how a PC-based control solution can achieve it.

The overwhelming benefits of personal computers and the Windows operating environment in factory control is a trend that cannot be ignored. The economies of scale of the $100 billion dollar PC industries far outweigh the comparatively tiny PLC industry. The R&D alone spent on accelerating PC technology is greater than the entire industrial controls market. And now, as in most other industries, the industrial control market is moving from expensive proprietary hardware to open PC hardware and software solutions causing most experts in the industry to agree: PCs are the control platform of the future.

The commercial PC industry, however, is not focused on realtime requirements for discrete manufacturing. One of the biggest fears control engineers have about replacing their PLC with a PC is giving up deterministic hard realtime control. Hard realtime control provides the ability to get fast, deterministic, repeatable scan times from the control engine. PLCs are, by their nature, hard realtime controllers that give predictable, repeatable results every scan. Understandably, PLC users demand the same level of hard realtime control that they have now as they move to PC-based control.

How the PLC accomplishes hard realtime control

A PLC is really nothing more than a microprocessor with a realtime operating system (RTOS) in proprietary form. The RTOS is the kernel of code that controls all operations and tasks run on the microprocessor. PLCs perform control by building the control engine around the RTOS, which gives the PLC its fast, deterministic response. It is the RTOS that controls the PLC I/O scan and logic control functions inside the PLC.

This same level of deterministic control can be attained on a PC by using the same type of hard realtime operating system used in a PLC - an RTOS with capabilities beyond Windows NT. Microsoft defines a hard realtime operating system as one that "must, without fail, provide a response to some kind of event within a specified time window. The response must be predictable and independent of other activities undertaken by the operating system." Microsoft goes on to explain, "under this definition, Microsoft Windows NT Workstation is not a hard realtime operating system."

Certainly, some slower process applications can withstand control engine hiccups of 30+ ms while Windows services higher priority disk accesses or network communications. In these cases, soft-logic control with Windows-based engines may be acceptable (see Figure 1).

Figure 1. Soft logic control with a Windows-based control engine
Figure 1. Soft logic control with a Windows-based control engine

In discrete applications, however, where scan times range from under 1 to 50 ms; the impact of the non-deterministic nature of Windows is unacceptable. Stopping the control engine to run system tasks such as servicing the hard disk or Ethernet card could cause lost machine cycles, damaged equipment, or even injury.

Still, Windows offers too many advantages to be ignored. The ability to run Windows-based programming, operator interface, program monitoring and access to other Windows applications on the same PC that runs control is one of the key benefits of moving to PC-based control. The question remains: How does one gain all of the benefits of Windows running on the PC yet achieve the reliability required of a PLC?

The answer lies in moving PLC RTOS technology to the PC

Hard realtime PC-based controllers, like the visual logic controller (VLC) by Entivity, marry the core of the PLC (a hard realtime operating system) with Windows. By running the PLC control engine as high priority tasks in an RTOS and Windows as a background task, control engineers get the best of both worlds: realtime control and the Windows operating environment running on the same PC.

With a hard realtime operating system at the core, all of the memory and CPU bandwidth required for the PLC function is set aside at boot-up. Windows loads after the control engine as low priority background tasks within the RTOS. The control engine is completely protected from Windows, which cannot access the control engine memory or pre-empt the control engine. Windows can lock-up - or even crash - with no impact on the realtime control operation.

Using a hard realtime operating system for control, the PLC function can be separated and run as a higher priority task that is completely independent of Windows (see Figure 2).

Figure 2. Hard realtime control
Figure 2. Hard realtime control

Windows can run applications best suited for non-realtime: data management, network communications and graphical user interfaces. Control logic programming, operator interface, data acquisition and client/server networking can run on the same PC as realtime control logic without impacting control engine performance. Other Windows applications running on the same PC, while independent of the RTOS, can access its realtime control data. For example, shifts reports or batch recipes can be managed with Excel, Visual Basic can be used for custom applications and SPC packages can be implemented to monitor production data for quality problems at the control station.

As a practical note, because the control engine always takes precedence, heavy control programs may impact the performance of Windows applications. Like every control application, sizing the controller (in this case the PC) to the application is important. One of the benefits of PC-based control is the range of PCs available to meet your application need. Also important to note: PCs can already significantly out-perform most PLCs. For example, the VLC running on a low-end Pentium processor performs Boolean logic 50 times faster and integer manipulation 216 times faster than leading PLCs. Many PC-based control applications consume only 5-15% of the CPU bandwidth for logic control, leaving 85-95% of the PC left over to run Windows.

With a PC-based control system that can provide all of the hard realtime control characteristics of a PLC, control engineers can look to PCs to meet their most demanding discrete control applications that may require deterministic, repeatable scan times as short as 200 µs. By moving the capabilities of the PLC to the PC, hard realtime PC-based control can offer the best of both worlds: deterministic control and Windows functionality. The logic control engine can be combined with easy-to-use Windows programming tools and operator interfaces. The challenge is not trying to make Windows function as a PLC. The challenge is to move the PLC into the PC.

With most soft-logic control systems, the control engine is run as a high priority pseudo-realtime task under Windows. Pseudo-realtime tasks can be interrupted by deferred process calls (DPCs), which are used to service NT system functions such as disk accesses, network communications and mouse interrupts. DPCs can be triggered by lower priority user tasks such as opening files or starting applications. This phenomenon is known as priority inversion-when a user task can cause a higher priority task to wait.

Stated simply, user tasks or system functions can force the control engine to wait for a significant amount of time while the DPC is being serviced. In many slower process applications, these delays are insignificant to the speed at which the process must run. For discrete applications, however, these delays can be unacceptable.

In a hard realtime system, the core of a PLC - a hard realtime operating system (RTOS) - is loaded first. The control engine runs as the highest priority task in the RTOS. All Windows functions run as the lowest priority task within the RTOS. The logic control engine always has priority and is completely protected from Windows, which cannot pre-empt realtime control.

For many critical discrete applications, deterministic control is required. User and system functions cannot pre-empt control. Hard realtime PC-control provides deterministic scan times as short as 200 µs.

In conclusion

Discrete manufacturing applications can view PC-based control as a viable alternative to outmoded PLCs when that solution provides the necessary deterministic scan times applications demand. PC-based control solutions that provide hard realtime control guarantee that the control function runs as a higher priority task independent of Windows.

This benefits the control engineer by providing the hard realtime they need with an easy to use Windows environment running on a standard PC. The manufacturer benefits from the PC's economy of scale, its ease of use, its low maintenance and upkeep, and its ability to scale as the technology matures. A PC-based control solution that guarantees hard realtime enables a manufacturer to take advantage of the undeniable business benefits that result from using standard technology.

For more information contact Winston Ilsley, Alstom Automation, 012 664 1415, [email protected], www.plcdirect.co.za





Share this article:
Share via emailShare via LinkedInPrint this page

Further reading:

Megatech is expanding
PLCs, DCSs & Controllers
Megatech SA has been importing high quality industrial plant equipment and spare parts since 2016. Based in KwaZulu-Natal, the company specialises in electrical and mechanical equipment and instrumentation.

Read more...
Powerful and versatile IIoT controller
ifm - South Africa PLCs, DCSs & Controllers
The IIoT controller from ifm is a powerful, communicative and flexible PLC solution in machine and plant digitalisation.

Read more...
ACTOM Industry to upgrade drive and control system
ACTOM Electrical Machines PLCs, DCSs & Controllers
ACTOM Industry secured an important contract to upgrade the drive and control system of a man-winder at a gold mine in Ghana.

Read more...
Powerful and versatile IIoT controller
ifm - South Africa PLCs, DCSs & Controllers
The IIoT controller from ifm is a powerful, communicative and flexible PLC solution in machine and plant digitalisation.

Read more...
ACTOM Industry to upgrade drive and control system
ACTOM Electrical Machines PLCs, DCSs & Controllers
ACTOM Industry secured an important contract to upgrade the drive and control system of a man-winder at a gold mine in Ghana.

Read more...
MCCs for local and international markets
Iritron PLCs, DCSs & Controllers
With a history of delivering large engineering projects globally, Iritron has over 20 years’ experience in designing motor control centres (MCCs) built to the highest international specifications.

Read more...
Deep learning based component inspection in the automotive industry
Beckhoff Automation PLCs, DCSs & Controllers
Achieving the shortest possible inspection times – even when working with different components – is paramount when it comes to series production. This is precisely what stoba Sondermaschinen achieved with its optical inspection system, which is based on deep learning, and features the Beckhoff XPlanar planar motor system at the conveyor system core.

Read more...
Case history 189: Poor furnace temperature control.
Michael Brown Control Engineering Editor's Choice PLCs, DCSs & Controllers
Many process engineers do not appreciate the importance of flow loops in their unit controls. A senior process engineer once told me that flow loops need not be tuned well, as they generally have little effect on the more important and much slower loops like temperatures and pressures.

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 that’s providing real-time control, namely the PLC or the programmable automation controller.

Read more...
Enhanced perimeter defence solution
Emerson Automation Solutions PLCs, DCSs & Controllers
Emerson is improving perimeter security for the DeltaV distributed control system with its new NextGen Smart Firewall, a purpose-built control system firewall designed to provide easy-to-install and maintain perimeter security for all industries.

Read more...