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.

Function GFLIB_Ramp_F16<br />

4.74.2 Arguments<br />

Table 4-95. GFLIB_Ramp_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16In input Input argument representing the desired output value.<br />

GFLIB_RAMP_T_F16<br />

*const<br />

4.74.3 Return<br />

pParam input,<br />

output<br />

Pointer to the ramp parameters structure.<br />

The function returns a 16-bit value in <strong>for</strong>mat Q1.15, 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.74.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 />

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

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

390 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!