Today I have written the basics for servo control. As my panorama servos have not yet arrived, I tested with some of my spare servos (I’m an RC hobby pilot). I found a great little page which explains how to do servo control using the AVR 16-bit PWMs. This sure helped, as it pointed me into the right direction. After 20 minutes of work I got this:
Next thing will be to implement a system which allows me to move the servos in a smooth way, accelerating and decelerating so my camera will move super smoothly without shaking my tripod when moving.
I have already done some work on the CamControl software. As always, I use Linux as my development host. I use avr-gcc to compile my software and avrdude to download it via the ISP. Unfortunately I don’t have a JTAG which kind of complicates development, but with such a simple controller I can live without it.
A few words why I have chosen the Olimex AVR-MT-128 board. This board has all the major features I was looking for in a rather compact package:
LCD (unfortunately without backlight)
Five keys for navigation
A LED (which turned out to be wired parallel to the relais, so it’s rather not so useful, as the relais triggers whenever the LED is toggled)
16-bit PWMs for servo control (8-bit is not enough for smooth servo movement)
Buzzer for notification when a job is done
Plenty of IOs for additional stuff (rotary encoder, AF and shutter control, additional LEDs etc.)
4Kb of RAM (should be more than enough)
4Kb of EEPROM (nice to persistently store some settings)
128Kb Flash (more than enough)
Well, that’s about it. A rather nice board in my opinion. I plan to package it in a nice little enclosure and add a battery. So this could be used standalone without the mechanical construction. Might be useful when I just do timelapses etc. instead of always carring around the panorama construction.
I develop the software as an open-source project, partly because I use open-source components but also because I like the open-source paradigm. The source code repository is hosted on my github account here. I have ported QuantumLeaps QP-nano framework, which is a really nice small event-based operating system for small microcontrollers. I also use avr-libc which offers superb utilities for the AVR microcontroller line. I have already implement a simple keyboard driver and the basics for a menu system. Based on avr-libc I also written a LCD driver. This all works really well so far.
This are the most important components which will let me develop the software. For the mechanical construction I will have to buy some more stuff, but this can wait until my servos arrive (they are backordered). The Olimex stuff already arrived and I have already started development of the software. More on this later.