Sie sind auf Seite 1von 39

Plant: Controller: Asystemtobecontrolled Providestheexcitationfortheplant; Designedtocontroltheoverallsystembehavior

Figure 9.2 (Nise)


Compensat ion techniques: a.cascade; b.feedback

Figure 9.4 (Nise)

: Closed-loop system for

Example 9.1: a. Before compensation; b. After ideal integral compensation

Introduction Thethree-termcontroller ThecharacteristicsofP,I,andDcontrollers ExampleProblem


Open-loop step response Proportional control Proportional-Derivative control Proportional-Integral control Proportional-Integral-Derivative control

PID Tutorial

General tips for designing a PID controller

Basic Control Actions: u(t)


Proportion al control : Integral control : Differenti al control : u (t ) = K p e(t ) u (t ) = K i e(t )dt
0 t

d u (t ) = K d e(t ) dt

U (s) = Kp E (s) U (s) K i = E (s) s U (s) = Kd s E (s)

Effect of Control Actions


Proportional Action
Adjustablegain(amplifier)

Integral Action
Eliminatesbias(steady-stateerror) Cancauseoscillations

Derivative Action (rate control)


Effectiveintransientperiods Providesfasterresponse(highersensitivity) Neverusedalone

Basic Controllers
Proportional control is often used by itself Integral and differential control are typically used in combination with at least proportional control
eg, Proportional Integral (PI) controller:

KI U ( s) 1 G (s) = = Kp + = K p 1 + T s E (s) s i

Summary of Basic Control


Proportional control
Multiplye(t)byaconstant

PI control
Multiplye(t)anditsintegralbyseparateconstants Avoidsbiasforstep

PD control
Multiplye(t)anditsderivativebyseparateconstants Adjustmorerapidlytochanges

PID control
Multiplye(t),itsderivativeanditsintegralbyseparate constants Reducebiasandreactquickly

Introduction
Thistutorialwillshowyouthecharacteristicsoftheeachof proportional(P),theintegral(I),andthederivative(D)controls, andhowtousethemtoobtainadesiredresponse.Inthis tutorial,wewillconsiderthefollowingunityfeedbacksystem:

Plant: Controller: Asystemtobecontrolled Providestheexcitationfortheplant; Designedtocontroltheoverallsystembehavior

Thethree-termcontroller
ThetransferfunctionofthePIDcontrollerlookslikethe following:

Kp=Proportionalgain KI=Integralgain Kd=Derivativegain First,let'stakealookathowthePIDcontrollerworksina closed-loopsystemusingtheschematicshownabove.The variable(e)representsthetrackingerror,thedifference betweenthedesiredinputvalue(R)andtheactualoutput(Y).

This error signal (e) will be sent to the PID controller, and the controller computes both the derivative and the integral of this error signal. The signal (u) just past the controller is now equal to the proportional gain (Kp) times the magnitude of the error plus the integral gain (Ki) times the integral of the error plus the derivative gain (Kd) times the derivative of the error.


Thissignal(u)willbesenttotheplant,andthenewoutput(Y) willbeobtained.Thisnewoutput(Y)willbesentbacktothe sensoragaintofindthenewerrorsignal(e).Thecontroller takesthisnewerrorsignalandcomputesitsderivativeandits integralagain.Thisprocessgoesonandon.

Figure9.8(Nise) PIcontroller

Figure9.23(Nise) PDcontroller

Figure9.30(Nise) PIDcontroller

ThecharacteristicsofP,I,andDcontrollers
Aproportionalcontroller(Kp)willhavetheeffectofreducing therisetimeandwillreduce,butnevereliminate,thesteadystateerror. Anintegralcontrol(Ki)willhavetheeffectofeliminatingthe steady-stateerror,butitmaymakethetransientresponse worse. Aderivativecontrol(Kd)willhavetheeffectofincreasingthe stabilityofthesystem,reducingtheovershoot,andimproving thetransientresponse. EffectsofeachofcontrollersKp,Kd,andKionaclosed-loop systemaresummarizedinthetableshownbelow.

CL RESPONSE Kp Ki Kd

RISE TIME Decrease Decrease Small Change

OVERSHO OT Increase Increase Decrease

SETTLING TIME Small Change Increase Decrease

S-S ERROR Decrease Eliminate Small Change

Notethatthesecorrelationsmaynotbeexactlyaccurate, becauseKp,Ki,andKdaredependentofeachother. Infact,changingoneofthesevariablecanchangetheeffectof theothertwo. For this reason, the table should only be used as a reference when you are determining the values for Ki, Kp and Kd.

ExampleProblem Supposewehaveasimplemass,spring,anddamperproblem. Themodelingequationofthissystemis (1) TakingtheLaplacetransformofthemodelingequation(1) ThetransferfunctionbetweenthedisplacementX(s)andthe inputF(s)thenbecomes

Let M = 1kg b = 10 N.s/m k = 20 N/m F(s) = 1 Plugthesevaluesintotheabovetransferfunction ThegoalofthisproblemistoshowyouhoweachofKp, KiandKdcontributestoobtain Fastrisetime Minimumovershoot Nosteady-stateerror

Open-loopstepresponse
Let'sfirstviewtheopen-loopstepresponse.Createanew m-fileandaddinthefollowingcode: num=1; den=[11020]; step(num,den)

Runningthism-fileintheMatlabcommandwindowshouldgive youtheplotshownabove.

The DC gain of the plant transfer function is 1/20, so 0.05 is the final value of the output to an unit step input. This corresponds to the steady-state error of 0.95, quite large indeed. Furthermore, the rise time is about one Let's design athe second, and controller that will reduce the rise time, reduce the settling time, and eliminates the steadysettling time is about stateseconds. 1.5 error.

