Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Square to Sine Wave Conversion Question

Status
Not open for further replies.

asabalon

New Member
I am trying to design a motor driver for a Robot Arm. I need to convert a square wave to a sine wave. My square wave has a peak-to-peak voltage of 80V and a current of 2.5A. What circuit must i use to be able to accommodate this large voltage and current? Thank You.
 
I am trying to design a motor driver for a Robot Arm. I need to convert a square wave to a sine wave. My square wave has a peak-to-peak voltage of 80V and a current of 2.5A. What circuit must i use to be able to accommodate this large voltage and current? Thank You.
A symmetric 50% duty cycle square wave is made up of a bunch of sine waves. The frequency of the square wave is the frqeuency of the lowest frqeuency sine wave (the fundamental frequency). From there, the sine waves are odd harmonics of the fundamental. So they are multiples of 3, 5, 7, 9, etc of the fundamental. Filter these high frequencies out and you have just the sinewave.

So a 10kHz square wave has harmonics of 30kHz, 50kHz, 70kHz, 90kHz, and so on. For a single filter, this does place limits on the frequency range of your square wave though. As you decrease the frequency the largest harmonic after the fundamental (the third harmonic) won't be filtered out. This is bad because the 3rd harmonic is the strongest harmonic that you do not want (as the harmonics get higher they also get weaker). If you go too high then the fundamental starts to get filtered out too. It's worth a try though seeing as how you could just try a simple low-pass filter. With a simple first-order RC filter you want a big capacitor because you probably want to keep the resistance small to limit power loss and heat. It's probably not practical with an RC filter.

A lowpass LC filter would be better. No resistance except for the small parasitic resistance of the inductor would means less loss and heat. A lowpass LC filter also supresses higher frequencies more than an RC filter (the inductor is also filtering along with the capacitor). This will help to reduce the size of the capacitor as well. It'd would filter That might be more efficient. For the LC filter, have the resontant frequency be at the third harmonic which is the strongest harmonic that you do not want. If you don't filter enough, you'll get something that won't look like a sine-wave, but it will look more like a sine-wave than a square wave.
-----------
If you actually need a sine wave that can vary over a large range of frequencies things get LOT harder and you shouldnt try to build one until you have built a non-sinewave motor driver. It's among the most difficult of motor drivers to build. What you have to do is have a regular motor driver that produces a PWM signal at much much higher frequencies than the sine-wave that you want to make. You sinusoidally modulate the duty cycle of the this square wave. This will make it so the instananeous average of your square wave is follows the the voltage value of a sine-wave. THis means your square wave has a sine-wave hidden in it and the sine wave has a frequency lower than the frequency of your square wave. If you filter out the all the higher frequencies square wave, you'll be left with that low frequency sine-wave.

In this way, you can vary the frequency of the sine wave much more because you don't actually vary the frequency of the PWM signal to vary the frequency of the output sine-wave. As a result the output filter still works because it's designed to filter out very high frequencies and the sine-wave you want is always of a much lower frequency than your PWM square waves. You adjust the frequency by adjusting the period that the of the sinusoidally modulated duty cycle. The actual PWM frequency stays the same (you don't mess with this because then you might push the frequency too low to a point where the output filter stops working just like in the first method I described above. This second method is really just the first method that has been modified to work around the the low frequency limitation.

i want sine wave inverter pl z help me 50hz 220 out put 12v input and minimum power factor
Sine wave inverters are among the most difficult to build and there's a crapload of work that goes into making them. From the sounds of it you need about 3 more years of school before you even have a hope of attempting one. Frankly, I don't think the OP is going to be able to build one either. It's almost the kind of thing that if you have to bluntly ask how to do it, you probably can't do it.
 
Last edited:
In some countries a pay of $65.00 is a year of work.
But in modern civilized countries it is one hour's worth of work (or less).
 
Irrespective of the $65.00, it is going to cost him three times this amount to buy the parts IN ANY COUNTRY.
 
I previously built a motor driver which uses 3 half bridges which also uses PWM. I just want to convert its output to a sine. Will the Lowpass LC Filter convert the square wave efficiently? Thank You.
 
It will only do it efficiently if the sine-waves you generate are much lower frequency than the PWM frequency. You'll only be able to generate sine-waves that are at most 1/10th of the PWMfrequency (lower if you want better results). THat's why half-bridges designed for this kind of thing run at frequencies much highier than normal- so you can generate sine-waves that are high enough in frequency to drive the motor at the right speeds.

And of course, you have to be able to modulate the duty sinusoidally in the first place. Motor drivers that are designed for this have dedicated hardware and software to update the duty cycle properly (sometimes every PWM cycle). THe less frequently you can update the duty cycle of your half bridges, the lower the sine-wave that you can generate.

The highest frequency sine-wave you can generate is the lower of the two limits described above.

Of course, if you just want a sine-wave of only one frequency, that's easy. Just use the first method I described. Make a 50% duty cycle square wave at the sine-wave frequency you want, and lowpass filter all frequencies higher than the fundamental.
 
Last edited:
If I could program a pic or any other micro controller, then I would use it to measure time between each edge (positive or negative). Then I would have an sinous subroutine wich I told the µpc to cycle through 0 to 2 pi during the very same time as measured time between each edge.

The resolution could be poor if you're talking about higher frequenzis.
 
Sorry for the late reply

Sirs, i built a motor driver which generates a square wave being controlled by a microcontroller. i wanted a lowpass filter that can convert the sqaure wave into a sine wave at different frequencies. i didn't quite get your explanation. Sorry for that, I'm still a newbie in designing circuits. Thank You. Below is the image of what i have designed. V4 and V2 are 3.3V square waves with varying frequency which comes from the microcontroller. i would want to attach a low pass filter between the two MOSFETs.

**broken link removed**
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top