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.

}<br />

Param.f16Kx = FRAC16 (0.87905201358520957);<br />

Param.s16Ny = 0;<br />

Param.s16Nx = 0;<br />

Param.f16ThetaAdj = FRAC16 (0.05555555555);<br />

// theta = 15 deg<br />

// Y = sin(theta) = 0.2588190<br />

// X = sin(theta + dtheta) = 0.9951074<br />

f16InY = FRAC16 (0.2588190);<br />

f16InX = FRAC16 (0.9951074);<br />

// f16Ang contains 0x11c6c, the theoretical value is 0x1C34<br />

f16Ang = GFLIB_AtanYXShifted_F16 (f16InY, f16InX, &Param);<br />

// f16Ang contains 0x11c6, the theoretical value is 0x1C34<br />

f16Ang = GFLIB_AtanYXShifted (f16InY, f16InX, &Param, Define F16);<br />

// ##############################################################<br />

// Available only if 16-bit fractional implementation selected<br />

// as default<br />

// ##############################################################<br />

// f16Ang contains 0x11c6, the theoretical value is 0x1C34<br />

f16Ang = GFLIB_AtanYXShifted (f16InY, f16InX, &Param);<br />

4.39 Function GFLIB_AtanYXShifted_FLT<br />

This function calculates the angle of two sine waves shifted in phase to each other.<br />

4.39.1 Declaration<br />

tFloat GFLIB_AtanYXShifted_FLT(tFloat fltInY, tFloat fltInX, GFLIB_ATANYXSHIFTED_T_FLT<br />

*pParam);<br />

4.39.2 Arguments<br />

Table 4-49. GFLIB_AtanYXShifted_FLT<br />

arguments<br />

Type Name Direction Description<br />

tFloat fltInY input The value of the first signal, assumed to be sin( θ).<br />

tFloat fltInX input The value of the second signal, assumed to be sin( θ + Δθ).<br />

GFLIB_ATANYXSHIFT<br />

ED_T_FLT *<br />

pParam input,<br />

output<br />

The parameters <strong>for</strong> the function.<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 263

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

Saved successfully!

Ooh no, something went wrong!