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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Function GMCLIB_ClarkInv_FLT<br />

Equation GMCLIB_ClarkInv_Eq3<br />

Note<br />

The inputs <strong>and</strong> the outputs are normalized to fit in the range [-1,<br />

1).<br />

4.98.5 Re-entrancy<br />

The function is re-entrant.<br />

4.98.6 Code Example<br />

~ 0.707106781<br />

0.707106781<br />

#include "gmclib.h"<br />

SWLIBS_2Syst_F16 f16trAlBe;<br />

SWLIBS_3Syst_F16 f16trAbc;<br />

void main(void)<br />

{<br />

// input value<br />

f16trAlBe.f16Arg1 = FRAC16 (0.707106781); // input phase alpha ~ sin(45)<br />

}<br />

f16trAlBe.f16Arg2 = FRAC16 (0.707106781); // input phase beta ~ cos(45) ~<br />

// output should be f16trAbc.f16Arg1 ~ phA = 0x5A82 ~ FRAC16(0.707106781)<br />

// output should be f16trAbc.f16Arg2 ~ phB = 0x2120 ~ FRAC16(0.258819045)<br />

// output should be f16trAbc.f16Arg3 ~ phC = 0x845C ~ FRAC16(-0.965925826)<br />

GMCLIB_ClarkInv_F16 (&f16trAbc,&f16trAlBe);<br />

// output should be f16trAbc.f16Arg1 ~ phA = 0x5A82 ~ FRAC16(0.707106781)<br />

// output should be f16trAbc.f16Arg2 ~ phB = 0x2120 ~ FRAC16(0.258819045)<br />

// output should be f16trAbc.f16Arg3 ~ phC = 0x845C ~ FRAC16(-0.965925826)<br />

GMCLIB_ClarkInv (&f16trAbc,&f16trAlBe,Define F16);<br />

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

// Available only if 16-bit fractional implementation selected<br />

// as default<br />

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

// output should be f16trAbc.f16Arg1 ~ phA = 0x5A82 ~ FRAC16(0.707106781)<br />

// output should be f16trAbc.f16Arg2 ~ phB = 0x2120 ~ FRAC16(0.258819045)<br />

// output should be f16trAbc.f16Arg3 ~ phC = 0x845C ~ FRAC16(-0.965925826)<br />

GMCLIB_ClarkInv (&f16trAbc,&f16trAlBe);<br />

4.99 Function GMCLIB_ClarkInv_FLT<br />

The function implements the inverse Clarke trans<strong>for</strong>mation.<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 />

458 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!