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.

Equation GMCLIB_DecouplingPMSM_Eq10<br />

Substituting GMCLIB_DecouplingPMSM_Eq8 - GMCLIB_DecouplingPMSM_Eq10<br />

into GMCLIB_DecouplingPMSM_Eq7 results in the final <strong>for</strong>m of the equation set,<br />

actually implemented in the GMCLIB_DecouplingPMSM_F32 function:<br />

Equation GMCLIB_DecouplingPMSM_Eq11<br />

Scaling of both equations into the fractional range is done using a multiplication by 2<br />

k_d_shift , 2 k_q_shift , respectively. There<strong>for</strong>e, it is implemented as a simple left shift with<br />

overflow protection.<br />

Note<br />

All parameters can be reset during declaration using the<br />

GMCLIB_DECOUPLINGPMSM_DEFAULT_F32 macro.<br />

4.100.5 Re-entrancy<br />

The function is re-entrant.<br />

4.100.6 Code Example<br />

#include "gmclib.h"<br />

Chapter 4 API References<br />

#define L_D (50.0e-3) // Ld inductance = 50mH<br />

#define L_Q (100.0e-3) // Lq inductance = 100mH<br />

#define U_MAX (50.0) // scale <strong>for</strong> voltage = 50V<br />

#define I_MAX (10.0) // scale <strong>for</strong> current = 10A<br />

#define W_MAX (2000.0) // scale <strong>for</strong> angular velocity = 2000rad/sec<br />

GMCLIB_DECOUPLINGPMSM_T_F32 f32trDec = GMCLIB_DECOUPLINGPMSM_DEFAULT_F32;<br />

SWLIBS_2Syst_F32 f32trUDQ;<br />

SWLIBS_2Syst_F32 f32trIDQ;<br />

SWLIBS_2Syst_F32 f32trUDecDQ;<br />

tFrac32 f32We;<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 />

Freescale Semiconductor, Inc. 465

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

Saved successfully!

Ooh no, something went wrong!