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

Table 4-87. GFLIB_Lut1D example table (continued)<br />

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

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

interval length in this example is equal to 2 -1 . The pf16Table 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 pf16Table 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 />

• the values of the interpolated function are 16 bits 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, ... 13<br />

• the provided abscissa <strong>for</strong> interpolation is 16 bits long<br />

The algorithm per<strong>for</strong>ms the following steps:<br />

1. Compute the index representing the interval, in which the linear interpolation will be<br />

per<strong>for</strong>med:<br />

Equation GFLIB_Lut1D_Eq2<br />

where I is the interval index <strong>and</strong> the s Interval the shift amount provided in the<br />

parameters structure as the member s16ShamIntvl. The operator >> represents the<br />

binary arithmetic right shift.<br />

2. Compute the abscissa offset within an interpolating interval:<br />

3.<br />

Equation GFLIB_Lut1D_Eq3<br />

where Δ{x} is the abscissa offset within an interval <strong>and</strong> the s Offset is the shift amount<br />

provided in the parameters structure. The operators

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

Saved successfully!

Ooh no, something went wrong!