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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.102.5 Re-entrancy<br />

The function is re-entrant.<br />

4.102.6 Code Example<br />

#include "gmclib.h"<br />

GMCLIB_DECOUPLINGPMSM_T_FLT flttrDec = GMCLIB_DECOUPLINGPMSM_DEFAULT_FLT;<br />

SWLIBS_2Syst_FLT flttrUDQ;<br />

SWLIBS_2Syst_FLT flttrIDQ;<br />

SWLIBS_2Syst_FLT flttrUDecDQ;<br />

tFloat fltWe;<br />

void main(void)<br />

{<br />

// input values<br />

flttrDec.fltLD = 50e-3; // LD inductance = 50mH<br />

flttrDec.fltLQ = 100e-3; // LQ inductance = 100mH<br />

flttrUDQ.fltArg1 = 5.0; // D quantity of input voltage vector 5[V]<br />

flttrUDQ.fltArg2 = 10.0; // Q quantity of input voltage vector 10[V]<br />

flttrIDQ.fltArg1 = 6.0; // D quantity of measured current vector 6[A]<br />

flttrIDQ.fltArg2 = 4.0; // Q quantity of measured current vector 4[A]<br />

fltWe 100.0; // rotor angular velocity<br />

// output should be flttrUDecDQ.fltArg1 ~= -35[V]<br />

// output should be flttrUDecDQ.fltArg2 ~= 40[V]<br />

GMCLIB_DecouplingPMSM_FLT<br />

(&flttrUDecDQ,&flttrUDQ,&flttrIDQ,fltWe,&flttrDec);<br />

// output should be flttrUDecDQ.fltArg1 ~= -35[V]<br />

// output should be flttrUDecDQ.fltArg2 ~= 40[V]<br />

GMCLIB_DecouplingPMSM<br />

(&flttrUDecDQ,&flttrUDQ,&flttrIDQ,fltWe,&flttrDec,Define FLT);<br />

}<br />

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

// Available only if single precision floating point<br />

// implementation selected as default<br />

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

// output should be flttrUDecDQ.fltArg1 ~= -35[V]<br />

// output should be flttrUDecDQ.fltArg2 ~= 40[V]<br />

GMCLIB_DecouplingPMSM (&flttrUDecDQ,&flttrUDQ,&flttrIDQ,fltWe,&flttrDec);<br />

4.103 Function GMCLIB_ElimDcBusRip_F32<br />

This function implements the DC Bus voltage ripple elimination.<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 475

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

Saved successfully!

Ooh no, something went wrong!