PID Tuning tool

I please to excuse me, I have one stupid question:
Why do all your models include dead time? Do all your systems have transport delay (conveyors, pipelines, etc.)? What is the reason?
In reality EVERYTHING HAS A DEAD TIME!!!!
In most cases the dead time is so small it can be ignored.

Peter Nachtwey's "Hotrod.zip" example is approximated pretty well by the following function

W(s) = 3,77142857142857/ ((170,2864769*s+1)* (36,0195267*s+1)* (14,57362541*s+1)* (11,51468826*s+1))
That doesn't' look right because there is no dead time. What is the SSE ( sum of squared errors ) between the actual data and your estimated data? I always print that because it tells me how good my model is.

destination unknown example (post 36):

W(s) = 2,22 / ((91,225*s+1)* (21,3625*s+1))
(If I get data (not image) maybe I can improve the model.)
This doesn't look right either. Again, would like to see the SSE.

SSE is the sum of squared errors is more appropriate than other evaluation methods when testing for goodness of fit between a model and actual data.

My SOPDT program returns this for hotrod.txt
sse = 250.31414761879358
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.840 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
 
W(s) = 2,22 / ((91,225*s+1)* (21,3625*s+1))
(If I get data (not image) maybe I can improve the model.)
I have previously posted the data hotrod.txt. It is included in this zip file
https://deltamotion.com/peter/py/SysID SOPDT.zip

BTW, it doesn't take much longer to find the parameter for a SOPDT system than a FOPDT system but the difference in the quality of the model can be significant.

This is my old Mathcad Hotrod SOPDT work sheet as a pdf
http://www.plctalk.net/qanda/attachment.php?attachmentid=62756&stc=1&d=1660019198
Notice that I use differential equations to express the SOPDT model. Differential equations are THE way to go because they are so flexible. State space and Laplace transforms don't work for non-linear systems.

None of you guys account for the ambient temperature nor do you express the dead time correctly.
 
Last edited:
I have previously posted the data hotrod.txt. It is included in this zip file
https://deltamotion.com/peter/py/SysID SOPDT.zip

BTW, it doesn't take much longer to find the parameter for a SOPDT system than a FOPDT system but the difference in the quality of the model can be significant.

This is my old Mathcad Hotrod SOPDT work sheet as a pdf
http://www.plctalk.net/qanda/attachment.php?attachmentid=62756&stc=1&d=1660019198
Notice that I use differential equations to express the SOPDT model. Differential equations are THE way to go because they are so flexible. State space and Laplace transforms don't work for non-linear systems.

None of you guys account for the ambient temperature nor do you express the dead time correctly.

Here's the model for the Hotrod data, using a different representation:

HR.png

Model:
Model Gain= 3.78
Damping Factor= 1.27
2nd Order Time Constant= 83.23 seconds
DeadTime= 20.73 seconds

The PID Tune:
Kp=1.496
Ki=0.0071
Kd=49.39

HrTuned.PNG




I please to excuse me, I have one stupid question:
Why do all your models include dead time? Do all your systems have transport delay (conveyors, pipelines, etc.)? What is the reason?

Peter Nachtwey's "Hotrod.zip" example is approximated pretty well by the following function

W(s) = 3,77142857142857/ ((170,2864769*s+1)* (36,0195267*s+1)* (14,57362541*s+1)* (11,51468826*s+1))

example (post 36):

W(s) = 2,22 / ((91,225*s+1)* (21,3625*s+1))
(If I get data (not image) maybe I can improve the model.)

These functions look like they are from some curve fitting tool disregarding the dead time.
 
The response looks good but still not sum of squared errors. Also, when the damping factors is greater or equal to one then you have two real poles and the transfer function should be expressed that way. Normally a damping factor is used when the open loop system is under damped.
The math still works but now we can't compare your two time constants to my two time constants.
 
A PIDNN (PID Neural Network) is a dream of mine. This method of control shows a lot of potential. Unfortunately, I am not able to create this code myself.
 
