Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

15 views
Skip to first unread message

Wolfgang

unread,
Feb 15, 2009, 4:11:23 AM2/15/09
to
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

pnachtwey

unread,
Feb 15, 2009, 12:33:23 PM2/15/09
to
This is the link to the pdf file I posted the last time.
ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20t1p1%20pid%20cd.%20wolfgang.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
http://www.engin.umich.edu/group/ctm/PID/PID.html
Read 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=5, 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


JCH

unread,
Feb 16, 2009, 8:02:42 AM2/16/09
to
> 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
>
 
 
Rewriting process transfer function (non-self regulating system 2nd order)
 
          K1*K1
F(s) = ----------
       T1*s^2 + s
 
               1
F(s) = ----------------- 
       A2*s^2 + A1*s + 0
 
 
EXAMPLE DATA
 
Process transfer function:
 
A1 = 0,05
A2 = 1
 
Target filter regarding also speed and acceleration:
 
C0 = 1
C1 = 1,7
C2 = 1
 
* See possible solution
 
The solution was found by defining a bench mark scheme and simulating with different parameters.
 

--
Regards/Grüße    http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann  eMail aktuell: ja...@nospam.arcornews.de 
                 Microsoft-kompatibel/optimiert für IE7+OE7

 

Wolfgang

unread,
Feb 22, 2009, 8:52:18 AM2/22/09
to
On 15 Feb., 18:33, pnachtwey <pnacht...@gmail.com> wrote:
> What I think you need is to get the big picture.  Here is some home
> work.  Look at this websitehttp://www.engin.umich.edu/group/ctm/PID/PID.html

> Read 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.
>
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 >= 0. Do you agree?

Wolfgang

pnachtwey

unread,
Feb 22, 2009, 10:25:33 AM2/22/09
to
On Feb 22, 5:52 am, Wolfgang <Wolfgangweinm...@aol.com> wrote:
> On 15 Feb., 18:33, pnachtwey <pnacht...@gmail.com> wrote:> What I think you need is to get the big picture.  Here is some home
> > work.  Look at this websitehttp://www.engin.umich.edu/group/ctm/PID/PID.html
> > Read 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.
>
> Hello Peter, I did it.
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 the transferfunction has a damping, I can
> increase Kp very much, but it remains damped.

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.

> The transferfunction has
> no zeros where the real-part is >= 0. Do you agree?
>
> Wolfgang

It better not. If it did the transfer function would have a non-
minimum phase response.

Peter Nachtwey

Wolfgang

unread,
Feb 24, 2009, 4:11:18 PM2/24/09
to
On 22 Feb., 16:25, pnachtwey <pnacht...@gmail.com> wrote:
>What is the value of Kp that will return a critically damped
>response? This should be easy.

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

pnachtwey

unread,
Feb 24, 2009, 5:04:14 PM2/24/09
to
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

Tim Wescott

unread,
Feb 24, 2009, 5:07:56 PM2/24/09
to
On Tue, 24 Feb 2009 14:04:14 -0800, pnachtwey wrote:

-- snip --


> 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

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

--
http://www.wescottdesign.com

pnachtwey

unread,
Feb 25, 2009, 12:20:42 AM2/25/09
to
On Feb 24, 2:07 pm, Tim Wescott <t...@seemywebsite.com> wrote:
> Unless you've been using WxMaxima for a bit too long :-)
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


Tim Wescott

unread,
Feb 25, 2009, 1:23:55 AM2/25/09
to

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?

--
http://www.wescottdesign.com

Wolfgang

unread,
Feb 25, 2009, 10:21:56 AM2/25/09
to
On 24 Feb., 23:04, pnachtwey <pnacht...@gmail.com> wrote:
> 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?
>

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.

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

What is your way by hand?

>
> Peter Nachtwey

pnachtwey

unread,
Feb 25, 2009, 1:16:22 PM2/25/09
to

