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

Equation GMCLIB_Park_Eq2<br />

where θ e represents the electrical position of the rotor flux.<br />

Note<br />

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

1).<br />

4.107.5 Re-entrancy<br />

The function is re-entrant.<br />

4.107.6 Code Example<br />

#include "gmclib.h"<br />

SWLIBS_2Syst_F16 tr16Angle;<br />

SWLIBS_2Syst_F16 tr16AlBe;<br />

SWLIBS_2Syst_F16 tr16Dq;<br />

void main(void)<br />

{<br />

// input angle sin(60) = 0.866025403<br />

// input angle cos(60) = 0.5<br />

tr16Angle.f16Arg1 = FRAC16 (0.866025403);<br />

tr16Angle.f16Arg2 = FRAC16 (0.5);<br />

}<br />

// input alpha = 0.123<br />

// input beta = 0.654<br />

tr16AlBe.f16Arg1 = FRAC16 (0.123);<br />

tr16AlBe.f16Arg2 = FRAC16 (0.654);<br />

// output should be<br />

// tr16Dq.f16Arg1 ~ d = 0x505E<br />

// tr16Dq.f16Arg2 ~ q = 0x1C38<br />

GMCLIB_Park_F16 (&tr16Dq,&tr16Angle,&tr16AlBe);<br />

// output should be<br />

// tr16Dq.f16Arg1 ~ d = 0x505E<br />

// tr16Dq.f16Arg2 ~ q = 0x1C38<br />

GMCLIB_Park (&tr16Dq,&tr16Angle,&tr16AlBe,Define F16);<br />

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

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

// as default<br />

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

// output should be<br />

// tr16Dq.f16Arg1 ~ d = 0x505E<br />

// tr16Dq.f16Arg2 ~ q = 0x1C38<br />

GMCLIB_Park (&tr16Dq,&tr16Angle,&tr16AlBe);<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 />

490 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!