You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old July 14th, 2022, 11:34 AM   #16
Peter Nachtwey
Member
St Kitts and Nevis

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: No income tax, no capital gains tax. Freedom!
Posts: 8,300
Quote:
Originally Posted by Matjuhnl View Post
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.
It looks like you have only one time constant when there should be two for a SOPDT model.


Don't you have a way to show your response?
Doesn't TIA Portal have a way to show trends?
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 14th, 2022, 11:32 PM   #17
Peter Nachtwey
Member
St Kitts and Nevis

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: No income tax, no capital gains tax. Freedom!
Posts: 8,300
Quote:
Originally Posted by destination unknown View Post
PI:

Attachment 62483

PID:

Attachment 62484

I did a SOPDT simulator but the FOPDT is easier for demonstration purposes.
I'm sure you have plenty of your own anyway

I noticed that your plots are labeled ITAE. What did you use ITAE for? Calculating optimum controller gains or optimum pole locations?
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 15th, 2022, 09:33 AM   #18
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 110
Quote:
Originally Posted by Peter Nachtwey View Post
I noticed that your plots are labeled ITAE. What did you use ITAE for? Calculating optimum controller gains or optimum pole locations?
My tuning values are in a similar range to what you guys have already posted.
Those graphs are from the simulation with the values provided above (converted to Independent form)
  Reply With Quote
Old July 15th, 2022, 12:56 PM   #19
Peter Nachtwey
Member
St Kitts and Nevis

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: No income tax, no capital gains tax. Freedom!
Posts: 8,300
Quote:
Originally Posted by destination unknown View Post
My tuning values are in a similar range to what you guys have already posted.
Those graphs are from the simulation with the values provided above (converted to Independent form)
The didn't answer my question. Your graphs say ITAE. Did you use ITAE and did you use it calculate the gains directly or the poles. My suspicion is that you used ITAE to calculate the controller gains directly. That is not how ITAE is supposed to be used because the results will be different depending on whether you jump from 25 degree to 90 degrees or 25 degrees to 180 degrees. In other words, you solution will only work well for this one example.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 15th, 2022, 01:34 PM   #20
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 110
Quote:
Originally Posted by Peter Nachtwey View Post
The didn't answer my question. Your graphs say ITAE. Did you use ITAE and did you use it calculate the gains directly or the poles. My suspicion is that you used ITAE to calculate the controller gains directly. That is not how ITAE is supposed to be used because the results will be different depending on whether you jump from 25 degree to 90 degrees or 25 degrees to 180 degrees. In other words, you solution will only work well for this one example.
The plots were from the PID simulation with a FOPDT model as given above. The ITAE in this instance is used an indicator of PID performance allowing for comparisons of tunes.
  Reply With Quote
Old July 16th, 2022, 08:45 AM   #21
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 110
The simulator is available here:
https://github.com/Destination2Unkno...nPID_Simulator

and windows exe here:
https://github.com/Destination2Unkno...ases/tag/v1.01

The tuning package is available here:
https://github.com/Destination2Unknown/pytunelogix
  Reply With Quote
Old July 21st, 2022, 11:47 AM   #22
Matjuhnl
Member
Netherlands

Matjuhnl is offline
 
Join Date: Jun 2020
Location: Somewhere
Posts: 23
Thank you all! Nice to get this discussion on PIDs going once in a while.

What bothers me the most at the moment is the adjustment of the PID controller in combination with the Smith predictor. Any good suggestions?
  Reply With Quote
Old July 21st, 2022, 01:08 PM   #23
Peter Nachtwey
Member
St Kitts and Nevis

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: No income tax, no capital gains tax. Freedom!
Posts: 8,300
Quote:
Originally Posted by Matjuhnl View Post
Thank you all! Nice to get this discussion on PIDs going once in a while.

What bothers me the most at the moment is the adjustment of the PID controller in combination with the Smith predictor. Any good suggestions?
Yes, tune the PID as if there is no dead time because the Smith Predictor takes care of the dead time. The issue is that a Smith Predictor requires an accurate model. If the dead time isn't too long you can compensate for the dead time by using a two term Taylor series or Pade Approximant.

The link is to a .pdf I made a few months ago when we were having a discussion about floating control vs Smith Predictor. The Smith Predictor wins hands down and is noise immune because you are actually controlling a model and using the model for feedback, not the noisy feedback. However that assume you can estimate a good model.
NOTE! ALL THE WORK A DERIVATION IS SHOWN. YOU WON'T TIME THIS KIND OF DETAIL ANYWHERE ELSE.
https://deltamotion.com/peter/Mathca...09deg%20db.pdf
To estimate a model I use Nelder-Mead with differential equations to find the model with the lowest sum of squared errors, sse.
I usually don't bother with FOPDT models since they are not as accurate as the SOPDT models
The output of my python system identification tool
Code:
sse =  250.3141656165739
sse =  250.31416493541923
sse =  250.31414761879358
 final_simplex: (array([[ 3.75741204,  0.68461421,  2.84927027, 77.84024028,  0.35401924],
       [ 3.75741276,  0.68461511,  2.84926905, 77.84016508,  0.35401852],
       [ 3.75741085,  0.68461181,  2.84927089, 77.84033032,  0.35402135],
       [ 3.75741199,  0.68461453,  2.84926966, 77.84023678,  0.35401922],
       [ 3.75741296,  0.68461419,  2.84927032, 77.8401676 ,  0.35401904],
       [ 3.75741189,  0.68461419,  2.84927023, 77.84025638,  0.35401937]]), array([250.31414491, 250.3141476 , 250.31414762, 250.3141638 ,
       250.31416494, 250.31416562]))
           fun: 250.31414490854445
       message: 'Optimization terminated successfully.'
          nfev: 764
           nit: 452
        status: 0
       success: True
             x: array([ 3.75741204,  0.68461421,  2.84927027, 77.84024028,  0.35401924])
