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, y1 <strong>and</strong> y2 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->fltTable <strong>and</strong> the<br />

x is the input value provided to the function as an fltIn argument. It should be noted<br />

that due to assumption of equidistant data points, division by the interval length is<br />

avoided.<br />

The address of the table with the data, the pTable, shall be defined by the parameter<br />

structure member pParam->pfltTable.<br />

The offset amount can be provided by the following <strong>for</strong>mula:<br />

Equation GFLIB_Lut1D_Eq5<br />

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

2, ... 29.<br />

This simple way to calculate the interpolating abscissa offset is a consequence of<br />

assuming that all interpolating interval lengths 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->pfltTable. However, if it is<br />

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

pParam->pfltTable pointer.<br />

Note<br />

The function per<strong>for</strong>ms a linear interpolation.<br />

CAUTION<br />

The function does not check whether the input abscissa value is<br />

within the range allowed by the interpolating data table<br />

pParam->pfltTable. If the computed interval index points to<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. 367

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

Saved successfully!

Ooh no, something went wrong!