i2c
I2C-based H-bridge controller with PWM
ian – Tue, 2006 – 07 – 04 10:42
During development of my Sumo robot, I ran into some problems around controlling the H-bridges:
- If you're going to use PWM, the PWM signals on each input of the H-bridge need to be synchronised (phase-coherent), and there's no such guarantee when using an AVR to drive them. If they're not phase-coherent, the H-bridge will get hot and not drive the motor properly.
- I wanted to use braking on the H-bridge, which means I need independent control of all four H-bridge inputs. The ATMega32 that I was using has four PWM channels - more than most microcontrollers - but still only enough to run a single H-bridge.
Controller hardware
ian – Tue, 2006 – 05 – 16 15:07
The controller is based around a PIC16F84A. It has 13 I/O's, a timer, and not a lot else. To program it I'm using JDM programmer hardware, ICProg software, and the excellent Microchip MPLAB suite to compile and simulate the software.
The controller board, attached to the main control board: Note the I2C cable running between them, which provides the main control board with power.

