Editor's Choice


Control Loop: Case History 176 - The importance of programming PLC control modules correctly.

March 2021 Editor's Choice

Every time I work on a plant that is using a PLC and scada system for feedback control, I always first do a test on a controller module to ensure that the controllers have been configured correctly. I find that they are not working properly in at least 85% of cases! This is because the average person who writes the PLC program has no real understanding of the potential pitfalls.

As mentioned in previous articles, this is because most PLC manufacturers, as opposed to manufacturers of DCS systems, have not provided any safeguards in their system to prevent users from making mistakes. (The DCS people come from a background extending over nearly a century of manufacturing PID controllers from the early analog technology days, and have the experience to ensure that their digital systems provide all the necessary safeguards to prevent users making basic errors).

What are the problems associated with controllers that are configured incorrectly?

1. Controllers not working at all: I have been in at least three plants in my career where system integrators have written controller algorithms and software blocks that have not worked properly, for instance, not being able to change the tuning. Generally, these plants end up running the control loops in manual. Unbelievable but true.

2. Controllers not triggered correctly: controllers should be triggered by an accurate and repeatable timed interrupt, as the I (integral) and D (derivative) terms are time dependent.

3. Controllers triggered correctly, but the wrong scan time entered in the controller’s parameter block: the result is I and D terms that are not calculated correctly. It seems very strange that the scan rate is not automatically set to the same time as the interrupt scan time, but often there doesn’t seem much logical thought used by certain manufacturers. It should be noted that most DCS controllers actually measure the exact scan rate on each and every scan, and the time is incorporated into the control algorithm, so there can be no error.

4. Incorrect control algorithms used by manufacturers: this is very rare these days, but I have encountered a few PLC controllers that do not operate correctly.

5. Incorrect input/output scaling: the calculation performed by the P term in the controller is to take the control error, which is the difference between SP (set-point) and PV (process variable), multiply it by the gain factor, and then send the result to the controller’s output. Now, in the vast majority of cases, the controller’s output is scaled 0-100%. Therefore to be correct, the units of error must also be in percentage.

Figure 1.

Figure 2.

Figure 3.

Figure 4.

In modern day digital control systems, people prefer to work in engineering units rather percentages, so it is important that the SP and PV inputs be converted, or that a factor be used to convert the engineering units to percentages. Most, if not all, DCS manufacturers do this for you when you program in your control loop. However, many PLC manufacturers seem completely unaware of the need for this, and leave it up to the user to perform the ‘normalisation’.

As an example: assume the measuring range of a transmitter is 0-200°C, and the system integrator programs 0-200°C as the ranges of both the SP and PV. Now, let’s say the SP is at 100°C, and the PV is at 99°C. The error is 100°C-99°C = 1°C. This is actually a percentage error of 0,5%. However, if the controller manufacturer, or the system integrator, has not compensated for this, the controller ‘thinks’ it is an error of 1%, which it will multiply by the P gain factor.

Assuming that the controllers are actually working (unlike those mentioned in point 1 above), what is the main problem encountered because of incorrect controller operation?

The answer is that if the proportional gain, and/or the integral and possibly derivative terms are not set up correctly, then scientific tuning is not possible as the closed loop responses will be wrong.

This may not worry most people, since very few use scientific tuning methods and surveys show that 98% of all tuning is done by trial and error. However, people who are any good at such tuning have acquired their skill through years of practice. The problem then is that the loops may all behave differently, maybe due to incorrect triggering, or incorrect configuration when using engineering units. Therefore the ‘feel’ for tuning that these people have developed may work differently on each loop, and they find that their tuning skills don’t seem to work anymore.

I always remember a control manager on a large mine saying to me: “I don’t understand it. We have got eight identical plants on this mine, yet the tunings on the loops are completely different for each plant. Surely they should be the same, or very similar?”

The answer was that each plant had its own PLC control system. Even though the PLCs were all the same make and model, each had been programmed by different people, none of whom understood how to configure controllers properly. Therefore, because the PLC manufacturer had not built in sufficient safeguards to prevent configuration errors, the programmers had all done different things. As a result, the controllers all behaved differently, as did the P, I and D terms. Not only that, but the different control loops in each individual PLC operated differently. It was a complete mess.

To test a controller for P+I action, one must set up the controller as shown in Figure 1. One needs to use a spare control block, or disconnect the controller in the field. As shown, a fixed 50% signal is fed into the PV input. The PD (output) and SP are then set to 50% with the controller in manual. Then you switch to auto. The PD signal should remain at 50% as the control error is zero. One then makes step changes on the SP and records the PD response.

