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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Equation GFLIB_Lut1D_Eq4<br />

where y, y 1 <strong>and</strong> y 2 are, respectively, the interpolated value, the ordinate at the start<br />

of the interpolating interval, the ordinate at the end of the interpolating interval. The<br />

pTable is the address provided in the parameters structure pParam->f16Table. It<br />

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

interval length is avoided.<br />

It should be noted that the computations are per<strong>for</strong>med with a 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 />

>s16ShamOffset, pParam->s16ShamIntvl). The address of the table with the data, the<br />

pTable, shall be defined by the parameter structure member pParam->pf16Table.<br />

The shift amounts, the s Interval <strong>and</strong> s Offset, can be computed with the following <strong>for</strong>mulas:<br />

Equation GFLIB_Lut1D_Eq5<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, ... -15.<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 16-bit halfword, after the sign bit, compose the interval index, in<br />

which 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 assuming that 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,<br />

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

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

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

the pParam->pf16Table 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. 363

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

Saved successfully!

Ooh no, something went wrong!