Other Parts Discussed in Thread: TMS320F28379D, CONTROLSUITE, SFRA
Hi Team,
Our customer encountered an issue generating a sinusoidal signal on TMS320F28379D board. Please see the output waveform below for reference.
According to our customer,
"My objective is to use the SVGEN macro in the TMS320F28379D LaunchXL board. The input signals to that macro has to be in the form of sinusoidal waveforms
I am generating the waveform using my code:
#include "IQmathLib.h"
#include <math.h>
#include <stdio.h>
int whilecount=0;
#define GLOBAL_Q 24
_iq24 angl1;
float t=0;
double Ualpha1;
double Ubeta1;
double Ta1, Tb1, Tc1;
float x,y,z,angl,pi = 3.14156;
double x1,y1,z1;
_iq24 si,co;
_iq24 _IQsin(_iq angl1);
double abc1, abc2, abc3, abc4;
float i1, aaa[600];
int j1 = 0;
/*void main(void)
{
}
*/
SVGENDQ svgen_dq1 = SVGENDQ_DEFAULTS;
void main(void) {
// void interrupt periodic_interrupt_isr();
while(1)
{
abc1 = sin(0);
abc2 = sin(pi/6);
abc3 = sin(pi/2);
abc4 = sin(3*pi/2);
angl= (sin((180*t)/pi));
si = _IQ(angl);
co = _IQ(angl);
DelayUs(2000*1000);
SVGENDQ svgen_dq1 ;
SVGEN_MACRO(svgen_dq1);
Ualpha1 = _IQ(11.101);
Ubeta1 = _IQ(10.110);
svgen_dq1.Ualpha = Ualpha1; // Pass inputs to svgen_dq1
svgen_dq1.Ubeta = Ubeta1; // Pass inputs to svgen_dq1
//svgen_dq2.Ualpha = Ualpha2; // Pass inputs to svgen_dq2
//svgen_dq2.Ubeta = Ubeta2; // Pass inputs to svgen_dq2
SVGEN_MACRO (svgen_dq1); // Call compute macro for svgen_dq1
//SVGEN_MACRO (svgen_dq2); // Call compute macro for svgen_dq2
Ta1 = svgen_dq1.Ta; // Access the outputs of svgen_dq1
Tb1 = svgen_dq1.Tb; // Access the outputs of svgen_dq1
Tc1 = svgen_dq1.Tc; // Access the outputs of svgen_dq1
t=t+0.01;
whilecount++ ;
}
// return ;
} "
Even the abc1, abc2, abc3 and abc4 doesn't give the proper values. They always return 0
I also include the "math.h" library as well
Regards,
Danilo