Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: manut on December 04, 2009, 09:15:50 PM
-
hi, I have a little problem with my 50$ robot: the servos turns in opposite directions, does anybody knows what I did wrong..I guess I just inverted something, but don't know what.. (I used photoresistors of different values, could come from that?)
thanx
manu
-
It could be the photo resistors, or it could be that if you swap the pins the servos are plugged into it will work.
Have you got it all mounted yet
-
It depends how you mount your servo's, once you are happy with construction, alter you code to account for this. In the code you should have 3 PWM values (assuming you are using the photovore zip file). One is one direction, the middle value should be stop and the other is the opposite direction. Try reversing one set to see the difference.
{
//go straight
servo_left(25);
servo_right(44);
}
See, if I swapped both around, it would go backward, see?
-
thanks guys,
I will try to modify the code, but first I'd like to be sure that this problem doesn't comme from electronic...because I mounted the servos exactly like in the tutorial, ...but both turn in the clockwork sense in the light and opposite sense in the dark.
-
Hi,
It's because you mount the servos back to back, sort of speaking, so one will go opposite the other if both get either a short or a long pulse (relative to 1.5ms). Either mod the code as suggested or swap the leads on the motor inside one of the servos, whatever you find easier.
-
hi,
by swapping the leads inside the motor, you mean I've to swap the negative and the positive? I used the 2.2Kohm resistor method to modify the servos.
thanx
manu
-
Hi,
I mean to swap the leads soldered to the motor _inside_ the servo - the terminals on the motor itself.
There might be from 1 to 3 caps mounted there (for electric noise removal) and you don't need to swap them, just the leads.
You SHOULD NOT swap the leads going outside, as that would most likely render the servo seriously dead.
-
thanx guys! :) 'M going to work on that....I let you know..
-
put them on backwards?
-
hmmm...that's an idea but I'd like to keep them in symetry..
-
It be a lot easier and safer to just edit your code. If you cannot change the directions of your servo's with code, you will need to learn sooner or later.
-
I read a few things about it, and you're right, modifying the code seems to be the easiest way to make the modif..