Skip to content

Hardware/Microcontroller project to build basic functions of an H-Bridge Inverter

License

Notifications You must be signed in to change notification settings

JoHassel/H_Bridge_Inverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

H-Bridge Inverter

Goal

Basic functionality of an H-Bridge Inverter (12V DC --> 230V AC)

Overview

  1. Microcontroller (Raspi Pico) generates a sine PWM as a control signal
  2. Sine PWM goes into a gate driver (Bootstrap)
  3. Bootstrap (one for each side) controls H-Bridge MOSFETs --> sine_wave AC

Fig.1 - Simple H-Bridge

Code

Flowchart

Fig.2 - Flowchart Code

Output

Fig.3 - Sine PWM Output

Hardware

Why Bootstrap Circuit?

  • source of high side MOSFET floats between V_AC (here: 12V AC) --> V_GS at the high side MOSFET must be high enough to safely switch on/off the MOSFET
  • if low side MOSFET on, Bootstrap capacitor is chraged up to V_DC (here: 12V DC, voltage drop over bootstrap diode negligible)
  • if high side MOSFET is switched on, the capacitor delivers its voltage to the control pin of the high side MOSFET

Fig.4 - Bootstrap CIrcuit

Circuit Design

Bootstrap Capacitor

$C_{boot} >= \frac{Q_{total}}{\Delta V_{HB}} = 183.75nF$ (Rule of thumb: 10 times gate capacitance leads to $190nF$) --> $C_{boot} = 200 nF$

$Q_{total} = Q_G + I_{HBS} \cdot \frac{D_{max}}{f_{sw}} + \frac{I_{HB}}{f_{sw}} $

$\Delta V_{HB} = V_ {DD} − V_ {DH} − V_ {HBL} = 1.2V $

Bootstrap Resistor

$R_{boot} = \frac{V_{DD} - V_{Boot,Diode}}{I_{peak}} = 5.5 \Omega$ --> $5.6 \Omega$

Gate Resistors

$R_{G,HS} = \frac{V_{Gate}}{I_{o+}} = 92 \Omega$ --> $91 \Omega$

$R_{G,LS} = \frac{V_{Gate}}{I_{o-}} = 44 \Omega$ --> $47 \Omega$

Output Filter

  • second order passive lowpass filter (LC filter)
  • Cutoff frequency $f_g = \frac{1}{2 \pi \cdot \sqrt{LC}}$ (see ElectronicBase.net)
  • Cap chosen based on availabilty in store: $C_{Filter} = 10 \mu F$ (use film cap, not a polarized one)
  • $L_{Filter} = 100mH$ --> $f_g = 159.2Hz$

Results

The higher the resolution of the sine PWM (pwm_periods & scaler, see code) the clearer the sine wave output gets. Since the performance of the C code is better than the Micropython code (see below), the sine wave from the C code has less ripples. The amplitude is relatively low at the moment since there is no output voltage regulation yet.

Fig.5 -Resulting Sine Wave with Micropython Code


Fig.6 -Resulting Sine Wave with C Code

Performance

Disclaimer: I know Micropython is not made for high performance applications, but rather for rapid prototyping and easy debugging. I still wanted to see how far I can get with Micropython and compare it to C. Also the C code can become much faster by shorten the timer callback, using bit operations and more. I am looking forward to any improvement suggestions :)

Language Code Version $f_{sin,set}$ in Hz $f_{sin,real}$ in Hz $f_{switch,real}$ in kHz
MicroPython 26/12/2024 50 50 5
MicroPython 26/12/2024 100 100 10
MicroPython 26/12/2024 500 105.3 10.5
C 02/01/2025 50 50 5
C 02/01/2025 100 100 10
C 02/01/2025 500 444.4 44.4

ToDos

  • shorten timer callback
  • add output voltage regulation
  • (if inductive load: add external flyback diodes in parallel to MOSFETs)

About

Hardware/Microcontroller project to build basic functions of an H-Bridge Inverter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published