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

}<br />

flttrMyHyst.fltHystOff = (tFloat)(-0.3634);<br />

flttrMyHyst.fltOutValOn = (tFloat)(0.589);<br />

flttrMyHyst.fltOutValOff = (tFloat)(-0.123);<br />

flttrMyHyst.fltOutState = (tFloat)(-0.3333);<br />

// input value = -0.41115<br />

fltIn = (tFloat)(-0.41115);<br />

// output should be -0.123<br />

fltOut = GFLIB_Hyst_FLT (fltIn,&flttrMyHyst);<br />

// output should be -0.123<br />

flttrMyHyst.fltOutState = (tFloat)(0);<br />

fltOut = GFLIB_Hyst (fltIn, &flttrMyHyst, Define FLT);<br />

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

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

// implementation selected as default<br />

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

// output should be -0.123<br />

flttrMyHyst.fltOutState = (tFloat)(0);<br />

fltOut = GFLIB_Hyst (fltIn, &flttrMyHyst);<br />

4.58 Function GFLIB_IntegratorTR_F32<br />

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

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

4.58.1 Declaration<br />

tFrac32 GFLIB_IntegratorTR_F32(tFrac32 f32In, GFLIB_INTEGRATOR_TR_T_F32 *const pParam);<br />

4.58.2 Arguments<br />

Table 4-75. GFLIB_IntegratorTR_F32 arguments<br />

Type Name Direction Description<br />

tFrac32 f32In input Input argument to be integrated.<br />

GFLIB_INTEGRATOR_<br />

TR_T_F32 *const<br />

4.58.3 Return<br />

pParam input,<br />

output<br />

Pointer to the integrator parameters structure.<br />

The function returns a 32-bit value in <strong>for</strong>mat Q1.31, 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 />

338 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!