Maker Pro
Maker Pro

Project MOSFET H-Bridge to generate single phase signal

Status
Not open for further replies.
Hi all,
I am currently working on a project which is able to generate three phase signal, using a microcontroller Teensy++2.0 and MOSFET circuits. The MOSFET circuit will be able to convert/smoothen the square waves with variable duty cycles generated by the microcontroller into reasonable sine waves. To begin, I started with a single phase.

NI MultiSim is used as the simulation tool, and for that purpose opamp together with sine wave and triangular wave generator replaced the microcontroller to generate the required square waves for testing purposes.

Objective: To get a reasonable looking sine wave
After weeks of trying and troubleshooting, I am still unable to get the required output (reasonable looking sine wave).

My circuit design is shown below: (Left shows the function gen used) (Mid is the circuit) (right is the output that I generated)
upload_2017-9-4_13-53-9.png

I would appreciate your advice and guidance.
Please help.

Thank you so much.
KX
 

Attachments

  • MOSFET H-Bridge Circuit Design.pdf
    23.6 KB · Views: 33
Hi Harald and Kellys,

Thank you for the advice. I tried to modify the circuit accordingly, the signal is now much cleaner however still not a reasonable sine wave yet. Below is the revised circuit, appreciate your help to advise.

upload_2017-9-7_17-35-51.png

Thank you so much.
Best Regards,
KX
 

Attachments

  • MOSFET H-Bridge Circuit Design v2.pdf
    28.1 KB · Views: 40

Harald Kapp

Moderator
Moderator
The high side drive of your circuit is less than ideal. Consider Q1:
With U1 active, the gate is pulled to 0V, turning Q1 off.
With U1 inactive, the gate is pulled up to 9 V by R1. Since the threshold voltage of Q1 is in the range 2V ... 4 V, the source of Q1 will reach max. 5 V ... 7 V. It cannot reach 9 V, for that you need a gate voltage > 13 V (worst case Vgsth = 4 V).
Or use P-channel MOSFETs in the upper legs of the H-bridge.

Also the pull-up by R1 creates a comparatively slow edge: The gate-source capacitance of Q1 is ~ 1300 pF. Since the gates of Q1 and Q4 are in parallel, the total capacitance seen by R1 is 2.6 nF. Together with R1 these capacitances create a low pass filter with a time constant of 1.8 µs.

C4 is not well placed. It will alternately be charged and discharged by Q3 and Q4.This creates a lot of wasted power in these transistors. Remove C4.
When I mentioned a low pass I meant an RC filter from the right side of R6 to the input of the oscilloscope.
 
HOLY SMOKE HARALD!

That's all....just HSH!

How can you know all of that off the top of your head? That's encyclopedic!
Tip my hat to that one for sure......I wonder if I'll ever know that much. No laughing,I'm serious. :p
 
Last edited:
Hi Harald, thank you so much for the help.
There are a number of points which I don't really understand and is rather confused. I tried to interpret as much and came out with a revised circuit using P-channel MOSFETs in the upper legs of H-Bridge.

I would really appreciate your guidance and support.
Thank you so much.

upload_2017-9-9_18-39-7.png
 

Attachments

  • MOSFET H-Bridge Circuit Design v3.pdf
    27 KB · Views: 38

Harald Kapp

Moderator
Moderator
The P-Channel MOSFET needs an inverted gate source voltage.

When the output of the opamp is at low voltage, U1 will be active, pulling the gate of Q1 low. Q1 will be on.The same voltaeg is connected to the gate of Q4, which will be off.
U2 will be inactive, pulling the gate of Q2 high which turns on Q" and turns off Q3.
You have created a short circuit between VDD and GND via Q! and Q2 which are both on.

Similarly a short circuit will be created between Q3 abd Q4 when the output of the opamp is at high voltage.

Swap the gate connections of Q2 and Q4. That way either Q1/Q4 or Q2/Q3 will be on in pairs.

Read here and here how an H-bridge works.

There's also the question of why you use photocouplers. Since you're operating all parts from the same VCC/GND, the isolation by the photocouplers is not necessary.

THe low pass filter at the output of the opamp is also detrimental. R5, C2, C28 will round your pulses. This in turn will slow the turn-on and turn-off of the MOSFETs. Even with correct gate connections (see above) this will increase the power dissipation due to switching and current spikes from VDD to GND when both transistors in a leg (e.g. Q1, Q2) are partly on at the same time.
On the contrary, a good H-bridge driver would not simply invert the gate drive (as your circuit does) but would insert a brief dead-time, a period where none of the MOSFETs is on to minimize this effect. See the above links.
 
