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
#include <Servo.h>
//set variable servo1 and variable servo2
Servo servo1;
Servo servo2;
void setup()
{
//assign pins 9 and 10 to each servo
servo1.attach(9);
servo2.attach(10);
}
void loop()
{
//move range +10, -10, +20, -20, +30, -30 and back to 0
servo1.write(90);
servo2.write(90);
delay(200);
servo1.write(80);
servo2.write(80);
delay(200);
servo1.write(100);
servo2.write(100);
delay(200);
servo1.write(70);
servo2.write(70);
delay(200);
servo1.write(110);
servo2.write(110);
delay(200);
servo1.write(60);
servo2.write(60);
delay(200);
servo1.write(120);
servo2.write(120);
delay(200);
}
Tags: Arduimuv2, camera, self-balancing, servo
Permalink Reply by Ritchie on February 13, 2011 at 10:00am
Permalink Reply by Ian Ellis on February 13, 2011 at 10:33am Thanks Ritchie!
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
Permalink Reply by Ian Ellis on February 13, 2011 at 11:02am
Permalink Reply by Ritchie on February 13, 2011 at 3:54pm
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.182 members
9 members
1289 members
140 members
313 members
© 2013 Created by Chris Anderson.
Powered by
