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

4.95.5 Re-entrancy<br />

The function is re-entrant.<br />

4.95.6 Code Example<br />

#include "gmclib.h"<br />

SWLIBS_3Syst_F16 f16trAbc;<br />

SWLIBS_2Syst_F16 f16trAlBe;<br />

void main(void)<br />

{<br />

// input value<br />

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

0.707106781<br />

f16trAbc.f16Arg2 = FRAC16 (0.258819045); // input phase B ~ sin(45 +<br />

120) ~ 0.258819045<br />

f16trAbc.f16Arg3 = FRAC16 (-0.965925826); // input phase C ~ sin(45 -<br />

120) ~ -0.965925826<br />

// output should be f16trAlBe.f16Arg1 ~ alpha = 0x5A82 ~<br />

FRAC16(0.707106781)<br />

// output should be f16trAlBe.f16Arg2 ~ beta = 0x5A82 ~<br />

FRAC16(0.707106781)<br />

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

// output should be f16trAlBe.f16Arg1 ~ alpha = 0x5A82 ~<br />

FRAC16(0.707106781)<br />

// output should be f16trAlBe.f16Arg2 ~ beta = 0x5A82 ~<br />

FRAC16(0.707106781)<br />

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

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

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

// as default<br />

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

// output should be f16trAlBe.f16Arg1 ~ alpha = 0x5A82 ~<br />

FRAC16(0.707106781)<br />

// output should be f16trAlBe.f16Arg2 ~ beta = 0x5A82 ~<br />

FRAC16(0.707106781)<br />

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

}<br />

4.96 Function GMCLIB_Clark_FLT<br />

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

4.96.1 Declaration<br />

void GMCLIB_Clark_FLT(SWLIBS_2Syst_FLT *const pOut, const SWLIBS_3Syst_FLT *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 />

452 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!