I want to realize a position control of an el. motor. To get information of the process I make a step experiment. So I get the following model of the process:
F(s) = K1/(1+s*T1) for the speed and with the integrator K2/s the process has the transfer funktion
F(s) = (K1/(1+s*T1))*K2/s
The PID controller works with the frequency of 1KHz.
What I want is to determine the PID Parameters in the processor at runtime.
What approach do you sugggest. I got he advice to "Ackerman". I looked on the "Ackerman formula", but its not easy for me. I dont understand the whole context.
Who knows a approach or want to helt to come through the Ackermann formuls?
This is the link to the pdf file I posted the last time. ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20t1p1%20pid%20cd.%20wolfg= ang.pdf I know I don't have much explanation about all the steps but the method works very well. Most people just want the formulas without knowing all the theory so I just provided the formula. You can buy books that explain the formula.
Here is a version written in Scilab ftp://ftp.deltacompsys.com/public/Scilab/Ackermann.sce You can play with the open loop system parameters and see how the gains change.
The whole idea is to
Find the system's open loop transfer function using system identification. Your system was easy enough to find the gain and time constant by inspection.
Determine where you want the poles to be. I usually just put them all on the negative real axis. This keeps the system stable even if the system changes a bit. The poles will not drift far.
Calculate the controller gains. I use two methods. Symbolic and Ackermann's method. The symbolic method assume the sample time is very fast. The advantage I have with symbolic gain calculations is that I can easily change the gains on-the-fly whereas the Ackermann's method requires a lot of matrix math as you can see.
What I think you need is to get the big picture. Here is some home work. Look at this website
formatting link
down to the point where it says "Proportional Control" . What is the value of Kp that will return a critically damped response? This should be easy.
When you have solved that then go to "Proportional-Derivative control" What should Kd be to get a crtically damped response when Kp=3D5, 16, 29 and 44. This should be easy too.
Now go to the "Proportional-Integral" control. Are there any values of Kp and Ki that will provide a critically damped response? Why or why not?
Do the same for the "Proportional-Integral-derivative" example. This one will take some work but when you get through it you will understand what the Ackermann formulas is doing for you. While solving problems like these I developed the formulas for calculating gains symbolically. I used a program called Mathcad to derive the symbolic solutions for the gains. There is another program called wxMaxima that is free that can solve these problems easily.
Let us know what you get. I am sure there are many that have the same questions and will work through this problem. I need to work through the last two myself. I don't remember the results I got. My objection to the CTM PID page is that it shows Matlab answers without understanding. This takes time and effort.
Hello Peter, I did it. As the transferfunction has a damping, I can increase Kp very much, but it remains damped. The transferfunction has no zeros where the real-part is >=3D 0. Do you agree?
ou need is to get the big picture. =A0Here is some home
Did you figure out how to place the poles by doing the 'home work'?
Did you find a method to calculate the gains? You should be able to solve for the PID gains symbolically.
As long as you increase the derivative gain to keep the system critically damped BUT reality limits how high you can increase the derivative gain. Sample jitter and sample quantizing non-linearities limit how high the derivative gain can be increased.
It better not. If it did the transfer function would have a non- minimum phase response.
Wolfgang, your answer is correct for proportional only tuning. For PD tuning there are many more options as both Kp and Kd can be increased together. PID control allows the error to be driven to 0. What are the gains PID gains that will result in a critically damped response?
You should be able to solve for general symbolic formulas that will provide critically damped responses or any response for that matter. It takes about 10 lines of code in wxMaxima. It takes only a few minutes to work this out by hand.
I had to think about what you were trying to say before I finally got it. I think a system with 3 closed loop poles should be easy enough so that it is easier to solve for the symbolic gains by hand rather than try to figure out how to use wxMaxima for the first time. I didn't know you use wxMaxima. I like the new wxMaxima interface and have been using it more and more. wxMaxima is finally usable and allow multiple windows on a Mac but only one window on a PC.
They got it right for Windows about the time I started using it, but made sure to leave the old-style WTHIT* interface for a bit on the Linux distributions.
At this point the only symbolic calculations I do by hand are either really easy, because it's not worth firing up WxMaxima or the like, or they're really hard, because WxMaxima can't cope.
At first to PD: I can calculate the poles by hand. But zhere are always yet the parameters Kp and Kd. They is no singular solution.
Naturaly you can make an approach for (s + lambda)^2 and verify the coefficients for the polynome s*s + (10+KD)*s + (20 + KP)
But then is the question how t set lambda to a good value.
PI and PID: The characteristic polynome is of the 3rd order. So I dont have a fast solution to calculate the poles. I need one pole to reduce it to a second order and then I can calculte the other two poles.
I see, for the PID you make also the aproach with (s + lambda)^3
But again: What is the reasonalble value for lambda?
You break the problem down to three equations and three unknowns. The desired closed loop transfer function, desired CLTF(s)=3D K*lamda^3/(s+lamba)^3 so the deisred characteristic equation is: CEdesird=3Ds^3+3*lambda*s^2+3*lambda^3+lamda^3 and and the actual closed loop CE is CEact=3Ds^3+(10+Kd)*s^2+(20+Kp)*s+Ki Now there are three questions and three unknowns, one for each of the powers of s except the highest power.
Holy %^$!, I could do that in my head!!!! That wasn't so hard even though I have been using Mathcad and wxMaxima for years!!!!
Now obviously we don't what any of the gains to be negative, for now. Therefore is must make sure that lambda is greater or equal to the sqrt (20/3) and greater or equal to than 10/3. If lambda is set to 2*PI that means gains will be positive but the response will be very slow as it takes about 9 lambda to get within %1 of a set point in response to a step change. The larger the lambda the faster the response as the poles move farther to the left on the negative real axis BUT there is a reality limit due to feed back resolution and unmodeled non- linearities.
BTW, I have used the CTM PID page to show my engineers this for years. ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20T0C1-PID%20CTM%20NG.pdf
Now, you calculate the PID formulas for your motor system OLTF(s)=3DGain*alpha/(s*(s+alpha)) BTW, don't be surprised if you have a gain in the denominator. The CTM PID example assumes K=3D1 so it disappears.
I thought you had gone. Normally, a more general approach is to make the desired CE ((s+a) ^2+b^2)*(s+c). There is always one real pole on the negative real axis. You can adjust b to provide as much overshoot as you want or can tolerate. I usually don't tolerate any overshoot on a motion system so the simple multiple real pole solution works for me
I have done this before, many times.
What time constant? The closed loop time constant is 1/lambda. lambda is the location of the closed loop poles specified by a frequency in radians per second.
Increasing lambda makes the response faster because the closed loop pole locations are at a higher frequency. Increasing the lambda makes the closed loop time constants shorter.
This is wxMaxima. It is free. If you want answers uses Matlab or Scilab. If you want understanding then use wxMaxima, Mathcad, Maple or Mathematica.
formatting link
Mathcad, Maple or Mathematica makes doing symbolic math easier.
Yes, keep it simple at first. I think you are still confused. Download wxMaxima and play with variations. After a while you get the feel for how to place closed loop poles.
Part 1:"but the response will be very slow as it takes about 9 lambda to get within %1 of a set point in response to a step change"
If you write this, then the time to reach setpoint is growing with lambda! t_99% =3D 9* lambda !!!!
Part 2:"The larger the lambda the faster the response as the poles move farther to the left on the negative real axis"
Thats correct, but Part 1 is an antilogy to Part 1
Thank you for advice
So - now I have calculated the approach for my integrating process and for the low-pass-process.
At first : Integrating process with f(s) =3D k/{s*(1+s*T)]
I have scanned the approach:
formatting link
With the right mouse button, you can save it.
To the result (at the bottom):
1)The system has a unique solution
2) If I want a control without D-Part, then lambda must be 1/(3*T) That means, with a PI controller, I cant vary lambda?!?!
At 2nd to the low-Pass-Process with f(s) ? k/(1+s*T)
reachable at
formatting link
To the result:
1) I get only 2 equations for the 3 unknowns (Kp, Ki, Kd)
2) I set K to any value and calculate with the 2 equations Ki and Kd
The closed loop transfer function of your approach is: TFCL = lambda^3/(s + lambda)^3 TLTF = lambda^3/[s^3 + 3*lambda*s^2 + 3* lambda^2 * s + lambda^3]
if I ignore the higher order of s I get the CLTF_approx
Part 1:"but the response will be very slow as it takes about 9 lambda to get within %1 of a set point in response to a step change" If you write this, then the time to reach setpoint is growing with lambda! t_within1% = 9* lambda !!!!
Part 2:"The larger the lambda the faster the response as the poles move farther to the left on the negative real axis"
Thats correct, but Part 1 is an antilogy to Part 1
Thank you for advice
So - now I have calculated the approach for my integrating process and for the low-pass-process.
At first : Integrating process with f(s) = k/{s*(1+s*T)]
I have scanned the approach:
formatting link
With the right mouse button, you can save it.
To the result (at the bottom):
1)The system has a unique solution
2) If I want a control without D-Part, then lambda must be 1/(3*T) That means, with a PI controller, I cant vary lambda?!?!
At 2nd to the low-Pass-Process with f(s) ? k/(1+s*T) reachable at
formatting link
To the result:
1) I get only 2 equations for the 3 unknowns (Kp, Ki, Kd)
2) I set K to any value and calculate with the 2 equations Ki and Kd
Yes, because the CLTF is a third order system! I just take the desired settling time and divide by 9 to get the close loop transfer function time constant, tc. If lambda is then 1/tc.
Your solution is good.
Yes, IF you want all three pole at the same place.
Yes, but now your desired closed loop characteristic equation is (s
+lambda)^2*(s+mu) As lambda gets bigger, mu will get smaller. All three poles will converge at 1/(3*T). When the three poles aren't at 1/(3*T) the system is over damped.
Now you have new home work. Find the PI gains that result in the closed loop characteristic equation being (s+lambda)^2*(s+mu) AND (s+lambda)*(s+mu)^2. You still have three equations, one for each of the powers of s except s^3. Now you solve for Ki, Ki, mu as a function of K, tau and lambda. In the case of (s
+lambda)^2*(s+mu) you are only placing two poles and the third pole is calculated from the plant data and the lambda poles. In the second case, (s+lambda)*(s+mu)^2, you are only placing one pole
Ackermaan's equation assume all the poles are going to be placed. You can see that there is more flexibility solving the problem symbolically.
Solving for Ki and Kd doesn't make much sense, it might work but I think the obvious thing to do is to solve for Ki and Kp. Try that instead. You are getting the hang of it.
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Yes but what is TLTF? Not closed loop, not open loop, not desired What does TL stand for? Is TL a German abbreviation for something? I didn't see where TLTF was used.
I hope I am not confusing anybody. I often use CE for characteristic equation and TF for transfer function. OL for open loop and CL for closed loop. Mathcad lets me use subsripts but I can't do that here or in Scilab.
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.