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.

Equation GFLIB_Lut2D_Eq16<br />

It should be noted that due to assumption of the equidistant data points, the division<br />

by the interval length is avoided.<br />

It should be noted that the computations are per<strong>for</strong>med with the 16-bit accuracy. In<br />

particular the 16 least significant bits are ignored in all multiplications.<br />

The shift amounts shall be provided in the parameters structure (pParam-<br />

>s32ShamOffset1, pParam->s32ShamIntvl1, pParam->s32ShamOffset2, <strong>and</strong>pParam-<br />

>s32ShamIntvl2). The address of the table with the data, the pTable}, shall be defined by<br />

the parameter structure member pParam->pf32Table.<br />

The shift amounts, the s Interval1,2 <strong>and</strong> s Offset1,2, can be computed with the following<br />

<strong>for</strong>mulas:<br />

Equation GFLIB_Lut2D_Eq17<br />

Chapter 4 API References<br />

where n is the integer defining the length of the interpolating interval in the range of -1,<br />

-2, ... -29.<br />

The computation of the abscissa offset <strong>and</strong> the interval index can be viewed also in the<br />

following way. The input abscissa value can be divided into two parts. The first n most<br />

significant bits of the 32-bit word, after the sign bit, compose the interval index, in which<br />

interpolation is per<strong>for</strong>med. The rest of the bits <strong>for</strong>m the abscissa offset within the<br />

interpolating interval. This simple way to calculate the interpolating interval index <strong>and</strong><br />

the abscissa offset is the consequence of assumption of all interpolating interval lengths<br />

equal 2 -n .<br />

It should be noted that the input abscissa value can be positive or negative. If it is positive<br />

then the ordinate values are read as in the ordinary data array, that is at or after the data<br />

pointer provided in the parameters structure (pParam->pf32Table). However, if it is<br />

negative, then the ordinate values are read from the memory, which is located behind the<br />

pParam->pf32Table pointer.<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 />

Freescale Semiconductor, Inc. 373

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

Saved successfully!

Ooh no, something went wrong!