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_Lut2D_FLT<br />

2.<br />

data type is required because parameters s32ShamOffset1,2 are integer numbers<br />

which have to be stored as float variables, <strong>and</strong> it then indicates the position of the<br />

first interpolated value in the X-axis <strong>and</strong> the Y-axis in the table.<br />

Equation GFLIB_Lut2D_Eq5<br />

where s32IntvlX <strong>and</strong> s32IntvlY are the coordinates of the first ordinate value at the<br />

beginning of the interpolating interval, the fSegmentsX <strong>and</strong> fSegmentsY are the<br />

equidistant interpolating intervals in the both axes <strong>and</strong> the fltIn1, fltIn2 are the input<br />

values provided to the function as arguments. The casting to tS32 data type is a final<br />

operation of the equation which cuts the fractional part of the value <strong>and</strong> then<br />

indicates the position of the first interpolated value in the X-axis <strong>and</strong> the Y-axis in<br />

the table.<br />

3. Count the number of the interpolation samples in the X-axis:<br />

4.<br />

Equation GFLIB_Lut2D_Eq6<br />

Equation GFLIB_Lut2D_Eq7<br />

where the pTable} is the address provided in the parameters structure pParam-<br />

>fltTable.<br />

5. Compute the interpolated value by the linear interpolation in the X-axis of the y 1<br />

value between the ordinates x 1 <strong>and</strong> x<br />

Equation GFLIB_Lut2D_Eq8<br />

reduced to (division by the interval length is avoided):<br />

Equation GFLIB_Lut2D_Eq9<br />

interpretation in C language is following:<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 />

384 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!