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 December 26th, 2021, 02:16 AM   #16
Peter Nachtwey
Member
United States

Peter Nachtwey is online now
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,202
Quote:
Originally Posted by PLCnovice61 View Post
Sorry for my indulgency, this is how some people learn (of course l include me in that statement)
P watch out he is pretty(understatement) smart, poke the computer at your possible peareal
You do know D an't going to lay down.
I really don't expect people on this forum to follow the math. I have a YouTube channel "Peter Ponders PID". Most people bail out after about 2 to 3 minutes because they don't understand the math. This is sad. If a judge by the names, most aren't even Americans, Canadians or UK citizens. This is very sad.


drbitboy isn't my main concern. The problem I really have is that no one at my company wants to dive into the control theory. The math makes their brain hurt. This is sad.


What people should take away from these threads is that mathemagic is possible and could be worth $$$$
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old December 26th, 2021, 06:35 AM   #17
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 6,706
Update: I am not saying a dead band is always better than a filter; I am only saying it is another tool in the toolbox, and its benefits or detriments in any situation will come from knowledge of the entire system (process + control).

TL;DR

Quote:
Originally Posted by Peter Nachtwey View Post
Do you know how to generate transfer functions using Laplace transforms? There is a significant difference between having an input filter and a output filter.
It's been awhile (decades), I am working on refreshing that. But I do roughly follow what you have done.
Quote:
Originally Posted by Peter Nachtwey View Post

Yes, but an input low pass filter doesn't change the characteristic equation. An output filter just adds another pole and doesn't change the tuning.
Yah I could be wrong here, but I don't see how either one does not delay, or at least attenuate, the response.

Quote:
Originally Posted by Peter Nachtwey View Post
Close but no. The dead band will ignore drifting from the set point within the dead band. If the noise is Gaussian the noise will filter out to the true value.
Sorry, I have to disagree, but a dead band that ignores the drift has been set incorrectly. If the dead band is set correctly i.e. based on common mode variation i.e. actual noise, not signal, then when the actual signal drifts in one direction, the noise will "break through" that side of the dead band and the PID will respond. Noise that is Gaussian makes both approaches work.

An interesting aspect of this is that there is a delay, random to be sure, but a delay nonetheless, in how long it takes for the (first) breakthrough, so in that sense it has the problem as the filter. But since we are saying things like "if the sample time is fast then the noise averages itself out." then it does not matter.
Quote:
Originally Posted by Peter Nachtwey View Post

The filter will not increase the noise.
I didn't say the filter increases the noise. What I said was that, in a system with input noise, a PID that responds to that noise, i.e. "chases the noise," will increase (amplify) the noise. Since a filter attenuates but does not eliminate noise, the filter-attenuated noise that gets through will be amplified in the system (system = process + control) by the PID.

Quote:
Originally Posted by Peter Nachtwey View Post
Yes, but the system will not be a steady state. It will drift within the dead band. What if the noise is greater than the dead band? I made my simulation difficult on purpose. The dead band is 3 degrees but that is also the standard deviation of the noise so about 35% of the readings are outside the dead band.
That dead band was set incorrectly, which is why you got that result. But an incorrectly-designed experiment proves nothing. That is why I try to always remember to qualify that the dead band has to be set appropriately/correctly. It should be set to 2-σ (95%) or 3-σ (99.7%), not 1-σ (68%). Obviously there is a tradeoff here between how immune it will be to noise vs. how long it should take to respond to drift, as noted above.

Quote:
Originally Posted by Peter Nachtwey View Post
No! How can you say that? Where is the dead band? There is no dead band. The goal is sample fast enough to get a true reading of the average pressure. Do you remember Nyquist? Actually one needs to sample faster than that.
If we sample at a high rate, and take the extrema over some period, in order declare their midpoint as the actual signal, then that is roughly akin to empirically determining the dead band limits. Yes, that is not an actual dead band, because an actual dead band is fixed around the setpoint (only), but it is saying "ignore all variation between these two limits as noise," which is the same concept, roughly, as a dead band.
__________________
_
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 (∞).
vi) Hakuna matata.
vii) Bookkeeping.

Last edited by drbitboy; December 26th, 2021 at 06:42 AM.
  Reply With Quote
Old December 26th, 2021, 01:22 PM   #18
Peter Nachtwey
Member
United States

Peter Nachtwey is online now
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,202
Quote:
Originally Posted by drbitboy View Post
Yah I could be wrong here, but I don't see how either one does not delay, or at least attenuate, the response.
They both delay the response. The difference is that an input filter changes the characteristic equation.



