![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Jun 2020
Location: Somewhere
Posts: 23
|
PID Tuning tool
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! |
![]() |
![]() |
#2 |
Member
|
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: Jun 2020
Location: Somewhere
Posts: 23
|
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. |
![]() |
![]() |
#4 |
Member
|
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
![]() |
![]() |
#5 |
Member
![]() ![]() Join Date: Jun 2010
Location: Ireland
Posts: 110
|
Here's another simulator:
https://github.com/Destination2Unkno...nPID_Simulator It uses independent gains, to convert: Kp = Kc Ki = Kp/Ti ----Ti*60 if in minutes Kd = Kp*Td ----Td*60 if in minutes |
![]() |
![]() |
#6 | |
Member
|
Quote:
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
|
![]() |
![]() |
#7 |
Member
|
What about SOPDT, second order plus dead time, systems?
What if the system is under damped like controlling the position of a mass on a spring?
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
![]() |
![]() |
#8 |
Member
![]() ![]() Join Date: Jun 2020
Location: Somewhere
Posts: 23
|
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. |
![]() |
![]() |
#10 | |
Member
![]() ![]() Join Date: Jun 2010
Location: Ireland
Posts: 110
|
Quote:
Or you can create your own exe using pyinstaller |
|
![]() |
![]() |
#11 | |||
Member
|
Quote:
Quote:
https://pypi.org/project/pyinstaller/ Quote:
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon Last edited by Peter Nachtwey; July 13th, 2022 at 05:15 PM. |
|||
![]() |
![]() |
#12 | |
Member
|
Is that the same problem? That I presented above?
Quote:
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
|
![]() |
![]() |
#13 |
Member
![]() ![]() Join Date: Jun 2020
Location: Somewhere
Posts: 23
|
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. |
![]() |
![]() |
#14 | |||
Member
|
Quote:
Quote:
Quote:
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
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon Last edited by Peter Nachtwey; July 14th, 2022 at 02:21 AM. |
|||
![]() |
![]() |
#15 |
Member
![]() ![]() Join Date: Jun 2020
Location: Somewhere
Posts: 23
|
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. |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Slow Acting Long Time Interval PID Tuning | GrizzlyC | LIVE PLC Questions And Answers | 141 | March 30th, 2021 07:04 AM |
PID tuning methods | OysterMan | LIVE PLC Questions And Answers | 4 | March 21st, 2021 11:59 AM |
Micrologix 1400 Timed Proportioned Output PID Tuning | Paul Begley | LIVE PLC Questions And Answers | 3 | January 13th, 2014 05:26 PM |
PID Tuning and Process Modeling | kdcui | LIVE PLC Questions And Answers | 14 | October 15th, 2009 02:27 PM |
PLC PID Auto Tuning Problem | monet | LIVE PLC Questions And Answers | 6 | May 26th, 2009 10:50 AM |