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_<strong>Control</strong>lerPIp_F32<br />

4.40.2 Arguments<br />

Table 4-50. GFLIB_<strong>Control</strong>lerPIp_F32 arguments<br />

Type Name Direction Description<br />

tFrac32 f32InErr input Input error signal to the controller is a 32-bit number<br />

normalized between [-1, 1).<br />

GFLIB_CONTROLLER<br />

_PI_P_T_F32 *const<br />

4.40.3 Return<br />

pParam input,<br />

output<br />

Pointer to the controller parameters structure.<br />

The function returns a 32-bit value in <strong>for</strong>mat 1.31, representing the signal to be applied to<br />

the controlled system so that the input error is <strong>for</strong>ced to zero.<br />

4.40.4 Description<br />

A PI controller attempts to correct the error between a measured process variable <strong>and</strong> a<br />

desired set-point by calculating <strong>and</strong> then outputting a corrective action that can adjust the<br />

process accordingly. The GFLIB_<strong>Control</strong>lerPIp_F32 function calculates the<br />

Proportional-Integral (PI) algorithm according to the equations below. The PI algorithm<br />

is implemented in the parallel (non-interacting) <strong>for</strong>m, allowing the user to define the P<br />

<strong>and</strong> I parameters independently without interaction.<br />

An anti-windup strategy is not implemented in this function. Nevertheless, the<br />

accumulator overflow is prevented by correct saturation of the controller output at<br />

maximal values: [-1, 1) in fractional interpretation, or [-2 31 ,2 31 -1) in integer<br />

interpretation.<br />

The PI algorithm in the continuous time domain can be described as:<br />

where<br />

Equation GFLIB_<strong>Control</strong>lerPIp_Eq1<br />

• e(t) - input error in the continuous time domain<br />

• u(t) - controller output in the continuous time domain<br />

• K P - proportional gain<br />

• K I - integral gain<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 />

268 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!