Sie sind auf Seite 1von 8

:PID Tutorial

,@
C

c
',@
@

'
@-

,E

'

rllirocEeileE

S:e three.erx controlier,

-,-.-

.'-ote:
' Y' e y l v l at1a b Co r lrnandsusedrnthis.tuto ria l. a re : s t e u c } c * rr. . . , . ]
Matlab comrnandsfrom the controi systemtlboxle higirligtrtedin red.

---:-::---_,1_--,;t-::,,,._:::_.;_.__.

.r:. ,';,,.,.-'...,,l.i.;iti:.'''
l'. , ,
,,
.: :::..:...:a.:..
..:..,

,: :. ..i..:::,::.t,;..:.,::,,,:.,

i :i
i
'Tls
tutonal
wili
you flre characteriiliri'of th* eachof proporfionai
siiow
(;
{p), the inte;ai (I) andtie erlvairr,,

a desired
response.
ln tnisrrronal,wewin
"ll,T?'^1lil9-l'.*to usethernto obtain

\ iedbacksystem:
!r

"

t-.,r

t,
(.i

"

l '

"";ri;1tiil*duir;'"'

Plant:A s)'stemto be controlled


Conkolier: Providesthe excitationfo; tireplant; Designedto control the
oreralls),stembehavor

tlhe hree-em
ccntrcl[er
" ' -^ * Y '

L, ;

,,

t.
l.

hfini
,r'tfp://rvrvtv.engin.urni ch.edulgroup/ctrnlpiD,triD.
I

r1/20/2046

t-|

,i; rtD Tutorial

II
fe rransierfuncrionof tlie
I

PID controllerlookslike thefollowing:

K -st + K -s+ n,

" o * &* K o s -K i s* + :f+ ' r

gain
| " fp: ProPortional
u KI: hitegralgaiir
. Kd : Derivativegain

*s*g,1t:x5T:::^tl:::1Y,:
s-vstern
in a closed-loop
takea look at howthePID controllervorks
r!(
irsr,let,s
P:
valueF)
itrprut
desired
the
between
difference
the
rtretrackingerror,
lhul u (e)represenrs
ariabie
ILL
f_q
T:l
lJIlllI,
-t1]:
both +,"T,1:11:::S*: integral
r:ese-.irr
(e)u,ill
t rhePID controiier,a:rdthecontrollercomputes
rr I
*g,ruf\,v/
rrrru'
il;.;
JllJ Llrwt
f:
proportignai
the
equal
to
is
now
ryin.!rIiT::,11:
f thiserrorsignal.TtiresigrratGjusrpasfthecontroller
gain (Kd) tirnestire
ll Jl)

integral of the error pius the denvative


ragni*de of tire *"ror piilule'i,rtegtai gain (Ki) times the
envatit,e of the etror

* K"+
u: i{s++H,f,edt

dt

orltput (Y) will be obtained.This nevoutput (Y) will be sentback


,his sigral (u) rviii be sentto tlie plant, and the nerv
its
:l the sensoragainto find the,r.* .rro, signal(e). The coltroller taliesthis new error signaland computes
F
vativezurdltsintegralagain.Tirisprocessgooson andon'
l9t

of F, i, and E c*rlrcllers
'ihe cEtaraseE.isics
b;

effect ofreducing the rise tirne and will reduce,but nevereliminate,the


(Kp) rvill hav,e_the
! Froportionalcoritr-oller
(Ki)rvillhavetheeffeciofelirninatingthesteady-stateerror,!rtitmaymakethe
ii;..,:,,r
.--_.,:.::,.:,:,,..:.e,rl.it"gticontrol
the-system,
worse. derivativecontrol (Kd) will iravethe effect of increasingthe stabiliqrof
f;;r,=qp""*
on a
irnprovurgttre tralsient response.Effects of eachof controllersKp, Kd, and Ki
rr:ducingthe oversho"i
""
.Josed.l-oopS)stenraresurnarizedntlretablesirorvnbelorv.
L RESPCF{S RISE TIh4E

VERSHGOT SETTLING TI]\{


SmallChange

SS ERROR
Eliminate
SrnallChan

In fact'
g.,otethat theseconelationsrnay not be exactll,accurate,becauseKp, Ki, and I(d are depeildentof eagfiother'
usedas
be
only
two. For this reason,tlie table should
.rraiging oneof tiresevariablescanchangethe effect of tire other
for Ki. Kp andKd.
^ ref.e'cewhenvou are detenninrg
tite
t'alues

t,xaru[e Prcblem
tL '

$,lppose rve liave a sirnplemass, spdng, and darnperproblern.


t'.f'

[:
i
L'

p''//rvu'w.engin.urpich.
edu/group/ctm/PlD,PID.hnnl
,r"1t
i--'
[,:

I
I

TlDADAA6

5!

i::;:

'::, :i

rc modeling equationof this

systemis
M* +I:ir +Ice : F (U

;t';

-'

"

'I

''

equation(i)
el-aplace transformof the rnodeling

.t'-

'.,.

:'F{si
I*fX{si *bsX(si +!H{s}
X(s) andtireinputF(s)thenbe,c.o,rye1
the displacement
transferfunctionbetrveen

x{sj :
Fi=]

Ms'-tts-k

iet
l '

,i * M: l k g,
\\ . b : 1 0 N .s/m
l' . k: 20Nn
c

tj

l ( S):

'
' 'l the abovetransferfirncaon
Diugthesevalueslnt(

I-Q:
F(si

the goal of this problernis


l. .

--

lL'

s2+10s+2

andKd conftltrtes to obtaur"''


to showyou how eachof Kp' Ki

fime
* Fast-nse
Minimurn overshoot
"
effor
. No steadY-state

t,

{}pen-laop sePrespanse
rvr
the
Ltrv foilowing
addin
and aulr
"; luu
a new !:i:-:::iii
'r
Yet,s rst view the open_loop step resporxe. Create

L:

code:

ri

\r

t,
x* '

'|ttp: l/www. engin.u?nich.edulgsoup/cfin/PID/PID'html


,l{

trDAD0A6

ttetn Tutorial
/
F
-,,*-1

den=LI
g

IU^

^Afu j

'

slep (n um, d en )

!.*"*g

this m-file

:;

: , ',
.,_

: ', , " l r , 'r a


:

it

. . , ; - 1 : ., ,, r, , ,
.' r-,.
'l

':i
you the plot shorvnbe-lola''
in the Matlab commandrvindorishouldglve
Steti
Operr-Lr-rarr

. F
G

fi

fi.4

@
E

lb

g 0 .t- t3

il

r1e

(
:a

'41
trl r' rr'
3.:i

&

u. u I

1
Tirrte{:;ec)
. ei

1/2.9:
nnc1915
transfer
- ^Tl:e
to';
oftheplant
and
Dcgain
;;:::JT,,'U
second'
one
*,T:1,:::'.:,:t|'.";:l;L?'3nuffi:ff:
isabout
time
rise
;r'rJ.::g,"ll',1*lT:i:.i':"
;;# ?1?^t::1*":*3f"fre'J':i#:xi"ffi:;il,'J:'#';i';bi
time'
and
that will reducethe risetime, reducethe settling
ih\etttinq riine.is about1.5 seoods.L.tr; ;;r;6
enor'
!' .rliiliinates ille sieaC,y-s'{'ate
:( *.
'Pr c

"ont-oil.,

toPorticnal contrat

|; -:

^-----^l

ttle o'ershoot'
tirerisetime''increases
(Kp) reduces
above,we seethattheproportionalcontloller
+ti -lro,r, tiie tabresrrorvn
u'ith a prooortinalcontroller'
enor.n ;;i;;;-lolp tralsferfunctionof th* .b";
or.?odreduces
rhesread5,-srate
";"*
t

:'

"'

\j-J.

N-

ICL
l.: \-:
[

'{{s} : --.--

ti u i

.:. '
ll
tr:

KP

s' + ltls+in+ K ' J

tiet tiie proportronalgain (Kp) equal 300 andchangethe rn-fi'leto the followirg:
'

''
n':

g rolc\

tr tar q-I,
^ ..^+
a ' o'L
..

ttx t'
t,' '

t -t--

KP=300;
;

n u m - - [ K P]
d e n = [1

i0

2 0 + KP]

t:0
L -v'u
:0 . 07: . 2i
i:: ( nur ' den' t )

rtpl i

givesyou the follorving


,.-.utningthis m-file in the h4atlabcommandtvindou' should

'

plot

/nrT-\/T]IT-\
llhrl
:-t^-J-, /-^,,*/^h-- I cnni |' lv t y I l-, llnn I
gin.um ich.
edritgrotip
_ ' r1
' ;7iv,'q,s'.en
'lP' . lrfl
tn.

,-

tuz\l20a6

^ ti i
It

tl

fl

.=

i-'<
iLJ

F 8.tsi v

CJ
fl'-r u. u

'E

' n

I
j

d
f

'a
t

''a
il

'I
't

Tirre {trec}

't t

X':*:*Ti::*:.jl:::^"lt:*^."::::11p:::"9

g :!gli

closed_roop.r,u":.f.lp"*ion
directry
frornrheopen_

" frctionUi fr*l ihe followiing rn-file uses c.i


(insteadof obtainingclosed-loop
transfer
looptransferftncnon
the ocp
jr o m m a nd t hat
sh ou ld
give

,
a

-'-
;,
a

num=1;
den:[1
10 2 0];
K P :300 ;

y ou t he

ident ic al

ilo t

*"

the

o n e l " " " - '. r u " . " .

In' . irrrc],.d en Cl.l :cico o ( Kp* num , den) ;


: 0:0. Ci:2;
step (nu_irc],, cienCL, t)

sho ws th at
t he
)? re a love plot
-st e a d y-stat e
e rror,)L t rrr(
inc r-eas
r ea:ed
; eq
a.

pr opor t ional
controller
reduced both the
\ er
erssnoot
hot, _ anndt rdte c r e a s e d
t he ov
Ene
the settling

roport,anal--DerivaLive

rise
ti-me and the
time by small
a m o u n t.

co$,tral-

t&
take
. 9 ' ' let rs
c o ntrcl l er
(Kd)
, - uncti on
of
the

look

at

reduces
given

b o th
syste m

PD co n tr o l.
th e
with

F r o m the
tabl e
show n
abow e.
ue see that
o ve r sh o o t
a n d the
settl i ng
ti me.
The cfosed-l oop
a p D co n tr o l- ler
_s:

the

deri vati w e
transfer

xisi
Fisi

ll

a'
t

ios+Kr,
s? + (Itl+ I{nis +fZil + K.i

Kp equals
to 30 0 as bef or e
and Let Kd equa l s
and run it
in the M at l- ab c om m and window-

10,

Enter

the

fol-fowing

commands"into

an

)
)
.
)

KP :3 0 0;
Kd: 1 0;
num:[K d Kp ];
den: [ 1
1O+Kd 2 0+Kp] ;

1-

.
.gp://wwrv.engrn.umich.edu/group/cfmlplDl?lD.hfml
I

rv2.a/2006

[lJ ltrtonat

t = 0 :0 -0 L t 2;
si e p (n u m ,dent t

Kd='lI
iiFi='lng'
LnupStr:
Closeri1

II

I
i
I

0 .e

__J
a

t_l

Tit'',re
{ser}
the

overshoot
error

::":;::'li o'ilX"I;";;'-=;;;'
*;l:.:,';:: ;::':
;?:"t.:'""?l:":'
-:li'.
:

-^

^^-+-nl

ler

foth

recl uced

.'^*T ccner(
'
control
I i?'r<>pot'l-onal-Irrtegtal
r/,

- o ao-l
a :pt r-D
" ,::lccr
t::l,tri ..r.r
r nt, o

ta ke

ie t' s

a+- a

:ck

:r

settlrng

anci the

, ..

we see
From tl,e tabl'
and the
o
v
e
r
s
h
c
o
t
bo+ -h L h "
s),-stemr tha closed-IooP

th a t

LLrri L:L-'

tame, i ncreases

sirzen
F'r'|he
"""
I::.ilin;il-::":'":':i;-ln!.i:!t;";::.;;:';;;;
;; c o n tro r i s :
r' - " ' t t il|' " " ; ; ' ;
so i ng

"' a. f "t .

th e ri se

i't r u n= f"r

?r"

i{ss+ Ki

x g:

ll ri
1
8,,

+ K p ls + K r

Fisi l*f*tt* (2 0

$' ' '. " t ' s

reduce th e KP r o
l(
comrrra nd s'
i ' i o t r o * ing

3o

'

and

l- et

Kr

equals

to

?0'

Create

an neu'

- - - ''- '

and

enter

the

(
lt

tr, :
ll
.,
I

"

tl

KP= u;
Ki :? Ot
num=tKp Kil ;
d e n = ll 10 2o+ K P K i ]t

t ,.
t..
I ' o"" *"
t

-u: 0:0 '07 "2 ;


5i-eB (nu m, de n, t )
i le
t
-' --i -" m-f

- ' he } lat lab

c om m and windo w ,

and

you

should

get

the

following

prot

(
\
t

\
\
\
D.' hn
!
r - ^r . . , ' - . nr r n/ c t n / PlT)
""' n l"
L Lv
t ut, FJ
r, l i rn ' i/n, \ v\ ! . eng lll.titnich'e dulEoup/ c lt lr ir
' " r" "
il
1

1112812006

Page7 of9

Clssed-Laap
5lp;f\F=30Ki=0
t-4

12

E
Y
cfr g
Ar-*

Ll.,^

ri U.f

EC n,

tr.
tl

0 .5

is

a
L

l e irave eciuced th e pr opor t ionaf


( Kn) . b " . - r " " t t h e
inteqral
controller
also educes
tj-m e a nd j-n cre as es
, gar n
th e
t he : ower s hoot
_ as - tn . p r o f o r t i o n a r - . c n t r o t l e r
;i"u
does (dcubre
a bove re sp on se
e
f
r
e
c
t)
. th e
sho ws t hat
t he int egr al
c on t r o l l e r
eliminated
the steady-stat.e
)
error.

?ropcrti*na3

- EnteEral

-serirative

i i X l . , i " i r in tl uF.S

:::ir:ir:rP rD.contro]ler'
{fsj :-

cc*tr.*l

rh e c -ro s e d -lo o pt ra n s re r ru n c t jo n o r
rh e s i v e n
I{^rs2+ Hs* }ir

Fisi

A f t er
seve ral
tria f
and er r or
t ' ^t i
t he gai n s
Kp-350,
K i =3 0 0 ,
and Kd:50
J e sponse'
To con firm,
- ; i n d ow .
ao.n
*- - f i l e
""a"t
t
ir
"*
f
or
r
or
ir
'
r
q
and run
You sho uld
g et t he f ollowing
s t ep r"eos**p oi an =,
s e,.
I'

,
{
I

prowided
t h e d e si r e d
it
in the corn_mand

Kn=1(.

ri =3 0 0;
Kd :5 0;

n u m = [ K d K p K iJ ;
d e n = [ 1 1O + K d 20 + K p Ki ];
t:o :o. aL: 2;
st e: (nu m, d en , r 7

,
I
I

i
I
I
l

,lp:i/w\ryw.engin.
umichedu/group/ctm
/pID/pID.htrnI
I
.l

11/20/2A06

pap/e

fD Tutonai

Clretl- L ocF 5l ep: K.p=;5 i:.i=.1[$ l'i.d=55[t

u .u

='-"'
-rt|
rJ
fEt ,

-"

'f .g
t-t

Lr ,

't
Time{sec)

ftC

a-

E:

6 c w , we hav e

i ': 2.

Ac ji

Cbt ain

: : " J.

Adi

UU

d r!

lllLgUIq

adi, rs l-

pl

1.

t. \

i- e
a n C d e te r m in e
' -sr
- r -lo
' "-n-se
j n r n r zc
te
th '
co n tr o ' l

6.en-ionn

E,ropcl:tional
cieriv:tive
nf
uI

T{n
nF,

K;
Aj

nd
o!u

iin p r o ve
Rr l
f\u

'ulLrf,
--+;

follow

system,

to

t'hat neei s
c j me
j se

th e

orershoot

.'
^"
ylru

uuLaf
^ht=i n

ilPI D Tu t o r i a l - "

t his

s hown in

ref er, to lhe ta bl-e


w hat ch ara cte ristics

6'

to

ccn tr o l-

er r o r '

no steady-state

and

time,

a FED ccgltraller

a given

f or

PI D c ont r oller
h* r 1 1ro,, are de sig nln g:a
a desire ci
re sp on s e.
l::ain

rise

fast

no ov er s h o o t ,

designingr

for

tips

?eneral
(-

r ^' it h

s y s t em

t he

o bta ine d

be

to

shoun

's t e p s

befcv-

to

i mproved

overal i

desi red

page

the

out

find

response.

Y ou

can

al w ay s

c on tr o l s

controller

which

E:r

plea se

lt'.a s t l y ,

1-r,nr:inn=t
\y-v.,!--

r-*i
ItLi.if

G-

pF

:'Lu-

ke ep

-*^-:

g tltgtt

j-.-

.^ -.vatirze
qc r
I

do not

ih+crAl
-LIIL-y*q-

ano
--^

cYf i r e s;

c c ni r o l l s r- - - r

y ou

m inc i t hat

in

d-i---+
--fl-VaElver

o
o o cl
Yv v v

to

a
e

r F sr ' n se

e
orrnh
u n
v eY

c ont r c l- I er

need

into

l l i ke

s y st e m .

t he

to
sinalF
*-,igrs

qvsf
FTr)ruv.tLr

the

Keep the

contr:oLLers

al-l- three

implement

if
r!

above

n+
.rLL

nF.eccar\,'rlsus:crJ'.

exantpl e,

controli.er

as

chen

sirnple

f'or
aLr

yotl

^
c-/"llirst

C on't

ned

a s p o s s i b l e.

--:--,---.-.---..

!i

ilser

E'eedback

We v ouid
c/ - I f , pf c v e m e n t f

]j- ke
'

to

h ea r

e ffo fs -^

. :, n o l - j )mous; in clu de
tl-

about

+L
L n-+
aL

you r

y(
)u
' ,^,'

y ou

dif f j- c ul- t ies


r n
luur
r u,

n\t
ci
J

vr
^r

em ai- I adc ir es s

if

with
the
comments
want a replv.
had

nih er

y ou

y o u h a r e fo r
suggestions
tutorials,
is
f
e
e
d
back
T
h
i
s
that
h
a
v
e
.
lreu

);,.
;
l

;!"
I
I

,i.: l

[l
Submit Feedback

imi

ii.
1,
i..

PID/PID. Irtml
edu/group/ctrn
e.ngin.umich.
lrttp://r.vrvw.
..,

11,24D046

Das könnte Ihnen auch gefallen