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.

There<strong>for</strong>e, the resulting equation has the following <strong>for</strong>m:<br />

Equation GFLIB_Sin_Eq6<br />

Figure 4-35 depicts a floating point sine function generated from Matlab <strong>and</strong> the<br />

approximated value of the sine function obtained from GFLIB_Sin_F16, plus their<br />

difference. The course of calculation accuracy as a function of the input angle can be<br />

observed from this figure.<br />

Figure 4-35. sin(x) vs. GFLIB_Sin_F16(f16In)<br />

Note<br />

The input angle (f16In) is normalized into the range [-1, 1). The<br />

function call is slightly different from common approach in the<br />

library set. The function can be called in four different ways:<br />

• With implementation postfix (i.e. GFLIB_Sin_F16(f16In,<br />

&pParam)), where the &pParam is pointer to<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 407

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

Saved successfully!

Ooh no, something went wrong!