PID Tuning tool

Matjuhnl

Member
Join Date
Jun 2020
Location
Somewhere
Posts
23
A few months ago, I started to look into PID controllers and the tuning of first order processes. This has, partly thanks to you, resulted in a PI(D) tuner. I am very happy with it.

However, I still have one challenge. And that is detecting a stable process value. At this moment, I do 4*ProcessTime. However, this is not very accurate. Do you have better suggestions?

If you have a model of a first order process, I will be happy to tune it. Challenge me!
 
This will be fun.
Try this. It is a FOPDT or first order plus dead time temperature system
Kp*exp(-theta*s)/(tau*s+1)
Kp is the plant gain with units of 1% output per degree C of temperature error
tau is the plant time constant. Tau is 1 minute.
theta is the plant dead time. theta is 10 minutes
For simulation purposes, ambient temperature is 25 degrees C
The PV or actual temperature starts at ambient or 25 degrees C then ramps up top 90 degrees C.

This is your first test. However, I all my life I have NEVER seen a model of anything so I have had to compute the model using system identification. This is where the real challenge lies. Once you have the model, computing the controller parameters is easy. There are lots of posted solutions on the internet.
 
I have thrown your example into my tuner.

Model:
Process gain: 1.0
Process time: 60s
Process delay: 600s

PID settings (4-5% overshoot):
Kp: 0.135
Ti: 149s.
Td: 0s.

In addition, I would always use a Smith Predictor. My experience is that a more aggressive tuning is possible.

Identifying a system is no longer a challenge for me. I do this by means of a step response. I have created a function for this in the PLC.
 
Very good!This was a trick problem due to the long dead time.I include 3 plots of the response in a .docx file.
This first is yours using your tuning parameters.
Did you use a Smith Predictor?

The second plot uses IMC tuning.
The gains are way too high using the same closed loop time constant that I used.

The third uses my gains. I am not using a Smith Predictor. I used a Pade approximant to do simulate the dead time. I also used a closed loop time constant of 6 minutes. 5 minutes would work to and be a little tighter.

My gains are
Kc=0.09090909 %output/degree of error.
Ti=1.8333 minutes
Td=-8.636 minutes, Yet the derivative term is negative.

If I use a closed loop time constant of 5 minutes then the closed loop gains are
Kc=0.2 %output/degree of error
Ti=3.33333 minutes
Td=-2.5 minutes

Hopefully my .docx file shows.
 
I do not have good experiences with calculating the values. However, I do have good experiences with simulating the values.

Is it possible to make an .exe of the PID simulator from Github and share it here? For many people, Python is not the answer.

In addition, I have alternative settings for Peter's problem here.

PID settings (2-3% overshoot):
Kp: 0.239
Ti: 220s.
Td: 0s.
 
I do not have good experiences with calculating the values. However, I do have good experiences with simulating the values.

Is it possible to make an .exe of the PID simulator from Github and share it here? For many people, Python is not the answer.

In addition, I have alternative settings for Peter's problem here.

PID settings (2-3% overshoot):
Kp: 0.239
Ti: 220s.
Td: 0s.

https://github.com/Destination2Unknown/PythonPID_Simulator/releases/tag/v1.00

Or you can create your own exe using pyinstaller
 
I do not have good experiences with calculating the values. However, I do have good experiences with simulating the values.
Does that mean you can simulate given the model but not if you don't know the model.

Is it possible to make an .exe of the PID simulator from Github and share it here? For many people, Python is not the answer.
Yes! I have program that I use to size hydraulic systems. I wrote it in python and used a program called pyinstaller to make a .exe file from the .py files.
https://pypi.org/project/pyinstaller/

In addition, I have alternative settings for Peter's problem here.
PID settings (2-3% overshoot):
Kp: 0.239
Ti: 220s.
Td: 0s.
Are you using trial and error?
Where are your plots?


There are formulas for calculating the controller parameters I was a mean and nasty person and provided an example with a long, too long, dead time for most tuning methods you see on the internet. Obviously the IMC gains found on the controlguru website won't work.

Did you notice my negative derivative time constant? It works but you need to think outside the box.
 
