How to apply PWM on a Look up table based sinewave

Status
Not open for further replies.

Serpent

New Member
I am programming for a sine-wave UPS/Inverter using PIC.
I am using a 32 points sinetable to get values for the timer to make sine-wave for each half cycle - full cycle 64 points (32 - mirror 32).
I succeeded in getting a sine-wave also. So far it seems OK.

Now I need to introduce PWM to this sine-wave so that voltage remains stable irrespective of load.
I am looking for a logic/example code/suggestions to implement PWM based on output voltage reading from ADC.
I am coding in PIC assembly to reduce code size, but I can understand C code also
Thanks.
 
Need a little more clarification. Are you trying to make a switch mode power supply while also tasking the PIC with digital voltage regulator duties as well?
 
I am designing a UPS for mains (12Volt DC to 230V AC)
12V DC switched alternatively on a 12v-0-12v winding of a transformer to induce 230V AC on a secondary winding.
PIC drives MOSFETS in small slices so that output will be sine.

the width of each slice is loaded into a timer from a lookup table, I did it and I am getting this sinewave.
But I need to increase or decrease the width of each slice based on the output voltage during runtime with varying loads. Ideal method will be PID algoritham ( so it seems to me)
But I am implementing this low cost inverter on a PIC16 which may not be able to implement a full PID .
So I am looking for a simple method to provide a closed loop control for this adjustment.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…