25.08.2021 Views

082-Engineering-Mathematics-Anthony-Croft-Robert-Davison-Martin-Hargreaves-James-Flint-Edisi-5-2017

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

694 Chapter 22 Difference equations and the z transform

The most common type of controller used in industry is the proportional/integral/

derivative (p.i.d.)controller. Itcanbeshown thattheanalogue formofthiscontrolleris

modelled by the equation

m(t) =K p

e(t)+K i

∫ t

0

e(t)dt +K d

de(t)

dt

(22.4)

whereK p

,K i

andK d

are constants. In order to implement a discrete-time (digital) controlleritisnecessarytoconvertthisequationintoanequivalentdifferenceequation.The

approximation for the process of differentiation has already been examined in

Engineering application 22.3, and isgiven by

de(t)

dt

e[n] −e[n −1]

T

Thereareseveralpossiblewaysofapproximatingtheprocessofintegration.Onemethod

is illustrated in Figure 22.14. Here the area under the curve is approximated by a series

of rectangles, each of widthT. If the approximate area under the curve fromt = 0 to

t =nT isdenoted byx[n], then

x[n] =x[n −1] +Te[n] (22.5)

The discrete form ofEquation (22.4) can now be formulated. Itisgiven by

m[n] =K p

e[n] +K i

x[n] +K d

e[n] −e[n −1]

T

(22.6)

Equations (22.5) and (22.6) form a set of equations toimplement a discrete form of the

p.i.d.controlleronadigitalcomputerormicroprocessor.Thesetwoequationsaretermed

coupled difference equations because both are needed to calculate m[n]. In addition,

Equation(22.5)isrecursive.Aflowchartforimplementingtheseequationsisshownin

Figure 22.15.

Initialization

Time to

sample?

YES

NO

Get e[n]

e(t)

Calculate

m[n]

Output m[n]

t

Figure22.14

Approximating the areaunder the curve by a

seriesofrectangles.

Figure22.15

Flow chartforap.i.d. controller.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!