You break the problem down to three equations and three unknowns. The
desired closed loop transfer function,
desired CLTF(s)= K*lamda^3/(s+lamba)^3 so the deisred characteristic
equation is:
CEdesird=s^3+3*lambda*s^2+3*lambda^3+lamda^3 and and the actual closed
loop CE is
CEact=s^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=lambda^3
Kp+20=3*lambda^2 Kp=3*lambda^2-20
Kd+10=3*lambda Kd=3*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=%lambda^3/B0]
(%o8) [Kp=-(A0-3*%lambda^2)/B0]
(%o9) [Kd=-(A1-3*%lambda)/B0]
[Ki = %lambda^3/B0]$
[Kp = -(A0-3*%lambda^2)/B0]$
[Kd = -(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)=Gain*alpha/(s*(s+alpha))
BTW, don't be surprised if you have a gain in the denominator. The
CTM PID example assumes K=1 so it disappears.

Peter Nachtwey

Wolfgang

unread,
Mar 6, 2009, 3:14:54 PM3/6/09
to
On 25 Feb., 19:16, pnachtwey <pnacht...@gmail.com> wrote:
> You break the problem down to three equations and three unknowns.  The
> desired closed loop transfer function,
> desired CLTF(s)= K*lamda^3/(s+lamba)^3 so the deisred characteristic
> equation is:
> CEdesird=s^3+3*lambda*s^2+3*lambda^3+lamda^3 and and the actual closed
> loop CE is
> CEact=s^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=lambda^3
> Kp+20=3*lambda^2  Kp=3*lambda^2-20
> Kd+10=3*lambda      Kd=3*lambda-10
>

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

> Holy %^$!, I could do that in  my head!!!!  That wasn't so hard even
> though I have been using Mathcad and wxMaxima for years!!!!
>

Ok - by that way Im not slower...

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

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

Mathlab?

> Now, you calculate the PID formulas for your motor system
> OLTF(s)=Gain*alpha/(s*(s+alpha))
> BTW, don't be surprised if you have a gain in the denominator.  The
> CTM PID example assumes K=1 so it disappears.
>

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

pnachtwey

unread,
Mar 6, 2009, 5:56:33 PM3/6/09
to
On Mar 6, 12:14 pm, Wolfgang <Wolfgangweinm...@aol.com> wrote:
> On 25 Feb., 19:16, pnachtwey <pnacht...@gmail.com> wrote:
>
> > You break the problem down to three equations and three unknowns.  The
> > desired closed loop transfer function,
> > desired CLTF(s)= K*lamda^3/(s+lamba)^3 so the deisred characteristic
> > equation is:
> > CEdesird=s^3+3*lambda*s^2+3*lambda^3+lamda^3 and and the actual closed
> > loop CE is
> > CEact=s^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=lambda^3
> > Kp+20=3*lambda^2  Kp=3*lambda^2-20
> > Kd+10=3*lambda      Kd=3*lambda-10
>
> Okay - you always make the approach lambda^n/(s + lambda)^n for a
> characteristic polynome od degree n.
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

>
> > Holy %^$!, I could do that in  my head!!!!  That wasn't so hard even
> > though I have been using Mathcad and wxMaxima for years!!!!
>
> Ok - by that way Im not slower...

I have done this before, many times.

>
> > 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.
>
> The time constant is 3/lambda.

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.

> 9 lambda would increase the
> responsetime
> with increasing lambda.

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.
http://maxima.sourceforge.net/download.html
wxMaxima, Mathcad, Maple or Mathematica makes doing symbolic math
easier.

>
> > Now, you calculate the PID formulas for your motor system
> > OLTF(s)=Gain*alpha/(s*(s+alpha))
> > BTW, don't be surprised if you have a gain in the denominator.  The
> > CTM PID example assumes K=1 so it disappears.
>
> 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

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

Message has been deleted

Wolfgang

unread,
Mar 8, 2009, 10:08:50 AM3/8/09
to
> > > 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.
> > The time constant is 3/lambda.
> 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.

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.


> > 9 lambda would increase the
> > responsetime
> > with increasing lambda.
> 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.

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


> 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.http://maxima.sourceforge.net/download.html


> wxMaxima, Mathcad, Maple or Mathematica makes doing symbolic math
> easier.

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:

http://www.loaditup.de/334115.html

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

http://www.loaditup.de/334114.html

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

Jerry Avins

unread,
Mar 8, 2009, 12:50:12 PM3/8/09
to
Wolfgang wrote:

...

> TFCL = lambda^3/(s + lambda)^3
>
> TLTF = lambda^3/[s^3 + 3*lambda*s^2 + 3* lambda^2 * s + lambda^3]

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

...

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

pnachtwey

unread,
Mar 8, 2009, 3:31:57 PM3/8/09
to

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.

>
> 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
>
> > 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.http://maxima.sourceforge.net/download.html
> > wxMaxima, Mathcad, Maple or Mathematica makes doing symbolic math
> > easier.
>
> 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:
>
> http://www.loaditup.de/334115.html
>
> With the right mouse button, you can save it.
>
> To the result (at the bottom):

Your solution is good.

> 1)The system has a unique solution
> 2) If I want a control without D-Part, then lambda must be 1/(3*T)

