Re: Compensation Issue
- From: "bxa132203" <bxa1322003@xxxxxxxxx>
- Date: 13 Sep 2006 17:48:54 -0700
I did design a PID controller initially. This was the approac I took.
First, I did identified the model of the car in s-domain and then
designed a controller via Root Loci and simulated in the results (in
s-domain). The results were satisfactory. But when I went and
implemented the PID controller in Type C, the car was unstable. Then,
I converted the PID controller in z-domain and the result was an
unstable system. So then I tried to design a digital controller and
then converted calculated the difference equation and obtained somewhat
satisfactory results.
Is there a special way of implementing a PID controller (digitally)? Do
I need an actual integrator of the error? Can I just design the PID
controller in the s-domain and then converted it to z-domain, a certain
Ts, and implemented according to the difference equation of the
transfer in z-domain?
Tim Wescott wrote:
bxa132203 wrote:
I applied a square wave to my system as the input and the output.If you could post a picture to the web someplace, and include a link, it
From 0 to 10 the car reaches a steady state value as well as when itgoes from 10 to 20. But 20 to 10 , there is a huge error (20%). But
when it goes from 10 to 20, a steady state value is reached, and back
from 20 to 10, 20% error is observed.
would be helpful. Be sure to include your command that you want to follow.
First some nitpicking:
The compensator that was design for the car is
5.3291 (z-0.41) (z-0.05564)
Gc(z) = // -----------------------------------------------
(z-0.9884) (z+0.997)
The actual implementation is
Kz = .263171; (notice the gain is lower than that of the design)
z1 = -.41 ; z2 = -.05564 ; p1 = -.9884; p2 =.997 ;
uk = (p1+p2)*uk_1 -1.0*(p1*p2)*uk_2 +Kz*(ek + (
z1+z2)*ek_1 + z1*z2*ek_2)
Any ideas, why the discrepancy?
Your have a discrepancy in your notation. If the 'zn' is supposed to be
zeros and the 'pn' is supposed to be poles then
z1 = 0.41, z2 = 0.05564,
p1 = 0.9884, p2 = -0.997.
There is also a discrepancy between your transfer function and your
difference equation. If your transfer function is
z^2 - 0.4656z + 0.02281
Gc(z) = Kz * -----------------------
z^2 + 0.0086z - 0.98543
then your difference equation should be
u_k = -0.0086 * u_{k-1} + 0.98543 * u_{k-2} +
Kz * (e_k - 0.4656 * e_{k-1} + 0.02281 * e_{k-2}).
You have the sign of at least one term reversed in your transfer function.
Actually, you should cascade two 1st-order filters in your difference
equation. My paper "Z Transforms for the Embedded System Engineer" at
http://www.wescottdesign.com/articles/zTransform/z-transforms.html
explains why, as does my book.
Now to answer your question:
That controller has no poles at z = 1. As a consequence, if your system
has any disturbances with DC content, or if your plant is not
integrating you will never achieve zero steady-state error. Instead,
your error will build up to the point where the controller output can
cancel the DC content of the disturbance. This is probably what is
happening.
See if you can design a plain old PID controller for the thing, and if
not try a PID controller with a lead-lag thrown in for some more speed.
I'd get it going with a PID at first, then get more fancy after I'd
done some measurements.
Now some more nitpicking:
You have a controller pole at -0.997? What are you thinking! I believe
that you have done your design using pole placement techniques. Pole
placement can be a valuable technique (I've used it myself), but only if
you know exactly how tractable your plant is, and define your target
pole locations so you're not asking too much of it. What pole placement
doesn't do is introduce any sensibility about the fact that plant models
can be inaccurate, and will design controllers that are completely
unreasonable -- either just plain unstable, or ones that excite plant
nonlinearities -- at the drop of a hat.
You should not start out using pole placement. You should either use a
robust design technique like H^2 or H-infinity, or you should use the
1950's robust design technique of doing it all on a Bode plot and a
Nyquist chart (this is in my book, too). Using a Bode plot is the
quickest way I know for getting a known-good system with the best robust
performance.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Posting from Google? See http://cfaj.freeshell.org/google/
"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
.
- Follow-Ups:
- Re: Compensation Issue
- From: bxa132203
- Re: Compensation Issue
- References:
- Compensation Issue
- From: bxa132203
- Re: Compensation Issue
- From: Tim Wescott
- Compensation Issue
- Prev by Date: Conference on Hydrocarbon safety-PETROSAFE 2007 at Kochi, Kerala, India.
- Next by Date: MotorSolve Sneak Peak at EME 2006
- Previous by thread: Re: Compensation Issue
- Next by thread: Re: Compensation Issue
- Index(es):
Relevant Pages
|