Editor's Choice


Loop signature 27: SWAG tuning of simple integrating processes.

March 2025 Editor's Choice

The chief control engineer at 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. After the course he went out into his plant for a couple of days and personally optimised 16 level controls. He found that the originally tuning in all of them was appalling. He decided to try tuning them using the methods covered in this section. Even though he had a Protuner, he found to his delight that he obtained excellent results.

As a matter of interest, this section arose from a course I was giving at a remote diamond mine in Namibia quite a few years ago. Their processing plant was quite primitive compared to the modern one they now have, and there was only one self-regulating loop that was a density control. All the rest of the loops were tank levels. The delegates on the course appealed to me to offer them a simple method of tuning level loops as they would never have been able to justify the expenditure for a loop analysis and tuning package. The following is what we developed in that session.

In the previous three articles in this Loop Signature series, we looked at SWAG tuning of simple self-regulating processes. Now we go on to deal with simple integrating processes- like Level. Once again I must stress that this is for simple integrating processes. When it comes to tuning integrators with complex dynamics, such as very long dead times, with leads or large lags, you really do need to use a good tuning package like the Protuner.

Very few people have a real understanding of the characteristics of integrating processes, and how to go about tuning them. This is because the majority of control practitioners have not been taught about the differences between self-regulating and integrating processes. In most plants the majority of loops are self-regulating processes, which most people find easier to tune by trial and error, and they develop a feel for them. They then try and use that knowledge to tune integrating processes. This is where the main problem comes in, because integrating processes work is very different to self-regulating processes, and are tuned completely differently.

As a result we find that the vast majority of integrating processes in plants are tuned all wrong, and hence operate badly. Typically most are tuned extremely slowly, often with large over- and undershoots on setpoint step changes, followed by a very slow damped cycle that sometimes takes hours to die out. In my courses I always refer to the section on tuning simple integrating processes by a SWAG method as a brainwashing exercise, as we need to change the mindset that most people have about tuning. This will be illustrated as the article progresses.

Let us imagine we have been asked to tune the level control on a particular tank in your plant. The control requirements are:

• No cycling is permissible. This is the most important requirement.

• The response must be as fast as possible. Only one overshoot is permissible on a step change in setpoint.

We go out to the loop and perform a closed loop test as found (setpoint step change test using the existing tuning settings). The result is shown in Figure 1. It is pretty bad with huge overshoots and undershoots with a damped cycle that takes nearly half an hour to die out. We can see why the process people want something done about it if they don’t want cycling. Incidentally I encounter responses like this on many level controls in the majority of plants I work on.

Now, assuming we have not been taught much about integrating processes, we will try and tune the loop the way we would a self-regulating process. As the most important requirement is that no cycling is allowed, we will first try and stop the existing cycle.

How do we do this? Well, all our experience on self-regulating processes has taught us that if the response is too fast, then we must reduce the controller gain (Kp), i.e. increase the proportional band. Going into the controller parameter settings, we find that the person who had previously tuned the controller had set in a Kp of 1 and an integral of 5 seconds/repeat. The controller has a series algorithm.

Being determined to really get rid of the cycling, we reduce the gain by a factor of 10 and set theKp equal to 0,1. Another test is then done with a step change of setpoint. This is shown in Figure 2. To our horror the cycling has actually got much worse. After nearly 40 minutes, it is still cycling away, and this will obviously go on for a long while. This is the exact opposite of what we expected to happen, our self–confidence is suddenly badly shaken, and we don’t understand why it has got worse. What can be done? The answers lie in the following SWAG tuning rules for simple integrating processes:

SWAG Tuning Rule 1: Switch off I and D (if it has been used) and use P only control.

SWAG Tuning Rule 2: Make setpoint changes and establish the closed loop response you want by trial and error by adjusting Kp (proportional gain).

