Hi,
You need to modulate your sinewave according to a modulation index (that increases decreases the output voltage) derived from the error. Inititally a proportional error scheme is okay to experiment with later can add up to PID. In addition you can do a point by point correction to lower distortion. In 16Fs multiply is not supported in Hardware thus a different approach may be taken. Use a sliding lookup table. Here you have more number of points in the lookup table than regular 32/64 points. However it should be a single quadrant lookup table. Now if the resolution of the lookup table is increased you can have a sliding index (according to error) to have voltage correction without much software overhead.
Bookmarks