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.

Generating uni-polar PWM signal using IR2113

Status
Not open for further replies.
If I were to use dual supply for op-amps, is it possible to produce a waveform like this?
 

Attachments

  • 3 level PWM signal.JPG
    3 level PWM signal.JPG
    29 KB · Views: 906
In post #30 you said:
The sine wave is taken from the main.
Now you are saying:
Because I am using function generator to produce a 50Hz sine wave
So which is it?
It's difficult to advise you if you keep moving the goalposts :rolleyes:.
 
Just a couple of questions, with regards to what alec_t said. Because I am using function generator to produce a 50Hz sine wave, if I were to connect 6VDC to it, wont it blow the generator because of the DC & AC issue.
Alec used a transformer to block the DC voltage difference.
I used a coupling capacitor from the generator to the 6V input of the inverting opamp.
Then the 50Hz will have a reference of +6V which is what is needed.
 
In post #30 you said:

Now you are saying:

So which is it?
It's difficult to advise you if you keep moving the goalposts :rolleyes:.
As in, for my actual prototype, I am using the reference waveform from the grid. But in the lab for now, I am simulating the reference grid waveform from the signal generator instead of the grid.
 
is it possible to produce a waveform like this?
Why do you want to? For generating PWM don't you need waveforms like this? :-
SineTriangle.gif
 
Why do you want to? For generating PWM don't you need waveforms like this? :-
View attachment 82409

Okay then you can ignore it. If that's the case. Will this schematic be able to work? It is using uni-polar PWM.
Given that my triangular waveform: Vbtm = +3V, Vtop= +9V. Using a capacitor, it should remove the DC offset.
Does my output frequency is still equate to [1/2R1C1]?

However, given that my comparator saturate at +10.5V. If the pull-up resistor is connected to +12VDC. it will still be able to generate a PWM signal right?
 

Attachments

  • SPWM(VCC&GND).pdf
    94.1 KB · Views: 588
Last edited:
Hi,

I did some trials on the schematic itself. This is the exact schematic that I connected on the breadboard.
But there are some problems with the waveform I recorded on the oscilloscope.

1. For the Imperfect Triangular.jpg, the waveform was taken after C2 and its connected to LM339. It shows a DC offset despite the capacitor. However, if it is not connected to LM339, the triangular waveform shows no DC offset after the C2. And why is the triangular appears to be distorted at the negative part?

2. For Sine Wave (Before and AFter C5).jpg, why is that a DC offset after I connect it to a capacitor?

3. As for Inverting Sine Wave clipped.jpg, why does the waveform shows that the negative cycle is clipped despite the 6VDC biasing at the non-inverting input.m

4. With reference to Inverted & N-Inverting Sine Wave.jpg, why is there a drop in the inverted sine wave? Given that my G=-1, the voltage level should be the same. And after I connect the inverted sine wave to a capacitor to remove the DC offset (By right), the offset came back after I connect it to the input of the LM339. How do you solve this problem?
 

Attachments

  • Imperfect Triangular.jpg
    Imperfect Triangular.jpg
    1.1 MB · Views: 388
  • Sine Wave (Before and After C5).jpg
    Sine Wave (Before and After C5).jpg
    1.4 MB · Views: 449
  • Inverting Sine Wave clipped.jpg
    Inverting Sine Wave clipped.jpg
    1.2 MB · Views: 418
  • Inverted & N-Inverting Sine Wave.jpg
    Inverted & N-Inverting Sine Wave.jpg
    1.2 MB · Views: 361
  • SPWM(VCC&GND).pdf
    94 KB · Views: 360
You must NEVER EVER leave an analog input floating without a DC reference voltage. Six of the inputs on the comparators had no DC reference voltage. I biased them at +6V. I also added two supply filter capacitors.

If you look at the datasheet for the LM339 quad comparator you will see that it says LOW POWER which means low output current. It cannot drive a 12mA load but it can drive 4mA fairly well so I increased the value of its load resistors.

I cannot see where 0VDC is on your 'scope photos. Then I also cannot see where the +6VDC reference voltage is located.
 

Attachments

  • PWM circuit.png
    PWM circuit.png
    43.7 KB · Views: 1,197
You must NEVER EVER leave an analog input floating without a DC reference voltage. Six of the inputs on the comparators had no DC reference voltage. I biased them at +6V. I also added two supply filter capacitors.

If you look at the datasheet for the LM339 quad comparator you will see that it says LOW POWER which means low output current. It cannot drive a 12mA load but it can drive 4mA fairly well so I increased the value of its load resistors.

I cannot see where 0VDC is on your 'scope photos. Then I also cannot see where the +6VDC reference voltage is located.
With reference to the datasheet, the output sink current is taken as 6mA(Min.), 18mA(Typ.). That was the reason why I take the Rp as 1k to produce a 12mA current. Am I looking at the wrong section?

What do you mean by no 0VDC? As for the input to the comparator [LM339], I didnt put in the +6VDC ref.

Why is it that one resistor is 10k and the other one is 100k? Is it because of the current?
And what is the purpose of the capacitor 10uF connected to LM339 GND.

I take it as the both 10uF at the supply are the supply filter you were referring to.
 
