I have built a prototype assembly for use on a motorcycle. (picture link at end of post)
I am attempting to operate my servos off "pin 9" and "pin 10" I have written test code to just move the servos in a pattern to test what to do when I start using the IMU sensors.
First attempt, I ran the sketch with the servo power and ground going through the board. The servos were not moving to position, but were oscilating. We hypothesied that the IMU was not able to pass sufficient voltage through the board and modified to the setup shown where the + and gnd are direct to the servos and only the PWM signal wires go through the IMU.
I want to have this sort of functionality http://www.youtube.com/watch?v=aWAiZNZfeYc in two axis.
1) can the IMU provide sufficient voltage signal to control the servo?
2) does anyone see a problem with my common + and grnd set up?
3) can anyone suggest a sketch to study on how to pull the sensor data from the board?
Thanks in advance!
Code I wrote;
/* test program 2/7/11 to move both servos through a range of motion
//call servo subroutine
//set variable servo1 and variable servo2
//assign pins 9 and 10 to each servo
//move range +10, -10, +20, -20, +30, -30 and back to 0
Your post helped me identify what is going on.
1) I used sweep and still the bizare jerky partial motion
2) I disconnected the servo that was not being "swept"
3) sweep worked fine
4) reconnected 2nd servo and that servo started jerky motion and interrupted the smooth motion of first servo
5) swapped servo wiring and one connected worked fine, but connect second same problem
6) wrote "sweep" demo for 2 servos putting second on pin 10
7) couldn't get smooth motion on anything despite trying one servo at a time and swapping which pin served which servo.
hummm???? gottta think this one through
You are spot on. I had noticed the power light dip as the servos started. I tried some smaller servos and the program executed exactly as written. I need to research capacitors and look at a larger power supply.