How to get PID Padameters for a "lowpass with integrator" process

Hello,

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?

Best regards

Wolfgang

Reply to
Wolfgang
Loading thread data ...

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

  1. 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.
  2. 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.
  3. 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.

Peter Nachtwey.

Peter Nachtwey

Reply to
pnachtwey

Rewriting process transfer function (non-self regulating system 2nd order)

K1*K1 F(s) =

Reply to
JCH

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?

Wolfgang

Reply to
Wolfgang

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.

Peter Nachtwey

Reply to
pnachtwey

Hello Peter,

I confused the denomination of "critical damped" with the unstable fall.

the characteristic Polynome is s^2 + 10s + 20 + Kp

the Poles of the Polynome are -5 +(-) SQR(5-Kp)

The System is critical damped, if the two poles are at same Place at the negative real axis.

So the system is critical damped with Kp = 5

Wolfgang

Reply to
Wolfgang

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.

Peter Nachtwey

Reply to
pnachtwey

-- snip --

Unless you've been using WxMaxima for a bit too long :-)

Reply to
Tim Wescott

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.

Peter Nachtwey

Reply to
pnachtwey

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.

  • What The Heck Is This?
Reply to
Tim Wescott

  1. 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.

  1. 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?

What is your way by hand?

Reply to
Wolfgang

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.

Ki=3Dlambda^3 Kp+20=3D3*lambda^2 Kp=3D3*lambda^2-20 Kd+10=3D3*lambda Kd=3D3*lambda-10

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.

/* CTM PID tuning Compute the symbolic formulas (%i1) remvalue(A0,A1,B1,%lambda,Ki,Kp,Kd)$ /* Undefine */ Gp: B0/(s^2+A1*s+A0); /* System transfer function */ Gc: Ki/s+Kp+Kd*s; /* Simple PID controller */ CLTF: ratsimp(Gc*Gp/(1+Gc*Gp)); /* Closed loop transfer function */ CE: expand(denom(ratsimp(CLTF))); /* Characteristic equation */ DIFCE: expand(CE-(s+%lambda)^3); Ki: solve(coeff(DIFCE,s,0),Ki); Kp: solve(coeff(DIFCE,s,1),Kp); Kd: solve(coeff(DIFCE,s,2),Kd); grind(Ki,Kp,Kd); (%o2) B0/(s*A1+A0+s^2) (%o3) Kd*s+Ki/s+Kp (%o4) ((Kd*s^2+Kp*s+Ki)*B0)/((Kd*s^2+Kp*s+Ki)*B0+s^2*A1+s*A0+s^3) (%o5) Kd*s^2*B0+Kp*s*B0+Ki*B0+s^2*A1+s*A0+s^3 (%o6) Kd*s^2*B0+Kp*s*B0+Ki*B0+s^2*A1+s*A0-3*%lambda*s^2-3*%lambda^2*s- %lambda^3 (%o7) [Ki=3D%lambda^3/B0] (%o8) [Kp=3D-(A0-3*%lambda^2)/B0] (%o9) [Kd=3D-(A1-3*%lambda)/B0] [Ki =3D %lambda^3/B0]$ [Kp =3D -(A0-3*%lambda^2)/B0]$ [Kd =3D -(A1-3*%lambda)/B0]$ (%o10) done

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.

Peter Nachtwey

Reply to
pnachtwey

Okay - you always make the approach lambda^n/(s + lambda)^n for a characteristic polynome od degree n.

Ok - by that way Im not slower...

The time constant is 3/lambda. 9 lambda would increase the responsetime with increasing lambda.

Mathlab?

Ok, I will do this. I will look at the degree of the characteristic polynome and make the approach lambda^n/(s+lambda)^n

Wolfgang

Reply to
Wolfgang

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.

Peter Nachtwey

Reply to
pnachtwey

The closed loop transfer function of your approach is:

TFCL =3D lambda^3/(s + lambda)^3

TLTF =3D 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

CLTF_approx =3D lamda^3/[3*lambda^2*s + lambda^3] =3D lamda^3/[lambda^3*((3/lambda)*s + 1] =3D 1/[(3/lambda)*s + 1]

So the time constant is 3/lambda.

Please read what you wrote above:

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

How do you think about it?

Best regards

Wolfgang

Reply to
Wolfgang

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

CLTF_approx = lamda^3/[3*lambda^2*s + lambda^3] = lamda^3/[lambda^3*((3/lambda)*s + 1] = 1/[(3/lambda)*s + 1]

So the time constant is 3/lambda.

Please read exact what you wrote above:

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

How do you think about it?

Best regards

Wolfgang

Reply to
Wolfgang

...

So TFCL = TLTF? Doesn't s^3 + 3*lambda*s^2 + 3*lambda^2*s + lambda^3 = (s + lambda)^3?

...

Jerry

Reply to
Jerry Avins

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.

Peter Nachtwey

Reply to
pnachtwey

=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.

Peter Nachtwey

Peter Nachtwey

Reply to
pnachtwey

=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

Hello,

TLTF was a writing error of me. Obviously TFCL (Transfer Function Closed Loop) is correct.

Peter - You dont and didnt confuse anybody ;-))

Wolfgang

Reply to
Wolfgang

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.