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.

Function GMCLIB_DecouplingPMSM_F16<br />

vector 5[V]<br />

vector 10[V]<br />

vector 6[A]<br />

vector 4[A]<br />

void main(void)<br />

{<br />

// input values - scaling coefficients of given decoupling algorithm<br />

f32trDec.f32Kd = FRAC32 (0.625);<br />

f32trDec.s16KdShift = 6;<br />

f32trDec.f32Kq = FRAC32 (0.625);<br />

f32trDec.s16KqShift = 5;<br />

f32trUDQ.f32Arg1 = FRAC32 (5.0/U_MAX); // d quantity of input voltage<br />

f32trUDQ.f32Arg2 = FRAC32 (10.0/U_MAX); // q quantity of input voltage<br />

f32trIDQ.f32Arg1 = FRAC32 (6.0/I_MAX); // d quantity of measured current<br />

f32trIDQ.f32Arg2 = FRAC32 (4.0/I_MAX); // q quantity of measured current<br />

f32We = FRAC32 (100.0/W_MAX); // rotor angular velocity<br />

//output should be f32trUDecDQ.f32Arg1 ~ 0xA6666666 ~ FRAC32(-0.7)*50V<br />

~=-35[V]<br />

//output should be f32trUDecDQ.f32Arg2 ~ 0x66666666 ~ FRAC32(0.8)*50V<br />

~=40[V]<br />

GMCLIB_DecouplingPMSM_F32<br />

(&f32trUDecDQ,&f32trUDQ,&f32trIDQ,f32We,&f32trDec);<br />

//output should be f32trUDecDQ.f32Arg1 ~ 0xA6666666 ~ FRAC32(-0.7)*50V<br />

~=-35[V]<br />

//output should be f32trUDecDQ.f32Arg2 ~ 0x66666666 ~ FRAC32(0.8)*50V<br />

~=40[V]<br />

GMCLIB_DecouplingPMSM<br />

(&f32trUDecDQ,&f32trUDQ,&f32trIDQ,f32We,&f32trDec,Define F32);<br />

~=-35[V]<br />

~=40[V]<br />

}<br />

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

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

// as default<br />

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

//output should be f32trUDecDQ.f32Arg1 ~ 0xA6666666 ~ FRAC32(-0.7)*50V<br />

//output should be f32trUDecDQ.f32Arg2 ~ 0x66666666 ~ FRAC32(0.8)*50V<br />

GMCLIB_DecouplingPMSM (&f32trUDecDQ,&f32trUDQ,&f32trIDQ,f32We,&f32trDec);<br />

4.101 Function GMCLIB_DecouplingPMSM_F16<br />

This function calculates the cross-coupling voltages to eliminate the dq axis coupling<br />

causing non-linearity of the field oriented control.<br />

4.101.1 Declaration<br />

void GMCLIB_DecouplingPMSM_F16(SWLIBS_2Syst_F16 *const pUdqDec, const SWLIBS_2Syst_F16 *const<br />

pUdq, const SWLIBS_2Syst_F16 *const pIdq, tFrac16 f16AngularVel, const<br />

GMCLIB_DECOUPLINGPMSM_T_F16 *const pParam);<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 />

466 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!