Quote:
Sorry, I have to disagree, but a dead band that ignores the drift has been set incorrectly.
I think we are saying the same thing. Read again.



Quote:
I didn't say the filter increases the noise. What I said was that, in a system with input noise, a PID that responds to that noise, i.e. "chases the noise," will increase (amplify) the noise. Since a filter attenuates but does not eliminate noise, the filter-attenuated noise that gets through will be amplified in the system (system = process + control) by the PID.
You are assuming a input filter. Without an input filter the noise does get amplified but should be filtered on the output.



Quote:

That dead band was set incorrectly, which is why you got that result.But an incorrectly-designed experiment proves nothing. That is why I try to always remember to qualify that the dead band has to be set appropriately/correctly. It should be set to 2-σ (95%) or 3-σ (99.7%), not 1-σ (68%). Obviously there is a tradeoff here between how immune it will be to noise vs. how long it should take to respond to drift, as noted above.
In my example the standard deviation for noise is 3 degrees. You are saying the dead band should be set to 9 degrees? OK.
https://deltamotion.com/peter/Mathca...09deg%20db.pdf
I made a "noise" array so that both simulations will have exactly the same noise. The standard deviation is still 3 degrees. You can see that making the dead band wider at +/- 9 degrees makes things worse. Only 1% of the samples will correct the PV and nothing happens within the dead band.

I have also made the noise extremely small. The PV eventually just stops somewhere in the dead band.


Quote:
If we sample at a high rate, and take the extrema over some period, in order declare their midpoint as the actual signal, then that is roughly akin to empirically determining the dead band limits.
Yes, that is not an actual dead band, because an actual dead band is fixed around the setpoint (only), but it is saying "ignore all variation between these two limits as noise," which is the same concept, roughly, as a dead band.
[/quote]
It is just a crude way of finding the average assuming the wave form is symmetrical. One could average all the points during one cycle too but it would need to be one cycle and that would vary depending on the pump speed. The results would be wrong if the averaging occurred over a wave length and a half.



BTW, we are helping Star Hydraulics with their servo valve testing. The test involves generating sine waves to the valve and measuring the response. The person doing helping out is using a FFT to estimate the the amplitude of the response but it would have been easier to just capture the high and low of the responses sine wave. The sampling is done at 8KHz. This is fixed. It is best if the sine wave frequencies are some factor of 8KHz. For instance. Sampling a 333 Hz sine wave means we don't always catch the peak. We have a technique where we use two samples before the peak and two samples after the peak to estimate the true peak. This works well. If one just samples a 333 Hz signal at 8 KHz and applies a FFT, it will not return the correct amplitude.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old December 30th, 2021, 09:20 PM   #19
durallymax
Lifetime Supporting Member
United States

durallymax is offline
 
Join Date: Sep 2017
Location: Wi
Posts: 64
Quote:
Originally Posted by Peter Nachtwey View Post
What version of Mathcad do you have? The mcdx files can be zipped. Very few people have Mathcad and I wouldn't recommend buying it now. I would stick to Python now.
I have access to 6.0.0.0, I like the speed of it for some things. Express does a lot of what I need but I have access to the full version when needed.

I will have to check out the channel, going through EE most of the YT I watched be it transfer functions, nodal, Laplace, mesh, etc was not native English speakers but I did appreciate that they tend to get to the point instead of ramble like some of the Americanos. I doubt I'll follow the math either, but keep some contacts that do enjoy that type of math and will pass it on.

Last edited by durallymax; December 30th, 2021 at 09:24 PM.
  Reply With Quote
Old December 30th, 2021, 10:24 PM   #20
Peter Nachtwey
Member
United States

Peter Nachtwey is online now
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,202
Quote:
Originally Posted by durallymax View Post
I have access to 6.0.0.0, I like the speed of it for some things. Express does a lot of what I need but I have access to the full version when needed.
Is that a student version? Mathcad 6 was old back in the early 2000s. There is now a Mathcad Prime. I bet that is what you have. Mathcad is pretty good at symbolic math. wxMaxima and Mathematica are better. Python can do symbolic math but it is a kludge. Definitely learn python and wxMaxima because they are free. Here is an example using wxMaxima solving 17 equations for 17 unknowns to generate a 3rd order motion profile. Doing this by hand is tedious and error prone. The tools help you learn faster.
https://deltamotion.com/peter/wxMaxima/Seg1234567.html



Quote:

I will have to check out the channel, going through EE most of the YT I watched be it transfer functions, nodal, Laplace, mesh, etc was not native English speakers but I did appreciate that they tend to get to the point instead of ramble like some of the Americanos.
I know what you mean about getting to the point.