Figure 2 shows a simplified controller and how the P and I terms each react to a constant step change in error. Figure 3 shows how one measures the P and I responses to see if the controller is responding correctly.

Figure 4 is an actual controller test recently performed at a metallurgical processing plant, where they use a very well-known make of PLC. The P in the controller was set to unity, and integral to 2 minutes/repeat. The SP was then stepped by 10%. (The little steps on the recording of the PV during the integral ramp are due to the 1 second scan rate of the OPC system that connected the Protuner to the control system).

On the actual recording it can be seen that the P also stepped up by 10%, so the P gain in the controller was correct. However, the integral ramped up and repeated the P move of 10% in 25 seconds. It should have taken 120 seconds (2 minutes). This means that either the controller block was not being triggered correctly, or else incorrect time settings had been made in the controller setup program.

The implications for the plant are possibly appalling: if all the control blocks have been configured incorrectly, then it will mean retuning every one of over 100 controllers in that plant – a major undertaking. This illustrates how important it is to ensure your controllers are set up correctly.



Michael Brown.

About Michael Brown

Michael Brown is a specialist in control loop optimisation with many years of experience in process control instrumentation. His main activities are consulting, and teaching practical control loop analysis and optimisation. He gives training courses which can be held in clients’ plants, where students can have the added benefit of practising on live loops. His work takes him to plants all over South Africa and also to other countries. He can be contacted at Michael Brown Control Engineering cc.


Credit(s)



Share this article:
Share via emailShare via LinkedInPrint this page

Further reading:

The future of industrial automation: fieldbus and industrial networking
LAPP Southern Africa Editor's Choice
As a global leader in integrated solutions in the field of cable and connection technology, LAPP recognises that fieldbus and industrial networking technologies are pivotal in shaping the future of manufacturing and production processes.

Read more...
AI-driven innovations with CCTV and cyber security
RJ Connect Editor's Choice Fieldbus & Industrial Networking
The fast progress of artificial intelligence (AI) and video analytics is redefining the rail surveillance landscape. Advancements have bolstered proactive event detection, predictive maintenance and enhanced situational awareness.

Read more...
Loop signature 27: SWAG tuning of simple integrating processes.
Editor's Choice
The chief control engineer of one of the largest petrochemical refineries in South Africa once sent me an email after a course at his plant. He wrote that he had found the section on SWAG tuning of simple integrating processes one of the most informative of the whole course.

Read more...
Harnessing industrial AI agents for reliable automation
Editor's Choice IT in Manufacturing
The excitement around generative AI (GenAI) has been undeniable, promising wide-ranging changes across industries. However, for those of us in the world of industrial control and automation, the realities of implementing these powerful technologies are a little more nuanced.

Read more...
Futureproof your industrial network security with OT-centric cyber security
RJ Connect Editor's Choice
To achieve digital transformation, industrial operators must first address the daunting task of merging their information technology (IT) and operational technology (OT) infrastructure. In this article, we focus on the importance of strong OT network security and provide some tips on how to strengthen cybersecurity for industrial operations.

Read more...
The symbiotic relationship between OEMs and SIs
Schneider Electric South Africa Editor's Choice System Integration & Control Systems Design
While businesses tend to turn directly to original equipment manufacturers OEMs or vendors when embarking on IT projects, the role of the SI as a key facilitator and partner cannot be overstated.

Read more...
Case History 196: Unstable condensate level control.
Michael Brown Control Engineering Editor's Choice Level Measurement & Control
The operators in a petrochemical refinery were having great trouble in trying to stabilise the condensate level in a vessel, and this was adversely affecting other loops downstream. Several unsuccessful attempts had been made to retune the controller.

Read more...
Big themes for 2025
Editor's Choice News
2024 was a year of unprecedented innovation and global upheaval. As we look ahead, Amy Webb, CEO of the Future Today Institute asks which technologies will reshape our world in 2025?

Read more...
Loop signature: Tuning part 4 processes
Michael Brown Control Engineering Editor's Choice Fieldbus & Industrial Networking
The purpose of this particular article is to try and give those unfortunate enough to have to use SWAG (scientific wild ass guess) tuning a bit of an idea of how to go about it, and even more importantly some understanding of a couple of basic principles.

Read more...
EtherCAT and PC-based control elevate next-generation laser cutting machine
Beckhoff Automation Editor's Choice
Cincinnati Incorporated has been building sheet metal processing equipment for 125 years. Since the switch to PC-based control, the only limits to development have been physical.

Read more...