# Search the Community

Showing results for tags 'Lookup Table'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• PIC Embedded Programming
• BoostC and Chameleon compilers programming
• BoostC porting source code
• BoostC++ compiler programming
• BoostBasic compiler programming
• Assembler programming PIC
• Novo RTOS Programming
• Hardware PIC
• Enhancement Requests
• Bug Reports

• 0 Replies

• 0 Views

Found 1 result

1. ## Lookup Table For Sinewave

Hi, I am trying to create a sine wave inverter using MOSFETs in H-bridge mode. DC supply 12V is switched by the MOSFETs to create a sine wave and this sine wave would be fed to a step up transformer giving 230V / 50 Hertz AC Sine wave. After I googled on how to develop this concept using a PIC, Most of the guys out there have suggested to use a sine wave PWM for the same and for generating sinewave PWM I have to use lookup table. Now I know fundamentally what is a lookup table. If I am right a LUT (lookup table) is a table which has precalculated values corresponding to the variables which are frequently used in the calculations. As in my case suppose there are MOSFETS A,B,C,D in the bridge, where A and D are diagonal to each other and B and C are diagonal and the transformer is connected at the Source-Drain Junction of A-C and B-D, in order to get an AC waveform, I would need to give a PWM input on A, Compliment of A on C, MOSFET D must be kept ON and B MOSFET would be OFF in order to get 1 half cycle. For the other half cycle, PWM input is given to B, Compliment of B on D, C is kept ON and MOFET A is OFF. This half cycle is exactly the same as the previous, but its direction is opposite to that of the previous (due to transformer). So I need a Sine PWM for 180 degress and for the next 180 deg, I will simply switch the other side of bridge with the same PWM. Now if we consider an O/P of 50Hz, half of it would be 100 Hz (Or 50Hz=20mS; 100Hz=10mS) and say I decide to take a sine sample at every 3 degrees for 180 degress (i.e. 10mS), I would have 60 samples of 3 degrees each. So my each sample would be (10mS/60 Samples = 167uS OR 6KHz). Hence the ON Time of my waveform per sample would be 167 X sine value at that particular instance. [This is what my understanding is. Please correct it if thats not the case]. So the sine lookup table should be sine values of 3, 6, 9, 12, 15....180 etc, which would all be floating points (except for 90 deg and 180 Deg). But I am puzzled on seeing none of the lookup tables shown on various forums have any float value, instead all of them had some decimal values ranging from 0 to 1024 or 0 to 255 or atleast 0 to 64. How are these values computed and in the above case what would these values be and in case I am taking a feedback of output voltage with an ADC in order to control the amplitude of the sinewave (O/P voltage) how will the values in this table get affected (The proposed 12V supply is a battery so as it discharges, the output voltage would also fall, hence there might be a need to increase the pulse width accordingly). Also how would this be implemented in the PIC? I am thinking of using 16F887. I am trying to present the maximum facts that I understood, but I know that I can confuse the most precious brains with my stupid vocabulary. So please bear with me if anybody finds it confusing. Thanks and Regards Shree
×