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.

The Table 4-92 contains 4 interpolating points (note four rows). Interpolating interval<br />

length in this example is equal to 2 -1 . The pf16Table parameter points to the second<br />

row, defining also the interpolating index 0. The x-coordinates of the interpolating points<br />

are calculated in the right column. It should be noticed that the pf16Table pointer does<br />

not have to point to the start of the memory area with ordinate values. There<strong>for</strong>e the<br />

interpolating index can be positive or negative or, even, does not have to have zero in its<br />

range.<br />

Special algorithm is used to make the computation efficient, however under some<br />

additional assumptions as provided below:<br />

• the values of the interpolated function are 16-bit long<br />

• the length of each interpolating interval is equal to 2 -n , where n is an integer in the<br />

range of 1, 2, ... 13<br />

• the provided abscissa <strong>for</strong> interpolation is 16-bit long<br />

The algorithm per<strong>for</strong>ms the following steps:<br />

1. Compute the index representing the interval, in which the bilinear interpolation will<br />

be per<strong>for</strong>med in each axis:<br />

Equation GFLIB_Lut2D_Eq4<br />

Equation GFLIB_Lut2D_Eq5<br />

where I x <strong>and</strong> I y is the interval index <strong>and</strong> the s IntervalX <strong>and</strong> s IntervalY are the shift<br />

amounts provided in the parameters structure as a member s16ShamIntvl1 or<br />

s16ShamIntvl2. The operator >> represents the binary arithmetic right shift.<br />

2. Compute the abscissas offset <strong>for</strong> both axis within an interpolating intervals:<br />

Equation GFLIB_Lut2D_Eq6<br />

Equation GFLIB_Lut2D_Eq7<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 377

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

Saved successfully!

Ooh no, something went wrong!