I2C Motor Controller
This design is intended as a cost effective, readily available motor controller solution capable of handling multiple controllers from one master device in a logical, powerful and easy to use interface.
This solution is best suited to drive DC brush motors at encoder rates up to and exceeding 2 MHz. Motor positions are measured with hardware quadrature encoding to achieve this high rate. A built in PID controller with adjustable gains is used to control each motor to be flexible enough for any choice of motor.
See the datasheet here for more information about using this I2C motor controller.
Download zip file of code here
Code used on the final Team Banzai Design Competition 2009 robot can be found here as well. This code uses two PIC18F2431 chips with built in QEI(quadrature) modules. This portion of the slave code can be rewritten to use the LS7081 chips with PIC18F4520 controllers, but in its current state will not work for these chips. The code tracks trapezoidal motion profiles and may not be appropriate for motors will lower than 500CPR resolution. This code in its current state is untested, but the tracking, communication, and polling algorithms make it a good guide in differential drive mobile robotics control.