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
Содержание C28 Series
Страница 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Страница 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Страница 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Страница 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Страница 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Страница 275: ...Appendix eZdsp F2812 eZdsp F2812 Connector Header and Pin Diagram C28x Appendix A eZdsp F2812 A 3 ...
Страница 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Страница 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Страница 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Страница 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Страница 281: ...Appendix JP7 JP8 JP11 JP12 Boot Mode Select JP9 PLL Disable DS1 DS2 LEDs C28x Appendix A eZdsp F2812 A 9 ...
Страница 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...