H-Bridge Controller Using Raspberry Pi Pico


Author Message
Solar Mike
Guru

Joined: 08/02/2015
Location: New Zealand
Posts: 962
Posted: 11:52am 08 Jul 2021      

Have spent some more time with the PI Pico to see what it can do as an H-Bridge controller, very impressed, python is a very easy language to program in. The state machines are extremely versatile for controlling high speed IO signals. Using both CPU's seems quite stable after standard precautions are taken for threading.

Here is the result of setting up two of the PIO state machines to output a full H-Bridge output of SPWM at 24 Khz rate and 50 Hz sine modulation, with 250 nSec dead-time; so 4 IO pins are used for bridge drive.

Four waveforms Yellow = L0, Blue = H0, Purple = L1, Green = H1
After 180 degrees the L0 signal remains high and SPWM applied to the other H1, L1 and vice versa.




Here is a blowup of last 180 degree pulse showing the 250 nSec approx dead-time


I have synchronized the start of the state machines by setting their control register, so the wave forms are very accurate and easily setup in software; this means I can now dispense with the dead-time inserter module pcb, and buffer the cpu signals directly via 3.3:5v logic gates with a disable input to control the drive to the cross-coupled opto couplers on the power boards.

Its looking very good.


Cheers
Mike