I have my Mathcad examples done before I start videoing so I don't waste time typing and fixing mistakes during the video.



Quote:

I doubt I'll follow the math either, but keep some contacts that do enjoy that type of math and will pass it on.
My channel is not for beginners. It is gear for grad students and people in the field. There are too many channels that explain PID control by saying this gain does this and that gain does that but they don't provide a good understanding of how the gains and plant work together.

I have over 800 Mathcad files on all sorts of topics. I started with the original Mathcad 3 back in the early 1990s.


BTW, there is a lot of stuff I learned in college that I NEVER used. However, Laplace transforms and differential equations are a must. Many things were taught back then. PID knowledge was crude. When I was going to college there was a class where a PID was made using op amps, resisters and capacitors.


You need to see my "Root Locus is Useless" video
https://youtu.be/uYhz3TuTkfM
I used the same example an Indian IIT professor used. He used 8 videos to show how to plot the root locus. However, at the end he didn't have a means of controlling the system the root locus was based on. I am no nonsense. If you want some entertainment there is my Fuzzy Logic vs PID where I blast a paper that was presented to some engineering meeting. It is obvious the committee that accepted that paper didn't know anything.
https://youtu.be/5389Mh6Xibo


Learn python, Laplace transforms, numerical analysis, differential equations and system identification. Be able to solve systems of differential equations.


A channel I like is "APMonitor".



If you want to be more specialized, learn FPGA programming. FPGA programming. An FPGA is like PLC that can execute all its rungs at once.


Above all, the the basics. I call this "forever knowledge" because it will never change. The tools, PLCs and motion controllers and languages are all fads and may be gone in 20 years.


Have fun, the futures belongs to the doers and designers.
If you have a question PM me. I have help students get their masters degree in the past. Forum member Pandiani is an example.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old December 31st, 2021, 06:17 PM   #21
busarider29
Lifetime Supporting Member
United States

busarider29 is offline
 
Join Date: Aug 2013
Location: Midland, MI
Posts: 359
Quote:
Originally Posted by mylespetro View Post
This is pretty neat! I expect to see Peter and drbitboy in here shortly to bicker about it, as is customary
  Reply With Quote
Old January 3rd, 2022, 11:45 AM   #22
durallymax
Lifetime Supporting Member
United States

durallymax is offline
 
Join Date: Sep 2017
Location: Wi
Posts: 64
Quote:
Originally Posted by Peter Nachtwey View Post
Is that a student version? Mathcad 6 was old back in the early 2000s. There is now a Mathcad Prime. I bet that is what you have. Mathcad is pretty good at symbolic math. wxMaxima and Mathematica are better. Python can do symbolic math but it is a kludge. Definitely learn python and wxMaxima because they are free. Here is an example using wxMaxima solving 17 equations for 17 unknowns to generate a 3rd order motion profile. Doing this by hand is tedious and error prone. The tools help you learn faster.
It is Prime 6.0.0.0. I've used it to solve multiple equations for multiple unknowns using solve blocks and have also used Mathematica quite often, but not much anymore. I'll look at wxMaxima.

Quote:
Originally Posted by Peter Nachtwey View Post
My channel is not for beginners. It is gear for grad students and people in the field.

BTW, there is a lot of stuff I learned in college that I NEVER used. However, Laplace transforms and differential equations are a must.

If you want to be more specialized, learn FPGA programming. FPGA programming. An FPGA is like PLC that can execute all its rungs at once.
I have very little interest in grad school, but don't like to ignore things that can be solved with math. Hence the reason I kept the numbers of my much smarter peers that "see the math" and enjoy it. Laplace and DE were two things that were actually enjoyable, real world use for once.

We did FPGA's in VHDL and LabVIEW. I prefer VHDL but can see the appeal to LabVIEW for some.
  Reply With Quote
Old May 26th, 2023, 09:12 AM   #23
destination unknown
Member
Ireland

destination unknown is offline
 
Join Date: Jun 2010
Location: Ireland
Posts: 107
The online version: https://pidtuningireland.pythonanywhere.com/
  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
PID loop question Tom W LIVE PLC Questions And Answers 7 August 21st, 2012 09:28 AM
PID temperature excel simulator rlawson LIVE PLC Questions And Answers 36 February 14th, 2011 05:47 AM
Use a PID? MarBa LIVE PLC Questions And Answers 4 May 8th, 2003 09:31 PM
how often should I trigger the PID? Ron Beaufort LIVE PLC Questions And Answers 11 February 22nd, 2003 11:57 AM
Cascading Sparky LIVE PLC Questions And Answers 24 February 17th, 2003 12:33 PM


All times are GMT -4. The time now is 11:50 PM.


.