14.08.2013 Views

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

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.

Equations Common to All Algorithms<br />

Err = SP - PV<br />

Span = (OutHi - OutLo) / (InHi - InLo)<br />

Output = Output + FeedForward * TuneFF<br />

Velocity Algorithm<br />

CHAPTER 2: OVERVIEW OF PROGRAMMING<br />

The velocity algorithm is similar to the algorithm used in OptoControl for Mistic I/O except that<br />

the derivative does not act on setpoint changes.<br />

TermP = (Err - Err_1)<br />

TermI = TuneI * ScanTime * Err<br />

TermD = TuneD / ScanTime * (PvIn - 2 * PvIn_1 + PvIn_2)<br />

Output = Output + Gain * Span * (TermP + TermI + TermD)<br />

Non-velocity Algorithms<br />

These equations were derived from the article “A Comparison of PID Control Algorithms” by John<br />

P. Gerry in Control Engineering (March 1987). These three equations are the same except for the<br />

tuning coefficients; converting from one equation to another is merely a matter of converting the<br />

tuning coefficients.<br />

Equations common to all but the velocity algorithm:<br />

Integral += Err<br />

TermP = Err<br />

TermI = TuneI * ScanTime * Integral<br />

TermD = TuneD / ScanTime * ( PvIn - PvIn_1 )<br />

“Ideal” or ISA Algorithm:<br />

Output = Span * Gain * ( TermP + TermI + TermD )<br />

“Parallel” Algorithm:<br />

Output = Span * ( Gain * TermP + TermI + TermD )<br />

“Interacting” Algorithm:<br />

Output = Span * Gain * ( TermP + TermI ) * ( 1 + TermD )<br />

Formatting <strong>and</strong> Interpreting Data<br />

Data is formatted differently for different addresses in the memory map. The memory map tables<br />

in Appendix A (page 103) show whether the data in each address is a mask, a signed or unsigned<br />

integer, a float, <strong>and</strong> so on. This section explains some of these formats.<br />

Mask Data<br />

Some data is in the form of a 32-bit or 64-bit mask—four or eight addresses, each holding eight<br />

bits. Each bit in the mask contains the data for one thing in a group: one point, one module, one<br />

Scratch Pad bit, etc.<br />

SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide 41

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

Saved successfully!

Ooh no, something went wrong!