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.

where<br />

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

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

are the controller coefficients adapted according to the input <strong>and</strong> output scale values. In<br />

order to implement both coefficients as fractional numbers, both CC1 f <strong>and</strong> CC2 f must<br />

reside in the fractional range [-1, 1). However, depending on values CC1, CC2, E MAX , U<br />

MAX , the calculation of CC1 f <strong>and</strong> CC2 f may result in values outside this fractional range.<br />

There<strong>for</strong>e, a scaling of CC1 f, CC2 f is introduced as follows:<br />

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

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

The introduced scaling shift u16NShift is chosen such that both coefficients f32CC1sc,<br />

f32CC2sc reside in the range [-1, 1). To simplify the implementation, this scaling shift is<br />

chosen to be a power of 2, so the final scaling is a simple shift operation. Moreover, the<br />

scaling shift cannot be a negative number, so the operation of scaling is always to scale<br />

numbers with an absolute value larger than 1 down to fit in the range [-1, 1).<br />

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

Chapter 4 API References<br />

The final, scaled, fractional equation of a recurrent PI controller on a 32-bit fixed point<br />

plat<strong>for</strong>m is there<strong>for</strong>e implemented as follows:<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. 295

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

Saved successfully!

Ooh no, something went wrong!