Medusa Motor Controller
The most sopphisticated of the various motor control systems that I built while at MIT was the 16-channel Medusa motor controller that I designed for the Leonardo robot. Leo is largely controlled by four of these Medusa controllers, which come in two versions. There are two in the base of the robot, where there are no serious space constraints: these are flat packages with eight-pin connectors for each motor. The other two are in the head, where there is ridiculously little space. Here, there is no room for bulky connectors on the boards, and each controller is “folded up” into a three-layer sandwich.
The picture above shows two of the high-density head controllers, stacked and staggered to fit inside Leo’s head, with none of the pigtails that run out to the motors yet soldered on. The lego guy sets the scale, and remember that’s a thirty-two-channel motor control package that you're looking at there. It was a tight squeeze.
The picture at the left shows the problem that the Medusa was designed to solve. When Leo’s body was first built, it was tested using an external package of motor controlles that were connected to the motors via fat umbilical cords that entered into the back of the head. This was no good: the heft of the cables severely restricted Leo’s range of motion. We needed a fully integrated solution.
The mess of cables in that photo also provides a clue to the rationale behind the name “Medusa”: I realized early on that the final package was going to have cables coming out from all sides, and would look a bit like the snakes on Medusa’s head.
The 16-channel Medusa used a Xilinx Virtex FPGA as the central controller. Mostly for fun, I developed a custom soft-core microprocessor from scratch to run inside the FPGA and orchestrate the activity of the A/D converters, quadrature decoders, and pulse width modulators that drove the rest of the hardware. Since it was a custom processor there was no compiler available for it, but I had intentionally designed so that it was relatively easy to develop simple DSP algorithms for in assembly. Of course first I had to write the assembler itself; it was just a fairly simpler Perl script!
The design and implementation of Leonardo’s motor control system was a major part of my Masters Thesis.