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.

GFLIB_CONTROLLER_PI_R_T_F16 trMyPI = GFLIB_CONTROLLER_PI_R_DEFAULT_F16;<br />

void main(void)<br />

{<br />

// input error = 0.25<br />

f16InErr = FRAC16 (0.25);<br />

}<br />

// controller parameters<br />

trMyPI.f16CC1sc = FRAC16 (0.01);<br />

trMyPI.f16CC2sc = FRAC16 (0.02);<br />

trMyPI.u16NShift = 1;<br />

// output should be 0x00A3<br />

f16Output = GFLIB_<strong>Control</strong>lerPIr_F16 (f16InErr,&trMyPI);<br />

// output should be 0x00A3<br />

f16Output = GFLIB_<strong>Control</strong>lerPIr (f16InErr,&trMyPI, Define F16);<br />

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

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

// as default<br />

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

// output should be 0x00A3<br />

f16Output = GFLIB_<strong>Control</strong>lerPIr (f16InErr,&trMyPI);<br />

4.48 Function GFLIB_<strong>Control</strong>lerPIr_FLT<br />

This function calculates a st<strong>and</strong>ard recurrent <strong>for</strong>m of the Proportional- Integral controller,<br />

without integral anti-windup.<br />

4.48.1 Declaration<br />

tFloat GFLIB_<strong>Control</strong>lerPIr_FLT(tFloat fltInErr, GFLIB_CONTROLLER_PI_R_T_FLT *const pParam);<br />

4.48.2 Arguments<br />

Table 4-60. GFLIB_<strong>Control</strong>lerPIr_FLT arguments<br />

Type Name Direction Description<br />

tFloat fltInErr input Input error signal to the controller as a single precision<br />

floating point value.<br />

GFLIB_CONTROLLER<br />

_PI_R_T_FLT *const<br />

pParam input,<br />

output<br />

Pointer to the controller parameters structure.<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 301

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

Saved successfully!

Ooh no, something went wrong!