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

Equation GFLIB_Tan_Eq4<br />

Finally due to central symmetry of the tan function around the 3 π/4 point, the<br />

GFLIB_Tan_Eq4 is trans<strong>for</strong>med to GFLIB_Tan_Eq5 equation:<br />

Equation GFLIB_Tan_Eq5<br />

The rational polynomial approximation used actually approximates the tan(x * π/4), thus<br />

the input value has to be multiplied by the 4/ π coefficient.<br />

Finally, the sign is added to the computed value in interval (- π, 0). To keep the<br />

approximation error within range, the output value is limited to 1000 (defined by the<br />

GFLIB_TAN_LIMIT_FLT constant) <strong>and</strong> dividing by zero is h<strong>and</strong>led by a special case.<br />

The floating point optimized approximation coefficients used <strong>for</strong> GFLIB_Tan_FLT<br />

calculation are noted in Table 4-112.<br />

Table 4-112. Approximation polynomial coefficients<br />

a 0 a 1 a 2 a 3<br />

211.8493696641210 -12.5288887278448 269.7350131214120 -71.4145309347748<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 />

432 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!