Last edited:
Is that the same problem? That I presented above?


I did a SOPDT simulator but the FOPDT is easier for demonstration purposes.
I'm sure you have plenty of your own anyway (y)
Yes, I have files from 2005. In 2005 Ron Beaufort used what he called "hotrods" which were wood burning irons with a temperature sensor on the tip. The students had to use a PLC/5 to control the temperature at the tip of the iron. Ron was nice enough to collect the data from a test and send it too me. I used this data to compute a model of his "hotrod" and determined the gains for his PLC/5 PID.


I have this done for both FOPDT and SOPDT. The dead time is reasonable in Ron's.


Also, in the download/misc section there is a file called hotrod.zip. At that time I was using a SLC500 and ML1500 to test with.



Lets see what you come up with.
 
I can also tune without a model. But practice has shown that this is not the most ideal method. This is because tuning is time-consuming and (sometimes) expensive (especially with slow processes). Just doing a step response and getting a model out of it is much more interesting.

In the attachment, I have done a plot. This plot has been accelerated 200 times. I can enter this speed myself.

The negative D-factor is certainly interesting! I am going to take a look at this.

By the way. The process tuner is completely made in TIA Portal, including visualisation and plot.

Plot.png
 
I can also tune without a model. But practice has shown that this is not the most ideal method. This is because tuning is time-consuming and (sometimes) expensive (especially with slow processes). Just doing a step response and getting a model out of it is much more interesting.
+1000

In the attachment, I have done a plot. This plot has been accelerated 200 times. I can enter this speed myself.
This isn't clear too me.

The negative D-factor is certainly interesting! I am going to take a look at this.
Try my controller parameters in you simulator just like I tried your controller parameters in my simulator.

This is my results to the "hotrod.txt" data. I am computing a SOPDT model. The process variable is the actual recorded data. The estimated value is is generated by my model from the system identification.
If the estimated and process values are close to the same then my model is good.

final_simplex: (array([[ 3.75738871, 0.68459748, 2.8492896 , 77.84212178, 0.35403269],
[ 3.75738895, 0.68459766, 2.84928924, 77.8420959 , 0.35403266],
[ 3.75738776, 0.68459769, 2.84928958, 77.84219321, 0.35403292],
[ 3.75738878, 0.6845977 , 2.84929003, 77.84211757, 0.35403232],
[ 3.75738864, 0.68459843, 2.84928914, 77.84212303, 0.35403212],
[ 3.75738929, 0.68459787, 2.84928892, 77.84207222, 0.35403256]]), array([250.31411453, 250.31411796, 250.31413401, 250.31413445,
250.31413467, 250.31421152]))
fun: 250.31411452756277
message: 'Optimization terminated successfully.'
nfev: 204
nit: 105
status: 0
success: True
x: array([ 3.75738871, 0.68459748, 2.8492896 , 77.84212178, 0.35403269])
RMS error = 0.436
The open loop gain = 3.757 PV/%CO
Time constant 0 = 0.685 minutes
Time constant 1 = 2.849 minutes
Ambient PV = 77.842 in PV units
Dead time = 0.354
Time units are the same as provided in input file
The closed loop time constant = 0.285
The controller gain = 1.472 %CO/unit of error
The integrator time constant = 3.534 minutes
The derivative time constant = 0.552 minutes

temp.png
 
Last edited:
I have processed your data:

Model:
Process gain: 3.7
Process time: 210s
Process delay: 37s

PID settings (4-5% overshoot):
Kp: 0.736
Ti: 202s.
Td: 0s.
 

Similar Topics

http://www.pas.com/tunewizard I've been using this a lot lately, used to cost $10k but now it is free (hoping you will pay for support or buy...
Replies
15
Views
10,746
Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
1,907
so i have 4 25gpm wells feeding a 1000gal tank (T-1), with an additional 15gpm from a decant tank for 3hrs every 12hrs. P1 and P2 both controlled...
Replies
154
Views
34,522
Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a...
Replies
113
Views
26,611
I haven't had to tune a PID loop in a very long time. It's actually a PI loop for a pulse width modulation s.v. What was the name of that tuning...
Replies
16
Views
3,926
Back
Top Bottom