I’ve been working on this design on and off for the last couple of months. The idea came about when I was trying to build a robot that needed to read servo pulses, write servo pulses, and control two motors. I tried using an Arduino, but it really wasn’t up to it.
I decided to offload all of the timing work to a separate microcontroller. That effort resulted in a standardized communication protocol, some test software, and a pretty cool design. Here is a video of the board controlling half of the robot chassis it was designed for.
The board is 1.1”x1.5” and can control 2 DC motors 6-24VC at about 1A each. The 4 servo inputs have the ability to measure signals from 450-2500uS in 10uS intervals. The 4 servo outputs can produce pulses of the same width and resolution.
There were quite a few design tradeoffs I made during this process. The biggest was probably the decision to handle all control registers as 8-bit values. Although I have 10-bit PWM outputs for motor control I decided to use just a single 8-bit value for positive and negative (forward and reverse) motor speed settings. So instead of having +/-1023 speed settings there are only +/-127 speed settings. I went for easy-to-use, versus high resolution.
I was limited in the number of timers I had access to in this design, and so my servo output was also limited to an 8 bit value (0-255). I could have measured servo input pulses at a 16-bit resolution, but since I was already using 8-bit values for motor speed and servo pulse outputs I carried this format through to the servo pulse reading function.
This design has also been incorporated onto an Arduino Uno compatible design. That design shares pins 2 and 3 with the PIC16F1829. This allows the Arduino clone to read servo pulses, write to servos, and control the speed of 2 DC motors with a simple serial interface. There are some additional functions that allow the board to be programmed to accept 2 servo input signals, and convert them directly into skid steering robot control scheme.
Below is a photo of the Arduino compatible design with the dual motor quad servo controller included.