I hope the PIDNN automatically adapts to the situation. As the model in our machines sometimes changes depending on the type of product and weather conditions.

By adapt, I mean adjusting the Kp, Ti & Td. I see in literature that a PID controller is still active in the background.

I have seen people running a PIDNN functionally on a PLC. However, I would like to look into the code.
 
NNs need be trained with hundreds or even thousands of examples. When you provide the different inputs, how do you grade the output if you don't really know what you want or what is optimal? Who would do that? How would you do that? You can't just say I am using a NN or FL and that will solve the problem. If you don't know the best answer to a set of inputs, then training the NN is not going to yield the results you want.

I am a big believer in staying with the basics and understanding them thoroughly. Understanding how to write the differential equations is a must. I know most of you would not call differential equations, basic.
 
I gave it a crack with some pumps the other day.
Unfortunately the downstream pipework is not complete so I couldn't ramp to 50Hz. (set to 30Hz)

Bit of a noob here, but can you tell me what is happening around the 50s mark where the model starts tracking the PV ? What is happening prior to that point ?

Ill have some more time on site soon, so ill be keen to run some more tests.

Thanks for creating this tool.

MicrosoftTeams-image (5).png
 
Bit of a noob here, but can you tell me what is happening around the 50s mark where the model starts tracking the PV ? What is happening prior to that point ?



The tuner in pytunelogix is a very specific/limited tuner which is based on a single step Process Reaction Curve.


It looks for the step in the CV (point where CV is at its max) and uses that as its starting point.
I didn't really document this very well but as you can see it doesn't quite work when there are multiple steps. You have to pay extra for the one that does $$$$$ :ROFLMAO:


Try clean up the CV data in the csv file, instead of the CV going from 0->20->30 change it to 0->30 and see what that looks like.
 
Last edited:
I gave it a crack with some pumps the other day.
Unfortunately the downstream pipework is not complete so I couldn't ramp to 50Hz. (set to 30Hz)

For a Process Reaction Curve you generally do a small step in CV e.g 0-10% or 0-20% and see what happens.
In your case 0-20hz or 0-30Hz is fine, not the best idea to go 0-50Hz just for a step test.
 
I hope the PIDNN automatically adapts to the situation. As the model in our machines sometimes changes depending on the type of product and weather conditions.

By adapt, I mean adjusting the Kp, Ti & Td. I see in literature that a PID controller is still active in the background.

I have seen people running a PIDNN functionally on a PLC. However, I would like to look into the code.

You don't need NN for that, and PLC's are not the best place to handle NN anyway.

Feedforward and/or pre-calculated adaptive gains should work in that scenario.
 
Very interesting. Thanks for letting me know.
I have cleaned up the data but still seem to get a similar outcome:

It will be interesting to see the difference in model, say from a step from 0->20Hz, vs 20->30Hz (latter is more within the pumps operational curve).

Would probably be best to ramp up manually to minimum flow speed, and then let the PID take over once we are within the vicinity of the pump curve.

khVsCb3PKL.png
 
50 HZ is mentioned. What does 50 Hz have to do with anything. I don't see 50 Hz in any of the graphs or pictures nor do I see 30 Hz.
Thanks for the reply Peter - Hz is a common measurement for motor speed in Australia. (as opposed to RPM: 50Hz=approx 3000RPM for 2 pole motor.)
50Hz is mentioned in the context of me not being able to run the VSD @ 50Hz.
The pipework downstream from the pump is incomplete, and can only handle about 50L/s flow (achieved at about 40Hz).

If you look at the top left graph, you will see the CV (VSD Hz) ramps to 30Hz.

Being new to this, I assumed that the best model would be obtained by ramping over the whole range of the output CV ramps 0Hz >> 50Hz.
But further reading indicates it may be better to measure step response over "expected" process values, eg: 20-50Hz.
 
Last edited:

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,925
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
2,072
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
35,518
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
27,608
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
4,073
Back
Top Bottom