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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Function GFLIB_Tan_F32<br />

The GFLIB_Tan_F32 function uses fixed point fractional arithmetic, so to cast the<br />

fractional value of the input angle f32In [-1, 1) into the correct range [- π, π), the fixed<br />

point input angle f32In must be multiplied by π. Then the fixed point fractional<br />

implementation of the approximation polynomial, used <strong>for</strong> calculation of each sub sector,<br />

is defined as follows:<br />

Equation GFLIB_Tan_Eq2<br />

Equation GFLIB_Tan_Eq3<br />

The division of the [0, π/4) interval into eight sub-intervals, with polynomial coefficients<br />

calculated <strong>for</strong> each sub-interval, is noted in Table 4-108. Polynomial coefficients were<br />

obtained using the Matlab fitting function, where a polynomial of the 4th order was used<br />

<strong>for</strong> the fitting of each respective sub-interval.<br />

Table 4-108. Integer polynomial coefficients <strong>for</strong> each interval<br />

Interval a 1 a 2 a 3 a 4<br />

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

Saved successfully!

Ooh no, something went wrong!