In the previous video, we generated some PID coefficients using a manual tuning method.
Let’s run some tests to see how well it works.
Let’s go to the ISA PID algorithm in the chart. We want the parameters optimized for
setpoint changes and let’s start with the PI numbers.
I’ll put those in here.
When I recorded this, I put the wrong sample time right here, but it really doesn’t have
much affect so I’m not going to worry about that right now.
Write them out and make sure we are in auto mode.
I’ll bump the setpoint up 5 degrees like we did before, fast forward – that took
a few minutes – and the Do-more engine automatically adjusted the PID output to get us to the new
setpoint quickly and efficiently.
Exactly what we expect.
You can see where it is constantly adjusting things to maintain that 115 degrees, and these
variations are just a fraction of a degree.
Cool.
I’ll go to 100 degrees like we did before- and back to 110 degrees.
The cool thing about this manual method it’s an open loop tuning. That is, we put the
PID function in manual mode, did a 5% bump and took some measurements.
All the tunings we did in the previous videos were closed loop – they actually use the
PID function in auto mode to monitor the process variable, do the three cycles, and make a
decision.
Which begs the question – how does this manual tuning compare to the auto tuning we
have been doing?
Let’s do an Auto-Tune, make sure we are in PI mode, and try it!
I’ll zoom in so we can see the 3 cycles of the auto tuning – yep, looks good!
Fast forward through our usually steps and look at that!
This is the manual tuning, and this is the auto tuning.
Very similar except the auto tuning has a little more ripple.
Cool.
OK, let’s try the PI and D version of our manual tuning.
I’ll just take the results from our spreadsheet and put them in here.
And let’s get the sample time right this time.
Fast forward through our usually setpoints and look at that – it’s even better
than the PI version!
In general, you will find that temperature PID applications will almost always work better
with the full PI and D coefficient set, while just P and I will usually be fine for most
other industrial applications.
OK, let’s compare that with Auto-Tune.
I’ll select a P, I and D version, and let ‘er rip.
I’ll zoom in so we can see the closed loop 3 cycle Auto-Tune – yep looks good – zoom
back out and fast forward through our usual three setpoints.
Well, how about that?
This is the manual tuning, this is the 3-cycle Auto-Tune we did and this is the Auto-Tune
result.
The manual tune nails it!
Very cool.
One more thing, did you notice that the Do-more Designer has an open loop tuning option?
Let’s try it.
But before we start, we need to make sure we are in MANUAL mode, so we have a fixed
PID output and that the process variable has settled out near the value you want to operate
at.
This is critical to getting open loop tuning to work.
If you are in auto mode when you start open loop tuning, the PID output will be jumping
around doing it’s PID thing and it will confuse the open loop Auto-Tune.
You can see where I switched to manual. The PID output stopped adjusting things and got
real flat.
We want PI and D option, so we can compare apples to apples with the previous test and
we want open loop tuning.
We have some new options to look at.
First, we need to specify the rate at which we want the PLC to sample the data.
You want this to be around 4 times the speed of your PID loop.
We know our PID tends to run around 1000 milliseconds, so I put 250ms here.
Next, it’s asking how much the process variable needs to change before Auto-Tune can take its measurements.
Auto-Tune wants to measure the rate at which this slope is changing.
This gives you control over when it does that.
We know from this output bump we did during the manual tuning that a 5% change in the
PID output gives us around 6.5 degrees, but most of the serious slope is in this range,
so we could probably get away with telling Auto-Tune to take it’s measurements around
the 2 or 3 degree mark.
I’m going to set this to get roughly a 4 degree change just so we can see what happens.
That was all assuming a 5% PID output change, so I put that here.
Hit Start.
OK, this is going to take several minutes so I’ll fast forward.
Great!
We see Auto-Tune moved the setpoint to mark the starting point and we see the process
variable rose on that curve we expect to see until it got to about 4 degrees.
Auto-Tune then moved the setpoint to that level to mark where we stopped.
I’ll return to ladder program control and reset the setpoint to 110 degrees.
That’s it – that’s the whole open loop auto tune cycle.
It’s just a single bump exactly like we did in our manual tuning.
There is no three-cycle stuff like we are used to seeing in the in the closed loop Auto-
Tune.
Our new coefficients and new sample time are automatically populated, so let’s fast forward
through our standard setpoints.
Looks good!
Got a what...a 1.5-degree overshoot on the upswing, and a near perfect landing on the
downward run.
Nice!
Instead of using this time scale slider to make room for the next test, I’m going
to hold my keyboard control key and rotate the mouse wheel. That’s a cool trick.
Let’s put our manual coefficients and sample time back in and fast forward through the
same setpoints.
Ahh!
Our manual tuning hits the upswing bang on, and the downward trip applies the brakes a
little early, but there is no overshoot and it comes in for a nice smooth landing.
Perfect!
Let’s do one more open loop Auto-Tune, except this time let’s only let it rise 3 degrees
and see what happens.
Make sure we are in manual mode and hit start.
Fast forward through the open loop Auto- Tune and our standard setpoints and it looks like
the upswing overshoot is a little tighter, but we gained overshoot on the way down.
But it still looks pretty good!
Did you see what happened here?
We told Auto-Tune it could take its measurements after 3 degrees, but it went quite a bit further,
didn’t it?
Why?
Well, when it hit the 3-degree mark it started looking for the slope to flatten out.
Instead, the slope actually started getting steeper, didn’t it?
And that’s the key point of this open loop Auto-Tune. It's watching the rate at
which the slope of this curve decreases.
As long as it is increasing, it can’t take its measurements.
It’s exactly this kind of anomaly that drives Auto-Tune nuts,
because it only has this limited data to work with.
When we manually tune, we can see the bigger picture and are in a better position to make
judgements on what’s going on.
Even so, Do-more Designer does an amazing job.
Remember, this overshoot is only a degree or two. I’ll take that any day of the
week.
So now you have several ways you can tune a PID loop: closed loop Auto-Tune, open loop
Auto-Tune or manually using the open loop method we used in this video.
A couple things you need to be aware of: This open loop Auto-Tune was done with some
pretty heavy filtering on the process variable.
Open loop Auto-Tune is even more sensitive to noise than closed loop, so make sure
you have a good clean process variable before doing an open loop Auto-Tune.
The manual tuning we did in this video was for this specific self-regulating type of
system.
Don’t assume what we did here will work for all systems and don’t assume my spreadsheet
will work for your system until you have taken the time to understand how the method works.
I skipped some things that I knew weren’t important or required for this demo, but they
might be real important to your system.
Things like linearizing the system, normalizing the process gain, etc.
I’ll show you how to do some of those in future videos.
Check out the PID Blueprint website to see how to do other kinds of PID systems and learn
more about this method.
And remember – PLEASE don’t call AutomationDirect’s support team about this method – this isn’t
an AutomationDirect product, so they can’t support it.
Click here to see the other videos in this PID playlist.
Click here to learn about our Free tech support options and click here to subscribe to our
YouTube channel you will be notified when we publish new videos.