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

pwm a, pwm b <strong>and</strong> pwm c with a free-running up-down counter. The timer counts to 1<br />

(0x7FFF) <strong>and</strong> then down to 0 (0x0000). It is supposed that when a threshold level is<br />

larger than the timer value, the respective PWM output is active. Otherwise, it is inactive;<br />

see Figure 4-58<br />

Figure 4-58. St<strong>and</strong>ard space vector modulation technique - centre-aligned PWM<br />

4.112.5 Re-entrancy<br />

The function is re-entrant.<br />

4.112.6 Code Example<br />

#include "gmclib.h"<br />

#define U_MAX 15<br />

SWLIBS_2Syst_F32 tr32InVoltage;<br />

SWLIBS_3Syst_F32 tr32PwmABC;<br />

tU32 u32SvmSector;<br />

void main(void)<br />

{<br />

// Input voltage vector 15V @ angle 30deg<br />

// alpha component of input voltage vector = 12.99[V]<br />

// beta component of input voltage vector = 7.5[V]<br />

tr32InVoltage.f32Arg1 = FRAC32 (12.99/U_MAX);<br />

tr32InVoltage.f32Arg2 = FRAC32 (7.5/U_MAX);<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 />

512 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!