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

4.93.6 Code Example<br />

FLT);<br />

#include "gflib.h"<br />

SWLIBS_2Syst_FLT fltpIn;<br />

SWLIBS_2Syst_FLT fltpOut;<br />

GFLIB_VECTORLIMIT_T_FLT flttrMyVectorLimit = GFLIB_VECTORLIMIT_DEFAULT_FLT;<br />

tBool bLim;<br />

void main(void)<br />

{<br />

// desired magnitude of the input vector<br />

flttrMyVectorLimit.fltLimit = 0.25;<br />

// input vector<br />

fltpIn.fltArg1 = 0.25;<br />

fltpIn.fltArg2 = 0.25;<br />

}<br />

// output should be: bLim = TRUE;<br />

// fltpOut.fltArg1 = 0.17677<br />

// fltpOut.fltArg2 = 0.17677<br />

bLim = GFLIB_VectorLimit_FLT (&fltpOut,&fpltIn,&flttrMyVectorLimit);<br />

// output should be: bLim = TRUE;<br />

// fltpOut.fltArg1 = 0.17677<br />

// fltpOut.fltArg2 = 0.17677<br />

bLim = GFLIB_VectorLimit (&fltpOut,&fltpIn,&flttrMyVectorLimit,Define<br />

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

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

// implementation selected as default<br />

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

// output should be: bLim = TRUE;<br />

// fltpOut.fltArg1 = 0.17677<br />

// fltpOut.fltArg2 = 0.17677<br />

bLim = GFLIB_VectorLimit (&fltpOut,&fltpIn,&flttrMyVectorLimit);<br />

4.94 Function GMCLIB_Clark_F32<br />

The function implements the Clarke trans<strong>for</strong>mation.<br />

4.94.1 Declaration<br />

void GMCLIB_Clark_F32(SWLIBS_2Syst_F32 *const pOut, const SWLIBS_3Syst_F32 *const pIn);<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 />

448 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!