Yes, IF you want all three pole at the same place.

> That means, with a PI controller, I cant vary lambda?!?!

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.

>
> At 2nd to the low-Pass-Process with f(s) ? k/(1+s*T)
> reachable at
>
> http://www.loaditup.de/334114.html
>
> 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?

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

pnachtwey

unread,
Mar 8, 2009, 3:42:04 PM3/8/09
to
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

Wolfgang

unread,
Mar 9, 2009, 6:20:35 AM3/9/09
to
On 8 Mrz., 20:42, pnachtwey <pnacht...@gmail.com> wrote:
> On Mar 8, 9:50 am, Jerry Avins <j...@ieee.org> wrote:
>
>
>
> > Wolfgang wrote:
>
> >    ...
>
> > > TFCL = lambda^3/(s + lambda)^3
>
> > > TLTF = lambda^3/[s^3 + 3*lambda*s^2 + 3* lambda^2 * s + lambda^3]
>
> > So TFCL = TLTF? Doesn't s^3 + 3*lambda*s^2 + 3*lambda^2*s + lambda^3 =
> > (s + lambda)^3?
>
> >    ...
>
> > Jerry
> > --
> > Engineering is the art of making what you want from things you can get.
>
> ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
> 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.
>
Hello,

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

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

Wolfgang

Wolfgang

unread,
Apr 7, 2009, 2:31:20 PM4/7/09
to
Hello Peter,

I must "go back" to the measurement to determine the process
parameters.
You can see an measurement of the step respone at
http://www.loaditup.de/345637.html

If you look at the sheet, you can see the step response of the motor
with a inertia load (v-max = 19200) and with additional braking (v-max
= 11000)
This was the basics to suppose its a first order process (K/(1+p*T)

But now look at the impuse respone: http://www.loaditup.de/345634.html

The curve with the green rhombus has the same input strength as the
step.
While the impulse its the same curve as at the step with v-max =
19200).

But at the impulse end, the current is set to zero and you see the
speed
is decreasing linear. its really not a first order behaviour.

And if I reduse the Impulse duration to the half (curve with black
circles) you see,
that the response reaches in at the half time the state zero.

This is no first order behaviour. Both Impulses were significant
shorter as the time constant,
so they should reach zero araound at the same time.

If you look at http://www.loaditup.de/345636.html
you can see the motor modell. The motor is a FOC stepper motor.
The currents/voltages are sinusodial, but if you use instead the RMS-
values,
the model is the same like a dc motor with permanent magnets.

Look at first at Point II of the model: there ist the model with
voltage input and speed output.
The first element is a first order type for the rotor-current (stator
current at the stepper).
It has a very low time constant TA, which could be set to zero for
this discussion.
The current produces a drive moment (me). Of this driving moment the
load is subtracted.
The difference is the effective moment to the inertia, which is
modelled as the integrator
element with the time constant TI. Because the EMK of the motor, there
is a feedback to the
input voltage UA, where the EMK-part is subtracted. This model
describes the motor which
has a voltage as input.
But the control of the motor has a current control. I medelled it at
Point I. There you see,
that the actual current is feedback and verified with the setpoint
current. The current controller
is drawn by the blanc element. It outputs the voltage UA in a way,
that the requested current
flows.

Now to the impulse behaviour: The input is the current. Its set to a
certain value. This current
produces a driving moment, where the load moment is subtracted and the
difference
accelerates the inertia. The motor speeds up as you can see at the
diagram. At the end of the
impulse the current is set to zero. Look at the modell. Zero current
is reached, if the
Voltage UA is at the same level as the feedback EMK. Thus, the drive
moment is zero and the
mechanical load is subtracted. The negative moment decellerates the
inertia. If the load moment
is constant (not speed dependend), the speed falls linear. This is
exact, what you see at the
impulse diagram at the falling section. But this is really no first
order behaviour.

