I am developing an online ups system. I want to get a sine wave by using pwm method. Can anybody assist me regarding this matter? and also need some code.
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
another way into this
Posted: Mon Jun 22, 2009 2:56 pm
If you want HIGH purity sine functions,
and excellent frequency accuracy ( within .002% of 60 hz)
and wide frequency programmability i suggest you look at the AD9833
I use it in an instrument that has to have .01 hz accuracy from 1 hz to 100 khz - and this part does it to perfection.
The AD9833 it produces a 10 bit accuracy very high purity sine wave
with not too much SPI programming --
I use it several devices and found an EZ way to drive it - using hardware SPI on the PIC.
the secret is to use an EXACT power of 2 as the oscillator reference.
I use 8.388608 and 4.194304 mhz.
programming the part becomes pretty EZ - as all the
divisors are arrived at by simple shifting.
The basic setup is stored as a couple of constants that I initialize it with at system start, and thereafter - you just pump it new divisors to chaneg frequency or switch to square or tri wave output.
Multiple units can be digitally PHASE synchronized by the pic to create precise 3 phase 60 hz signals if you like that sort of thing too.
I admit that as a 60 hz ref its probably overkill
but you will never match the accuracy or purity with simpler circuits,
or trying to filter a PWM signal.
( BTW - you wil be hard pressed to use PWM to make a 60 hz signal
anyway unless you have a ridiculously LOW PIC master osc freq. )
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum