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.

4.67.4 Description<br />

where:<br />

Equation GFLIB_Lut1D_Eq1<br />

• y is the interpolated value<br />

• y 1 <strong>and</strong> y 2 are the ordinate values at, respectively, the beginning <strong>and</strong> the end of the<br />

interpolating interval<br />

• x 1 <strong>and</strong> x 2 are the abscissa values at, respectively, the beginning <strong>and</strong> the end of the<br />

interpolating interval<br />

• the x is the input value provided to the function in the f32In argument<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 entire<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-85. GFLIB_Lut1D example table<br />

ordinate (y) interpolating index abscissa (x)<br />

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

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

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

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

Chapter 4 API References<br />

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

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

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

points are calculated in the right column.<br />

It should be noted that the pf32Table pointer does not have to point to the start of the<br />

memory area of ordinate values. There<strong>for</strong>e, the interpolating index can be positive or<br />

negative or, even, does not have to have zero in its range.<br />

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

additional assumptions, as provided below:<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. 357

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

Saved successfully!

Ooh no, something went wrong!