The consquence is, that I cant determine the first order model
parameters by the impulse
evaluation. The problem is, that I should have a solution which needs
less turns of the motor,
because if the motor is in the machine installed, you cant presume
that the motor can run
to get the parameters by the step response.

Do you know a solution to get the parameters with less space?

Regards

Wolfgang


pnachtwey

unread,
Apr 7, 2009, 11:53:03 PM4/7/09
to
On Apr 7, 11:31 am, Wolfgang <Wolfgangweinm...@aol.com> wrote:
> Hello Peter,
>
> I must "go back" to the measurement to determine the process
> parameters.
> You can see an measurement of the step respone athttp://www.loaditup.de/345637.html

>
> If you look at the sheet, you can see the step response of the motor
> with a inertia load (v-max = 19200) and with additional braking (v-max
> = 11000)
> This was the basics to suppose its a first order process (K/(1+p*T)
The graphs make sense but is v-max the maximum velocity?. Counts/sec,
mm/sec, rads/sec


>
> But now look at the impuse respone:http://www.loaditup.de/345634.html
>
> The curve with the green rhombus has the same input strength as the
> step.
> While the impulse its the same curve as at the step with v-max =
> 19200).
>
> But at the impulse end, the current is set to zero and you see the
> speed
> is decreasing linear. its really not a first order behaviour.

This is a typical way motor systems excite their systems. The
decreasing velocity doesn't appear to be exponential. This is odd.
Are you sure you have any frictional loads removed?

>
> And if I reduse the Impulse duration to the half (curve with black
> circles) you see,
> that the response reaches in at the half time the state zero.
>
> This is no first order behaviour. Both Impulses were significant
> shorter as the time constant,
> so they should reach zero araound at the same time.

I don't understand this statement. The green squares should be with
1% of 0 5 time constants from 120 ms. The black circles should be
with 1% 5 time constants from 60 ms when the current is set to 0. Are
you sure the graph doesn't have an offset?

>
> If you look athttp://www.loaditup.de/345636.html


> you can see the motor modell. The motor is a FOC stepper motor.
> The currents/voltages are sinusodial, but if you use instead the RMS-
> values,
> the model is the same like a dc motor with permanent magnets.
>
> Look at first at Point II of the model: there ist the model with
> voltage input and speed output.
> The first element is a first order type for the rotor-current (stator
> current at the stepper).
> It has a very low time constant TA, which could be set to zero for
> this discussion.

But don't you have a load that makes the system time constant much
longer?

> The current produces a drive moment (me). Of this driving moment the
> load is subtracted.

Drive monemt == torque?. The Net Torque is divided by the inertia to
get angular acceleration. I don't know what you mean by subtracted.
The key is the Net Torque. The net torque is the torque caused by
the current minus and frictional torque.

> The difference is the effective moment to the inertia, which is
> modelled as the integrator
> element with the time constant TI. Because the EMK of the motor, there
> is a feedback to the
> input voltage UA, where the EMK-part is subtracted. This model
> describes the motor which
> has a voltage as input.
> But the control of the motor has a current control.

Do you have a current source?

> I medelled it at
> Point I. There you see,
> that the actual current is feedback and verified with the setpoint
> current. The current controller
> is drawn by the blanc element. It outputs the voltage UA in a way,
> that the requested current
> flows.
>
> Now to the impulse behaviour: The input is the current. Its set to a
> certain value. This current
> produces a driving moment, where the load moment is subtracted and the
> difference
> accelerates the inertia.

Check out what I said above.

> The motor speeds up as you can see at the
> diagram. At the end of the
> impulse the current is set to zero. Look at the modell. Zero current
> is reached, if the
> Voltage UA is at the same level as the feedback EMK. Thus, the drive
> moment is zero and the
> mechanical load is subtracted. The negative moment decellerates the
> inertia. If the load moment
> is constant (not speed dependend), the speed falls linear. This is
> exact, what you see at the
> impulse diagram at the falling section. But this is really no first
> order behaviour.

It is still hard to understand what you are saying. I understand the
drive torque goes to 0 when the current goes to 0 and the system will
coast to a stop depending on the damping and the static frictional
torque.

>
> The consquence is, that I cant determine the first order model
> parameters by the impulse
> evaluation. The problem is, that I should have a solution which needs
> less turns of the motor,
> because if the motor is in the machine installed, you cant presume
> that the motor can run
> to get the parameters by the step response.

