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

Equation GMCLIB_Park_Eq2<br />

where θ e represents the electrical position of the rotor flux.<br />

Note<br />

The inputs <strong>and</strong> the outputs are in single precision floating point<br />

data <strong>for</strong>mat.<br />

4.108.5 Re-entrancy<br />

The function is re-entrant.<br />

4.108.6 Code Example<br />

#include "gmclib.h"<br />

SWLIBS_2Syst_FLT trfltAngle;<br />

SWLIBS_2Syst_FLT trfltAlBe;<br />

SWLIBS_2Syst_FLT trfltDq;<br />

void main(void)<br />

{<br />

// input angle sin(60) = 0.866025403<br />

// input angle cos(60) = 0.5<br />

trfltAngle.fltArg1 = 0.866025403;<br />

trfltAngle.fltArg2 = 0.5;<br />

}<br />

// input alpha = 0.123<br />

// input beta = 0.654<br />

trfltAlBe.fltArg1 = 0.123;<br />

trfltAlBe.fltArg2 = 0.654;<br />

// output should be:<br />

// trfltDq.fltArg1 ~ d = 0.627880613<br />

// trfltDq.fltArg2 ~ q = 0.220479472<br />

GMCLIB_Park_FLT (&trfltDq,&trfltAngle,&trfltAlBe);<br />

// output should be:<br />

// trfltDq.fltArg1 ~ d = 0.627880613<br />

// trfltDq.fltArg2 ~ q = 0.220479472<br />

GMCLIB_Park (&trfltDq,&trfltAngle,&trfltAlBe,Define FLT);<br />

// ##############################################################<br />

// Available only if single precision floating point<br />

// implementation selected as default<br />

// ##############################################################<br />

// output should be:<br />

// trfltDq.fltArg1 ~ d = 0.627880613<br />

// trfltDq.fltArg2 ~ q = 0.220479472<br />

GMCLIB_Park (&trfltDq,&trfltAngle,&trfltAlBe);<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 />

492 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!