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

4.97.5 Re-entrancy<br />

The function is re-entrant.<br />

4.97.6 Code Example<br />

~ 0.707106781<br />

0.707106781<br />

#include "gmclib.h"<br />

SWLIBS_2Syst_F32 f32trAlBe;<br />

SWLIBS_3Syst_F32 f32trAbc;<br />

void main(void)<br />

{<br />

// input value<br />

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

f32trAlBe.f32Arg2 = FRAC32 (0.707106781); // input phase beta ~ cos(45) ~<br />

// output should be f32trAbc.f32Arg1 ~ phA = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

// output should be f32trAbc.f32Arg2 ~ phB = 0x2120FB83 ~<br />

FRAC32(0.258819045)<br />

// output should be f32trAbc.f32Arg3 ~ phC = 0x845C8AE5 ~<br />

FRAC32(-0.965925826)<br />

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

// output should be f32trAbc.f32Arg1 ~ phA = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

// output should be f32trAbc.f32Arg2 ~ phB = 0x2120FB83 ~<br />

FRAC32(0.258819045)<br />

// output should be f32trAbc.f32Arg3 ~ phC = 0x845C8AE5 ~<br />

FRAC32(-0.965925826)<br />

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

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

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

// as default<br />

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

// output should be f32trAbc.f32Arg1 ~ phA = 0x5A827999 ~<br />

FRAC32(0.707106781)<br />

// output should be f32trAbc.f32Arg2 ~ phB = 0x2120FB83 ~<br />

FRAC32(0.258819045)<br />

// output should be f32trAbc.f32Arg3 ~ phC = 0x845C8AE5 ~<br />

FRAC32(-0.965925826)<br />

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

}<br />

4.98 Function GMCLIB_ClarkInv_F16<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 />

456 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!