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

Equation GMCLIB_ParkInv_Eq2<br />

Note<br />

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

1).<br />

4.109.5 Re-entrancy<br />

The function is re-entrant.<br />

4.109.6 Code Example<br />

#include "gmclib.h"<br />

SWLIBS_2Syst_F32 tr32Angle;<br />

SWLIBS_2Syst_F32 tr32Dq;<br />

SWLIBS_2Syst_F32 tr32AlBe;<br />

void main(void)<br />

{<br />

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

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

tr32Angle.f32Arg1 = FRAC32 (0.866025403);<br />

tr32Angle.f32Arg2 = FRAC32 (0.5);<br />

}<br />

// input d = 0.123<br />

// input q = 0.654<br />

tr32Dq.f32Arg1 = FRAC32 (0.123);<br />

tr32Dq.f32Arg2 = FRAC32 (0.654);<br />

// output should be<br />

// tr32AlBe.f32Arg1 ~ alpha = 0xBF601273<br />

// tr32AlBe.f32Arg2 ~ beta = 0x377D9EE4<br />

GMCLIB_ParkInv_F32 (&tr32AlBe,&tr32Angle,&tr32Dq);<br />

// output should be<br />

// tr32AlBe.f32Arg1 ~ alpha = 0xBF601273<br />

// tr32AlBe.f32Arg2 ~ beta = 0x377D9EE4<br />

GMCLIB_ParkInv (&tr32AlBe,&tr32Angle,&tr32Dq,Define F32);<br />

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

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

// as default<br />

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

// output should be<br />

// tr32AlBe.f32Arg1 ~ alpha = 0xBF601273<br />

// tr32AlBe.f32Arg2 ~ beta = 0x377D9EE4<br />

GMCLIB_ParkInv (&tr32AlBe,&tr32Angle,&tr32Dq);<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 />

494 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!