My Airplane Servo Controller project is a product of necessity as most good designs are. I’ve been building and flying model aircraft for a number of years, and setting up control surface throws has always been a stumbling block for me. For those who don’t know about aircraft, they are controlled by “control surfaces” that move in one direction or the other and change the way that the air flows by the plane. This causes the plane to change direction in a certain way.
Depending on the design of the aircraft, the amount that the control surface should move may be different. Therefore, when setting up a new aircraft, it is important to measure and adjust the throw of the control surfaces to make sure they are within the design specifications. The reason that this can be difficult is because the control sticks on the radio transmitter are spring-loaded and therefore require one hand to be holding them while the other tries to measure the aircraft. I decided that it would be much easier if I could have both hands available to do the measurements. An airplane servo controller needed to be build that could meet three requirements:
1. The aircraft transmitter should not be needed
2. Servos should be able to be set to any position and held there
3. The positions of the servos should be shown to aid in setting up computer radios (i.e. Dual-Rate functions)
With ample GPIO, an internal oscillator, and an easy programming interface, the Atmel ATmege16 was a good microcontroller to build around. Its outputs could directly drive the control signals of the aircraft servos while still leaving plenty of I/O for reading push buttons and interfacing with an LCD display. Running at 8 MHz, there was plenty of horsepower to service waveform ISRs while still maintaining a responsive user interface.
Once I had chosen a target microcontroller, I next needed a compiler. After looking around, I found that there were two options: AVR Studio and avr-gcc. Always being one to favor open source projects, I downloaded WinAVR which includes a source editor (Programmers Notepad) and the avr-gcc compiler.
As with all projects, I built the system one piece at a time so that I wouldn’t get distracted by the details of the entire project. The specification for R/C servos states that the control pulses will be 1-2 ms long (1ms being full counter-clockwise and 2ms being full clockwise) and will be spaced approximately 20 ms apart. Therefore, my first task was to make the required waveforms on all seven channels simultaneously. Author: Ryan Knowlton