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.

Function GFLIB_Lut2D_F32<br />

• f[x,y] is the interpolated value<br />

• f[x,y 1] <strong>and</strong> f[x,y 2] are the ordinate values at, respectively, the beginning <strong>and</strong> the end<br />

of the final interpolating interval<br />

• x 1, x 2, y 1 <strong>and</strong> y 2 are the area values, respectively, the interpolated area<br />

• the x, y are the input values provided to the function in the f32In1 <strong>and</strong> f32In2<br />

arguments<br />

The interpolating intervals are defined in the table provided by the pf32Table member of<br />

the parameters structure. The table contains ordinate values consecutively over the whole<br />

interpolating range. The abscissa values are assumed to be defined implicitly by a single<br />

interpolating interval length <strong>and</strong> a table index while the interpolating index zero is the<br />

table element pointed to by the pf32Table parameter. The abscissa value is equal to the<br />

multiplication of the interpolating index <strong>and</strong> the interpolating interval length. For<br />

example let's consider the following interpolating table:<br />

Table 4-90. GFLIB_Lut2D example table<br />

ordinate (f[x,y]) interpolating index abscissa (x) abscissa (y)<br />

-0.5 -1 -1*(2 -1 ) -1*(2 -1 )<br />

pf32Table 0.0 0 0*(2 -1 ) 0*(2 -1 )<br />

0.5 1 1*(2 -1 ) 1*(2 -1 )<br />

1.0 N/A 2*(2 -1 ) 2*(2 -1 )<br />

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

length in this example is equal to 2 -1 . The pf32Table 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 pf32Table 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 32-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, ... 29<br />

• the provided abscissa <strong>for</strong> interpolation is 32-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 />

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

370 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!