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 September 30th, 2022, 04:25 PM   #106
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
Quote:
Originally Posted by destination unknown View Post
There are rule based gains, and then I have a selector that allows for optimisation of the gains for PI or PID. Also it can optimise between Overshoot or Minimum ITAE, and whether you want PvT or not.
Some of those rules cannot be justified. I have shown the calculation many times before.
I have derived the FOPDT and SOPDT gains using pole placement and IMC method.
I don't see pole placement.
The IMC method does not generate a derivative time constant for FOPDT systems.

Quote:
Whereas in reality the SOPDT will be a closer representation and will preform better, and does when tested.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 3rd, 2022, 09:10 AM   #107
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 94
Quote:
Originally Posted by Peter Nachtwey View Post
Some of those rules cannot be justified. I have shown the calculation many times before.
I have derived the FOPDT and SOPDT gains using pole placement and IMC method.
I don't see pole placement.
The IMC method does not generate a derivative time constant for FOPDT systems.
I went with the most common, although there are more than a few different interpretations. One size fits all does not apply.
For the FOPDT IMC: td = tc*dt/(2tc+dt) and I used a scaled back version of derivative for the conservative tune (for noisey systems)
__________________
same same, but different...

Github: https://github.com/Destination2Unknown
YouTube: https://www.youtube.com/channel/UCjw...hVY32I2q2JZnBQ
  Reply With Quote
Old October 3rd, 2022, 01:24 PM   #108
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
Quote:
Originally Posted by destination unknown View Post
For the FOPDT IMC: td = tc*dt/(2tc+dt) and I used a scaled back version of derivative for the conservative tune (for noisey systems)
Where did you get that?
Where is the derivation?
Look at pages 1 and 2 of this
https://deltamotion.com/peter/Mathca...0-%20FOPDT.pdf
I show how the gains are derived.
The pdf was first generated for my contribution to the controlguru.com website in 2005. There was an article about controlling an heat exchanger.
https://controlguru.com/validating-o...r-fopdt-model/
https://controlguru.com/a-discrete-t...eat-exchanger/




If the feed back is noisy you don't change the gains because that changes the response ( the closed loop pole locations ).
You should
1. clean up the wiring.
2. Sample with a higher resolution analog input.
3. Sample at constant intervals.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 3rd, 2022, 02:22 PM   #109
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 94
Quote:
Originally Posted by Peter Nachtwey View Post
Where did you get that?
Where is the derivation?
Look at pages 1 and 2 of this
https://deltamotion.com/peter/Mathca...0-%20FOPDT.pdf
I show how the gains are derived.
The pdf was first generated for my contribution to the controlguru.com website in 2005. There was an article about controlling an heat exchanger.
https://controlguru.com/validating-o...r-fopdt-model/
https://controlguru.com/a-discrete-t...eat-exchanger/

If the feed back is noisy you don't change the gains because that changes the response ( the closed loop pole locations ).
You should
1. clean up the wiring.
2. Sample with a higher resolution analog input.
3. Sample at constant intervals.
That's great stuff but it's just PI control.

Its' a fairly common tuning rule, for example:

https://www.semanticscholar.org/pape...fc227/figure/2

https://controlguru.com/pid-with-co-...irred-reactor/
__________________
same same, but different...

Github: https://github.com/Destination2Unknown
YouTube: https://www.youtube.com/channel/UCjw...hVY32I2q2JZnBQ
  Reply With Quote
Old October 3rd, 2022, 05:25 PM   #110
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
Quote:
Originally Posted by destination unknown View Post
That's great stuff but it's just PI control.

Its' a fairly common tuning rule, for example:

https://www.semanticscholar.org/pape...fc227/figure/2

https://controlguru.com/pid-with-co-...irred-reactor/
Yes, but where is their mathematical proof that it is optimal?
Are they just guessing like Z-N until they find something that works?

There is NO NEED for a PID on a FOPDT system. A FOPDT system has only one open loop pole so only ONE closed loop gain is required to place it. That is the proportional tern. The integrator does not count because it has its own pole so a FOPDT closed loop system has two poles. One from the system itself and one from the integrator.

It is possible to add extra poles but these are usually low pass filters. Adding a Pade approximant to simulated dead time will also add a pole.

Basically, show me the math!

BTW, using the Pade approximation is better than using a Taylor series but it complicates the math and it does add the need for a derivative function.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 4th, 2022, 10:02 AM   #111
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 94
Quote:
Originally Posted by Peter Nachtwey View Post
Yes, but where is their mathematical proof that it is optimal?
Are they just guessing like Z-N until they find something that works?

There is NO NEED for a PID on a FOPDT system. A FOPDT system has only one open loop pole so only ONE closed loop gain is required to place it. That is the proportional tern. The integrator does not count because it has its own pole so a FOPDT closed loop system has two poles. One from the system itself and one from the integrator.

It is possible to add extra poles but these are usually low pass filters. Adding a Pade approximant to simulated dead time will also add a pole.

Basically, show me the math!

BTW, using the Pade approximation is better than using a Taylor series but it complicates the math and it does add the need for a derivative function.
Using a first order Pade approximation (-0.5DTs+1)/(0.5DTs+1) and a filter will get you the D term.

Again FOPDT is an approximation, so in reality the system is of a higher order hence the need for a D term.
__________________
same same, but different...

Github: https://github.com/Destination2Unknown
YouTube: https://www.youtube.com/channel/UCjw...hVY32I2q2JZnBQ
  Reply With Quote
Old October 5th, 2022, 01:14 AM   #112
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
Quote:
Originally Posted by destination unknown View Post
Using a first order Pade approximation (-0.5DTs+1)/(0.5DTs+1) and a filter will get you the D term.

