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

4.41 Function GFLIB_<strong>Control</strong>lerPIp_F16<br />

This function calculates a parallel <strong>for</strong>m of the Proportional- Integral controller, without<br />

integral anti-windup.<br />

4.41.1 Declaration<br />

tFrac16 GFLIB_<strong>Control</strong>lerPIp_F16(tFrac16 f16InErr, GFLIB_CONTROLLER_PI_P_T_F16 *const pParam);<br />

4.41.2 Arguments<br />

Table 4-51. GFLIB_<strong>Control</strong>lerPIp_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16InErr input Input error signal to the controller is a 16-bit number<br />

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

GFLIB_CONTROLLER<br />

_PI_P_T_F16 *const<br />

4.41.3 Return<br />

pParam input,<br />

output<br />

Pointer to the controller parameters structure.<br />

The function returns a 16-bit value in <strong>for</strong>mat 1.15, 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.41.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_F16 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 15 ,2 15 -1) in integer<br />

interpretation.<br />

The PI algorithm in the continuous time domain can be described as:<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 />

272 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!