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

The f16ModIndex <strong>and</strong> f16ArgDcBusMsr are supplied to the function within the<br />

parameters structure through its members. The u α, u β correspond respectively to the<br />

f16Arg1 <strong>and</strong> f16Arg2 members of the input structure, <strong>and</strong> the u α* <strong>and</strong> u β* respectively<br />

to the f16Arg1 <strong>and</strong> f16Arg2 members of the output structure.<br />

It should be noted that although the modulation index (see the parameters structure, the<br />

f16ModIndex member) is assumed to be equal to or greater than zero, the possible values<br />

are restricted to those values resulting from the use of Space Vector Modulation<br />

techniques.<br />

In order to correctly h<strong>and</strong>le the discontinuity at f16ArgDcBusMsr approaching 0, <strong>and</strong> <strong>for</strong><br />

efficiency reasons, the function will assign 0 to the output duty cycle ratios if the<br />

f16ArgDcBusMsr is below the threshold of 2 -15 . In other words, the 16 least significant<br />

bits of the f16DcBusMsr are ignored. Also, the computed output of the <strong>and</strong> u β*<br />

components may have an inaccuracy in the 16 least significant bits.<br />

Note<br />

Both the inverse modulation index pIn->f16ModIndex <strong>and</strong> the<br />

measured DC bus voltage pIn->f16DcBusMsr must be equal to<br />

or greater than 0, otherwise the results are undefined.<br />

4.104.5 Re-entrancy<br />

The function is re-entrant.<br />

4.104.6 Code Example<br />

#include "gmclib.h"<br />

#define U_MAX (36.0) // voltage scale<br />

SWLIBS_2Syst_F16 f16AB;<br />

SWLIBS_2Syst_F16 f16OutAB;<br />

GMCLIB_ELIMDCBUSRIP_T_F16 f16trMyElimDcBusRip =<br />

GMCLIB_ELIMDCBUSRIP_DEFAULT_F16;<br />

~ 0x7FFF<br />

void main(void)<br />

{<br />

// inverse modulation coefficient <strong>for</strong> st<strong>and</strong>ard space vector modulation<br />

f16trMyElimDcBusRip.f16ModIndex = FRAC16 (0.866025403784439);<br />

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

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

f16AB.f16Arg1 = FRAC16 (12.99/U_MAX);<br />

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

f16AB.f16Arg2 = FRAC16 (7.5/U_MAX);<br />

// value of the measured DC bus voltage 17[V]<br />

f16trMyElimDcBusRip.f16ArgDcBusMsr = FRAC16 (17.0/U_MAX);<br />

// output alpha component of the output vector should be<br />

// f16OutAB.f16Arg1 = (12.99/36)*0.8660/(17.0/36/2) = 1.3235 -> FRAC16(1.0)<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 />

482 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!