The method you are trying to use is common. The way you do this is
simple. You need to know 3 things:
1. The time it takes to get to the peak speed. In this case it is
either 60 or 120 millis3econds.
2. You can tell from the graph how long it takes for the speed to drop
to within 1% of 0.
3. You need to get the peak speed from the graph.
If you know how long 5 time constants is then you can calculate how
many time constants the rise time is.
If you know how many time constants it takes get to the peak speed on
the graph then you can calulcate what
maximum speed the motor would eventuall reach at full speed.


>
> Do you know a solution to get the parameters with less space?
>

Yes, it is common for the ramp down to take a long time and possibly
go too far when opeating in current mode. Without negative current
there is no way of stopping except for friction. What I do a postive
pulse and then a negative pulse of the same duration. The negative
pulse stops the motor faster.

I will see if I have time to show an actual example. I have a motor
that has a time constant of about 1 second that runs in torque mode.
I don't like methods that depend on just a few readings. Everything
depends on just a few points.

Peter Nachtwey

Wolfgang

unread,
Apr 8, 2009, 8:12:01 AM4/8/09
to
On 8 Apr., 05:53, pnachtwey <pnacht...@gmail.com> wrote:
> On Apr 7, 11:31 am, Wolfgang <Wolfgangweinm...@aol.com> wrote:> Hello Peter,
>
> > I must "go back" to the measurement to determine the process
> > parameters.
> > You can see an measurement of the step respone athttp://www.loaditup.de/345637.html
>
> > If you look at the sheet, you can see the step response of the motor
> > with a inertia load (v-max = 19200) and with additional braking (v-max
> > = 11000)
> > This was the basics to suppose its a first order process (K/(1+p*T)
>
> The graphs make sense but is v-max the maximum velocity?.  Counts/sec,
> mm/sec, rads/sec
>

8192 at the diagram is equivalent to 1000 rpm

>
>
> > But now look at the impuse respone:http://www.loaditup.de/345634.html
>
> > The curve with the green rhombus has the same input strength as the
> > step.
> > While the impulse its the same curve as at the step with v-max =
> > 19200).
>
> > But at the impulse end, the current is set to zero and you see the
> > speed
> > is decreasing linear. its really not a first order behaviour.
>
> This is a typical way motor systems excite their systems.  The
> decreasing velocity doesn't appear to be exponential.  This is odd.
> Are you sure you have any frictional loads removed?
>

At all graphs the motor was mounted to a brake.
At the green rhombus line/black circe line (impulse 120ms/60ms; 0V at
brake -> no braking force)
the motor has to drive approx. only the inertia load.

At the red circle line/blue cross line (impulse 120ms/60ms; 5V at
brake -> braking torque is active)
the motor has to drive the inertia load and the constant braking
torque.

So at the green/black marked line there may be only a little
parasitic braking torque.

>
>
> > And if I reduse the Impulse duration to the half (curve with black
> > circles) you see,
> > that the response reaches in at the half time the state zero.
>
> > This is no first order behaviour. Both Impulses were significant
> > shorter as the time constant,
> > so they should reach zero araound at the same time.
>
> I don't understand this statement.  The green squares should be with
> 1% of 0 5 time constants from 120 ms.  The black circles should be
> with 1% 5 time constants from 60 ms when the current is set to 0.  Are
> you sure the graph doesn't have an offset?
>

Its sometimes hard to explain complex themes only by written words.
I will say it with other words.

1. The difference of green and the black curve is the impulse
duration:
120ms at the green one and 60ms at the black one.
2. While the impulse is present, the accelleration is the same as at
the
step experiment, where the motor speeds up to 19200.
3. At the step experiment we saw, that the time constant T is about
1s.
4. Back to the impulse: So while the impulse is present, the speed
rises in a "linear" way, because 120ms are less T (=1s). That is
ok
5. Now we look at the behaviour after the impulse. The motor current
is
reduced to 0. If the process now has furthermore a first order
character,
the speed must not fall linear. At first, the gradient must be
strong
and later the gradient reaches about zero. And: Independent of the
starting value, after 5 times T the speed must reach about zero.
But look at the impulse response after the impulse finished:
The green and black line falls nearly linear. And because they
falls
linear, the green line needs more time after impulse finish to
reach 0
as the black line. At a first order system, the time to reach "0"
must
be constant independent of the signal high.
Furthermore the green line needs significant less as
5*T to reach zero.
That means: At the whole step experiment or at the impulse experiment
while the
impulse is present, a first order behaviour is viewable.
But at the impulse experiment after the impulse, the behaviour is not
like
a first order system.