Last edited:
With reference to the datasheet, the output sink current is taken as 6mA(Min.), 18mA(Typ.). That was the reason why I take the Rp as 1k to produce a 12mA current. Am I looking at the wrong section?
National Semi invented the LM339 quad comparator IC. Their datasheet lists the maximum saturation voltage is 0.7V (not very good) when the output current is only 4mA and the supply is 5V. If you use 12mA then only some or none of your circuits will work. Using 4mA then ALL of your circuits will work properly.

What do you mean by no 0VDC?
The photos of your 'scope do not show where is 0V. Please use an arrow or something.

As for the input to the comparator [LM339], I didnt put in the +6VDC ref.
Yes, but the inputs MUST have a DC reference voltage.

Why is it that one resistor is 10k and the other one is 100k?
The triangle wave is at a much higher frequency so its bias resistor is at a 10k lower value so that stray capacitance at the inputs of the comparators do not attenuate it. The low frequency sinewave comes from the pot and since the pot has no value then I used a 100k fairly high value bias resistor to avoid attenuation of the pot signal.

And what is the purpose of the capacitor 10uF connected to LM339 GND.
It is the +12V supply bypass capacitor that all circuits need. All the grounds are connected together and all the +12V points are connected together.

I take it as the both 10uF at the supply are the supply filter you were referring to.
The one at the LM339 is the +12V supply bypass capacitor and the one at +6V filters and provides a low impedance for +6V.
 
National Semi invented the LM339 quad comparator IC. Their datasheet lists the maximum saturation voltage is 0.7V (not very good) when the output current is only 4mA and the supply is 5V. If you use 12mA then only some or none of your circuits will work. Using 4mA then ALL of your circuits will work properly.


The photos of your 'scope do not show where is 0V. Please use an arrow or something.


Yes, but the inputs MUST have a DC reference voltage.


The triangle wave is at a much higher frequency so its bias resistor is at a 10k lower value so that stray capacitance at the inputs of the comparators do not attenuate it. The low frequency sinewave comes from the pot and since the pot has no value then I used a 100k fairly high value bias resistor to avoid attenuation of the pot signal.


It is the +12V supply bypass capacitor that all circuits need. All the grounds are connected together and all the +12V points are connected together.


The one at the LM339 is the +12V supply bypass capacitor and the one at +6V filters and provides a low impedance for +6V.

I think I got it. But just asking, is it possible to use a dual supply for the PWM comparators?
*Assuming that my other circuitries also operates with dual power supply*
 
Of course an LM339 comparator can use a dual supply. Then its inputs will work from the negative supply voltage to the positive supply voltage minus 1.5V. The output will swing from about 0.4V more positive than the negative supply voltage to the positive supply voltage.
 
Of course an LM339 comparator can use a dual supply. Then its inputs will work from the negative supply voltage to the positive supply voltage minus 1.5V. The output will swing from about 0.4V more positive than the negative supply voltage to the positive supply voltage.
However, the problem here is that I want to get a output from +VDC to 0V, 0v to -VDC. Do you have any idea how?
 
You don't need output voltages going right to the supply rail voltages to do PWM. Why do you want to?
 
Now then problem that I am facing is that, if I can generate a PWM that is 0V to +VDC / 0V to -VDC, I can feed into my driver circuit with all my circuitries as dual power supply. But by using dual power supply, I get a bipolar PWM signal
 
Then why do your triangle-wave and sine-wave generators use a dual-polarity supply instead of the same single supply as your comparators?
Simply use a fast inverting opamp to convert the positive pulses to negative pulses. It will use a dual-polarity supply.

What are you making that uses PWM with positive and negative pulses?
 
Because initially I thought that I cant use single supply due to the clipping of the waveforms [Before I knew about voltage biasing].
Then, I designed my circuit to be a dual supply.

If the PWM pulse are bipolar, how do I go converting the PWM to [+VDC to 0V]/[0V to -VDC]?

And I dont get your last line
 
Your electronic circuits can use a dual-polarity power supply then their reference voltage is 0V. If a single power supply polarity is used then half the supply voltage is the reference voltage.

To convert the positive pulses to negative pulses, connect an opamp as an inverting amplifier with a dual-polarity supply and a reference of 0V. When the input goes positive with the PWM pulses then the output will go negative with the PWM pulses.

Most PWM circuits use only positive polarity pulses to vary the speed of a motor or dim a light.
Why do you need the negative polarity pulses? What will it be used for?
 
Your electronic circuits can use a dual-polarity power supply then their reference voltage is 0V. If a single power supply polarity is used then half the supply voltage is the reference voltage.

To convert the positive pulses to negative pulses, connect an opamp as an inverting amplifier with a dual-polarity supply and a reference of 0V. When the input goes positive with the PWM pulses then the output will go negative with the PWM pulses.

Most PWM circuits use only positive polarity pulses to vary the speed of a motor or dim a light.
Why do you need the negative polarity pulses? What will it be used for?

But if I connect a single supply op-amp in the circuit, my sine wave/triangular wave will be distorted.

The issue now is that I am getting a -Vdc to +Vdc PWM signal but I would only want a PWM signal which is +Vdc to 0V. Sorry if I get the message wrong
 
I ask again. Why don't you use a single positive supply for your entire circuit like almost all other PWM circuits?
 
Status
Not open for further replies.

Latest threads

Back
Top