In the previous video, we set up our hardware and we outlined what we need to do inside
the CLICK PLC.
Now it’s time to configure all of this stuff so we can start using PID.
Make sure you have the most recent version of the CLICK software, at least version
2.51 or later, to use PID.
And of course, make sure your CLICK PLC’s firmware is up to date too.
Here we go … I’ll bring up the software and start a new
project.
We’re using this CLICK PLC with analog inputs and sinking outputs.
Remember, only CLICK PLCs with ethernet ports can do PID - all the ones with an “E”
in the part number.
Also, notice that each of these analog inputs has two terminals - one for voltage and one
for current. You can only use one or the other, you can’t use both at the same time.
The PID stuff is right here.
For each loop, we can set up PID, monitor PID and get a list of all memory locations being
used by PID.
We want to set up a PID loop, so we double click on that one and give it a name.
You are limited to 6 characters here because the loop name becomes part of the tag name.
The six-character limit keeps the tag name from getting too long.
You can turn off auto naming here, but it makes everything so much easier if you leave
it enabled.
You can always change the names later.
Next, we need to allocate memory.
Looks like we need 40 C bits, 15 Integers and 25 Floats.
We could enter the starting address ourselves and hope there’s no conflicts, but it’s
so much easier to let the software help you by clicking on Find Available Addresses.
It scans your code and finds all of the available blocks of contiguous unused memory locations
and lists them here.
We don’t have any code so of course EVERYTHING is available, but if you try to add PID to
an existing project this is a real time-saver.
I’m going to start my PID C bits at C100.
Then I’ll do the integers.
Again, I’ll start at 100.
And finally, grab a block of memory for the floats which I’ll also start at address
100.
Great, these are the blocks of memory we set aside for PID.
We see a green checkmark here, so we are ready for the next tab.
It’s already green, so it’s fine as is, or if we want to we can add some limiting
to the setpoint.
This is great for when you want to limit what the system can do.
Maybe you want to limit how hot a system can get or how cold or how much pressure.
Stuff like that.
We’ll leave that alone for now because we haven’t turned our system on and don’t
know what it is capable of yet.
The error term is also good as is, but we can square the error and use a dead band if
we want to.
We’ll look at those in more detail in the loose ends video.
The PID Algorithm.
We are going to use autotune to fill these in.
We just need to give it something to start with and these are the values recommended
in the help file.
These are fine for now.
We’ll talk about them in the loose ends video too.
The bumpless mode is important to understand for autotune.
When the system switches from manual to auto mode, if there is a big difference between
the setpoint and the process variable, PID is going to try and correct the error as fast
as it can by making big changes to the control output.
In our temperature example that’s not a big deal because the system reacts slowly.
But in a fast-moving system that can be dangerous both as a safety issue and a machine wear
and tear issue.
So bumpless mode 1 automatically sets the setpoint to whatever the process variable
is, which makes the error zero, so there are no sudden changes in the control output.
Once the system is running in auto, you can then carefully raise the setpoint to whatever
value you want.
But we want to tune our system for a specific setpoint. We don’t want it to move, so
we need to choose bumpless mode 2, which turns that feature off and leaves the setpoint right
where we put it.
Both modes reset the bias term, which we’ll talk more about that in the loose ends video.
Do we have a Direct or Reverse acting system?
That is when we increase the output does the process variable, or temperature in
our example, go up?
Ours does, so we have a Direct acting system.
If the temperature went down when the output went up, like in a cooling system, we would
select Reverse acting.
We have a green checkmark so let's move on to the output tab.
We can change the output scaling if we need to.
We don’t need to change it from the default zero to 100% because we want to drive the
PWM output which needs 0 to 100%.
We want that PWM signal to control output Y1 which goes to the solid-state relay.
A one second period for the PWM signal is fine for our heating application.
Green checkmark, next tab.
These are really important, but we don’t know these values yet, so we are going to
have to come back and fill these in later.
This one is the process variable level when the control output is zero, and this one is
the process variable level when the control output is 100%.
Exactly what it says – the min and max process variable.
PID needs to know this so it can scale things correctly and keep things in engineering units.
Just remember, this is NOT the zero to 300-degree range of our sensor.
It’s the range of the process variable which we are going to measure in the next video.
This last tab is for setting up alarms, so you can enable different groups of alarms
and the values to alarm at.
We’ll skip that one for now, too.
That’s it!
We just worked our way around the PID loop and filled in all the blanks.
I love the way this holds my hand and makes sure I don’t forget anything.
Click OK and we now have a fully configured PID loop.
And look at this – if we click on the PID List View, we see all of the automatically
assigned nicknames.
Each one begins with the loop name – now you see why you were limited to 6 characters
– the type of function and the name.
And that’s even expanded on in the comments section with clear understandable descriptions.
We’ll take a closer look at this list view in the loose ends video.
If you need another PID loop, just right click and do it all again.
The click PLC can handle up to 8 simultaneous PID loops.
Join me in the next video where we will set up our analog inputs for PID and get our PID
configuration transferred to the CLICK PLC.
Click here to see all the videos in this series.
Click here to learn about AutomationDirect’s free support options and click here to subscribe
to our YouTube Channel so you will be notified when we publish new videos.