12.05.2014 Views

Automating Manufacturing Systems - Process Control and ...

Automating Manufacturing Systems - Process Control and ...

Automating Manufacturing Systems - Process Control and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

plc pid - 25.13<br />

Recall the cruise control system for a car. Figure 25.15 shows various equations<br />

that could be used as the controller.<br />

PID <strong>Control</strong>ler<br />

dv error<br />

θ gas<br />

K p<br />

v error<br />

K i ∫ v error<br />

dt ⎛ K ⎞<br />

= + + d<br />

----------------<br />

⎝ dt ⎠<br />

PI <strong>Control</strong>ler<br />

θ gas<br />

= K p<br />

v error<br />

+ K i<br />

v error<br />

dt<br />

∫<br />

PD <strong>Control</strong>ler<br />

dv<br />

θ ⎛<br />

gas<br />

= K p<br />

v error<br />

+ K error ⎞<br />

d<br />

----------------<br />

⎠ dt<br />

P <strong>Control</strong>ler<br />

θ gas<br />

=<br />

K p<br />

v error<br />

⎝<br />

Figure 25.15<br />

Different <strong>Control</strong>lers<br />

When implementing these equations in a computer program the equations can be<br />

rewritten as shown in Figure 25.16. To do this calculation, previous error <strong>and</strong> control values<br />

must be stored. The calculation also require the scan time T between updates.<br />

u n<br />

u n – 1<br />

e n<br />

K p<br />

K i<br />

T K ⎞ d<br />

+ + ----- e ⎛<br />

T n – 1<br />

– K p<br />

2 K d<br />

K<br />

–<br />

⎛<br />

----- ⎛ ⎞ d<br />

= + e ⎞<br />

+ +<br />

T n – 2<br />

-----<br />

T<br />

⎝<br />

⎠<br />

⎝<br />

⎠<br />

⎝<br />

⎠<br />

Figure 25.16<br />

A PID Calculation<br />

The PID calculation is available as a ladder logic function, as shown in Figure<br />

25.17. This can be used in place of the SUB <strong>and</strong> MUL functions in Figure 25.12. In this<br />

example the calculation uses the feedback variable stored in Proc Location (as read from<br />

the analog input). The result is stored in N7:2 (to be an analog output). The control block<br />

uses the parameters stored in PD12:0 to perform the calculations. Most PLC programming<br />

software will provide dialogues to set these value.

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

Saved successfully!

Ooh no, something went wrong!