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.

}<br />

// output should be 1.5e-2<br />

fltOutput = GFLIB_<strong>Control</strong>lerPIp (fltInErr, &trMyPI);<br />

4.43 Function GFLIB_<strong>Control</strong>lerPIpAW_F32<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.43.1 Declaration<br />

tFrac32 GFLIB_<strong>Control</strong>lerPIpAW_F32(tFrac32 f32InErr, GFLIB_CONTROLLER_PIAW_P_T_F32 *const<br />

pParam);<br />

4.43.2 Arguments<br />

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

_PIAW_P_T_F32<br />

*const<br />

4.43.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.43.4 Description<br />

Chapter 4 API References<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 />

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

Freescale Semiconductor, Inc. 279

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

Saved successfully!

Ooh no, something went wrong!