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

4.73.3 Return<br />

The function returns a 32-bit value in <strong>for</strong>mat Q1.31, which represents the actual ramp<br />

output value. This, in time, is approaching the desired (input) value by step increments<br />

defined in the pParam structure.<br />

4.73.4 Description<br />

The GFLIB_Ramp function, denoting ANSI-C compatible source code implementation,<br />

can be called via the function alias GFLIB_Ramp.<br />

If the desired (input) value is greater than the ramp output value, the function adds the<br />

f32RampUp value to the actual output value. The output cannot be greater than the<br />

desired value.<br />

If the desired value is lower than the actual value, the function subtracts the<br />

f32RampDown value from the actual value. The output cannot be lower than the desired<br />

value.<br />

Functionality of the implemented ramp algorithm can be explained with use of Figure<br />

4-31<br />

Figure 4-31. GFLIB_Ramp functionality<br />

Note<br />

All parameters <strong>and</strong> states used by the function can be reset<br />

during declaration using the GFLIB_RAMP_DEFAULT<br />

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

388 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!