![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
|
PID - Velocity control of a mass on a spring.
The is the first system that uses complex or imaginary poles. Complex poles oscillate. RLC circuits, masses on springs, pendulums, masses on shafts and hydraulic cylinders are examples of systems with complex poles. I designed this spread sheet to be more challenging yet, but I know there will be some that do quite well.
If you notice the damping factor is set to .1. This is very low and I would have strong words with a mechanical designer that designed a system like this. If you get stuck you may increase the damping factor to about .7 until you get the feel for tuning the system. Then gradually move the damping factor back down. These systems that oscillate can be quite challenging when the desired actual profile is not allowed to overshoot the target profile. After you get the system tuned you should try doubling the frequency and halving the amplitude. Notice that it is impossible to tune the system if the target frequency is higher than the natural frequency of the system. Too many times I see systems where the controller is to control an actuator above the natural frequency. This is impossible many times because the system gain drops and the controller can only output +/- 10 volts. Notice that the frequency of the target generator is double the natural frequency of the system. This system is on the edge, but that is why it will be a challenge. There are three graphs on this sheet. One where the target velocity is doing a sine waving, one where it makes step jumps and the last is just to show you how much the system rings in open loop. I can get the ISE to 153 for the sine wave and the ITAE to 44.69 for the ITAE with out cheating. Have fun. Tuning a PID Controlling a Mass on a Spring |
|
|
|
#2 |
|
Member
|
Peter,
Just so I don't screw this up when I simulate the system in the program of my choice, could you post the transfer function (either in s or z domain) for the systems that you are defining when you initially post them? Thanks. |
|
|
|
#3 | |
|
Member
|
Transfer functions that will make your head hurt.
Quote:
Here are this weeks transfer functions. I will update the other spread sheets. T(s)=(G*omega^2)/(s^2+2*zeta*omega*s+omega^2) T(z)= g*(B(n-1)*z+B(n-2))/(Z^2+A(n-1)z+A(n-2) Where G is the gain omega is the natural frequency in radians per second. zeta is the damping factor a:=zeta*omega b:=omega*sqrt(1-zeta^2) A(n-1):=-2*exp(-a*T)*cos(b*T) A(n-2):=exp(-2*a*T) B(n-1):=1-exp(-a*T)*(cos(b*T)+(a/b)*sin(b*T) B(n-2):=exp(-2*a*T)+exp(-a*T)*((a/b)sin(b*T)-cos(b/T)) The difference equation is: v(n):=-A(n-1)*v(n-1)-A(n-2)*v(n-2)+B(n-1)*u(n-1)+B(n-2)*u(n-2) where v is the resulting velocity and u is the conrol One can see that calculating v(n) is easy once you know the coefficients A and B. The trick is in finding the values for the As and Bs. The simulation is multiplies and adds and the PID is multiplies and adds. Have fun!! |
|
|
|
|
#4 |
|
Member
![]() Join Date: Feb 2004
Location: Idabel, Ok
Posts: 390
|
PID
Peter are those formulas in english?
Kp=30 Ki=250 Kd=.6 61.3 40.16 open loop looks really bad unless the Damping to .7
|
|
|
|
#5 | ||
|
Member
|
Re: PID
Quote:
Math is its own language. Engineers and mathematicians in Germany, Japan, China and India can understand these formulas.Your tuning looks pretty good. How long did it take? Quote:
Trying reducing the natural frequency to .9 and then .8. You will notice that as the ratio between the target frequency and natural frequency increases the greater the output is required to control. Eventually the control is limited at +/- 10 volts and the system is out of control. Reduce the damping factor to 0. This system will oscillate like a perpetual motion machine. |
||
|
|
|
#6 |
|
Member
![]() Join Date: Feb 2004
Location: Idabel, Ok
Posts: 390
|
pid
When you change the damping to 1 is the red
line under the blue or is it gone? I`m not sure probably 2 hrs. but I had to stop and read one of Terry Woods post to clear my head a little. You know once you get top lines acting right you can change the p & i quite a bit and it doesn`t seem to make much difference. Why does the derivetive make so much difference? |
|
|
|
#7 |
|
Lifetime Supporting Member
|
I thought I was doing pretty good with
P=30 I=300 D=1.0 ISE=71.7 ITAE=28.3 (but a little messy on the graph). But Thomas's ISE=61.3 Came in better. Now... combining my P&I with the 0.6 D gives ISE=58.8... See, two heads are better than one ![]() Peter, why did you have to post the transfer functions? Now I'm going to have to get out my controls book and brush up on the math again...(but not til tomorrow since it's at work )
__________________
nOrM ====================== nOrM=Norman Dziedzic Jr. Your program may do things you never intended/ When the inputs are in a state you never expected. |
|
|
|
#8 | |||
|
Member
|
A limitation!!!
Quote:
The -3 determines how fast the oscilations decay to steady state values. The more negative the faster. Faster is usually better. The +/-2j indicates the frequency in radians per second that the system oscillates. Quote:
Back in 1997 I went to a steel mill in the middle of India to help with setup. While I was tuning the systems I had an audience. The Indian technicians soon caught how I was tuning the system using the ISE and soon they were standing in line to tune the system so they could get the lowest ISE. Between the 8 to 10 technicians they spent hours tuning the system. They beat my lowest ISE by quite a bit however I did need to back off their gains a little because they were too hot. Needless to say they have never called about tuning problems. Quote:
PID Tutorial This covers the system we are tuning this week. This is the mathematical explaination your question. However, I have some serve problems with this page. They only get the results they do because they don't limit the output of the PID controller to +/- 10 volts. Now for a an electrians explaination of damping and PID in general. Think of a servo motor with all the PID gains set to 0. You should be able to freely turn the shaft will little resistance. If I barely increase the P gain then I should feel the shaft try to move back to the original position when I twist the shaft. I should feel the force increase as I twist the shaft farther from its original position. Now set the P gain back to 0 and increase the I gain. Now when the shaft is turned one can feel the force build up at a rate proportional to how far the shaft is twisted from the orginal position. Even if the shaft is only twisted a small amount from the orignal position it will eventually build up enough torque to force the shaft back to the original position or trip on a current overload trying. Now set the gains back to 0 and increase the D gain. Now the shaft doen't twist as freely as it did with all the gains a 0. It feel like some is grabing the other end of the shaft and trying to keep you from moving it. As the D gain is increased one finds it harder to twist the shaft. It feel like some one is really gripping the other end trying to keep it from turn. Note, this does not mean moving back to the original position. It means keeping it from turning or moving. Once the shaft is turned the D gain will try to keep it there. As the gain is increased it will feel like a 800 lb gorilla has a grip on the shaft and is keeping it from moving. This gripping force really feels like friction and it is. How often have you played the part of the 800 lbs gorilla and grabbed something to keep it from oscillating? When you did you were doing the same thing as the differentiator. I said when you changed the damping factor to 0, it would oscillate like a perpetual motion machine. Adding D gains does the same as adding friction or damping to the system. That is why the D gain is so important with most systems that have complex poles ( that oscillate). D gain is the 800 lbs gorilla that stabilizes your system. In this case the gorilla is keeping the mass from oscillating. Think about it. If mass was sliding on ice, it would oscillate for a long time with out the D gain. BTW, don't try this unless you have a fractional horse power motor or the motor may twist you hand off. At Delta we have small motors that we let trainees twist to feel what I just described. They can easily get the motor to trip on a over current fault because the motors are so small. Last edited by Peter Nachtwey; July 19th, 2004 at 11:51 PM. |
|||
|
|
|
#9 | |
|
Member
|
Quote:
I know that someone’s brain must be sacrificed and forced to program windows, but it isn't going to be mine. Last edited by Peter Nachtwey; July 20th, 2004 at 12:19 AM. |
|
|
|
|
#10 |
|
Member
![]() Join Date: Feb 2004
Location: Idabel, Ok
Posts: 390
|
pid
Peter thanks for the good explaination that really
makes sense,but I don`t completely understand the numbers that are not imaginary, much less 'Complex poles are number like -3+2j and -3-2j. The j means the number is imaginary.' I probably shouldn`t ask this ,BUT HOW in the world can a number be IMAGINARY????? This stuff starts to make sense once you know what some of the terms mean. THANKS Believe this site beats ebay |
|
|
|
#11 | |
|
Member
|
Why not?
Quote:
I will try to make an explanation this evening. See this thread I knew this was coming! I don't think I can make a movie though; an explanation will have to do. I think its time. Maybe this will do. Will will try to relate this to what we are doing. Last edited by Peter Nachtwey; July 20th, 2004 at 09:23 AM. |
|
|
|
|
#12 |
|
Lifetime Supporting Member
|
Thomas,
At the most basic level, an imaginary number includes some factor of the square root of a negative 1. Harkoning back to high school math, you may remember the 'quadratic equation' Code:
-b +/- sqrt((b^2-(4*a*c))/2*a) Code:
0 = a*x^2 + b*x + c I'm sure Peter will be able to detail more exactly how they relate to controls but you seemed to be looking for some basic information.
__________________
nOrM ====================== nOrM=Norman Dziedzic Jr. Your program may do things you never intended/ When the inputs are in a state you never expected. |
|
|
|
#13 |
|
Member
![]() Join Date: Feb 2004
Location: Idabel, Ok
Posts: 390
|
thanks
Norman thank you for the help, but the closest I`ve come
to High Level Math in the last 30 years was making a mark on conduit to bend an offset. We`re not on the same wave length I`ll just try to tune the loops. Looked at 'Dave Short Trig Coarse' will start there. As for as remembering school-----I loved grade school especially the 4th grade it was 3 of the best years of my life!
|
|
|
|
#14 |
|
Member
![]() Join Date: Jul 2004
Posts: 1
|
Tuning the loop
Peter made me do it! Note that I didn't have the benefit of reading the previous posts before Peter had me download and tune the simulation on his spreadsheet. I spent about twenty minutes playing with it and came up with the following numbers:
Kp = 30 Ki = 325 Kd = 0.75 ISE = 59.560 ITAE = 26.754 This was a nice little exercise with a "perfect" system model. This model allows you to get a feel for how the gains really work without having to worry about noise in the feedback being amplified by the differentiator and system non-linearities like curvilinear valves and supply pressure fluctuations etc. |
|
|
|
#15 |
|
Member
|
Imaginary and Complex Numbers
All of you are familiar with real numbers. They go from negative to position infinity. Complex numbers are just a little more complex that real numbers. Think of complex numbers as two dimensional numbers whereas real numbers are just one dimentional. One of the dimensions of the complex number is the real number dimension. The other is the imaginary dimension. Try to picture an graph with a horizontal real axis and a veritical imaginary axis. Real numbers can only be on the x axis whereas complex numbers can be anywhere.
In control the real part of a complex pole describes how the system will decay or not. The more negative the real part of the complex number, the faster the system will approach steady state. If the real part is positive then the system oscillates in with exponentially increasing amplitude. That is not good this means we want the poles to negative real part or be on the left hand side of the graph. The imaginary part describes how the system oscillates. The larger the imaginary number the faster the system will oscillate. If the imaginary part is negative the oscillation rotates in a clockwise direction and if the imaginary part is positive then the oscillation rotates in the counter clockwise direction. Download this spread sheet. Complex Response Spread Sheet The spread sheet shows graphically how complex numbers can define how a system responds. The response allways starts at 1+j0 or 1,0 and decays toward 0,0 if the real part is less than 0. The Real and Imaginary part define this response .Try these numbers: Real Imag -2 20 The real part is negative the response decays toward 0 -4 20 The real part is more negative and the response decay toward 0,0 faster. -4 10 The impaginary part defines the frequency. Notice that the response does not rotate around 0,0 as quickly as when the imaginary part is 20. -4 0 The imaginary part is 0 si the response does not oscillate around the center. It just decays directly toward zero. This is how a negative real pole decays. 1 10 Notice that the real part is postive and does not decay toward 0. In fact the amplitude of the response gets bigger. So in summary. The real part of a complex number describes how amplitude ( the distance between the point and zero ) will change. Negative real parts make the amplutude get smaller. More negative real part make the system reach steady state very quickly. Positive real parts make the amplitude increase with time which is not desirable. The imaginary part determines the frequency at which the system will oscillate. The larget the number the faster. The imaginary part actually specifies the frequency response in radians per second. Radians per second = 2 * pi * hz. |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Siemens S7 PID Control Problem | qee | LIVE PLC Questions And Answers | 27 | May 15th, 2007 10:53 AM |
| PID - Simple Velocity Control | Peter Nachtwey | LIVE PLC Questions And Answers | 15 | July 9th, 2004 04:39 PM |
| Proportional valve driver control with PID | lanman | LIVE PLC Questions And Answers | 6 | February 25th, 2004 10:05 PM |
| PID - what is it anyway? | Ron Beaufort | LIVE PLC Questions And Answers | 6 | May 22nd, 2003 11:21 PM |
| how often should I trigger the PID? | Ron Beaufort | LIVE PLC Questions And Answers | 11 | February 22nd, 2003 10:57 AM |