And there I ask myself, if I determine the PID-Parameters with the
behaviour ot the step experiment, get I than the correct parameters,
if the
behaviour at the impulse experiment (after finishing the impulse) is
not a
foirst order behaviour?
>

>
> > If you look athttp://www.loaditup.de/345636.html
> > you can see the motor modell. The motor is a FOC stepper motor.
> > The currents/voltages are sinusodial, but if you use instead the RMS-
> > values,
> > the model is the same like a dc motor with permanent magnets.
>
> > Look at first at Point II of the model: there ist the model with
> > voltage input and speed output.
> > The first element is a first order type for the rotor-current (stator
> > current at the stepper).
> > It has a very low time constant TA, which could be set to zero for
> > this discussion.
>
> But don't you have a load that makes the system time constant much
> longer?
>

Look at ma modell:
The first element (1/1+p*TA) is the modelled first order behaviour
of the current. This time constant is very less (about 1ms) and has no
importance for this discussion. The inertia mass is part of the
Integrator
1/(p*TI) and determines the value of TI. If TA is much less than TI
then the
transfer function between the voltage us and the speed n (look at the
modell at
point II) is 1/(1+pTI). that means that the behaviour of a voltage
controlled
motor is like a first order system and the time constant TI is
determined by
the mass inertia.

> > The current produces a drive moment (me). Of this driving moment the
> > load is subtracted.
>
> Drive monemt == torque?.

Yes

>   The Net Torque is divided by the inertia to
> get angular acceleration.  I don't know what you mean by subtracted.
> The key is the Net Torque.   The net torque is the torque caused by
> the current minus and frictional torque.
>

Yes. We mean nearly the same. The current produces an electrical
torque.
Now think at the motor axis is a wheel with a wraped rope ant at the
rope
is fixed a weight. This produces a load torque. If you define, that if
the load torque
works against the electrical torque, the load torque has a positive
value and if
the load torque works in the same way like the electrical, the torque
load has a
negative value, than you must subtract the load torque from the
electrical torque
to get the effective torque. If you have an additional friction, this
value must further
also be subtracted. ANd the effective rest is your net torque.

Think about:
You have a electrical torque from the current (which can also be
zero),
you have a mechanical load torque as by the wheel with weight (which
can be zero)
and you have a torque by friction (which can be zero and speed dep.)
This three torque types are different and all must be considdered.
That is done by my subtraction.

> > The difference is the effective moment to the inertia, which is
> > modelled as the integrator
> > element with the time constant TI. Because the EMK of the motor, there
> > is a feedback to the
> > input voltage UA, where the EMK-part is subtracted. This model
> > describes the motor which
> > has a voltage as input.
> > But the control of the motor has a current control.
>
> Do you have a current source?

The motor is controlled by a Allegro A3985 motor driver. And the input
value
of this IC is the current.

What I want to say:
At the step experiment - the input is the current
which is set to a fix value, the output is the speed - I see a first
order
process behaviour.
At the impulse experiment, if I look at the decreasing speed - I see
no!
first order behaviour. I understand the behaviour if I look to the
drawn modell.
And what does this circumstance mean for determining my PID-
Parameters.
If I determine the process-parameters with the step experiment, I can
determine
the PID-Parameters. But will fit this PID parameters, because if I
look at the
impulse experiment after finishing the impulse, I dont see the
behaviour of a
first order process.

> > The  consquence is, that I cant determine the first order model
> > parameters by the impulse
> > evaluation. The problem is, that I should have a solution which needs
> > less turns of the motor,
> > because if the motor is in the machine installed, you cant presume
> > that the motor can run
> > to get the parameters by the step response.
>
> The method you are trying to use is common.  The way you do this is
> simple. You need to know 3 things:
> 1. The time it takes to get to the peak speed. In this case it is
> either 60 or 120 millis3econds.
> 2. You can tell from the graph how long it takes for the speed to drop
> to within 1% of 0.

