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

4.94.5 Re-entrancy<br />

The function is re-entrant.<br />

4.94.6 Code Example<br />

#include "gmclib.h"<br />

SWLIBS_3Syst_F32 f32trAbc;<br />

SWLIBS_2Syst_F32 f32trAlBe;<br />

void main(void)<br />

{<br />

// input value<br />

f32trAbc.f32Arg1 = FRAC32 (0.707106781); // input phase A ~ sin(45) ~<br />

0.707106781<br />

f32trAbc.f32Arg2 = FRAC32 (0.258819045); // input phase B ~ sin(45 +<br />

120) ~ 0.258819045<br />

f32trAbc.f32Arg3 = FRAC32 (-0.965925826); // input phase C ~ sin(45 -<br />

120) ~ -0.965925826<br />

// output should be f32trAlBe.f32Arg1 ~ alpha = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

// output should be f32trAlBe.f32Arg2 ~ beta = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

GMCLIB_Clark_F32 (&f32trAlBe,&f32trAbc);<br />

// output should be f32trAlBe.f32Arg1 ~ alpha = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

// output should be f32trAlBe.f32Arg2 ~ beta = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

GMCLIB_Clark (&f32trAlBe,&f32trAbc,Define F32);<br />

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

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

// as default<br />

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

// output should be f32trAlBe.f32Arg1 ~ alpha = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

// output should be f32trAlBe.f32Arg2 ~ beta = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

GMCLIB_Clark (&f32trAlBe,&f32trAbc);<br />

}<br />

4.95 Function GMCLIB_Clark_F16<br />

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

4.95.1 Declaration<br />

void GMCLIB_Clark_F16(SWLIBS_2Syst_F16 *const pOut, const SWLIBS_3Syst_F16 *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 />

450 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!