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

4.10.4 Description<br />

This function calculates the first order infinite impulse (IIR) filter. The IIR filters are also<br />

called recursive filters because both the input <strong>and</strong> the previously calculated output values<br />

are used <strong>for</strong> calculation of the filter equation in each step. This <strong>for</strong>m of feedback enables<br />

transfer of the energy from the output to the input, which theoretically leads to an<br />

infinitely long impulse response (IIR).<br />

A general <strong>for</strong>m of the IIR filter expressed as a transfer function in the Z-domain is<br />

described as follows:<br />

Equation GDFLIB_FilterIIR1_Eq1<br />

where N denotes the filter order. The first order IIR filter in the Z-domain is there<strong>for</strong>e<br />

given from equation GDFLIB_FilterIIR1_Eq1 as:<br />

Equation GDFLIB_FilterIIR1_Eq2<br />

In order to implement the first order IIR filter on a microcontroller, the discrete time<br />

domain representation of the filter, described by equation GDFLIB_FilterIIR1_Eq2, must<br />

be trans<strong>for</strong>med into a time difference equation as follows:<br />

Equation GDFLIB_FilterIIR1_Eq3<br />

Equation GDFLIB_FilterIIR1_Eq3 represents a Direct Form I implementation of a first<br />

order IIR filter. It is well known that Direct Form I (DF-I) <strong>and</strong> Direct Form II (DF-II)<br />

implementations of an IIR filter are generally sensitive to parameter quantization if a<br />

finite precision arithmetic is considered. This, however, can be neglected when the filter<br />

transfer function is broken down into low order sections, i.e. first or second order. The<br />

main difference between DF-I <strong>and</strong> DF-II implementations of an IIR filter is in the number<br />

of delay buffers <strong>and</strong> in the number of guard bits required to h<strong>and</strong>le the potential overflow.<br />

The DF-II implementation requires less delay buffers than DF-I, hence less data memory<br />

is utilized. On the other h<strong>and</strong>, since the poles come first in the DF-II realization, 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 />

174 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!