Proportionalcontrol(PController)
Fromthetable(shownbellow),weseethattheproportional controller(Kp) reducestherisetime, increasestheovershoot,and reducesthesteady-stateerror. CL RESPONSE Kp Ki Kd RISE TIME Decrease Decrease Small Change OVERSHO OT Increase Increase Decrease SETTLING TIME Small Change Increase Decrease S-S ERROR Decrease Eliminate Small Change

Proportionalcontrol(PController)
Theclosed-looptransferfunctionofthesystemwitha proportionalcontrolleris:

Lettheproportionalgain(Kp)equals300andchangethe m-filetothefollowing: Kp=300;num=[Kp]; den=[11020+Kp]; t=0:0.01:2; step(num,den,t) Running this m-file in the Matlab command window should gives you the following plot.

Note: The Matlab function called cloop can be used


to obtain a closed-loop transfer function directly from the open-loop transfer function (instead of obtaining closed-loop transfer function by hand). The following m-file uses the cloop command that should give you the identical plot as the one shown above. num=1; den=[1 10 20]; Kp=300; [numCL,denCL] = cloop(Kp*num,den); t=0:0.01:2; step(numCL, denCL,t)

Theplotshowsthat theproportional controller reducedboth therisetime and thesteady-state error, increasedthe overshoot,and decreasedthesettling timebysmallamount.

Proportional-Derivativecontrol (PDController)
Now,let'stakealookataPDcontrol.Fromthetable,wesee thatthederivativecontroller(Kd)reducesboth theovershootandthesettlingtime. CL RESPONSE Kp Ki Kd RISE TIME Decrease Decrease Small Change OVERSHO OT Increase Increase Decrease SETTLING TIME Small Change Increase Decrease S-S ERROR Decrease Eliminate Small Change

Proportional-Derivativecontrol (PDController)
Now,let'stakealookataPDcontrol.Fromthetable,wesee thatthederivativecontroller(Kd)reducesboth theovershootandthesettlingtime. Theclosed-looptransferfunctionofthegivensystemwitha PDcontrolleris: Let Kp equals to 300 as before and let Kd equals 10.

Enter the following commands into an m-file and run it in the Matlab command window. Kp=300; Kd=10; num=[Kd Kp]; den=[1 10+Kd This plot shows that the derivative controller reduced both the 20+Kp]; overshoot and the settling time, and had small effect on the rise t=0:0.01:2; time and the steady-state error. step(num,den,t)

Proportional-Integralcontrol(PIController)
BeforegoingintoaPIDcontrol,let'stakealookataPIcontrol. Fromthetable,weseethatanintegralcontroller(Ki) decreasestherisetime, increasesboththeovershootandthesettlingtime, andeliminatesthesteady-stateerror. CL RESPONSE Kp Ki Kd RISE TIME Decrease Decrease Small Change OVERSHO OT Increase Increase Decrease SETTLING TIME Small Change Increase Decrease S-S ERROR Decrease Eliminate Small Change

For the given system, the closed-loop transfer function with a PI control is: Let's reduce the Kp to 30, and let Ki equals to 70. Create an new m-file and enter the following commands. Kp=30; Ki=70; num=[Kp Ki]; den=[1 10 20+Kp Ki]; t=0:0.01:2; step(num,den,t) Run this m-file in the Matlab command window, and you should get the following plot.

Wehavereducedtheproportionalgain(Kp)[from 30030] becausetheintegralcontrolleralsoreducestherisetimeand increasestheovershootastheproportionalcontrollerdoes (doubleeffect).

Theaboveresponse showsthattheintegral controllereliminated thesteady-stateerror.

Proportional-Integral-Derivativecontrol(PID Controller)
Now,let'stakealookataPIDcontroller.Theclosed-loop transferfunctionofthegivensystemwithaPIDcontrolleris: CL RESPONSE Kp Ki Kd RISE TIME Decrease Decrease Small Change OVERSHO OT Increase Increase Decrease SETTLING TIME Small Change Increase Decrease S-S ERROR Decrease Eliminate Small Change

Afterseveraltrialanderrorruns,thegainsKp=350,Ki=300, andKd=50providedthedesiredresponse. To confirm, enter the following commands to an m-file and run it in the command window. You should get the following step response. Kp=350; Ki=300; Kd=50; num=[Kd Kp Ki]; den=[1 10+Kd 20+Kp Ki]; t=0:0.01:2; step(num,den,t) Now,wehave obtainedthesystem withnoovershoot, fastrisetime,andno steady-stateerror.

GeneraltipsfordesigningaPIDcontroller
WhenyouaredesigningaPIDcontrollerforagivensystem, followthestepsshownbelowtoobtainadesiredresponse. 1. Obtainanopen-loopresponseanddeterminewhatneedsto beimproved 1. Addaproportionalcontroltoimprovetherisetime 1. Addaderivativecontroltoimprovetheovershoot 1. Addanintegralcontroltoeliminatethesteady-stateerror 5. AdjusteachofKp,Ki,andKduntilyouobtainadesired overallresponse.Youcanalwaysrefertothetableshownin this"PIDTutorial"pagetofindoutwhichcontrollercontrols whatcharacteristics.

Lastly,pleasekeepinmindthat
youdonotneedtoimplementallthreecontrollers (proportional,derivative,andintegral)intoasinglesystem,if notnecessary. Forexample,ifaPIcontrollergivesagoodenoughresponse (liketheaboveexample),thenyoudon'tneedtoimplement derivativecontrollertothesystem.

Keep the controller as simple as possible.

This presentation is made from:

http://www.library.cmu.edu/ctms/ctms/matlab42/pid/pid.htm

Das könnte Ihnen auch gefallen