RC gyro with Arduino to make a headtracker for FPV

That was a mouth full ;D I am working on a head tracker for my pan/tilt camera to fly FPV. Since I use JR radio, it is difficult to use an "off the shelf" head tracker. The easiest way to interface with the radio is though its potentiometers. (10k's set up as voltage dividers - I think they are 5 volt)

Since I want to track a pitch and yaw rotation on my head, I have to use Gyros instead of accelerometers. This hack here is very similar but uses accels. to do the work.

Gyros are expensive and its difficult finding a position gyro instead of a rate gyro. My next best bet is to use off the shelf RC helicopter Gyros that support heading lock. Most are rate gyro with HH capabilities. Move the gyro to a certain degree and the servo will hold that position until the gyro is back to where it was. Exactly what I need. RC gyros require a PPM (standard servo pulse) to initialize and they augment that original pulse to correct for movement.

So the design would be something like this..
Gyro has two inputs. Both are standard servo pulses. The gain/mode select where a value between 0 and 50% is the gain on dual rate mode. A value between 50 and 100% is the gain in heading lock mode. (Knocks two birds out with one stone) The second input is where the servo should be before augmentation.
Gyro has one output, the augmented servo signal. It cant be directly used by my radio so I need to process the signal further. I need help using PulseIn to read the pulse and scale it to an analog value from 0-5v (I think its 0-5 atleast!)

Part two is the connection to the RC radio. I need to put out a voltage between 0 and 5 volts (I THINK!) to fool the radio into thinking there is a potentiometer there. Should be fairly straight forward but I need help figuring out the scaling of the input to the analog output.

I would use Arduinos servo library and a potentiometer to set the gain/mode and a second pot. to set the base signal to the gyro which functions as a trim. I need Arduinos pulse in library to read the pulse of the gyro. After that I need to scale that pulse to an analog voltage.

Pretty straight forward in concept but I am pretty new to programming and would very much appreciate help. ::slight_smile:


Pretty straight forward in concept but I am pretty new to programming and would very much appreciate help.


your project sounds reasonable and can be split into good parts to test individually. You can do the gyro part on the Arduino alone and just send out text on the serial line. Once that is working, you can play around with interfacing to the remote control without gyro. Just have the remote control play a fixed program controlled by the Arduino. Once you have those two parts working, you can join them and be done.

As to using the Servo library, I doubt it's the right thing to do. The Servo library is made to control servos thus produces control signals for servos. It doesn't read signals for Servos. To control you remote control, you need to produce a voltage between 0 and 5 V or have a digital potentiometer. This you can do with the analogWrite PWM signal and some hardware to convert the PWM signal into a voltage or with a some hardware connected to a few control lines. Don't forget to do some research into digital potentiometers which may offer a reasonable alternative.

I hope that's enough help to get you started.

Have fun learning.