Building a simple two motor robot is easy. A dual H-bridge and you’re on your way. Building a robot arm or a robot with legs with multiple motors is much more complicated. There are different approaches such as RC servos. With an RC servo, all you need to do is send a pulse width modulation signal to the servo, but without a feed back to the controller, you never really know if the servo moved to the correct position. Then, throw in several servos and the process gets more complicated again. Motors with feedback potentiometers will give a feedback of the position of the motor, but for each joint on an arm or a leg, both a motor driver and an analog input is required to read the position. And again, throw in several motors and the process gets even more complicated. If the robot has a single controller, a lot of the processing time will go into just controlling the legs or arm. Adding a micro-controller with h-bridges to each leg is another possibility. But with this approach, the main controller will need to communicate with each individual leg and again eat up a lot of the controller’s time.
I started designing the squid motor control board for my other Hackaday project “Wheeled/Walker hybrid Bot” because it will need to control 16 motors, including the wheels and 16 analog feedback channels to read feedback from 4 legs. The more thought that went into the squid board, the more I realized how flexible the Squid could become. To start with, the Squid needs a lot of outputs to control 16 H-brides, 2 outputs for each H-bridge. I enjoy using MicroChip’s PICs so the Squid will be based on 2 PIC16F874As to handle the large number of H-bridges. As an extra benefit, the 2 chips together can provide the 16 pins for analog inputs which can also be configured as digital inputs or outputs.
To allow other users to experiment with the Squid board, each PIC will have an in-circuit serial programming port. The sub routines to handle all the features like usart for the Bluetooth and serial interface, I2C to communicate between the PICs and other peripherals, A to D converter will be provided as an include file. This will allow other makers to program the Squid to control whatever project the user wants to experiment with while easing the work load by already having callable sub routines to use the on board features.
For users who want to use the Squid with other controllers such as a Raspberry Pi, The Squid will be preprogramed with 2 user interface pages to be accessed through the Bluetooth or a serial port. One page will be used to configure all of the features which will be stored in the PICs FLASH so the Squid will remember the configuration after power down. The other will be used to control the motors and input pins and set/clear any pin configured as an output.
The default configuration for the 16 H-bridges will be as individual drivers to control 16 individual small dc motors. A configuration option will be provided to allow two H-bridges to be “bonded” as a 4 channel driver to control either a 4 phase unipolar step motor or a 4 phase bipolar step motor. In case the 16 H-bridges is not enough, an I2C interface will allow the Squid to interface with other Squid boards or other peripheral devices.
Software subroutines for MicroChip PIC onboard resources.
- USART interface for Bluetooth and direct connect serial interface.
- I2C interface to communicate between the PICs and other peripherals.
- Analog to digital converter.
- EEPROM routine to store to and read from PIC onboard EEPROM for configuration data.
Software routine to control small DC motors.
Software routine to control four phase unipolar step motors.
Software routine to control four phase bipolar step motors.
Software routine to organize I2C devices.
Software...Read more »