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

4.44 Function GFLIB_<strong>Control</strong>lerPIpAW_F16<br />

The function calculates the parallel <strong>for</strong>m of the Proportional-Integral (PI) controller with<br />

implemented integral anti-windup functionality.<br />

4.44.1 Declaration<br />

tFrac16 GFLIB_<strong>Control</strong>lerPIpAW_F16(tFrac16 f16InErr, GFLIB_CONTROLLER_PIAW_P_T_F16 *const<br />

pParam);<br />

4.44.2 Arguments<br />

Table 4-54. GFLIB_<strong>Control</strong>lerPIpAW_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 />

_PIAW_P_T_F16<br />

*const<br />

4.44.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.44.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>lerPIpAW function calculates the Proportional-<br />

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

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

parameters independently without interaction. The controller output is limited <strong>and</strong> the<br />

limit values (f16UpperLimit <strong>and</strong> f16LowerLimit) are defined by the user. The PI<br />

controller algorithm also returns a limitation flag. This flag (u16LimitFlag) is a member<br />

of the structure of the PI controller parameters<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 />

284 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!