[beagleboard] RC Servo Driver for Angstrom

Hi! Just wanted to shout that I have made a simple driver for RC
servos running as a kernel module on Angstrom linux. You will need to
have a working kernel compilation going on (bitbake virtual/kernel),
but if you have this, you may connect any number of servos on the
expansion header pins on the Beagleboard. For my servos, no additional
electronics is required either. No mux reconfiguration should be
necessary.

If you connect a servo to pin 5 on your board the following examples
will work:

  # 100% left
  echo 5:-100 > /dev/servodrive0

  # 100% right
  echo 5:100 > /dev/servodrive0

  # Neutral position
  echo 5:0 > /dev/servodrive0

  # End servo active control
  echo 5:off > /dev/servocontrol0

For more info, please visit http://github.com/tallakt/servodrive

If you try this out, please leave some feedback through github.

Note: This is basically a simplification and repackaging of Chris
Desjardins excellent servo project. More info on aforementioned page.

How about something like:

#define DEVNAME "servodrive"
static struct class *servodrive_class;
static int major;

major = register_chrdev(0, DEVNAME, NULL);
int id = 0;

servodrive_class = class_create(THIS_MODULE, DEVNAME);
device_create(servodrive_class, NULL, MKDEV(major, id), NULL, DEVNAME "%d", id);

And a 'device_destroy(bc_class, MKDEV(major, id));' at the end to have udev create the devnode for you? Also, modprobe is a lot nicer than insmod :slight_smile:

regards,

Koen

I am investigating this issue as I read your reply. I am totally
clueless in these matters, but yes, the 'installation' part is funky
to say the least.

Thanks.

Tallak

Do you also have any further tips after compiling these changes into
the .ko file, how to proceed to load the module automatically on
startup? Do I have to create a udev .rules file, run modprobe?

Tallak

I am investigating this issue as I read your reply. I am totally
clueless in these matters, but yes, the 'installation' part is funky
to say the least.

Could you give this totally untested patch a try?

regards,

Koen

0001-servodrive-add-device_create-destroy-to-have-udev-de.patch (1.43 KB)

Thanks a lot. This makes it all a bit more manageable.

I am left with running opkg install servodrive...ipk and then modprobe
servodrive. Quite easy :wink:

I have updated the github repository with the changes.

Tallak

Hi, I am in process of writing my own autopilot system for RC airplanes on BeagleBoard. Servodrive makes the job of connecting the software to hardware part easier. Thanks a lot for this achievement. This makes my job a bit easier.
I compiled it using OE. However when I install on my bb xM Rev C using opkg. It returns error about dependencies. And also points out something about Kernel 2.6.39. The version of Angstrom I’ve on my bb is 2.6.32. Will I need to upgrade to 2.6.39 in order to make servodrive work. If yes, Where can I find Angstrom for Beagleboard running this specific kernel ?

Thank You,
Hersh

Hi Tallak,

I’m going to use your driver in my beagleboard-xm to do an automatic stabilization system for a delta wing I have just built. The thing is that I’m new with embedded systems and I’m not sure how to cross-compile your code.

Instructions in the README file are clear but it seems like OpenEmbedded has changed his structure… Can you please tell me how to configure OpenEmbedded variables, .conf files and paths to cross-compile your servodrive for the BB-xm?

I have also installed the TI toolchain, wich has helped me cross-compiling some own c++ code for the BB-xm, do you think it is also possible using this compiler with servodrive taking in count the dependencies it uses?

Thanks!