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.

Function GFLIB_IntegratorTR_FLT<br />

void main(void)<br />

{<br />

// Setting parameters <strong>for</strong> integrator, Ts = 100e-4, E_MAX=U_MAX=1<br />

trMyIntegrator.f16C1 = FRAC16 (100e-4/2);<br />

trMyIntegrator.u16NShift = 0;<br />

}<br />

// input value = 0.5<br />

f16In = FRAC16 (0.5);<br />

// output should be 0x0051<br />

f16Out = GFLIB_IntegratorTR_F16 (f16In, &trMyIntegrator);<br />

// output should be 0x0051<br />

f16Out = GFLIB_IntegratorTR (f16In, &trMyIntegrator, Define F16);<br />

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

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

// as default<br />

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

// output should be 0x0051<br />

f16Out = GFLIB_IntegratorTR (f16In, &trMyIntegrator);<br />

4.60 Function GFLIB_IntegratorTR_FLT<br />

The function calculates a discrete implementation of the integrator (sum), discretized<br />

using a trapezoidal (Bilinear) trans<strong>for</strong>mation.<br />

4.60.1 Declaration<br />

tFloat GFLIB_IntegratorTR_FLT(tFloat fltIn, GFLIB_INTEGRATOR_TR_T_FLT *const pParam);<br />

4.60.2 Arguments<br />

Table 4-77. GFLIB_IntegratorTR_FLT arguments<br />

Type Name Direction Description<br />

tFloat fltIn input Input argument to be integrated.<br />

GFLIB_INTEGRATOR_<br />

TR_T_FLT *const<br />

4.60.3 Return<br />

pParam input,<br />

output<br />

Pointer to the integrator parameters structure.<br />

The function returns a single precision floating point value, which represents the actual<br />

integrated value of the input signal.<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 />

344 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!