Home : Articles : Phidgets Servo Controller Setup on Ubuntu
Well, the time has come to build a mobile robot to act as a test bed for Lereco. I'll do a more general write-up of the robot as time allows (and as time goes on) but for now I'm going to focus on the first interesting part to arrive: my Phidgets 8-Motor PhidgetServo from Active Robots. The initial robot design calls for 3 servos; I figured I may as well get the 8-motor controller now since I'm likely to want some more. This, plus 8 Hitec HS-422 servos, arrived quickly and well packed - thanks, Active Robots, I'll be buying more from you shortly!
Everything you might need is included except a PSU (which you probably already have); I don't actually have the batteries yet but, conveniently, the controller is pretty generous, accepting anything from 6V to 15V. I just used a random 9V DC supply I had lying around.
Here's a close-up on the controller board itself:
Installing the Software
To get the controller working on Linux, I downloaded Phidgetlinux (if that link breaks, just go to the home page and look for Downloads). Unpack this into a directory and you get the phidget21 library and a web service.
I haven't looked over the code in great detail but a quick skim reveals that while it doesn't follow my particular favourite coding style, the code looks tidy and consistently formatted. A quick make then make install as root (in the phidget21 directory) later and the library is installed with just a couple of minor compiler warnings during the build (with -Wall; nothing scary).
Finally, sudo cp udev/99-phidgets.rules /etc/udev/rules.d/ followed by sudo /etc/init.d/udev restart should mean ordinary users can access the Phidget when it's connected.
Quick Initial Test
After make install, change to the examples subdirectory and make there too. Run ./manager (in place) and then connect the controller to a USB port (no servos or external power are required for this check as the controller itself is USB powered). You should get:
Device Added: PhidgetAdvancedServo, Serial: 9nnnn, Version: 100
printed to the terminal (except that 9nnnn is the actual device serial number). If not, you may need to check you've not missed a step; for example, have you installed the udev rules and restarted udev?
Waving a Servo Around
For this, you need to attach a servo (while the Phidget is disconnected) and external power, then connect the controller to your USB port again.
Download the examples (again, if this link breaks in future, just browse from the Phidgets home page) and unpack and change into the source directory. Do a ./configure then make.
Hook up a servo to the first position on the controller, connect external power and run AdvancedServo-simple and connect the controller. If all is well, the example will put the servo through its paces.
That's all for now
Next up - programming the servos using C. I'll post more when I have it!







