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.

Figure 4-7. Course of the function GFLIB_Acos<br />

The computational algorithm uses the symmetry of the arccos(x) function around the<br />

point (0, π/2), which allows <strong>for</strong> computing the function values just in the interval [0, 1)<br />

<strong>and</strong> to compute the function values in the interval [-1, 0) by the simple <strong>for</strong>mula:<br />

where:<br />

Equation GFLIB_Acos_Eq1<br />

• y[-1, 0) is the arccos(x) function value in the interval [-1, 0)<br />

• y[0, 1) is the arccos(x) function value in the interval [0, 1)<br />

Additionally, because the arccos(x) function is difficult <strong>for</strong> polynomial approximation <strong>for</strong><br />

x approaching 1 (or -1 by symmetry), due to its derivatives approaching infinity, a special<br />

trans<strong>for</strong>mation is used to trans<strong>for</strong>m the range of x from [0.5, 1) to (0, 0.5]:<br />

Equation GFLIB_Acos_Eq2<br />

Chapter 4 API References<br />

In this way, the computation of the arccos(x) function in the range [0.5, 1) can be<br />

replaced by the computation in the range (0, 0.5], in which approximation is easier.<br />

For the interval (0, 0.5], the algorithm uses a polynomial approximation as follows:<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. 209

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

Saved successfully!

Ooh no, something went wrong!