A test showing the response to a setpoint change with a Kp of 4 is shown in Figure 3. The control is typical of a P only control scheme. The loop signature article entitled ’Digital Controllers Part 3: the P Term’ showed how P only control generally results in the measurement being offset from setpoint. Adjusting the manual bias in the controller can reset the offset. However, any load change will result in a fresh offset. As level controls usually have relatively high gains, the offset may be relatively small and might not be a problem. Offset cannot be larger than the proportional band.

Higher gain in the P only controller will give the advantages of a smaller offset and also a faster control response. However, the higher the gain, the more the output of the controller (PD) moves around, thus leading to more valve wear and a shorter life. There is also very often a high noise amplitude in level measurements. This will be amplified through the P term of the controller, again increasing valve wear. Therefore, when tuning integrating processes like level, one has to carefully balance valve life against control performance.

In the example we are tuning here, the control response shown in Figure 3 is with a Kp of 4. In actual fact, much better control and less offset could be obtained with higher gains of typically 12 or 20, but in this case let us imagine we are happy with the control response and don’t wish to work the valve too hard, so we will stay with the gain of 4.

SWAG Tuning Rule 3: Once you are happy with the response, and if the offset is not a problem, then the job is done. Leave the controller like that.

Note that integrating loops are in actual fact better without an I term in the controller. There are two reasons for this: the first is that any hysteresis on a valve on an integrating process that is controlled with P + I control will result in continuous cycling, and the second reason is that the I term introduces a second integral term into the combined loop process transfer function, and prevents perfect pole cancellation tuning from being achieved.

However, if the offset is unacceptable, which may be the case here, as with a P gain of 4 (i.e. a proportional band of 25%), relatively large offsets would result if big load changes occur, and one must then use the I term.

SWAG Tuning Rule 4: If you need to use the I term because the offset is unacceptable, then the next step is to determine the process gain. To recap, and also referring to Figure 4, the process gain of an integrating process is given by:

On our loop the PG works out as 0,01/second.

SWAG Tuning Rule 5:

This works out for the loop we are working on as:

= 100 seconds/repeat

The recording of a closed loop step test with this tuning is shown in Figure 5. It can be seen that the control is working very well with good recovery from load changes.

SWAG Tuning Rule 6: The SWAG formula for the I term given in Rule 5 above is very approximate and is relatively safe. In most cases if you feel the response is too slow, you can reduce the integral by trial and error. As you do so, you will find the overshoot will increase on setpoint changes, but the response to load changes will be faster. However, do not let the response get too cyclic. I generally prefer to tune integrating processes so that the response to setpoint changes results in only one overshoot.

To change your mindset when tuning integrating processes, the little equation given in Rule 5 is really a SWAG type of formula, but it gives excellent results. Moving the denominator on the right side to the left hand side gives us:

In most cases PG is also a constant. Moving it to the right hand side results in an equation:

This means that if you wish to change the response by altering Kp, then you need to change I proportionally. Thinking a bit further about this, we see that the higher the gain we put in, the faster we can make the integral. This goes completely against our gut feeling based on years of experience tuning mostly self-regulating processes. However it’s true, and it works well within reasonable boundaries. There are a lot of advantages for using higher gains on integrating processes, which generally need tuning with relatively slow integrals, so being able to speed up the integral is great.

Conversely, if you really must have a slow response and need to reduce Kp, then you must increase the I term proportionally. Be careful that the process gain is in fact constant. If it varies, which it will do for example on non-uniform tanks, or gravity feed tanks, then you must also take it into account. If the PG varies then at least one or both of the other two terms must change to keep the constant the same.


About Michael Brown


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 now presents courses and performs optimisation over the internet. His work has taken him to plants all over South Africa and also to other countries. He can be contacted at: Michael Brown Control Engineering CC, +27 82 440 7790




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...
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...
Ensure seamless integration and reliable performance with CANbus solutions
RJ Connect Editor's Choice Fieldbus & Industrial Networking
Modern industrial applications require robust and effective communication. The CANbus product range guarantees smooth integration and data transfers throughout systems.

Read more...