Servo Positioning

I am currently working on a positioning system that uses input data from an IMU. I need my system to keep a camera pointed straight down at all times, regardless of the roll and pitch of my RC heli. I am using HS-422 servos to do the job, but am having problems figuring out how to use the angles from the IMU to create PWM signals for the servos. Anyone have any ideas on how to use the IMU data to create the PWM signals?

I think any help you receive will depend upon what the signals from the IMU are… which might be more clear if you supplied what IMU you are looking to use. :unamused: :smiley: 8)
Seriously though, unless you are talking about something like an R/C gyro, you will most likely need to convert the output from the IMU into a position error and adjust the PWM signal being applied to the pan/tilt servos. this could be done using op-amps and timers, or more typically these days some sort of micro controller and some software for it. :wink:

I am reading the signals from a Sparkfun 5DOF IMU using a dsPIC30F3011 microcontroller. These signals include 3 accelerations (X, Y, Z) and 2 gyros (Roll and Pitch rate). I already have established a Kalman Filter that is used to fuse the data together to come up with the roll and pitch, which produces good results. The plan is to implement the control signals using PWM module from the micro controller. Its a simple concept, I guess, but I can’t seem to implement it. Example: the heli rolls 10 degrees along the X-axis. I need my roll servo to compensate for that “error” and move my device back 10 degrees.

sounds like you have a good handle on it. I’m not familliar with your PIC but having used other PICs I have to ask, can you actually slow it’s internal PWM down enough to actually make a 1.5ms pulse at 50Hz and still have any appreciable resolution left for adjustment? I guess what I am saying is to set everything else aside and make sure you can actually make a pair of PWM outputs with enough resolution to run the servos and not have to move them in 3 degree steps.