Michael Brown Control Engineering CC
Practical Process Control Training & Loop Optimisation
CONTROL LOOP CASE HISTORY 176
IMPORTANCE OF PROGRAMMING PLC CONTROL MODULES CORRECTLY
Every time I work on a plant that is using PLC/SCADA systems for feedback control systems I always first do a test on a controller module to ensure that 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’s programme has no real understanding of the practical pitfalls associated with this.
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 on the other hand come from a background extending over nearly a century of manufacturing PID controllers from the early analogue 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 3 plants in my career where system integrators have written their own controller algorithm and software block that have not worked at all properly, such as being unable to change tuning. Generally these plants end up running the control loops in manual. In two of these plants which had been running for many years, no one was actually aware that the controllers were not working. Really unbelievable, but true.
2. Controllers not triggered correctly: This is a common problem. 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: This results in I and D not being calculated correctly. This is a very common fault. 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. A couple of PLC manufacturers are now also doing this, but most still don’t.
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. Only once did I find a controller is a DCS system that didn’t work 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 (setpoint) and PV (process variable), multiply it by the gain factor and then send the resultant 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.
In modern day digital control systems people far rather prefer to work in terms of engineering units rather than percentage, so it is important that the SP and PV inputs be converted to percentages (or that a scaling factor be used to convert the scale of the engineering unit inputs to percentage).
Most if not all of the DCS manufacturers automatically do this for you when you programme in your control loop. However many of the PLC controller manufacturers seem completely unaware of the need to do this, and leave it up to the user to do this “normalisation”. They don’t even mention it in their manuals, so I assume that they are themselves unaware of the practicalities.
To give an example of the problem: Assume the measuring range of a transmitter is say 0 -200℃, and the system integrator programmes in 0 - 200℃ as the ranges of both the SP and PV. Now let us say the SP is at 100℃, and the PV is at 99℃. The error is 100℃ – 99℃ = 1℃. 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%, and will multiply it by the P gain factor, so in actual fact the gain calculation is actually half of what it should be.
This is one, if not the most, common fault I encounter in PLC controller installations.
Assuming that the controllers are actually working (not like 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 firstly scientific tuning is not possible, as the closed loop responses will be wrong.
Secondly this may not worry most people, as very few people indeed use scientific tuning methods, and in fact surveys have shown that 98% of all tuning worldwide is done by trial and error. However people who are any good at all at such tuning have acquired their skill by years of practice. The problem here is that the loops may all behave differently, maybe due to different incorrect triggering, or incorrect setup 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 8 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 PLC’s were all the same make and model, each had been programmed by different people none of whom understood how to set up controllers properly. Therefore because the PLC manufacturer had not built in sufficient safeguards to prevent set-up errors, the programmers had all done different things so the controllers behave differently, and the P, I, and D terms on all the PLC’s behaved differently. Therefore tuning of each of the PLC’s by trial and error required different “feels”. Not only that, but the different control loops in each individual PLC operated differently. It was a complete mess. Impossible to properly tune by scientific tuning or trial and error.
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 must disconnect the controller from the field. As shown in the figure 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, and 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 performed at a metallurgical processing plant recently 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 set up programme.
The implications for the plant are possibly appalling, as if all the control blocks have been setup incorrectly, then once corrected it will mean retuning every one of over 100 controllers in that plant controller in that plant. A major undertaking.
This illustrates how important it is to ensure your controllers are set up correctly.