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

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

Trans<strong>for</strong>ming equation GFLIB_<strong>Control</strong>lerPIrAW_Eq2 into a discrete time domain leads<br />

to the following equation:<br />

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

where Kp is proportional gain, Ki is integral gain, Ts is the sampling period, u(k) is the<br />

controller output, e(k) is the controller input error signal, CC1 <strong>and</strong> CC2 are the controller<br />

coefficients calculated depending on the discretization method used, as shown in Table<br />

4-65.<br />

Table 4-65. Calculation of coefficients CC1 <strong>and</strong> CC2 using various discretization methods<br />

Trapezoidal Backward Rect. Forward Rect.<br />

CC1= K p+K iT s/2 K p+K iT s K p<br />

CC2= -K p+K iT s/2 -K p -K p+K iT s<br />

In order to implement the discrete equation of the controller<br />

GFLIB_<strong>Control</strong>lerPIrAW_Eq3 on the fixed point arithmetic plat<strong>for</strong>m, the maximal<br />

values (scales) of input <strong>and</strong> output signals<br />

• E MAX - maximal value of the controller input error signal<br />

• U MAX - maximal value of the controller output signal<br />

have to be known a priori. This is essential <strong>for</strong> correct casting of the physical signal<br />

values into fixed point values [-1, 1).<br />

Then the fractional representation [-1, 1) of both input <strong>and</strong> output signals is obtained as<br />

follows:<br />

Equation GFLIB_<strong>Control</strong>lerPIrAW_Eq4<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 />

310 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!