EasyManuals Logo

Texas Instruments C28 Series Student Guide

Texas Instruments C28 Series
342 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #184 background imageLoading...
Page #184 background image
AC Induction Motor Example
AC Induction Motor Example
AC Induction Motor Example
Park Transform
Park Transform
-
-
converting to “
converting to “
IQmath
IQmath
” C++ code
” C++ code
#include
#include
math.h
math.h
#define TWO_PI 6.28318530717959
#define TWO_PI 6.28318530717959
void park_calc(PARK *v)
void park_calc(PARK *v)
{
{
float
float
cos
cos
_
_
ang
ang
, sin_
, sin_
ang
ang
;
;
sin_
sin_
ang
ang
= sin(TWO_PI * v
= sin(TWO_PI * v
-
-
>
>
ang
ang
);
);
cos
cos
_
_
ang
ang
=
=
cos
cos
(TWO_PI * v
(TWO_PI * v
-
-
>
>
ang
ang
);
);
v
v
-
-
>de = (v
>de = (v
-
-
>
>
ds
ds
*
*
cos
cos
_
_
ang
ang
) + (v
) + (v
-
-
>
>
qs
qs
* sin_
* sin_
ang
ang
);
);
v
v
-
-
>
>
qe
qe
= (v
= (v
-
-
>
>
qs
qs
*
*
cos
cos
_
_
ang
ang
)
)
-
-
(v
(v
-
-
>
>
ds
ds
* sin_
* sin_
ang
ang
);
);
}
}
extern “C” { #include “IQmathLib.h” }
#include “IQmathCPP.h”
IQ(6.28318530717959)
iq
IQsin(TWO_PI * v->ang);
IQcos(TWO_PI * v->ang);
As can be seen, the floating-point C and "IQmath" C++ code looks almost identical. It is quite a
simple and fast procedure to take any floating-point algorithm and convert it to an "IQmath" algo-
rithm.
The complete system was coded using "IQmath". Based on analysis of coefficients in the system,
the largest coefficient had a value of 33.3333. This indicated that a minimum dynamic range of 7
bits (+/-64 range) was required. Therefore, this translated to a GLOBAL_Q value of 32-7 = 25
(Q25). Just to be safe, the initial simulation runs were conducted with GLOBAL_Q = 24 (Q24)
value.
8 - 28 C28x - Numerical Concepts & IQmath

Table of Contents

Other manuals for Texas Instruments C28 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments C28 Series and is the answer not in the manual?

Texas Instruments C28 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelC28 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals