Forum Discussion
Altera_Forum
Honored Contributor
16 years agoSpace Vector PWM
Hello, i am new to Altera and would need help regarding a task. i want to implement SVPWM on an FPGA it goes like this... ANALOGUE SIGNAL----->ADC(SPI)----->FPGA----->SVPWM i am actu...
Altera_Forum
Honored Contributor
16 years agoyou can use any kind of script language to calculate a sin(x) table. Someting like:
This is pseudo matlab code: for i = [0:0,1:360] printf("%f\n",sin(i)) end Then store that in a .mif file. Take a look at http://www.alteraforum.com/forum/showthread.php?t=23628&highlight=matlab+mif to see how to do that. After that you can initialize the contents of a RAM inside the FPGA with the values you just pre-calculated. Now just do a counter that counts from 0 to 3600. Use the output of that counter as an address for the ram. The data output of the ram will be a perfect digital sine wave. Now you can use three RAMs instead of one and that will give you your 120º phase shift. By controlling the speed of the counter you can control the frequency of the 3 generated sine waves. You can control the quantization error/precision by using more or less bits in the RAM. You can control the sine wave distortion by using more or less addresses. And be careful, your FPGA has a limited amount of RAM.