Hi Harald,

I have read through and have revised the circuit.
There are some parts which I couldn't understand in the links given above.

The circuit is still unable to generate the required signal sine wave and is getting further.
I would really appreciate if you could help me out.

I based this project on an example found online (Please find attached)

Thank you so much.
KX.
upload_2017-9-10_14-57-2.png
 

Attachments

  • A small inverter to drive 3-phase motors - DIY projectp3.pdf
    604.9 KB · Views: 51
  • MOSFET H-Bridge Circuit Design v4.pdf
    21 KB · Views: 38
  • A small inverter to drive 3-phase motors - DIY projectp4.pdf
    180.4 KB · Views: 50

Harald Kapp

Moderator
Moderator
There are a number of points which I don't really understand and is rather confused. I tried to interpret as much and came out with a revised circuit using P-channel MOSFETs in the upper legs of H-Bridge.
No, you don't. Your circuit still shows IRF840 for all 4 MOSFETs.

You also missed this part:
QUOTE="Harald Kapp, post: 1743291, member: 22009"]Swap the gate connections of Q2 and Q4. That way either Q1/Q4 or Q2/Q3 will be on in pairs.[/QUOTE]
As it is, with th eoutput of the opamp high, U1 is off, U2 is on.
U1 off provides a positive gate voltage to Q1 and Q4. but Q1 being an NMOS will not turn on completely, cf. post #5. And if Q1 were a PMOS, as I suggested, it would be off.

Maybe this video helps you more than my verbal explanations?
 
Hi Harald,

Can the IRF840 be used as P-channel by switching the drain and the source?
If not, do you have any idea what P-channel MOSFET is equivalent to the N-channel IRF840?

I have swapped the gate connections of Q2 and Q4. Am I doing it correctly?

Thank you so much for the advice and guidance and I appreciate it so much.
KX.

upload_2017-9-10_18-20-31.png
 

Attachments

  • MOSFET H-Bridge Circuit Design v5.pdf
    22.7 KB · Views: 40

Harald Kapp

Moderator
Moderator
Can the IRF840 be used as P-channel by switching the drain and the source?
No, these are different technologies.

do you have any idea what P-channel MOSFET is equivalent to the N-channel IRF840?
Sorry, I don't. But you don't need a 500 V MOSFET here. USe any P-channel MOSFET with a Drain-source voltega higher than VDS (e.g. use 20 V) and a low Rdson (<100mΩ)

I have swapped the gate connections of Q2 and Q4. Am I doing it correctly?
Looks good if you use P-channel MOSFETs for Q1 and Q3.
 
Hi Harald,

Changing Q1 and Q3 into P-Channel MOSFET, the output is as follows. Have I done it correctly?

upload_2017-9-12_13-15-24.png

upload_2017-9-12_13-21-18.png

Not that much of a sine wave yet, I would really appreciate your help and guidance.

Thank you so much.
Regards,
KX.
 

Attachments

  • MOSFET H-Bridge Circuit Design v6.pdf
    22 KB · Views: 39
Hi Harald,

I have connected the source of PMOS to VDD, but the output seems to be the same.

upload_2017-9-13_13-25-51.png

Please advice me.
Thank you.
KX
 

Attachments

  • MOSFET H-Bridge Circuit Design v7.pdf
    22.3 KB · Views: 36

Harald Kapp

Moderator
Moderator
remove C2, connect R5 directly to Q3/Q4. put an RC low pass filter between h-bridge and scope:
upload_2017-9-13_11-26-7.png
Adjust the filter frequency to ~1/10 PWM frequency.
 
Hi Harald,

Following your guidance, the waveform is now so much nicer!
Is it normal for the signal to start high and slowly reduces to the sine wave?

I tried setting the low pass filter to 1.5kHz, but was not successful, the frequency fluctuates and reduces to 1kHz eventually. My output from the op-amp is 15kHz.

upload_2017-9-16_16-24-1.png\

upload_2017-9-16_16-25-3.png

Thank you so much!
KX
 

Harald Kapp

Moderator
Moderator
C2 is still in the wrong place. See my post #16 for the correct position. M1 is equivalent to Q4 in your circuit, M2 is equivalent to Q3.

tried setting the low pass filter to 1.5kHz, but was not successful, the frequency fluctuates and reduces to 1kHz eventually
???
The frequency response of an RC lowpass filter is determined by the values of R and C and does not fluctuate and settle.
 
Status
Not open for further replies.
Top