H-Bridge Controller Using Raspberry Pi Pico


Author Message
Solar Mike
Guru

Joined: 08/02/2015
Location: New Zealand
Posts: 963
Posted: 11:28am 19 Jun 2021      

Having a go at designing the CPU controller for the modular H-Bridge using the recently released Raspberry Pi Pico. I picked up 5 of these from a NZ wholesaler for $30 odd, seem extremely great value for building any simple control system.

Decided to use micro python rather than go down the Picomite route; have never programmed python before, but I have a book that I have never read, been sitting on the shelf for the past 10 years or so.

After doing some reading, python is a great fully object orientated language, so after a slow start with the different syntax that I'm normally used to, have managed to get the Pico to output some pretty good SPWM sine waves by making use of the tiny PIO state machines that sit along side the dual cpu's.

Using 2 IO pins, each alternately outputting a 180 degree SPWM wave form to suit my power half bridge boards. Here are some images taken from the scope that show the 2 1/2 sine wave forms after passing via a simple RC filter, the other shows the gap between the outputs where they cross over (65 uSec), the SPWM carrier is 23.8 Khz; pretty easy to make it go up to 100 Khz; Pico is running at standard clock frequency.








The software creates a table of hundreds of rows of sine 1/2 wave values, each of a differing modulation depth; my intention is to measure the incoming battery voltage and at every 360 degree cycle and select either a higher or lower table row as feedback to counter differing voltages (fast loop). Above that is a slower loop that measures the output AC.

Early stages yet, but looks very promising...

Cheers
Mike
Edited 2021-06-19 21:31 by Solar Mike