Altera_Forum
Honored Contributor
17 years agoGenerate Triangular Wave Table
Hello!
I'm doing a project at school using the DE2 board as the digital controller of a DC-AC inverter. The goal is to output a 120V 60Hz sine wave from a ~300VDC input. Right now the design uses a ADC to read in the values of current output (scaled down of course) and this is to be compared with the Altera board to a 60Hz triangular wave (of equal magnitude scale) so that the board can control the gates of the inverter. I read this post on the forum: http://www.alteraforum.com/forum/showthread.php?t=4365&highlight=triangle but I'm still a little confused. One person suggested doing the triangle wave in logic (accumulator) and other people mentioned the Altera Megafunction generator. My plan was to either save in the values of the perfect 60Hz triangular wave to a table that can be compared to the value read in from the ADC and control the correction accordingly. I read on another post about using Matlab to generate VHDL code? Is it possible to make a triangle function in Matlab then export it some how to VHDL? Thanks a bunch guys, -J