Again FOPDT is an approximation, so in reality the system is of a higher order hence the need for a D term.
Yes! I said that but have an example using a Pade approximation but the resulting formulas are much more complicated than those you have shown so I know none of tuning methods you have shown don't use the Pade approximation you have shown.

I have done the math long ago.
https://deltamotion.com/peter/Mathca...PDT%20PIDx.pdf
Yes, there is a derivative gain but look how complicated the formulas for the gain are? My formulas are not the same as the ones you have shown. Notice that the derivative time constant is negative but it still works even though the dead time is 10 times the open loop time constant so that a Smith Predictor isn't required if the dead time isn't too much longer than the open loop time constant.

I have done it all before and I show the math whereas other people just copy bogus formulas.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 5th, 2022, 01:08 PM   #113
jamesau
Lifetime Supporting Member
United States

jamesau is offline
 
Join Date: Mar 2004
Posts: 180
The derivation for the IMC PID tuning cited by Destination Unknown can be found in Table 2 of the nearly 40 year old article, Ind. Eng. Chem. Process Des. Dev. 1986, 25, 252-265.
Its derivation is detailed within and can be viewed here:
https://folk.ntnu.no/skoge/publicati...6/Rivera86.pdf

The tuning rules developed back then have subsequently been amended as 'SIMC' rules. (Google Skogestad PID SIMC for more...)
  Reply With Quote
Old October 5th, 2022, 04:50 PM   #114
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
Quote:
Originally Posted by jamesau View Post
The derivation for the IMC PID tuning cited by Destination Unknown can be found in Table 2 of the nearly 40 year old article, Ind. Eng. Chem. Process Des. Dev. 1986, 25, 252-265.
Its derivation is detailed within and can be viewed here:
https://folk.ntnu.no/skoge/publicati...6/Rivera86.pdf

The tuning rules developed back then have subsequently been amended as 'SIMC' rules. (Google Skogestad PID SIMC for more...)
It will take from time to go through this document. However, we agree on rows A and B.
Row C is an underdamped second order system like a hydraulic system which I am very familiar with. I will check that out.
It is taking a while to get familiar with the symbols used in the document because much of it was written long ago.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 5th, 2022, 10:45 PM   #115
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
BTW, the FOPDT controller gains did not include a derivative time constant. You can see from my math that if one used a second order Pade approximation, the formulas for the gains gets significantly more complicated.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 7th, 2022, 09:35 AM   #116
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 94
Here's an extract that shows the derivation for the IMC rules (FOPDT):

IMC.jpg



And the final form of the AutoTuner (SOPDT example):

AutoTuneSOPDT.jpg
__________________
same same, but different...

Github: https://github.com/Destination2Unknown
YouTube: https://www.youtube.com/channel/UCjw...hVY32I2q2JZnBQ
  Reply With Quote
Old October 7th, 2022, 10:51 PM   #117
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
The formulas for the controller gains in #116 look reasonable. However, in step 4 they admittedly fudged things. I spent some time trying to do the math without fudging. The document is right. You don't end up with a PID. I failed to have a good/easy solution without fudging.

The authors made a decision to sacrifice purity for simplicity.
Also, the documents technique is a little different from the method used to generate the formulas for row A and B above. It looks like they inverted the plant transfer function and added a low pass filter. Inverting the plant transfer function results in generating the feed forward gains. The document then adds a low pass filter or the response will have a first order response.


I would like to have a copy of the data used to generate the plot in #116



Our motion controller supports using PIs and PIDs but we also go beyond to improve response. As long as the customer doesn't need to deal with the added complexity but only benefits then all is good.


The response shown in the last plot is not that good. There is way too much over shoot. In my last plot the dead time was 10 times longer than the plant time constant.


OT but somewhat related. I have been working on python code to use .json files in addition to .csv files.


Currently I can import a .csv file with the first line being text to describe the columns of time, output, and PV and then as many rows of numbers of time, output and PV.


I am also working on importing accelerometer data acquired from test systems and then using FFTs and IFFTs to filter the data.


For some reason our software group exports motion data in xml or gzipped xml format. Since I do most of my work in python now I need to covert this data to python dictionaries or .json files.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 7th, 2022, 11:35 PM   #118
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 5,859
Quote:
Originally Posted by Peter Nachtwey View Post
OT but somewhat related. I have been working on python code to use .json files in addition to .csv files.

Have discovered the pandas module? Not that it is difficult write code to parse CSVs using Python, but pandas does that and so much more.
__________________
_
Brian T. Carcich
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
iii) Measurement is hard.
iv) I solemnly swear that I am up to no good
v) I probably have the highest ratio of forum posts to actual applications in the field (∞).
  Reply With Quote
Old October 8th, 2022, 06:15 AM   #119
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,028
Quote:
Originally Posted by drbitboy View Post
Have discovered the pandas module? Not that it is difficult write code to parse CSVs using Python, but pandas does that and so much more.
I haven't used pandas yet. I can already read .csv files no problem. I need to be able to convert a .xml file to a .csv file exporting only the data I want. There is a routine I use that makes it easy but it converts the whole file I need only the motion data.

What I am really trying to do is make some utilities for extracting the data I want out of our motion controller's .rmcplots ( xml ) and ,rmcplotx ( gzipped xml ) files. There is a bunch of 'junk' in them but I am usually only interested in the motion data for processing using python.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old October 8th, 2022, 09:53 AM   #120
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 5,859
XML? Yeah, been there, done that: "neither human- nor machine-readable "

I feel your pain.
__________________
_
Brian T. Carcich
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
iii) Measurement is hard.
iv) I solemnly swear that I am up to no good
v) I probably have the highest ratio of forum posts to actual applications in the field (∞).

Last edited by drbitboy; October 8th, 2022 at 09:56 AM.
  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 09:19 PM.


.