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.

calculation precision in boundary intervals. This correction<br />

constant is equal to the difference of √(3)/4 computed in double<br />

<strong>and</strong> in single precision.<br />

4.114.5 Re-entrancy<br />

The function is re-entrant.<br />

4.114.6 Code Example<br />

#include "gmclib.h"<br />

#define U_MAX 15<br />

SWLIBS_2Syst_FLT tInVoltage;<br />

SWLIBS_3Syst_FLT tPwmABC;<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 />

tInVoltage.fltArg1 = (tFloat)(12.99/U_MAX);<br />

tInVoltage.fltArg2 = (tFloat)(7.5/U_MAX);<br />

}<br />

// output pwm dutycycles stored in structure referenced by tr32PwmABC<br />

// pwmA dutycycle = (tFloat)(0.9999888)<br />

// pwmb dutycycle = (tFloat)(0.5000111)<br />

// pwmc dutycycle = (tFloat)(0.0000111)<br />

// u32SvmSector = 0x1 [sector]<br />

u32SvmSector = GMCLIB_SvmStd_FLT (&tPwmABC,&tInVoltage);<br />

// output pwm dutycycles stored in structure referenced by tr32PwmABC<br />

// pwmA dutycycle = (tFloat)(0.9999888)<br />

// pwmb dutycycle = (tFloat)(0.5000111)<br />

// pwmc dutycycle = (tFloat)(0.0000111)<br />

// u32SvmSector = 0x1 [sector]<br />

u32SvmSector = GMCLIB_SvmStd (&tPwmABC,&tInVoltage,Define FLT);<br />

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

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

// implementation selected as default<br />

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

Chapter 4 API References<br />

// output pwm dutycycles stored in structure referenced by tr32PwmABC<br />

// pwmA dutycycle = (tFloat)(0.9999888)<br />

// pwmb dutycycle = (tFloat)(0.5000111)<br />

// pwmc dutycycle = (tFloat)(0.0000111)<br />

// u32SvmSector = 0x1 [sector]<br />

u32SvmSector = GMCLIB_SvmStd (&tPwmABC,&tInVoltage);<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. 541

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

Saved successfully!

Ooh no, something went wrong!