printing plot
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
The data came from Ron Beaufort's "Hotrod" data.
Attached Images
File Type: png temp.png (52.2 KB, 176 views)
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 22nd, 2022, 09:47 AM   #24
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 110
Rarely is a Smith Predictor the answer, first port of call should be to reduce dead time where possible. Here's an example implementation in Logix.


Step Response:
PRC.png

Logix FBD Smith Predictor:
Smith.PNG

PIDE (Smith Predictor) in Auto
SmithPredictor.png
  Reply With Quote
Old July 22nd, 2022, 03:08 PM   #25
Peter Nachtwey
Member
St Kitts and Nevis

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: No income tax, no capital gains tax. Freedom!
Posts: 8,300
If that is the response from a control logix, they are getting much better.
The next big hurdle with be model predictive control, MPC. I don't see that being implemented anytime soon on a PLC due to the lack of processing power but processing power is getting easier to come by.
I would like to implement MPC on our motion controller. There are some applications that are now controlled crashes because all the physical devices are TOO SLOW.

None of this makes any difference is you can't get a good model.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 22nd, 2022, 08:06 PM   #26
kamenges
Member
United States

kamenges is online now
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 4,308
Quote:
Originally posted by destination unknown:

Rarely is a Smith Predictor the answer, first port of call should be to reduce dead time where possible.
Isn't that kind of like saying "Rarely is amputation the answer, first port of call should be to treatment with antibiotics where possible". Well, you don't say. But if I were the one with a resistant infection and gangrene is setting in, I would certainly be glad amputation was developed as an option.

Typing "reduce dead time" is a fairly easy thing to do. Actually reducing dead time is often a whole lot complicated. Granted, it is not the best course of action to jump to advanced control methods without first looking at the physical system. But quite often the physical system is what it is due to cost, logistics, time, etc. Sometimes there is just no choice and its good to have tools to deal with those times.

Keith
  Reply With Quote
Old July 23rd, 2022, 08:52 AM   #27
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 110
Yeah kind of but that's why it's rarely instead of never.
Also for a Smith Predictor to be worthwhile the DeadTime has to be greater than 2*Time Constant. And the model of the system has to be pretty accurate and preferably linear.
The effectiveness and robustness of the Smith Predictor relies heavily on the accuracy of the model.

The built-in IMC in Logix is an alternative:

IMC_Param.png

IMC.png

or even a PID can be tuned to be somewhat effective:

JustAPID.PNG
  Reply With Quote
Old July 23rd, 2022, 09:07 AM   #28
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 110
Quote:
Originally Posted by Peter Nachtwey View Post
If that is the response from a control logix, they are getting much better.
The next big hurdle with be model predictive control, MPC. I don't see that being implemented anytime soon on a PLC due to the lack of processing power but processing power is getting easier to come by.
I would like to implement MPC on our motion controller. There are some applications that are now controlled crashes because all the physical devices are TOO SLOW.

None of this makes any difference is you can't get a good model.
Yes that is from Control Logix.
They also have an MPC module, it's a separate dedicated processor that fits in a ControlLogix rack.
Comes with MPC builder, AOI etc but I haven't used it yet and don't know how good it is.
  Reply With Quote
Old July 27th, 2022, 04:56 AM   #29
Matjuhnl
Member
Netherlands

Matjuhnl is offline
 
Join Date: Jun 2020
Location: Somewhere
Posts: 23
Is there a possibility to make a continuous model of the process (FOPDT). So without step response. This would make life a lot easier.
  Reply With Quote
Old July 27th, 2022, 11:08 AM   #30
Peter Nachtwey
Member
St Kitts and Nevis

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: No income tax, no capital gains tax. Freedom!
Posts: 8,300
Quote:
Originally Posted by Matjuhnl View Post
Is there a possibility to make a continuous model of the process (FOPDT). So without step response. This would make life a lot easier.
Yes, but it isn't easier math wise.

In some applications a step response is not desirable. For instance tuning a hydraulic cylinder moving a 50 ton roll of steel on a platform. A step response would cause the steel roll to fall off the platform and cause damage. That would be the fastest way to get kicked out of the mill.

In this case I used a M or W profile with gentle ramps. What I was testing was the picture in picture, not the auto tuning.

https://www.youtube.com/watch?v=tCNAydm4xpw

Here is an example where I use a swept sine wave.
https://deltamotion.com/peter/Videos/ValveID.mp4

The advantage of step changes is that it has very high frequency components that are necessary to identify systems with a high frequency response. However, temperature systems do not have high frequency responses, neither due most hydraulic systems. Therefore the excitation doesn't need to have a lot of high frequency components.

Most people that claim to have auto tuners use very crude ways of determining the model. They use the method you normally see on line and in text books. A step jump is used to determine the model by looking at only a few points. I use thousands of data points to get a model and you can see I don't care if it is linear or not as you can see in the ValveID video. I think there were about 3500 data points used in the ValveID video.

I use differential equations for my models. Differential equations are MUCH more flexible than using state space or Laplace transforms.

I have posted the ValveID video on YouTube because I have since made significant improvements to program.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
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


All times are GMT -4. The time now is 01:08 PM.


.