03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

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.

Function GFLIB_Hyst_F16<br />

4.56.3 Return<br />

The function returns the value of the hysteresis output, which is equal to either<br />

f16OutValOn or f16OutValOff depending on the value of the input <strong>and</strong> the state of the<br />

function output in the previous calculation step. The output value is interpreted as a fixed<br />

point 16-bit number, normalized between [-1, 1).<br />

4.56.4 Description<br />

The GFLIB_Hyst function provides a computational method <strong>for</strong> the calculation of a<br />

hysteresis (relay) function. The function switches the output between the two predefined<br />

values stored in the f16OutValOn <strong>and</strong> f16OutValOff members of structure<br />

GFLIB_HYST_T_F16. When the value of the input is higher than the upper threshold<br />

f16HystOn, then the output value is equal to f16OutValOn. On the other h<strong>and</strong>, when the<br />

input value is lower than the lower threshold f16HystOff, then the output value is equal to<br />

f16OutValOff. When the input value is between these two threshold values then the<br />

output retains its value (the previous state).<br />

Equation GFLIB_Hyst_Eq1<br />

A graphical description of GFLIB_Hyst functionality is shown in Figure 4-29.<br />

Figure 4-29. Hysteresis function<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

334 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!