Thats the point: this time depends of the peak speed. At a real
first order process, this time is constant, independent of the peak
speed!
And therefor I cant determine a reasonable time constant with the
impulse
experiment. Evaluating the impulse respone I never come to the time
constant of 1s as by the step experiment!

> 3. You need to get the peak speed from the graph.
> If you know how long 5 time constants is then you can calculate how
> many time constants the rise time is.
> If you know how many time constants it takes get to the peak speed on
> the graph then you can calulcate what
> maximum speed the motor would eventuall reach at full speed.
>
> > Do you know a solution to get the parameters with less space?
>
> Yes, it is common for the ramp down to take a long time and possibly
> go too far when opeating in current mode.  Without negative current
> there is no way of stopping except for friction.   What I do a postive
> pulse and then a negative pulse of the same duration.  The negative
> pulse stops the motor faster.
>
> I will see if I have time to show an actual example.  I have a motor
> that has a time constant of about 1 second that runs in torque mode.

It would be very interesting: If you input a current impulse - I
believe
you will have the same bahaviour (if you input a regulated fix
current for the
impulse, not a fix voltage).

> I don't like methods that depend on just a few readings.  Everything
> depends on just a few points.
>

Yes - you are right - but for me its now importand to principile of
the whole.
I know that a method which is based on an integral behaviour is much
stable
as one which evaluates a few points of a response.


Wolfgang Weinmann


Wolfgang

unread,
Apr 9, 2009, 3:46:45 PM4/9/09
to
Hello Peter,

for better understanding of the falling curve of the impulse-response,
I modelled the motor in scicos. And now I understand the behaviour.
Responsible for the shape is the speed independent load torque.
My modell is adjusten in a way, that I have the same behaviour as
at a real run.
If you are interested, I will send you the scicos modell.

Wolfgang


pnachtwey

unread,
Apr 11, 2009, 5:20:01 PM4/11/09
to
I am glad you found out why the response looked the way it did. It
looked to me like the response was exponential but decaying to an
offset other than 0 as if you had another active load. You should
also plot the control output to the motor.

I will look at it your Scicos file. I have never used Scicos, just
Scilab, but I am willing to give it a try.

BTW, I agree with your comments about the documentation. I am
looking into new tools like perhaps Python or Java augmented by a
graphing package and math library. I have found the new release of
Scilab to be so buggy that I just can't get behind it anymore.

I did buy software to do video captures of my screen and audio but I
found out that my test system had been 'modified'. I need to get my
system put back together. It did look like this.
ftp://ftp.deltacompsys.com/public/Pictures/Motor%20test%20system.JPG
It is just two DC 200 watt motors running in current mode as yours
are.
Then I will be able to play too and make some vodcasts.

Peter Nachtwey

pnachtwey

unread,
Apr 17, 2009, 10:58:43 PM4/17/09
to
On Apr 9, 12:46 pm, Wolfgang <Wolfgangweinm...@aol.com> wrote:

Wolfgang, I am about to do a first on this use group. I am posting a
link to a vodcast about how we do auto tuning. Notice that the open
loop control signal doesn't need to be a pulse or a step. I can use
just about any control signal I want. The real trick is how the data
in the graphs is processed.

The video is about 30 MB because I needed to use 1280x720 HD so the
numbers on the screen can be seen. This is my first crude unscripted
vodcast. Download the video first and then play. Otherwise the parts
of the screen that are changing will be blurry when limited by
internet speeds..

ftp://ftp.deltacompsys.com/public/videos/AutoTuneMotor.mp4

Notice that I still think in terms of hydraulic systems using terms
like extend and retract.
It is hard to talk intelligently for 15 second let alone 7 minutes.
I will work on making scripts in the future.

Peter Nachtwey

pnachtwey

unread,
Apr 20, 2009, 1:47:07 PM4/20/09
to
On Apr 17, 7:58 pm, pnachtwey <pnacht...@gmail.com> wrote:
>
> ftp://ftp.deltacompsys.com/public/videos/AutoTuneMotor.mp4
>
It has come to my attention that QuickTime is required for view the
file.

ftp://ftp.deltacompsys.com/public/videos/AutoTuneMotor.divx
Can be viewed using VLC. I am still experimenting with the best
compression methods
DivX seems to be the best so far.

Peter Nachtwey

0 new messages